#include "InsetCharStyle.h"
-#include "buffer.h"
-#include "bufferparams.h"
+#include "Buffer.h"
+#include "BufferParams.h"
#include "BufferView.h"
-#include "dispatchresult.h"
-#include "funcrequest.h"
+#include "DispatchResult.h"
+#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "cursor.h"
+#include "Cursor.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
-#include "LColor.h"
-#include "lyxlex.h"
-#include "lyxtext.h"
-#include "metricsinfo.h"
-#include "paragraph.h"
+#include "Color.h"
+#include "Lexer.h"
+#include "Text.h"
+#include "MetricsInfo.h"
+#include "Paragraph.h"
#include "paragraph_funcs.h"
#include "sgml.h"
void InsetCharStyle::init()
{
- setInsetName(from_utf8("CharStyle"));
setInlined();
setDrawFrame(false);
}
}
-auto_ptr<InsetBase> InsetCharStyle::doClone() const
+auto_ptr<Inset> InsetCharStyle::doClone() const
{
- return auto_ptr<InsetBase>(new InsetCharStyle(*this));
+ return auto_ptr<Inset>(new InsetCharStyle(*this));
}
params_.latextype.clear();
params_.latexname.clear();
params_.latexparam.clear();
- params_.font = LyXFont(LyXFont::ALL_INHERIT);
- params_.labelfont = LyXFont(LyXFont::ALL_INHERIT);
- params_.labelfont.setColor(LColor::error);
+ params_.font = Font(Font::ALL_INHERIT);
+ params_.labelfont = Font(Font::ALL_INHERIT);
+ params_.labelfont.setColor(Color::error);
params_.show_label = true;
}
}
-void InsetCharStyle::read(Buffer const & buf, LyXLex & lex)
+void InsetCharStyle::read(Buffer const & buf, Lexer & lex)
{
params_.read(lex);
InsetCollapsable::read(buf, lex);
bool InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
{
- LyXFont tmpfont = mi.base.font;
+ Font tmpfont = mi.base.font;
getDrawFont(mi.base.font);
- mi.base.font.reduce(LyXFont(LyXFont::ALL_SANE));
+ mi.base.font.reduce(Font(Font::ALL_SANE));
mi.base.font.realize(tmpfont);
mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
InsetText::metrics(mi, dim);
mi.base.font = tmpfont;
if (params_.show_label) {
// consider width of the inset label
- LyXFont font(params_.labelfont);
- font.realize(LyXFont(LyXFont::ALL_SANE));
+ Font font(params_.labelfont);
+ font.realize(Font(Font::ALL_SANE));
font.decSize();
font.decSize();
int w = 0;
{
setPosCache(pi, x, y);
- LyXFont tmpfont = pi.base.font;
+ Font tmpfont = pi.base.font;
getDrawFont(pi.base.font);
// I don't understand why the above .reduce and .realize aren't
//needed, or even wanted, here. It just works. -- MV 10.04.2005
// the name of the charstyle. Can be toggled.
if (params_.show_label) {
- LyXFont font(params_.labelfont);
- font.realize(LyXFont(LyXFont::ALL_SANE));
+ Font font(params_.labelfont);
+ font.realize(Font(Font::ALL_SANE));
font.decSize();
font.decSize();
int w = 0;
s = _("Undef: ") + s;
theFontMetrics(font).rectText(s, w, a, d);
pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a,
- s, font, LColor::none, LColor::none);
+ s, font, Color::none, Color::none);
}
// a visual clue when the cursor is inside the inset
- LCursor & cur = pi.base.bv->cursor();
+ Cursor & cur = pi.base.bv->cursor();
if (cur.isInside(this)) {
y -= ascent();
pi.pain.line(x, y + 4, x, y, params_.labelfont.color());
}
-void InsetCharStyle::getDrawFont(LyXFont & font) const
+void InsetCharStyle::getDrawFont(Font & font) const
{
font = params_.font;
}
-void InsetCharStyle::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetCharStyle::doDispatch(Cursor & cur, FuncRequest & cmd)
{
setInlined();
switch (cmd.action) {
}
-bool InsetCharStyle::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetCharStyle::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
switch (cmd.action) {
}
-void InsetCharStyleParams::read(LyXLex & lex)
+void InsetCharStyleParams::read(Lexer & lex)
{
while (lex.isOK()) {
lex.next();