A bit more re-organization.
[lyx.git] / src / mathed / InsetMathSize.cpp
blobd3a16317baa2178a10eacab63097bf3b80a64220
1 /**
2 * \file InsetMathSize.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author André Pönitz
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "InsetMathSize.h"
15 #include "MathData.h"
16 #include "MathParser.h"
17 #include "MathStream.h"
19 #include "support/convert.h"
21 #include <ostream>
24 namespace lyx {
26 InsetMathSize::InsetMathSize(Buffer * buf, latexkeys const * l)
27 : InsetMathNest(buf, 1), key_(l), style_(Styles(convert<int>(l->extra)))
31 Inset * InsetMathSize::clone() const
33 return new InsetMathSize(*this);
37 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
39 StyleChanger dummy(mi.base, style_);
40 cell(0).metrics(mi, dim);
41 metricsMarkers(dim);
45 void InsetMathSize::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 InsetMathSize::write(WriteStream & os) const
55 MathEnsurer ensurer(os);
56 os << "{\\" << key_->name << ' ' << cell(0) << '}';
60 void InsetMathSize::normalize(NormalStream & os) const
62 os << '[' << key_->name << ' ' << cell(0) << ']';
66 void InsetMathSize::infoize(odocstream & os) const
68 os << "Size: " << key_->name;
72 } // namespace lyx