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
19 #include "BufferView.h"
20 #include "funcrequest.h"
25 #include "frontends/Painter.h"
26 #include "frontends/mouse_state.h"
28 #include "support/lstrings.h"
33 // Initialization of the counter for the inset id's,
34 unsigned int Inset::inset_id = 0;
38 top_x(0), top_baseline(0), scx(0),
39 id_(inset_id++), owner_(0), par_owner_(0),
40 background_color_(LColor::inherit)
44 Inset::Inset(Inset const & in, bool same_id)
46 top_x(0), top_baseline(0), scx(0), owner_(0),
47 name_(in.name_), background_color_(in.background_color_)
56 bool Inset::directWrite() const
62 Inset::EDITABLE Inset::editable() const
68 void Inset::validate(LaTeXFeatures &) const
72 bool Inset::autoDelete() const
79 LyXFont const Inset::convertFont(LyXFont const & font) const
90 string const Inset::editMessage() const
92 return _("Opened inset");
96 LyXText * Inset::getLyXText(BufferView const * bv, bool const) const
99 return owner()->getLyXText(bv, false);
105 void Inset::setBackgroundColor(LColor::color color)
107 background_color_ = color;
111 LColor::color Inset::backgroundColor() const
113 if (background_color_ == LColor::inherit) {
115 return owner()->backgroundColor();
117 return LColor::background;
119 return background_color_;
123 int Inset::id() const
128 void Inset::id(int id_arg)
133 void Inset::setFont(BufferView *, LyXFont const &, bool, bool)
137 bool Inset::forceDefaultParagraphs(Inset const * inset) const
140 return owner()->forceDefaultParagraphs(inset);
144 int Inset::latexTextWidth(BufferView * bv) const
147 return (owner()->latexTextWidth(bv));
148 return bv->workWidth();