2 * \file InsetMathSize.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathSize.h"
15 #include "MathParser.h"
16 #include "MathStream.h"
18 #include "support/convert.h"
19 #include "support/std_ostream.h"
27 InsetMathSize::InsetMathSize(latexkeys const * l)
28 : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
32 auto_ptr<InsetBase> InsetMathSize::doClone() const
34 return auto_ptr<InsetBase>(new InsetMathSize(*this));
38 bool InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
40 StyleChanger dummy(mi.base, style_);
41 cell(0).metrics(mi, dim);
50 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
52 StyleChanger dummy(pi.base, style_);
53 cell(0).draw(pi, x + 1, y);
54 drawMarkers(pi, x, y);
58 void InsetMathSize::write(WriteStream & os) const
60 os << "{\\" << key_->name << ' ' << cell(0) << '}';
64 void InsetMathSize::normalize(NormalStream & os) const
66 os << '[' << key_->name << ' ' << cell(0) << ']';
70 void InsetMathSize::infoize(odocstream & os) const
72 os << "Size: " << key_->name;