diff --git a/src/insets/inset.C b/src/insets/inset.C index 29c2a0c3eb..21b91021ea 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -19,7 +19,6 @@ #include "debug.h" #include "gettext.h" #include "lyxtext.h" -#include "LColor.h" #include "metricsinfo.h" #include "coordcache.h" @@ -30,29 +29,14 @@ using std::string; InsetOld::InsetOld() - : //background_color_(LColor::inherit) - background_color_(LColor::background) {} InsetOld::InsetOld(InsetOld const & in) - : InsetBase(in), name_(in.name_), - background_color_(in.background_color_) + : InsetBase(in), name_(in.name_) {} -void InsetOld::setBackgroundColor(LColor_color color) -{ - background_color_ = color; -} - - -LColor_color InsetOld::backgroundColor() const -{ - return LColor::color(background_color_); -} - - void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const { //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl; diff --git a/src/insets/inset.h b/src/insets/inset.h index f1a4d48560..73c8a4380f 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -16,14 +16,10 @@ #define INSETOLD_H #include "insetbase.h" -#include "dimension.h" namespace lyx { -class LColor_color; - - /// Insets class InsetOld : public InsetBase { public: @@ -40,10 +36,6 @@ public: void setInsetName(docstring const & s) { name_ = s; } /// virtual docstring const & getInsetName() const { return name_; } - /// - virtual void setBackgroundColor(LColor_color); - /// - LColor_color backgroundColor() const; /// set x/y drawing position cache void setPosCache(PainterInfo const &, int, int) const; @@ -56,10 +48,6 @@ private: /// docstring name_; - /** We store the LColor::color value as an int to get LColor.h out - * of the header file. - */ - int background_color_; }; diff --git a/src/insets/insetbase.C b/src/insets/insetbase.C index 7aa2fef4a5..64bdb67c2c 100644 --- a/src/insets/insetbase.C +++ b/src/insets/insetbase.C @@ -108,6 +108,16 @@ static TranslatorMap const build_translator() } +/// pretty arbitrary dimensions +InsetBase::InsetBase(): dim_(10, 10, 10), background_color_(LColor::background) +{} + + +InsetBase::InsetBase(InsetBase const & i) +: dim_(i.dim_), background_color_(i.background_color_) +{} + + std::auto_ptr InsetBase::clone() const { std::auto_ptr b = doClone(); @@ -345,6 +355,18 @@ void InsetBase::dump() const } +void InsetBase::setBackgroundColor(LColor_color color) +{ + background_color_ = color; +} + + +LColor_color InsetBase::backgroundColor() const +{ + return LColor::color(background_color_); +} + + ///////////////////////////////////////// bool isEditableInset(InsetBase const * inset) diff --git a/src/insets/insetbase.h b/src/insets/insetbase.h index 46bdf22f19..09990a217a 100644 --- a/src/insets/insetbase.h +++ b/src/insets/insetbase.h @@ -31,6 +31,7 @@ class FuncStatus; class InsetMath; class InsetText; class LaTeXFeatures; +class LColor_color; class LCursor; class LyXLex; class LyXText; @@ -445,6 +446,10 @@ public: /// int scroll() const { return 0; } /// + void setBackgroundColor(LColor_color); + /// + LColor_color backgroundColor() const; + /// enum CollapseStatus { Collapsed, Inlined, @@ -453,9 +458,8 @@ public: /// virtual void setStatus(LCursor &, CollapseStatus) {} protected: - /// pretty arbitrary dimensions - InsetBase(): dim_(10, 10, 10) {} - InsetBase(InsetBase const & i): dim_(i.dim_) {} + 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'. @@ -473,6 +477,10 @@ protected: mutable Dimension dim_; private: virtual std::auto_ptr doClone() const = 0; + /** We store the LColor::color value as an int to get LColor.h out + * of the header file. + */ + int background_color_; };