]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSize.cpp
Fix RTL inset painting.
[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 #include "MathData.h"
15 #include "MathParser.h"
16 #include "MathStream.h"
17
18 #include "support/convert.h"
19 #include "support/std_ostream.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         dim_ = dim;
41 }
42
43
44 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
45 {
46         StyleChanger dummy(pi.base, style_);
47         cell(0).draw(pi, x + 1, y);
48         drawMarkers(pi, x, y);
49 }
50
51
52 void InsetMathSize::write(WriteStream & os) const
53 {
54         os << "{\\" << key_->name << ' ' << cell(0) << '}';
55 }
56
57
58 void InsetMathSize::normalize(NormalStream & os) const
59 {
60         os << '[' << key_->name << ' ' << cell(0) << ']';
61 }
62
63
64 void InsetMathSize::infoize(odocstream & os) const
65 {
66         os << "Size: " << key_->name;
67 }
68
69
70 } // namespace lyx