X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Frender_base.h;h=4aea45469824baed9111d9234950b178da082edf;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=23a5e9af4394dff47cf791e4bc51cbd6ce1ec43d;hpb=fff7d8407c7f6b9ed10cd04f9356c3d56d89bf05;p=lyx.git diff --git a/src/insets/render_base.h b/src/insets/render_base.h index 23a5e9af43..4aea454698 100644 --- a/src/insets/render_base.h +++ b/src/insets/render_base.h @@ -16,6 +16,9 @@ #include + +namespace lyx { + class InsetBase; class MetricsInfo; class PainterInfo; @@ -31,10 +34,15 @@ public: virtual std::auto_ptr 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