]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathComment.cpp
e3c385abb3d88b3815733690df2cd6d46b776e78
[lyx.git] / src / mathed / InsetMathComment.cpp
1 /**
2  * \file InsetMathComment.cpp
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 "InsetMathComment.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17 #include "support/std_ostream.h"
18
19
20 namespace lyx {
21
22 InsetMathComment::InsetMathComment()
23         : InsetMathNest(1)
24 {}
25
26
27 InsetMathComment::InsetMathComment(docstring const & str)
28         : InsetMathNest(1)
29 {
30         // FIXME UNICODE
31         asArray(str, cell(0));
32 }
33
34
35 Inset * InsetMathComment::clone() const
36 {
37         return new InsetMathComment(*this);
38 }
39
40
41 bool InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const
42 {
43         cell(0).metrics(mi, dim);
44         metricsMarkers(dim);
45         if (dim_ == dim)
46                 return false;
47         dim_ = dim;
48         return true;
49 }
50
51
52 void InsetMathComment::draw(PainterInfo & pi, int x, int y) const
53 {
54         cell(0).draw(pi, x + 1, y);
55         drawMarkers(pi, x, y);
56 }
57
58
59 void InsetMathComment::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
60 {
61         cell(0).metricsT(mi, dim);
62 }
63
64
65 void InsetMathComment::drawT(TextPainter & pain, int x, int y) const
66 {
67         cell(0).drawT(pain, x, y);
68 }
69
70
71 void InsetMathComment::write(WriteStream & os) const
72 {
73         os << '%' << cell(0) << "\n";
74 }
75
76
77 void InsetMathComment::maple(MapleStream & os) const
78 {
79         os << '#' << cell(0) << "\n";
80 }
81
82
83 void InsetMathComment::mathematica(MathematicaStream &) const
84 {}
85
86
87 void InsetMathComment::octave(OctaveStream &) const
88 {}
89
90
91 void InsetMathComment::mathmlize(MathStream & os) const
92 {
93         os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
94 }
95
96
97 void InsetMathComment::infoize(odocstream & os) const
98 {
99         os << "Comment";
100 }
101
102
103 } // namespace lyx