]> git.lyx.org Git - lyx.git/blob - src/mathed/math_commentinset.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[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 using std::auto_ptr;
12
13
14 MathCommentInset::MathCommentInset()
15         : MathNestInset(1)
16 {}
17
18
19 MathCommentInset::MathCommentInset(string const & str)
20         : MathNestInset(1)
21 {
22         asArray(str, cell(0));
23 }
24
25
26 auto_ptr<InsetBase> MathCommentInset::clone() const
27 {
28         return auto_ptr<InsetBase>(new MathCommentInset(*this));
29 }
30
31
32 void MathCommentInset::metrics(MetricsInfo & mi, Dimension & dim) const
33 {
34         cell(0).metrics(mi);
35         metricsMarkers();
36         dim = dim_;
37 }
38
39
40 void MathCommentInset::draw(PainterInfo & 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, Dimension & dim) const
48 {
49         cell(0).metricsT(mi, dim);
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::maple(MapleStream & os) const
66 {
67         os << '#' << cell(0) << "\n";
68 }
69
70
71 void MathCommentInset::mathematica(MathematicaStream &) const
72 {}
73
74
75 void MathCommentInset::octave(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 }