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