]> git.lyx.org Git - lyx.git/blob - src/mathed/math_commentinset.C
Finish the task of removing all cruft from the header files.
[lyx.git] / src / mathed / math_commentinset.C
1 /**
2  * \file math_commentinset.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_commentinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_support.h"
17 #include "support/std_ostream.h"
18
19 using std::auto_ptr;
20
21
22 MathCommentInset::MathCommentInset()
23         : MathNestInset(1)
24 {}
25
26
27 MathCommentInset::MathCommentInset(string const & str)
28         : MathNestInset(1)
29 {
30         asArray(str, cell(0));
31 }
32
33
34 auto_ptr<InsetBase> MathCommentInset::clone() const
35 {
36         return auto_ptr<InsetBase>(new MathCommentInset(*this));
37 }
38
39
40 void MathCommentInset::metrics(MetricsInfo & mi, Dimension & dim) const
41 {
42         cell(0).metrics(mi);
43         metricsMarkers();
44         dim = dim_;
45 }
46
47
48 void MathCommentInset::draw(PainterInfo & pi, int x, int y) const
49 {
50         cell(0).draw(pi, x + 1, y);
51         drawMarkers(pi, x, y);
52 }
53
54
55 void MathCommentInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
56 {
57         cell(0).metricsT(mi, dim);
58 }
59
60
61 void MathCommentInset::drawT(TextPainter & pain, int x, int y) const
62 {
63         cell(0).drawT(pain, x, y);
64 }
65
66
67 void MathCommentInset::write(WriteStream & os) const
68 {
69         os << '%' << cell(0) << "\n";
70 }
71
72
73 void MathCommentInset::maple(MapleStream & os) const
74 {
75         os << '#' << cell(0) << "\n";
76 }
77
78
79 void MathCommentInset::mathematica(MathematicaStream &) const
80 {}
81
82
83 void MathCommentInset::octave(OctaveStream &) const
84 {}
85
86
87 void MathCommentInset::mathmlize(MathMLStream & os) const
88 {
89         os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
90 }
91
92
93 void MathCommentInset::infoize(std::ostream & os) const
94 {
95         os << "Comment";
96 }