Small clean-ups.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7138 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-06-10 11:54:31 +00:00
parent d92b3fd67c
commit 445ae0da6f
5 changed files with 26 additions and 23 deletions

View File

@ -1,3 +1,11 @@
2003-06-10 Angus Leeming <leeming@lyx.org>
* graphicinset.[Ch] (params): removed.
* graphicinset.h (operator=): declared private but not defined.
(statusMessage): made private.
* insetexternal.[Ch]: graphic_ renamed as renderer_.
2003-06-07 John Levon <levon@movementarian.org>
* insetert.C (latex): make a newline mean just that not

View File

@ -50,12 +50,6 @@ void GraphicInset::update(grfx::Params const & params)
}
grfx::Params const & GraphicInset::params() const
{
return params_;
}
bool GraphicInset::hasFileChanged() const
{
unsigned long const new_checksum = loader_.checksum();

View File

@ -43,8 +43,6 @@ public:
/// Refresh the info about which file to display and how to display it.
void update(grfx::Params const & params);
/// File name, image size, rotation angle etc.
grfx::Params const & params() const;
/// compute the size of the object returned in dim
void metrics(MetricsInfo & mi, Dimension & dim) const;
@ -64,10 +62,13 @@ public:
typedef boost::signal0<void>::slot_type slot_type;
boost::signals::connection connect(slot_type const &) const;
private:
/// Not implemented.
GraphicInset & operator=(GraphicInset const &);
/// The message to display instead of the graphic itself.
string const statusMessage() const;
private:
enum DisplayType {
IMAGE,
STATUS_MESSAGE,

View File

@ -64,9 +64,9 @@ InsetExternal::Params::Params()
InsetExternal::InsetExternal()
: graphic_(new GraphicInset)
: renderer_(new GraphicInset)
{
graphic_->connect(boost::bind(&InsetExternal::statusChanged, this));
renderer_->connect(boost::bind(&InsetExternal::statusChanged, this));
params_.templ = ExternalTemplateManager::get().getTemplates().begin()->second;
}
@ -75,9 +75,9 @@ InsetExternal::InsetExternal(InsetExternal const & other)
: Inset(other),
boost::signals::trackable(),
params_(other.params_),
graphic_(new GraphicInset(*other.graphic_))
renderer_(new GraphicInset(*other.renderer_))
{
graphic_->connect(boost::bind(&InsetExternal::statusChanged, this));
renderer_->connect(boost::bind(&InsetExternal::statusChanged, this));
}
@ -98,7 +98,7 @@ InsetExternal::~InsetExternal()
void InsetExternal::statusChanged()
{
BufferView * bv = graphic_->view();
BufferView * bv = renderer_->view();
if (bv)
bv->updateInset(this);
}
@ -139,19 +139,19 @@ dispatch_result InsetExternal::localDispatch(FuncRequest const & cmd)
void InsetExternal::cache(BufferView * bv) const
{
graphic_->view(bv);
renderer_->view(bv);
}
void InsetExternal::metrics(MetricsInfo & mi, Dimension & dim) const
{
graphic_->metrics(mi, dim);
renderer_->metrics(mi, dim);
}
void InsetExternal::draw(PainterInfo & pi, int x, int y) const
{
graphic_->draw(pi, x, y);
renderer_->draw(pi, x, y);
}
@ -192,9 +192,9 @@ void InsetExternal::setParams(Params const & p, string const & filepath)
// Update the display using the new parameters.
if (params_.filename.empty() || !filepath.empty())
graphic_->update(get_grfx_params(params_, filepath));
renderer_->update(get_grfx_params(params_, filepath));
string const msg = doSubstitution(0, params_.templ.guiName);
graphic_->setNoDisplayMessage(msg);
renderer_->setNoDisplayMessage(msg);
}
@ -310,9 +310,9 @@ void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
// Update the display using the new parameters.
if (buffer)
graphic_->update(get_grfx_params(params_, buffer->filePath()));
renderer_->update(get_grfx_params(params_, buffer->filePath()));
string const msg = doSubstitution(0, params_.templ.guiName);
graphic_->setNoDisplayMessage(msg);
renderer_->setNoDisplayMessage(msg);
}
@ -523,7 +523,7 @@ void InsetExternal::editExternal() const
if (et.editCommand.empty())
return;
BufferView const * bv = graphic_->view();
BufferView const * bv = renderer_->view();
Buffer const * buffer = bv ? bv->buffer() : 0;
if (!buffer)
return;

View File

@ -127,7 +127,7 @@ private:
mutable string tempname_;
/// The thing that actually draws the image on LyX's screen.
boost::scoped_ptr<GraphicInset> const graphic_;
boost::scoped_ptr<GraphicInset> const renderer_;
};