]> git.lyx.org Git - lyx.git/blob - src/mathed/math_substackinset.C
a bit visual feedback for substack...
[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 void 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         metricsMarkers2();
29 }
30
31
32 void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const
33 {
34         MathGridInset::draw(pi, x + 1, y);
35         drawMarkers2(pi, x, y);
36 }
37
38
39 void MathSubstackInset::infoize(std::ostream & os) const
40 {
41         os << "Substack ";
42 }
43
44
45 void MathSubstackInset::write(WriteStream & os) const
46 {
47         os << "\\substack{";
48         MathGridInset::write(os);
49         os << "}\n";
50 }
51
52
53 void MathSubstackInset::normalize(NormalStream & os) const
54 {
55         os << "[substack ";
56         MathGridInset::normalize(os);
57         os << ']';
58 }
59
60
61 void MathSubstackInset::maple(MapleStream & os) const
62 {
63         os << "substack(";
64         MathGridInset::maple(os);
65         os << ')';
66 }