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 "frontends/Painter.h"
26 #include "frontends/mouse_state.h"
28 #include "support/lstrings.h"
31 // Initialization of the counter for the inset id's,
32 unsigned int Inset::inset_id = 0;
36 top_x(0), top_baseline(0), scx(0),
37 id_(inset_id++), owner_(0), par_owner_(0),
38 background_color_(LColor::inherit)
42 Inset::Inset(Inset const & in)
44 top_x(0), top_baseline(0), scx(0), owner_(0),
45 name_(in.name_), background_color_(in.background_color_)
51 bool Inset::directWrite() const
57 Inset::EDITABLE Inset::editable() const
63 bool Inset::autoDelete() const
70 LyXFont const Inset::convertFont(LyXFont const & font) const
81 string const Inset::editMessage() const
83 return _("Opened inset");
87 LyXText * Inset::getLyXText(BufferView const * bv, bool const) const
90 return owner()->getLyXText(bv, false);
96 void Inset::setBackgroundColor(LColor::color color)
98 background_color_ = color;
102 LColor::color Inset::backgroundColor() const
104 if (background_color_ == LColor::inherit) {
106 return owner()->backgroundColor();
108 return LColor::background;
110 return background_color_;
114 int Inset::id() const
119 void Inset::id(int id_arg)
124 void Inset::setFont(BufferView *, LyXFont const &, bool, bool)
128 bool Inset::forceDefaultParagraphs(Inset const * inset) const
131 return owner()->forceDefaultParagraphs(inset);
135 int Inset::latexTextWidth(BufferView * bv) const
138 return (owner()->latexTextWidth(bv));
139 return bv->workWidth();
143 int Inset::ascent(BufferView * bv, LyXFont const & font) const
154 int Inset::descent(BufferView * bv, LyXFont const & font) const
161 return dim.descent();
165 int Inset::width(BufferView * bv, LyXFont const & font) const