#include "gettext.h"
#include "LColor.h"
+#include "lyx_main.h"
#include "lyxrc.h"
#include "metricsinfo.h"
#include "support/filetools.h"
+#include <boost/bind.hpp>
+
namespace graphics = lyx::graphics;
using lyx::support::AbsolutePath;
using std::auto_ptr;
-RenderGraphic::RenderGraphic()
- : checksum_(0)
-{}
+RenderGraphic::RenderGraphic(InsetBase const * inset)
+{
+ loader_.connect(boost::bind(&LyX::updateInset,
+ boost::cref(LyX::cref()), inset));
+}
-RenderGraphic::RenderGraphic(RenderGraphic const & other)
+RenderGraphic::RenderGraphic(RenderGraphic const & other,
+ InsetBase const * inset)
: RenderBase(other),
loader_(other.loader_),
- params_(other.params_),
- checksum_(0)
-{}
+ params_(other.params_)
+{
+ loader_.connect(boost::bind(&LyX::updateInset,
+ boost::cref(LyX::cref()), inset));
+}
-auto_ptr<RenderBase> RenderGraphic::clone() const
+auto_ptr<RenderBase> RenderGraphic::clone(InsetBase const * inset) const
{
- return auto_ptr<RenderBase>(new RenderGraphic(*this));
+ return auto_ptr<RenderBase>(new RenderGraphic(*this, inset));
}
}
-bool RenderGraphic::hasFileChanged() const
-{
- unsigned long const new_checksum = loader_.checksum();
- bool const file_has_changed = checksum_ != new_checksum;
- if (file_has_changed)
- checksum_ = new_checksum;
- return file_has_changed;
-}
-
-
-boost::signals::connection RenderGraphic::connect(slot_type const & slot) const
-{
- return loader_.connect(slot);
-}
-
-
namespace {
bool displayGraphic(graphics::Params const & params)
return params.display != graphics::NoDisplay &&
lyxrc.display_graphics != graphics::NoDisplay;
}
-
+
string const statusMessage(graphics::Params const & params,
graphics::ImageStatus status)