]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphics.h
ws changes only
[lyx.git] / src / insets / insetgraphics.h
index c9e1887cebfc70b2ddd69d921a08a0ddac5938b7..2ac1afc35b75fe2fe44f4cfa5b2631b61d867cef 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <boost/scoped_ptr.hpp>
 #include <boost/signals/trackable.hpp>
+#include <boost/weak_ptr.hpp>
 
 
 class Dialogs;
@@ -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,11 +76,16 @@ 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.
         */
@@ -105,6 +109,9 @@ private:
 
        /// The thing that actually draws the image on LyX's screen.
        boost::scoped_ptr<RenderGraphic> const graphic_;
+
+       /// Cached
+       mutable boost::weak_ptr<BufferView> view_;
 };