]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathComment.cpp
Account for old versions of Pygments
[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 }
54
55
56 void InsetMathComment::draw(PainterInfo & pi, int x, int y) const
57 {
58         cell(0).draw(pi, x, y);
59 }
60
61
62 void InsetMathComment::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
63 {
64         cell(0).metricsT(mi, dim);
65 }
66
67
68 void InsetMathComment::drawT(TextPainter & pain, int x, int y) const
69 {
70         cell(0).drawT(pain, x, y);
71 }
72
73
74 void InsetMathComment::write(WriteStream & os) const
75 {
76         os << '%' << cell(0) << "\n";
77 }
78
79
80 void InsetMathComment::maple(MapleStream & os) const
81 {
82         os << '#' << cell(0) << "\n";
83 }
84
85
86 void InsetMathComment::mathmlize(MathStream & os) const
87 {
88         os << MTag("comment") << cell(0) << ETag("comment");
89 }
90
91
92 void InsetMathComment::htmlize(HtmlStream & os) const
93 {
94         os << "<!-- " << cell(0) << " -->";
95 }
96
97
98 void InsetMathComment::infoize(odocstream & os) const
99 {
100         os << "Comment";
101 }
102
103
104 } // namespace lyx