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