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