]> git.lyx.org Git - lyx.git/blobdiff - src/insets/render_base.h
more cleanup:
[lyx.git] / src / insets / render_base.h
index dbd7cec7f2da1586abd2a603383c52a8fbf05734..4aea45469824baed9111d9234950b178da082edf 100644 (file)
@@ -34,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; }
@@ -50,6 +55,8 @@ protected:
        RenderBase(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_;
 };