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"
32 // Insets default methods
34 // Initialization of the counter for the inset id's,
35 unsigned int Inset::inset_id = 0;
39 top_x(0), top_baseline(0), scx(0),
40 id_(inset_id++), owner_(0), par_owner_(0),
41 background_color_(LColor::inherit)
45 Inset::Inset(Inset const & in, bool same_id)
47 top_x(0), top_baseline(0), scx(0), owner_(0),
48 name_(in.name_), background_color_(in.background_color_)
57 bool Inset::directWrite() const
63 Inset::EDITABLE Inset::editable() const
69 void Inset::edit(BufferView *, int, int, mouse_button::state)
73 void Inset::validate(LaTeXFeatures &) const
77 bool Inset::autoDelete() const
83 void Inset::edit(BufferView *, bool)
88 LyXFont const Inset::convertFont(LyXFont const & font) const
99 string const Inset::editMessage() const
101 return _("Opened inset");
105 LyXText * Inset::getLyXText(BufferView const * bv, bool const) const
108 return owner()->getLyXText(bv, false);
114 void Inset::setBackgroundColor(LColor::color color)
116 background_color_ = color;
120 LColor::color Inset::backgroundColor() const
122 if (background_color_ == LColor::inherit) {
124 return owner()->backgroundColor();
126 return LColor::background;
128 return background_color_;
132 int Inset::id() const
137 void Inset::id(int id_arg)
142 void Inset::setFont(BufferView *, LyXFont const &, bool, bool)
146 bool Inset::forceDefaultParagraphs(Inset const * in) const
149 return owner()->forceDefaultParagraphs(in);
153 int Inset::latexTextWidth(BufferView * bv) const
156 return (owner()->latexTextWidth(bv));
157 return bv->workWidth();