]> git.lyx.org Git - lyx.git/blob - src/mathed/math_inset.C
Compile fix gcc 2.95 + stlport
[lyx.git] / src / mathed / math_inset.C
1 /**
2  * \file math_inset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alejandro Aguilar Sierra
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "math_inset.h"
15 #include "math_data.h"
16 #include "math_mathmlstream.h"
17 #include "debug.h"
18
19 using std::string;
20 using std::ostream;
21 using std::endl;
22
23
24 MathArray dummyCell;
25
26 MathArray & MathInset::cell(idx_type)
27 {
28         lyxerr << "I don't have a cell 1" << endl;
29         return dummyCell;
30 }
31
32
33 MathArray const & MathInset::cell(idx_type) const
34 {
35         lyxerr << "I don't have a cell 2" << endl;
36         return dummyCell;
37 }
38
39
40 void MathInset::substitute(MathMacro const &)
41 {}
42
43
44
45 void MathInset::dump() const
46 {
47         lyxerr << "---------------------------------------------" << endl;
48         WriteStream wi(lyxerr, false, true);
49         write(wi);
50         lyxerr << "\n---------------------------------------------" << endl;
51 }
52
53
54 void MathInset::drawSelection(PainterInfo &,
55         idx_type, pos_type, idx_type, pos_type) const
56 {
57         lyxerr << "MathInset::drawSelection() called directly!" << endl;
58 }
59
60
61 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
62 {
63 #ifdef WITH_WARNINGS
64         lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
65 #endif
66 }
67
68
69 void MathInset::drawT(TextPainter &, int, int) const
70 {
71 #ifdef WITH_WARNINGS
72         lyxerr << "MathInset::drawT(Text) called directly!" << endl;
73 #endif
74 }
75
76
77
78 void MathInset::write(WriteStream & os) const
79 {
80         os << '\\' << name().c_str();
81         os.pendingSpace(true);
82 }
83
84
85 void MathInset::normalize(NormalStream & os) const
86 {
87         os << '[' << name().c_str() << "] ";
88 }
89
90
91 void MathInset::octave(OctaveStream & os) const
92 {
93         NormalStream ns(os.os());
94         normalize(ns);
95 }
96
97
98 void MathInset::maple(MapleStream & os) const
99 {
100         NormalStream ns(os.os());
101         normalize(ns);
102 }
103
104
105 void MathInset::maxima(MaximaStream & os) const
106 {
107         MapleStream ns(os.os());
108         maple(ns);
109 }
110
111
112 void MathInset::mathematica(MathematicaStream & os) const
113 {
114         NormalStream ns(os.os());
115         normalize(ns);
116 }
117
118
119 void MathInset::mathmlize(MathMLStream & os) const
120 {
121         NormalStream ns(os.os());
122         normalize(ns);
123 }
124
125
126 string const & MathInset::getType() const
127 {
128         static string const t("none");
129         return t;
130 }
131
132
133 string MathInset::name() const
134 {
135         return "unknown";
136 }
137
138
139 ostream & operator<<(ostream & os, MathAtom const & at)
140 {
141         WriteStream wi(os, false, false);
142         at->write(wi);
143         return os;
144 }
145
146
147 string MathInset::fileInsetLabel() const
148 {
149         return "Formula";
150 }