]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphics.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / insetgraphics.C
index 5c303d867d37604b18ebbfc182e7a089cf6e6f78..754f6a6116edc743a726c6b4bcf6b0d6fbd4a846 100644 (file)
@@ -53,7 +53,7 @@ TODO
 #include <config.h>
 
 #include "insets/insetgraphics.h"
-#include "insets/renderers.h"
+#include "insets/render_graphic.h"
 
 #include "buffer.h"
 #include "BufferView.h"
@@ -64,10 +64,13 @@ TODO
 #include "gettext.h"
 #include "LaTeXFeatures.h"
 #include "latexrunparams.h"
+#include "lyx_main.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
+#include "metricsinfo.h"
 
 #include "frontends/Alert.h"
+#include "frontends/LyXView.h"
 
 #include "support/filetools.h"
 #include "support/lyxalgo.h" // lyx::count
@@ -92,14 +95,15 @@ using lyx::support::GetExtension;
 using lyx::support::getExtFromContents;
 using lyx::support::IsFileReadable;
 using lyx::support::LibFileSearch;
-using lyx::support::os;
 using lyx::support::rtrim;
 using lyx::support::Systemcall;
 using lyx::support::unzipFile;
 using lyx::support::unzippedFileName;
 
-using std::endl;
+namespace os = lyx::support::os;
 
+using std::endl;
+using std::string;
 using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
@@ -151,7 +155,7 @@ string findTargetFormat(string const & suffix, LatexRunParams const & runparams)
 
 InsetGraphics::InsetGraphics()
        : graphic_label(uniqueID()),
-         graphic_(new GraphicRenderer)
+         graphic_(new RenderGraphic)
 {
        graphic_->connect(boost::bind(&InsetGraphics::statusChanged, this));
 }
@@ -161,7 +165,7 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig)
        : InsetOld(ig),
          boost::signals::trackable(),
          graphic_label(uniqueID()),
-         graphic_(new GraphicRenderer(*ig.graphic_))
+         graphic_(new RenderGraphic(*ig.graphic_))
 {
        graphic_->connect(boost::bind(&InsetGraphics::statusChanged, this));
        setParams(ig.params());
@@ -180,15 +184,14 @@ InsetGraphics::~InsetGraphics()
 }
 
 
-void InsetGraphics::statusChanged()
+void InsetGraphics::statusChanged() const
 {
-       BufferView * bv = graphic_->view();
-       if (bv)
-               bv->updateInset(this);
+       LyX::cref().updateInset(this);
 }
 
 
-dispatch_result InsetGraphics::localDispatch(FuncRequest const & cmd)
+dispatch_result
+InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 {
        switch (cmd.action) {
        case LFUN_INSET_MODIFY: {
@@ -212,7 +215,7 @@ dispatch_result InsetGraphics::localDispatch(FuncRequest const & cmd)
                return DISPATCHED;
 
        default:
-               return InsetOld::localDispatch(cmd);
+               return UNDISPATCHED;
        }
 }