]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbase.h
* In the process of fixing the math background color bug, this commit transfer backgr...
[lyx.git] / src / insets / insetbase.h
index 815136072c431412f65755e57ff1ef5818843f82..09990a217a52890a663f163cb5f14b99af1db5e3 100644 (file)
@@ -31,6 +31,7 @@ class FuncStatus;
 class InsetMath;
 class InsetText;
 class LaTeXFeatures;
+class LColor_color;
 class LCursor;
 class LyXLex;
 class LyXText;
@@ -436,15 +437,19 @@ public:
        /// reject the changes within the inset
        virtual void rejectChanges(BufferParams const &) {};
 
-       /// pretty arbitrary
-       virtual int width() const { return 10; }
-       /// pretty arbitrary
-       virtual int ascent() const { return 10; }
-       /// pretty arbitrary
-       virtual int descent() const { return 10; }
+       /// inset width.
+       int width() const { return dim_.wid; }
+       /// inset ascent.
+       int ascent() const { return dim_.asc; }
+       /// inset descent.
+       int descent() const { return dim_.des; }
        ///
        int scroll() const { return 0; }
        ///
+       void setBackgroundColor(LColor_color);
+       ///
+       LColor_color backgroundColor() const;
+       ///
        enum CollapseStatus {
                Collapsed,
                Inlined,
@@ -453,8 +458,8 @@ public:
        ///
        virtual void setStatus(LCursor &, CollapseStatus) {}
 protected:
-       InsetBase() {}
-       InsetBase(InsetBase const &) {}
+       InsetBase();
+       InsetBase(InsetBase const & i);
        /** The real dispatcher.
         *  Gets normally called from LCursor::dispatch(). LCursor::dispatch()
         *  assumes the common case of 'LFUN handled, need update'.
@@ -472,6 +477,10 @@ protected:
        mutable Dimension dim_;
 private:
        virtual std::auto_ptr<InsetBase> doClone() const = 0;
+       /** We store the LColor::color value as an int to get LColor.h out
+        *  of the header file.
+        */
+       int background_color_;
 };