X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finset.C;h=5f0b633794979a5e7b0c6f9fb2c615067bc68579;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=88affad0752447fc792d724c56d67e7ef6344e1c;hpb=4b2c271e23b97a863e748a270ba8f912134ac014;p=lyx.git diff --git a/src/insets/inset.C b/src/insets/inset.C index 88affad075..5f0b633794 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -14,55 +14,33 @@ #include #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_), + : 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; -} - - -string const InsetOld::editMessage() const -{ - return _("Opened inset"); -} - - void InsetOld::setBackgroundColor(LColor_color color) { background_color_ = color; @@ -75,14 +53,6 @@ LColor_color InsetOld::backgroundColor() const } -bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const -{ - if (owner()) - return owner()->forceDefaultParagraphs(inset); - return false; -} - - int InsetOld::ascent() const { return dim_.asc; @@ -101,26 +71,11 @@ int InsetOld::width() const } -bool InsetOld::insetAllowed(InsetOld * in) const +void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const { - return insetAllowed(in->lyxCode()); + //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl; + pi.base.bv->coordCache().insets().add(this, x, y); } -int InsetOld::scroll(bool recursive) const -{ - if (!recursive || !owner_) - return scx; - return 0; -} - -bool isEditableInset(InsetOld const * i) -{ - return i && i->editable(); -} - - -bool isHighlyEditableInset(InsetOld const * i) -{ - return i && i->editable() == InsetOld::HIGHLY_EDITABLE; -} +} // namespace lyx