]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathComment.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathComment.C
1 /**
2  * \file InsetMathComment.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 "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<InsetBase> InsetMathComment::doClone() const
40 {
41         return auto_ptr<InsetBase>(new InsetMathComment(*this));
42 }
43
44
45 void InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const
46 {
47         cell(0).metrics(mi, dim);
48         metricsMarkers(dim);
49         dim_ = dim;
50 }
51
52
53 void InsetMathComment::draw(PainterInfo & pi, int x, int y) const
54 {
55         cell(0).draw(pi, x + 1, y);
56         drawMarkers(pi, x, y);
57 }
58
59
60 void InsetMathComment::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
61 {
62         cell(0).metricsT(mi, dim);
63 }
64
65
66 void InsetMathComment::drawT(TextPainter & pain, int x, int y) const
67 {
68         cell(0).drawT(pain, x, y);
69 }
70
71
72 void InsetMathComment::write(WriteStream & os) const
73 {
74         os << '%' << cell(0) << "\n";
75 }
76
77
78 void InsetMathComment::maple(MapleStream & os) const
79 {
80         os << '#' << cell(0) << "\n";
81 }
82
83
84 void InsetMathComment::mathematica(MathematicaStream &) const
85 {}
86
87
88 void InsetMathComment::octave(OctaveStream &) const
89 {}
90
91
92 void InsetMathComment::mathmlize(MathStream & os) const
93 {
94         os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
95 }
96
97
98 void InsetMathComment::infoize(odocstream & os) const
99 {
100         os << "Comment";
101 }
102
103
104 } // namespace lyx