]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCharStyle.cpp
BUG 3598: display framed and shaded notes in a separate paragraph, require package...
[lyx.git] / src / insets / InsetCharStyle.cpp
index 4ba65a79a1744d91aa8ef57ccf068672f9de3f9c..84ee71fd0f03d2d7e3db0332c1a370b02fa71462 100644 (file)
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
 #include "Lexer.h"
-#include "LyXText.h"
+#include "Text.h"
 #include "MetricsInfo.h"
 #include "Paragraph.h"
 #include "paragraph_funcs.h"
@@ -51,7 +51,6 @@ using std::ostringstream;
 
 void InsetCharStyle::init()
 {
-       setInsetName(from_utf8("CharStyle"));
        setInlined();
        setDrawFrame(false);
 }
@@ -83,9 +82,9 @@ InsetCharStyle::InsetCharStyle(InsetCharStyle const & in)
 }
 
 
-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));
 }
 
 
@@ -100,9 +99,9 @@ void InsetCharStyle::setUndefined()
        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;
 }
 
@@ -141,17 +140,17 @@ void InsetCharStyle::read(Buffer const & buf, Lexer & 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;
@@ -180,7 +179,7 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const
 {
        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
@@ -199,8 +198,8 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const
 
        // 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;
@@ -212,11 +211,11 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const
                        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());
@@ -229,13 +228,13 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-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) {
@@ -266,7 +265,7 @@ void InsetCharStyle::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetCharStyle::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetCharStyle::getStatus(Cursor & cur, FuncRequest const & cmd,
        FuncStatus & status) const
 {
        switch (cmd.action) {