]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSize.cpp
more latin1..utf8 schanges. all of src/* should be utf8 now
[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 #include <ostream>
22
23
24 namespace lyx {
25
26 InsetMathSize::InsetMathSize(latexkeys const * l)
27         : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
28 {}
29
30
31 Inset * InsetMathSize::clone() const
32 {
33         return new InsetMathSize(*this);
34 }
35
36
37 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
38 {
39         StyleChanger dummy(mi.base, style_);
40         cell(0).metrics(mi, dim);
41         metricsMarkers(dim);
42 }
43
44
45 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
46 {
47         StyleChanger dummy(pi.base, style_);
48         cell(0).draw(pi, x + 1, y);
49         drawMarkers(pi, x, y);
50 }
51
52
53 void InsetMathSize::write(WriteStream & os) const
54 {
55         MathEnsurer ensurer(os);
56         os << "{\\" << key_->name << ' ' << cell(0) << '}';
57 }
58
59
60 void InsetMathSize::normalize(NormalStream & os) const
61 {
62         os << '[' << key_->name << ' ' << cell(0) << ']';
63 }
64
65
66 void InsetMathSize::infoize(odocstream & os) const
67 {
68         os << "Size: " << key_->name;
69 }
70
71
72 } // namespace lyx