]> git.lyx.org Git - lyx.git/blob - src/mathed/math_commentinset.C
small up/down tweaking
[lyx.git] / src / mathed / math_commentinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_commentinset.h"
8 #include "math_mathmlstream.h"
9 #include "LaTeXFeatures.h"
10 #include "support/LOstream.h"
11 #include "textpainter.h"
12
13
14
15 MathCommentInset::MathCommentInset()
16         : MathNestInset(1)
17 {}
18
19
20 MathCommentInset::MathCommentInset(string const & str)
21         : MathNestInset(1)
22 {
23         cell(0) = asArray(str);
24 }
25
26
27 MathInset * MathCommentInset::clone() const
28 {
29         return new MathCommentInset(*this);
30 }
31
32
33 void MathCommentInset::metrics(MathMetricsInfo & mi) const
34 {
35         dim_ = cell(0).metrics(mi);
36         metricsMarkers();
37 }
38
39
40 void MathCommentInset::draw(MathPainterInfo & pi, int x, int y) const
41 {
42         cell(0).draw(pi, x + 1, y);
43         drawMarkers(pi, x, y);
44 }
45
46
47 void MathCommentInset::metricsT(TextMetricsInfo const & mi) const
48 {
49         dim_ = cell(0).metricsT(mi);
50 }
51
52
53 void MathCommentInset::drawT(TextPainter & pain, int x, int y) const
54 {
55         cell(0).drawT(pain, x, y);
56 }
57
58
59 void MathCommentInset::write(WriteStream & os) const
60 {
61         os << '%' << cell(0) << "\n";
62 }
63
64
65 void MathCommentInset::maplize(MapleStream & os) const
66 {
67         os << '#' << cell(0) << "\n";
68 }
69
70
71 void MathCommentInset::mathematicize(MathematicaStream &) const
72 {}
73
74
75 void MathCommentInset::octavize(OctaveStream &) const
76 {}
77
78
79 void MathCommentInset::mathmlize(MathMLStream & os) const
80 {
81         os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
82 }
83
84
85 void MathCommentInset::infoize(std::ostream & os) const
86 {
87         os << "Comment";
88 }