#include "lyxfont.h"
#include "lyxtext.h"
#include "dimension.h"
+#include "metricsinfo.h"
+
+#include "insets/updatableinset.h"
#include "frontends/Painter.h"
#include "frontends/mouse_state.h"
#include "support/lstrings.h"
-using std::endl;
+#include "debug.h"
// Initialization of the counter for the inset id's,
-unsigned int Inset::inset_id = 0;
+unsigned int InsetOld::inset_id = 0;
-Inset::Inset()
+InsetOld::InsetOld()
: InsetBase(),
top_x(0), top_baseline(0), scx(0),
id_(inset_id++), owner_(0), par_owner_(0),
{}
-Inset::Inset(Inset const & in)
+InsetOld::InsetOld(InsetOld const & in)
: InsetBase(),
- top_x(0), top_baseline(0), scx(0), owner_(0),
+ top_x(0), top_baseline(0), scx(0), id_(in.id_), owner_(0),
name_(in.name_), background_color_(in.background_color_)
{
- id_ = inset_id++;
}
-// Inset::Inset(Inset const & in, bool same_id)
-// : InsetBase(),
-// top_x(0), top_baseline(0), scx(0), owner_(0),
-// name_(in.name_), background_color_(in.background_color_)
-// {
-// if (same_id)
-// id_ = in.id();
-// else
-// id_ = inset_id++;
-// }
-
-
-bool Inset::directWrite() const
+bool InsetOld::directWrite() const
{
return false;
}
-Inset::EDITABLE Inset::editable() const
+InsetOld::EDITABLE InsetOld::editable() const
{
return NOT_EDITABLE;
}
-void Inset::validate(LaTeXFeatures &) const
-{}
-
-
-bool Inset::autoDelete() const
+bool InsetOld::autoDelete() const
{
return false;
}
#if 0
-LyXFont const Inset::convertFont(LyXFont const & font) const
+LyXFont const InsetOld::convertFont(LyXFont const & font) const
{
#if 1
return font;
#endif
-string const Inset::editMessage() const
+string const InsetOld::editMessage() const
{
return _("Opened inset");
}
-LyXText * Inset::getLyXText(BufferView const * bv, bool const) const
+LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
{
if (owner())
return owner()->getLyXText(bv, false);
}
-void Inset::setBackgroundColor(LColor::color color)
+void InsetOld::setBackgroundColor(LColor::color color)
{
background_color_ = color;
}
-LColor::color Inset::backgroundColor() const
+LColor::color InsetOld::backgroundColor() const
{
if (background_color_ == LColor::inherit) {
if (owner())
}
-int Inset::id() const
+int InsetOld::id() const
{
return id_;
}
-void Inset::id(int id_arg)
+void InsetOld::id(int id_arg)
{
id_ = id_arg;
}
-void Inset::setFont(BufferView *, LyXFont const &, bool, bool)
+void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
{}
-bool Inset::forceDefaultParagraphs(Inset const * inset) const
+bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
{
if (owner())
return owner()->forceDefaultParagraphs(inset);
return false;
}
-int Inset::latexTextWidth(BufferView * bv) const
+int InsetOld::latexTextWidth(BufferView * bv) const
{
if (owner())
return (owner()->latexTextWidth(bv));
}
-int Inset::ascent(BufferView * bv, LyXFont const & font) const
+int InsetOld::ascent() const
{
- Dimension dim;
- dimension(bv, font, dim);
- return dim.ascent();
+ return dim_.asc;
}
-int Inset::descent(BufferView * bv, LyXFont const & font) const
+int InsetOld::descent() const
{
- Dimension dim;
- dimension(bv, font, dim);
- return dim.descent();
+ return dim_.des;
}
-int Inset::width(BufferView * bv, LyXFont const & font) const
+int InsetOld::width() const
{
- Dimension dim;
- dimension(bv, font, dim);
- return dim.width();
+ return dim_.wid;
}