3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
8 * \author Lars Gullik Bjønnes
9 * \author Matthias Ettrich
11 * Full author contact details are available in file CREDITS.
17 #include "BufferView.h"
18 #include "funcrequest.h"
22 #include "dimension.h"
23 #include "metricsinfo.h"
25 #include "insets/updatableinset.h"
27 #include "frontends/Painter.h"
28 #include "frontends/mouse_state.h"
30 #include "support/lstrings.h"
35 // Initialization of the counter for the inset id's,
36 unsigned int InsetOld::inset_id = 0;
40 top_x(0), top_baseline(0), scx(0),
41 id_(inset_id++), owner_(0),
42 background_color_(LColor::inherit)
46 InsetOld::InsetOld(InsetOld const & in)
48 top_x(0), top_baseline(0), scx(0),
49 id_(in.id_), owner_(0),
50 name_(in.name_), background_color_(in.background_color_)
54 bool InsetOld::directWrite() const
60 InsetOld::EDITABLE InsetOld::editable() const
66 bool InsetOld::autoDelete() const
73 LyXFont const InsetOld::convertFont(LyXFont const & font) const
84 string const InsetOld::editMessage() const
86 return _("Opened inset");
90 LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
93 return owner()->getLyXText(bv, false);
99 void InsetOld::setBackgroundColor(LColor::color color)
101 background_color_ = color;
105 LColor::color InsetOld::backgroundColor() const
107 if (background_color_ == LColor::inherit) {
109 return owner()->backgroundColor();
111 return LColor::background;
113 return background_color_;
117 int InsetOld::id() const
122 void InsetOld::id(int id_arg)
127 void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
131 bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
134 return owner()->forceDefaultParagraphs(inset);
138 int InsetOld::latexTextWidth(BufferView * bv) const
141 return (owner()->latexTextWidth(bv));
142 return bv->workWidth();
146 int InsetOld::ascent() const
152 int InsetOld::descent() const
158 int InsetOld::width() const
164 bool InsetOld::insetAllowed(InsetOld * in) const
166 return insetAllowed(in->lyxCode());
170 bool InsetOld::checkInsertChar(LyXFont &)
176 bool isEditableInset(InsetOld const * i)
178 return i && i->editable();
182 bool isHighlyEditableInset(InsetOld const * i)
184 return i && i->editable() == InsetOld::HIGHLY_EDITABLE;