]> git.lyx.org Git - lyx.git/blob - src/mathed/math_inset.C
several small fixes for mathed
[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::metricsT(TextMetricsInfo const &, Dimension &) const
55 {
56 #ifdef WITH_WARNINGS
57         lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
58 #endif
59 }
60
61
62 void MathInset::drawT(TextPainter &, int, int) const
63 {
64 #ifdef WITH_WARNINGS
65         lyxerr << "MathInset::drawT(Text) called directly!" << endl;
66 #endif
67 }
68
69
70
71 void MathInset::write(WriteStream & os) const
72 {
73         os << '\\' << name().c_str();
74         os.pendingSpace(true);
75 }
76
77
78 void MathInset::normalize(NormalStream & os) const
79 {
80         os << '[' << name().c_str() << "] ";
81 }
82
83
84 void MathInset::octave(OctaveStream & os) const
85 {
86         NormalStream ns(os.os());
87         normalize(ns);
88 }
89
90
91 void MathInset::maple(MapleStream & os) const
92 {
93         NormalStream ns(os.os());
94         normalize(ns);
95 }
96
97
98 void MathInset::maxima(MaximaStream & os) const
99 {
100         MapleStream ns(os.os());
101         maple(ns);
102 }
103
104
105 void MathInset::mathematica(MathematicaStream & os) const
106 {
107         NormalStream ns(os.os());
108         normalize(ns);
109 }
110
111
112 void MathInset::mathmlize(MathMLStream & os) const
113 {
114         NormalStream ns(os.os());
115         normalize(ns);
116 }
117
118
119 string const & MathInset::getType() const
120 {
121         static string const t("none");
122         return t;
123 }
124
125
126 string MathInset::name() const
127 {
128         return "unknown";
129 }
130
131
132 ostream & operator<<(ostream & os, MathAtom const & at)
133 {
134         WriteStream wi(os, false, false);
135         at->write(wi);
136         return os;
137 }
138
139
140 string MathInset::fileInsetLabel() const
141 {
142         return "Formula";
143 }