2 * \file math_sizeinset.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 "math_sizeinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_parser.h"
17 #include "math_streamstr.h"
19 #include "support/convert.h"
20 #include "support/std_ostream.h"
25 MathSizeInset::MathSizeInset(latexkeys const * l)
26 : MathNestInset(1), key_(l), style_(Styles(convert<int>(l->extra)))
30 auto_ptr<InsetBase> MathSizeInset::doClone() const
32 return auto_ptr<InsetBase>(new MathSizeInset(*this));
36 void MathSizeInset::metrics(MetricsInfo & mi, Dimension & dim) const
38 StyleChanger dummy(mi.base, style_);
39 cell(0).metrics(mi, dim);
45 void MathSizeInset::draw(PainterInfo & pi, int x, int y) const
47 StyleChanger dummy(pi.base, style_);
48 cell(0).draw(pi, x + 1, y);
49 drawMarkers(pi, x, y);
53 void MathSizeInset::write(WriteStream & os) const
55 os << "{\\" << key_->name << ' ' << cell(0) << '}';
59 void MathSizeInset::normalize(NormalStream & os) const
61 os << '[' << key_->name << ' ' << cell(0) << ']';
65 void MathSizeInset::infoize(std::ostream & os) const
67 os << "Size: " << key_->name;