X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FRenderBase.h;h=b522978ef62e32b3cf60120d4ecab8fcef9dc388;hb=8124e6c02ea1fd6779bb6c47ffe2bca2c8bd2d97;hp=098614e2498c0160e4d157427b1eb69e19e2944c;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/insets/RenderBase.h b/src/insets/RenderBase.h index 098614e249..b522978ef6 100644 --- a/src/insets/RenderBase.h +++ b/src/insets/RenderBase.h @@ -14,8 +14,6 @@ #include "Dimension.h" -#include - namespace lyx { @@ -32,17 +30,18 @@ class RenderBase { public: virtual ~RenderBase() {} - virtual std::auto_ptr clone(Inset const *) const = 0; + virtual RenderBase * clone(Inset const *) 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; + virtual void 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; + virtual void draw(PainterInfo & pi, int x, int y, bool const darkmode = false) const = 0; + /// render state, exact meaning of state is render-specific - void setRenderState(int state) { state_ = state; } + void setRenderState(bool state) { state_ = state; } /// get render state - int renderState() const { return state_; } + bool renderState() const { return state_; } /// equivalent to dynamic_cast virtual RenderButton * asButton() { return 0; } @@ -51,12 +50,12 @@ public: virtual RenderMonitoredPreview * asMonitoredPreview() { return 0; } protected: - RenderBase() {} - RenderBase(RenderBase const &) {} + RenderBase() : state_(false) {} + RenderBase(RenderBase const & x) : state_(x.state_) {} RenderBase & operator=(RenderBase const &) { return *this; } /// render state. currently, render_button uses this to store mouse_hover_ - int state_; + bool state_; /// Cached mutable Dimension dim_; };