]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.h
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / Inset.h
index e451c7718b96d5c2746c969276c29e565505300a..2090a7e369ae0600a21f1c6d79a28c4d20f5a5e6 100644 (file)
@@ -120,7 +120,7 @@ public:
 
        /// compute the size of the object returned in dim
        /// \retval true if metrics 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;
        /// draw inset selection if necessary
@@ -147,6 +147,8 @@ public:
        int yo(BufferView const & bv) const;
        /// set x/y drawing position cache if available
        virtual void setPosCache(PainterInfo const &, int, int) const;
+       ///
+       void setDimCache(MetricsInfo const &, Dimension const &) const;
        /// do we cover screen position x/y?
        virtual bool covers(BufferView const & bv, int x, int y) const;
        /// get the screen positions of the cursor (see note in Cursor.cpp)
@@ -478,14 +480,8 @@ public:
        /// reject the changes within the inset
        virtual void rejectChanges(BufferParams const &) {};
 
-       /// FIXME: move dim_ out of Inset!
-       Dimension const & dimension() { return dim_; }
-       /// inset width.
-       int width() const { return dim_.wid; }
-       /// inset ascent.
-       int ascent() const { return dim_.asc; }
-       /// inset descent.
-       int descent() const { return dim_.des; }
+       ///
+       virtual Dimension const dimension(BufferView const &) const;
        ///
        int scroll() const { return 0; }
        ///
@@ -520,9 +516,6 @@ protected:
         *  \sa getStatus
         */
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
-
-       /// Cached dimensions of the inset.
-       mutable Dimension dim_;
 };