2 * \file MathMacroArgument.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
14 #include "MathMacroArgument.h"
15 #include "InsetMathMacro.h"
16 #include "MathMLStream.h"
17 #include "MathSupport.h"
29 MathMacroArgument::MathMacroArgument(size_t n)
33 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
37 str_[1] = static_cast<unsigned char>('0' + n);
42 auto_ptr<InsetBase> MathMacroArgument::doClone() const
44 return auto_ptr<InsetBase>(new MathMacroArgument(*this));
48 void MathMacroArgument::write(WriteStream & os) const
54 void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
56 vector<char_type> n(str_, str_ + 3);
57 mathed_string_dim(mi.base.font, n, dim_);
62 void MathMacroArgument::draw(PainterInfo & pi, int x, int y) const
65 drawStrRed(pi, x, y, from_utf8(str_));
66 setPosCache(pi, x, y);
70 void MathMacroArgument::normalize(NormalStream & os) const
72 os << "[macroarg " << str_ << "] ";