]> git.lyx.org Git - lyx.git/blob - src/mathed/math_substackinset.C
Prepare mathed for unified two-stage drawing
[lyx.git] / src / mathed / math_substackinset.C
1 #include <config.h>
2
3 #include "math_substackinset.h"
4 #include "math_mathmlstream.h"
5 #include "math_streamstr.h"
6 #include "support/LOstream.h"
7
8
9 MathSubstackInset::MathSubstackInset()
10         : MathGridInset(1, 1)
11 {}
12
13
14 MathInset * MathSubstackInset::clone() const
15 {
16         return new MathSubstackInset(*this);
17 }
18
19
20 Dimension MathSubstackInset::metrics(MetricsInfo & mi) const
21 {
22         if (mi.base.style == LM_ST_DISPLAY) {
23                 StyleChanger dummy(mi.base, LM_ST_TEXT);
24                 MathGridInset::metrics(mi);
25         } else {
26                 MathGridInset::metrics(mi);
27         }
28         metricsMarkers();
29         return dim_;
30 }
31
32
33 void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const
34 {
35         MathGridInset::draw(pi, x + 1, y);
36         drawMarkers(pi, x, y);
37 }
38
39
40 void MathSubstackInset::infoize(std::ostream & os) const
41 {
42         os << "Substack ";
43 }
44
45
46 void MathSubstackInset::write(WriteStream & os) const
47 {
48         os << "\\substack{";
49         MathGridInset::write(os);
50         os << "}\n";
51 }
52
53
54 void MathSubstackInset::normalize(NormalStream & os) const
55 {
56         os << "[substack ";
57         MathGridInset::normalize(os);
58         os << ']';
59 }
60
61
62 void MathSubstackInset::maple(MapleStream & os) const
63 {
64         os << "substack(";
65         MathGridInset::maple(os);
66         os << ')';
67 }