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/std_ostream.h"
20 #include "support/lyxlib.h"
22 using lyx::support::atoi;
27 MathSizeInset::MathSizeInset(latexkeys const * l)
28 : MathNestInset(1), key_(l), style_(Styles(atoi(l->extra)))
32 auto_ptr<InsetBase> MathSizeInset::doClone() const
34 return auto_ptr<InsetBase>(new MathSizeInset(*this));
38 void MathSizeInset::metrics(MetricsInfo & mi, Dimension & dim) const
40 StyleChanger dummy(mi.base, style_);
41 cell(0).metrics(mi, dim);
47 void MathSizeInset::draw(PainterInfo & pi, int x, int y) const
49 StyleChanger dummy(pi.base, style_);
50 cell(0).draw(pi, x + 1, y);
51 drawMarkers(pi, x, y);
55 void MathSizeInset::write(WriteStream & os) const
57 os << "{\\" << key_->name << ' ' << cell(0) << '}';
61 void MathSizeInset::normalize(NormalStream & os) const
63 os << '[' << key_->name << ' ' << cell(0) << ']';
67 void MathSizeInset::infoize(std::ostream & os) const
69 os << "Size: " << key_->name;