]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphics.h
ws changes only
[lyx.git] / src / insets / insetgraphics.h
index 6ac5f21424e8aa62e9d98875aeef0bf76f7ff2c4..2ac1afc35b75fe2fe44f4cfa5b2631b61d867cef 100644 (file)
 
 #include <boost/scoped_ptr.hpp>
 #include <boost/signals/trackable.hpp>
+#include <boost/weak_ptr.hpp>
 
 
 class Dialogs;
-class GraphicRenderer;
+class RenderGraphic;
 class LaTeXFeatures;
 
 ///
@@ -38,8 +39,6 @@ public:
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
-       void draw(PainterInfo & pi, int x, int y) const;
-       ///
        EDITABLE editable() const;
        ///
        void write(Buffer const &, std::ostream &) const;
@@ -77,15 +76,20 @@ public:
 
        /// Get the inset parameters, used by the GUIndependent dialog.
        InsetGraphicsParams const & params() const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
 
 private:
        ///
        friend class InsetGraphicsMailer;
 
+       void cache(BufferView *) const;
+       BufferView * view() const;
+
        /** This method is connected to the graphics loader, so we are
         *  informed when the image has been loaded.
         */
-       void statusChanged();
+       void statusChanged() const;
 
        /// Read the inset native format
        void readInsetGraphics(LyXLex & lex, std::string const & bufpath);
@@ -104,7 +108,10 @@ private:
        std::string const graphic_label;
 
        /// The thing that actually draws the image on LyX's screen.
-       boost::scoped_ptr<GraphicRenderer> const graphic_;
+       boost::scoped_ptr<RenderGraphic> const graphic_;
+
+       /// Cached
+       mutable boost::weak_ptr<BufferView> view_;
 };