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