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