2 * \file InsetMathSize.cpp
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"
16 #include "MathParser.h"
17 #include "MathStream.h"
19 #include "support/convert.h"
24 InsetMathSize::InsetMathSize(latexkeys const * l)
25 : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
29 Inset * InsetMathSize::clone() const
31 return new InsetMathSize(*this);
35 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
37 StyleChanger dummy(mi.base, style_);
38 cell(0).metrics(mi, dim);
43 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
45 StyleChanger dummy(pi.base, style_);
46 cell(0).draw(pi, x + 1, y);
47 drawMarkers(pi, x, y);
51 void InsetMathSize::write(WriteStream & os) const
53 os << "{\\" << key_->name << ' ' << cell(0) << '}';
57 void InsetMathSize::normalize(NormalStream & os) const
59 os << '[' << key_->name << ' ' << cell(0) << ']';
63 void InsetMathSize::infoize(odocstream & os) const
65 os << "Size: " << key_->name;