]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetFormulaMacro.cpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / mathed / InsetFormulaMacro.cpp
index 1a17f8705cf60d8fffc78e23accddd7633444ad7..c0148fcac2bce8fb5c0310800444a611328cc05b 100644 (file)
 #include <config.h>
 
 #include "InsetFormulaMacro.h"
-#include "MathMacroTable.h"
+#include "MacroTable.h"
 #include "MathMacroTemplate.h"
 
 #include "BufferView.h"
-#include "cursor.h"
+#include "Cursor.h"
 #include "debug.h"
 #include "gettext.h"
-#include "LColor.h"
-#include "lyxlex.h"
-#include "outputparams.h"
+#include "Color.h"
+#include "Lexer.h"
+#include "OutputParams.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
 
 #include <sstream>
 
-
-namespace lyx {
-
-using odocstream;
-using support::bformat;
-
 using std::string;
 using std::auto_ptr;
 using std::ostream;
 using std::endl;
 
+namespace lyx {
+
+using support::bformat;
 
 
 InsetFormulaMacro::InsetFormulaMacro()
@@ -49,7 +46,7 @@ InsetFormulaMacro::InsetFormulaMacro()
 
 
 InsetFormulaMacro::InsetFormulaMacro
-               (string const & name, int nargs, string const & type)
+               (docstring const & name, int nargs, docstring const & type)
        : InsetMathNest(2), name_(name)
 {
        MathMacroTable::create(MathAtom(new MathMacroTemplate(name, nargs, type)));
@@ -64,9 +61,9 @@ InsetFormulaMacro::InsetFormulaMacro(string const & s)
 }
 
 
-auto_ptr<InsetBase> InsetFormulaMacro::clone() const
+auto_ptr<Inset> InsetFormulaMacro::clone() const
 {
-       return auto_ptr<InsetBase>(new InsetFormulaMacro(*this));
+       return auto_ptr<Inset>(new InsetFormulaMacro(*this));
 }
 
 
@@ -79,7 +76,7 @@ void InsetFormulaMacro::write(Buffer const &, ostream & os) const
 
 
 int InsetFormulaMacro::latex(Buffer const &, odocstream & os,
-                             OutputParams const & runparams) const
+                            OutputParams const & runparams) const
 {
        //lyxerr << "InsetFormulaMacro::latex" << endl;
        WriteStream wi(os, runparams.moving_arg, true);
@@ -89,7 +86,7 @@ int InsetFormulaMacro::latex(Buffer const &, odocstream & os,
 
 
 int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os,
-                                 OutputParams const &) const
+                                OutputParams const &) const
 {
        odocstringstream oss;
        WriteStream wi(oss, false, true);
@@ -102,13 +99,13 @@ int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os,
 
 
 int InsetFormulaMacro::docbook(Buffer const & buf, ostream & os,
-                               OutputParams const & runparams) const
+                              OutputParams const & runparams) const
 {
        return plaintext(buf, os, runparams);
 }
 
 
-void InsetFormulaMacro::read(Buffer const &, LyXLex & lex)
+void InsetFormulaMacro::read(Buffer const &, Lexer & lex)
 {
        read(lex.getStream());
 }
@@ -144,8 +141,8 @@ bool InsetFormulaMacro::metrics(MetricsInfo & mi, Dimension & dim) const
 void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const
 {
        // 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;
@@ -155,15 +152,13 @@ void InsetFormulaMacro::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
-       pi.pain.fillRectangle(x, a, w, h, LColor::mathmacrobg);
-       pi.pain.rectangle(x, a, w, h, LColor::mathframe);
+       // Color::mathbg used to be "AntiqueWhite" but is "linen" now, too
+       pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
+       pi.pain.rectangle(x, a, w, h, Color::mathframe);
 
-#ifdef WITH_WARNINGS
-#warning FIXME
-#endif
+       // FIXME
 #if 0
-       LCursor & cur = p.base.bv->cursor();
+       Cursor & cur = p.base.bv->cursor();
        if (cur.isInside(this))
                cur.drawSelection(pi);
 #endif