]> 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 48756136208fd4229525443df87378f4bd9a052c..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
@@ -100,7 +103,7 @@ using lyx::support::unzippedFileName;
 namespace os = lyx::support::os;
 
 using std::endl;
-
+using std::string;
 using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
@@ -152,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));
 }
@@ -162,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());
@@ -181,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: {
@@ -213,7 +215,7 @@ dispatch_result InsetGraphics::localDispatch(FuncRequest const & cmd)
                return DISPATCHED;
 
        default:
-               return InsetOld::localDispatch(cmd);
+               return UNDISPATCHED;
        }
 }