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