]> git.lyx.org Git - lyx.git/blobdiff - src/insets/RenderGraphic.h
Fix bug #12795
[lyx.git] / src / insets / RenderGraphic.h
index 7bbb87496c852fafae5f15f290085e7c7ee53a80..fc631a0c7aed2c73605e5fac8816101119c748a6 100644 (file)
@@ -17,7 +17,6 @@
 #include "graphics/GraphicsLoader.h"
 #include "graphics/GraphicsParams.h"
 
-#include <boost/signal.hpp>
 
 namespace lyx {
 
@@ -25,33 +24,33 @@ namespace lyx {
 class RenderGraphic : public RenderBase
 {
 public:
-       RenderGraphic(Inset const *);
+       explicit RenderGraphic(Inset const *);
        RenderGraphic(RenderGraphic const &, Inset const *);
-       std::auto_ptr<RenderBase> clone(Inset const *) const;
-
-       ~RenderGraphic() { loader_connection_.disconnect(); }
+       RenderBase * clone(Inset const *) const override;
 
        /// compute the size of the object returned in dim
-       bool metrics(MetricsInfo & mi, Dimension & dim) const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const override;
        /// draw inset
-       void draw(PainterInfo & pi, int x, int y) const;
+       void draw(PainterInfo & pi, int x, int y, bool const darkmode = false) const override;
 
        /// Refresh the info about which file to display and how to display it.
        void update(graphics::Params const & params);
+       /// Reloads the image if necessary
+       void reload() const;
 
        /// equivalent to dynamic_cast
-       virtual RenderGraphic * asGraphic() { return this; }
+       RenderGraphic * asGraphic() override { return this; }
 
 private:
        /// Not implemented.
        RenderGraphic & operator=(RenderGraphic const &);
 
+       /// Reference to owner
+       Inset const * inset_;
+
        /// The stored data.
        graphics::Loader loader_;
        graphics::Params params_;
-
-       //
-       boost::signals::connection loader_connection_;
 };