]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.cpp
rename LyXFont to Font except in tex2lyx
[lyx.git] / src / mathed / MathMacroTemplate.cpp
index d16492ac68759ffbc1522cf8ef2fb411e310a06a..028390533f910ab1ef3160c1116d2fba69d65e02 100644 (file)
 #include "MathParser.h"
 #include "MathSupport.h"
 
-#include "LCursor.h"
+#include "Cursor.h"
 #include "debug.h"
 #include "gettext.h"
 #include "Lexer.h"
-#include "LColor.h"
+#include "Color.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -44,7 +44,7 @@ MathMacroTemplate::MathMacroTemplate()
 
 
 MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs,
-               docstring const & type, MathArray const & ar1, MathArray const & ar2)
+               docstring const & type, MathData const & ar1, MathData const & ar2)
        : InsetMathNest(2), numargs_(numargs), name_(name), type_(type)
 {
        initMath();
@@ -62,7 +62,7 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str)
 {
        initMath();
 
-       MathArray ar;
+       MathData ar;
        mathed_parse_cell(ar, str);
        if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
                lyxerr << "Cannot read macro from '" << ar << "'" << endl;
@@ -72,13 +72,13 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str)
 }
 
 
-auto_ptr<InsetBase> MathMacroTemplate::doClone() const
+auto_ptr<Inset> MathMacroTemplate::doClone() const
 {
-       return auto_ptr<InsetBase>(new MathMacroTemplate(*this));
+       return auto_ptr<Inset>(new MathMacroTemplate(*this));
 }
 
 
-void MathMacroTemplate::edit(LCursor & cur, bool)
+void MathMacroTemplate::edit(Cursor & cur, bool)
 {
        //lyxerr << "MathMacroTemplate: edit left/right" << endl;
        cur.push(*this);
@@ -142,8 +142,8 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        setPosCache(p, x, y);
 
        // label
-       LyXFont font = p.base.font;
-       font.setColor(LColor::math);
+       Font font = p.base.font;
+       font.setColor(Color::math);
 
        PainterInfo pi(p.base.bv, p.pain);
        pi.base.style = LM_ST_TEXT;
@@ -153,16 +153,16 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        int const w = dim_.wid - 2;
        int const h = dim_.height() - 2;
 
-       // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too
+       // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
        // the next line would overwrite the selection!
-       //pi.pain.fillRectangle(x, a, w, h, LColor::mathmacrobg);
-       pi.pain.rectangle(x, a, w, h, LColor::mathframe);
+       //pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
+       pi.pain.rectangle(x, a, w, h, Color::mathframe);
 
 #ifdef WITH_WARNINGS
 #warning FIXME
 #endif
 #if 0
-       LCursor & cur = p.base.bv->cursor();
+       Cursor & cur = p.base.bv->cursor();
        if (cur.isInside(this))
                cur.drawSelection(pi);
 #endif
@@ -175,10 +175,10 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
        int const w1 = cell(1).width();
        cell(0).draw(pi, x + 2, y + 1);
        pi.pain.rectangle(x, y - dim_.ascent() + 3,
-               w0 + 4, dim_.height() - 6, LColor::mathline);
+               w0 + 4, dim_.height() - 6, Color::mathline);
        cell(1).draw(pi, x + 8 + w0, y + 1);
        pi.pain.rectangle(x + w0 + 6, y - dim_.ascent() + 3,
-               w1 + 4, dim_.height() - 6, LColor::mathline);
+               w1 + 4, dim_.height() - 6, Color::mathline);
        
        if (lockMacro)
                MacroTable::globalMacros().get(name_).unlock();
@@ -187,7 +187,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
 
 void MathMacroTemplate::read(Buffer const &, Lexer & lex)
 {
-       MathArray ar;
+       MathData ar;
        mathed_parse_cell(ar, lex.getStream());
        if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
                lyxerr << "Cannot read macro from '" << ar << "'" << endl;