]> git.lyx.org Git - lyx.git/blobdiff - src/insets/render_base.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / render_base.h
index 23a5e9af4394dff47cf791e4bc51cbd6ce1ec43d..4aea45469824baed9111d9234950b178da082edf 100644 (file)
@@ -16,6 +16,9 @@
 
 #include <memory>
 
+
+namespace lyx {
+
 class InsetBase;
 class MetricsInfo;
 class PainterInfo;
@@ -31,10 +34,15 @@ public:
 
        virtual std::auto_ptr<RenderBase> clone(InsetBase const *) const = 0;
 
-       /// compute the size of the object returned in dim
-       virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
+       /// compute the size of the object returned in dim.
+       /// \retval true if the metrics has changed.
+       virtual bool metrics(MetricsInfo & mi, Dimension & dim) const = 0;
        /// draw inset and update (xo, yo)-cache
        virtual void draw(PainterInfo & pi, int x, int y) const = 0;
+       /// render state, exact meaning of state is render-specific
+       void setRenderState(int state) { state_ = state; }
+       /// get render state
+       int renderState() const { return state_; } 
 
        /// equivalent to dynamic_cast
        virtual RenderButton * asButton() { return 0; }
@@ -45,10 +53,15 @@ public:
 protected:
        RenderBase() {}
        RenderBase(RenderBase const &) {}
-       void operator=(RenderBase const &) {}
+       RenderBase & operator=(RenderBase const &) { return *this; }
 
+       /// render state. currently, render_button uses this to store mouse_hover_
+       int state_;
        /// Cached
        mutable Dimension dim_;
 };
 
+
+} // namespace lyx
+
 #endif // NOT RENDER_BASE_H