]> git.lyx.org Git - lyx.git/blob - src/mathed/math_substackinset.C
move around stuff, remove unneeded declarations etc
[lyx.git] / src / mathed / math_substackinset.C
1 /**
2  * \file math_substackinset.C
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 "math_substackinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "support/std_ostream.h"
17
18 using std::auto_ptr;
19
20
21 MathSubstackInset::MathSubstackInset()
22         : MathGridInset(1, 1)
23 {}
24
25
26 auto_ptr<InsetBase> MathSubstackInset::clone() const
27 {
28         return auto_ptr<InsetBase>(new MathSubstackInset(*this));
29 }
30
31
32 void MathSubstackInset::metrics(MetricsInfo & mi, Dimension & dim) const
33 {
34         if (mi.base.style == LM_ST_DISPLAY) {
35                 StyleChanger dummy(mi.base, LM_ST_TEXT);
36                 MathGridInset::metrics(mi, dim);
37         } else {
38                 MathGridInset::metrics(mi, dim);
39         }
40         dim_ = dim;
41 }
42
43
44 void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const
45 {
46         MathGridInset::draw(pi, x + 1, y);
47 }
48
49
50 void MathSubstackInset::infoize(std::ostream & os) const
51 {
52         os << "Substack ";
53 }
54
55
56 void MathSubstackInset::write(WriteStream & os) const
57 {
58         os << "\\substack{";
59         MathGridInset::write(os);
60         os << "}\n";
61 }
62
63
64 void MathSubstackInset::normalize(NormalStream & os) const
65 {
66         os << "[substack ";
67         MathGridInset::normalize(os);
68         os << ']';
69 }
70
71
72 void MathSubstackInset::maple(MapleStream & os) const
73 {
74         os << "substack(";
75         MathGridInset::maple(os);
76         os << ')';
77 }