]> git.lyx.org Git - lyx.git/blob - src/mathed/math_substackinset.C
architectural changes to tex2lyx
[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 using std::auto_ptr;
9
10
11 MathSubstackInset::MathSubstackInset()
12         : MathGridInset(1, 1)
13 {}
14
15
16 auto_ptr<InsetBase> MathSubstackInset::clone() const
17 {
18         return auto_ptr<InsetBase>(new MathSubstackInset(*this));
19 }
20
21
22 void MathSubstackInset::metrics(MetricsInfo & mi, Dimension & dim) const
23 {
24         if (mi.base.style == LM_ST_DISPLAY) {
25                 StyleChanger dummy(mi.base, LM_ST_TEXT);
26                 MathGridInset::metrics(mi);
27         } else {
28                 MathGridInset::metrics(mi);
29         }
30         metricsMarkers();
31         dim = dim_;
32 }
33
34
35 void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const
36 {
37         MathGridInset::draw(pi, x + 1, y);
38         drawMarkers(pi, x, y);
39 }
40
41
42 void MathSubstackInset::infoize(std::ostream & os) const
43 {
44         os << "Substack ";
45 }
46
47
48 void MathSubstackInset::write(WriteStream & os) const
49 {
50         os << "\\substack{";
51         MathGridInset::write(os);
52         os << "}\n";
53 }
54
55
56 void MathSubstackInset::normalize(NormalStream & os) const
57 {
58         os << "[substack ";
59         MathGridInset::normalize(os);
60         os << ']';
61 }
62
63
64 void MathSubstackInset::maple(MapleStream & os) const
65 {
66         os << "substack(";
67         MathGridInset::maple(os);
68         os << ')';
69 }