#include "debug.h"
#include "gettext.h"
#include "lyxtext.h"
-#include "LColor.h"
#include "metricsinfo.h"
#include "coordcache.h"
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;
#define INSETOLD_H
#include "insetbase.h"
-#include "dimension.h"
namespace lyx {
-class LColor_color;
-
-
/// Insets
class InsetOld : public InsetBase {
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;
///
docstring name_;
- /** We store the LColor::color value as an int to get LColor.h out
- * of the header file.
- */
- int background_color_;
};
}
+/// 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> InsetBase::clone() const
{
std::auto_ptr<InsetBase> b = doClone();
}
+void InsetBase::setBackgroundColor(LColor_color color)
+{
+ background_color_ = color;
+}
+
+
+LColor_color InsetBase::backgroundColor() const
+{
+ return LColor::color(background_color_);
+}
+
+
/////////////////////////////////////////
bool isEditableInset(InsetBase const * inset)
class InsetMath;
class InsetText;
class LaTeXFeatures;
+class LColor_color;
class LCursor;
class LyXLex;
class LyXText;
///
int scroll() const { return 0; }
///
+ void setBackgroundColor(LColor_color);
+ ///
+ LColor_color backgroundColor() const;
+ ///
enum CollapseStatus {
Collapsed,
Inlined,
///
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'.
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_;
};