X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathMacroTemplate.cpp;h=028390533f910ab1ef3160c1116d2fba69d65e02;hb=fc6ce7cd08562fd7bab4427880b46390bb7d2f07;hp=1c21beb5c6be22a8bdd31eba1a272fdb654e31fd;hpb=00e305c9d9bd8b0ff54b6c58adb6192d5934ed60;p=lyx.git diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 1c21beb5c6..028390533f 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -15,11 +15,11 @@ #include "MathParser.h" #include "MathSupport.h" -#include "LCursor.h" +#include "Cursor.h" #include "debug.h" #include "gettext.h" -#include "LyXLex.h" -#include "LColor.h" +#include "Lexer.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 MathMacroTemplate::doClone() const +auto_ptr MathMacroTemplate::doClone() const { - return auto_ptr(new MathMacroTemplate(*this)); + return auto_ptr(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,19 +175,19 @@ 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(); } -void MathMacroTemplate::read(Buffer const &, LyXLex & lex) +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;