]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSize.cpp
f90a76c1fa661e83cba831324fa5cbb4495d437a
[lyx.git] / src / mathed / InsetMathSize.cpp
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.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetMathSize.h"
14
15 #include "MathData.h"
16 #include "MathParser.h"
17 #include "MathStream.h"
18
19 #include "support/convert.h"
20
21
22 namespace lyx {
23
24 InsetMathSize::InsetMathSize(latexkeys const * l)
25         : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
26 {}
27
28
29 Inset * InsetMathSize::clone() const
30 {
31         return new InsetMathSize(*this);
32 }
33
34
35 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
36 {
37         StyleChanger dummy(mi.base, style_);
38         cell(0).metrics(mi, dim);
39         metricsMarkers(dim);
40 }
41
42
43 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
44 {
45         StyleChanger dummy(pi.base, style_);
46         cell(0).draw(pi, x + 1, y);
47         drawMarkers(pi, x, y);
48 }
49
50
51 void InsetMathSize::write(WriteStream & os) const
52 {
53         os << "{\\" << key_->name << ' ' << cell(0) << '}';
54 }
55
56
57 void InsetMathSize::normalize(NormalStream & os) const
58 {
59         os << '[' << key_->name << ' ' << cell(0) << ']';
60 }
61
62
63 void InsetMathSize::infoize(odocstream & os) const
64 {
65         os << "Size: " << key_->name;
66 }
67
68
69 } // namespace lyx