#include <config.h>
#include "InsetFormulaMacro.h"
-#include "MathMacroTable.h"
+#include "MacroTable.h"
#include "MathMacroTemplate.h"
#include "BufferView.h"
-#include "LCursor.h"
+#include "Cursor.h"
#include "debug.h"
#include "gettext.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "OutputParams.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()
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)));
}
-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));
}
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);
int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os,
- OutputParams const &) const
+ OutputParams const &) const
{
odocstringstream oss;
WriteStream wi(oss, false, true);
int InsetFormulaMacro::docbook(Buffer const & buf, ostream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
return plaintext(buf, os, runparams);
}
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;
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
#if 0
- LCursor & cur = p.base.bv->cursor();
+ Cursor & cur = p.base.bv->cursor();
if (cur.isInside(this))
cur.drawSelection(pi);
#endif