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"
15 #include "MathParser.h"
16 #include "MathStream.h"
18 #include "support/convert.h"
19 #include "support/std_ostream.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 bool InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
37 StyleChanger dummy(mi.base, style_);
38 cell(0).metrics(mi, dim);
47 void InsetMathSize::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 InsetMathSize::write(WriteStream & os) const
57 os << "{\\" << key_->name << ' ' << cell(0) << '}';
61 void InsetMathSize::normalize(NormalStream & os) const
63 os << '[' << key_->name << ' ' << cell(0) << ']';
67 void InsetMathSize::infoize(odocstream & os) const
69 os << "Size: " << key_->name;