]> git.lyx.org Git - lyx.git/blobdiff - src/insets/RenderBase.h
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / RenderBase.h
index 28876e45f5e586de30f67bd314c0ba4aace8bec0..e42035d87fd936e2947a335304193824667cd090 100644 (file)
 #ifndef RENDERBASE_H
 #define RENDERBASE_H
 
-#include "dimension.h"
-
-#include <memory>
+#include "Dimension.h"
 
 
 namespace lyx {
 
-class InsetBase;
+class Inset;
 class MetricsInfo;
 class PainterInfo;
 
@@ -32,17 +30,20 @@ class RenderBase {
 public:
        virtual ~RenderBase() {}
 
-       virtual std::auto_ptr<RenderBase> clone(InsetBase 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;
+       ///
+       Dimension const & dimension() const { return dim_; };
+
        /// render state, exact meaning of state is render-specific
        void setRenderState(int state) { state_ = state; }
        /// get render state
-       int renderState() const { return state_; } 
+       int renderState() const { return state_; }
 
        /// equivalent to dynamic_cast
        virtual RenderButton * asButton() { return 0; }