#include <config.h>
#include "inset.h"
-#include "updatableinset.h"
#include "BufferView.h"
+#include "debug.h"
#include "gettext.h"
+#include "lyxtext.h"
#include "LColor.h"
+#include "metricsinfo.h"
+#include "coordcache.h"
+namespace lyx {
+
using std::string;
InsetOld::InsetOld()
- : InsetBase(),
- xo_(0), yo_(0), scx(0), owner_(0),
- background_color_(LColor::inherit)
+ : //background_color_(LColor::inherit)
+ background_color_(LColor::background)
{}
InsetOld::InsetOld(InsetOld const & in)
- : InsetBase(),
- xo_(0), yo_(0), scx(0), owner_(0),
- name_(in.name_), background_color_(in.background_color_)
+ : InsetBase(in), name_(in.name_),
+ background_color_(in.background_color_)
{}
-bool InsetOld::directWrite() const
-{
- return false;
-}
-
-
-InsetOld::EDITABLE InsetOld::editable() const
-{
- return NOT_EDITABLE;
-}
-
-
-bool InsetOld::autoDelete() const
-{
- return false;
-}
-
-
-#if 0
-LyXFont const InsetOld::convertFont(LyXFont const & font) const
-{
-#if 1
- return font;
-#else
- return LyXFont(font);
-#endif
-}
-#endif
-
-
-string const InsetOld::editMessage() const
-{
- return _("Opened inset");
-}
-
-
void InsetOld::setBackgroundColor(LColor_color color)
{
background_color_ = color;
LColor_color InsetOld::backgroundColor() const
{
- if (background_color_ == LColor::inherit) {
- if (owner())
- return owner()->backgroundColor();
- else
- return LColor::background;
- } else
- return LColor::color(background_color_);
-}
-
-
-bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
-{
- if (owner())
- return owner()->forceDefaultParagraphs(inset);
- return false;
-}
-
-int InsetOld::latexTextWidth(BufferView * bv) const
-{
- if (owner())
- return (owner()->latexTextWidth(bv));
- return bv->workWidth();
+ return LColor::color(background_color_);
}
}
-bool InsetOld::insetAllowed(InsetOld * in) const
-{
- return insetAllowed(in->lyxCode());
-}
-
-
-bool InsetOld::checkInsertChar(LyXFont &)
-{
- return false;
-}
-
-
-int InsetOld::scroll(bool recursive) const
+void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const
{
- if (!recursive || !owner_)
- return scx;
- return 0;
-}
-
-bool isEditableInset(InsetOld const * i)
-{
- return i && i->editable();
+ //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl;
+ pi.base.bv->coordCache().insets().add(this, x, y);
}
-bool isHighlyEditableInset(InsetOld const * i)
-{
- return i && i->editable() == InsetOld::HIGHLY_EDITABLE;
-}
+} // namespace lyx