]> git.lyx.org Git - lyx.git/blob - src/mathed/math_inset.C
start native C++ support for Octave, Maple and MathML
[lyx.git] / src / mathed / math_inset.C
1 /*
2  *  File:        math_inset.C
3  *  Purpose:     Implementation of insets for mathed
4  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
5  *  Created:     January 1996
6  *  Description: 
7  *
8  *  Dependencies: Xlib, XForms
9  *
10  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
11  *
12  *   Version: 0.8beta.
13  *
14  *   You are free to use and modify this code under the terms of
15  *   the GNU General Public Licence version 2 or later.
16  */
17
18 #ifdef __GNUG__
19 #pragma implementation
20 #endif
21
22 #include <sstream>
23
24 #include "math_inset.h"
25 #include "math_scriptinset.h"
26 #include "debug.h"
27
28
29 MathInset::MathInset()
30 {}
31
32
33 MathInset::~MathInset()
34 {}
35
36
37 int MathInset::height() const
38 {
39         return ascent() + descent();
40 }
41
42
43 std::ostream & operator<<(std::ostream & os, MathInset const & inset)
44 {
45         MathWriteInfo wi(0, os, false);
46         inset.write(wi);
47         return os;
48 }
49
50
51 MathInset::size_type MathInset::nargs() const
52 {
53         return 0;
54 }
55
56
57 MathXArray dummyCell;
58
59 MathXArray & MathInset::xcell(idx_type)
60 {
61         lyxerr << "I don't have a cell 1\n";
62         return dummyCell;
63 }
64
65
66 MathXArray const & MathInset::xcell(idx_type) const
67 {
68         lyxerr << "I don't have a cell 2\n";
69         return dummyCell;
70 }
71
72
73 MathArray & MathInset::cell(idx_type)
74 {
75         lyxerr << "I don't have a cell 3\n";
76         return dummyCell.data_;
77 }
78
79
80 MathArray const & MathInset::cell(idx_type) const
81 {
82         lyxerr << "I don't have a cell 4\n";
83         return dummyCell.data_;
84 }
85
86
87 void MathInset::substitute(MathMacro const &)
88 {}
89
90
91 bool MathInset::idxNext(idx_type &, pos_type &) const
92 {
93         return false;
94 }
95
96
97 bool MathInset::idxRight(idx_type &, pos_type &) const
98 {
99         return false;
100 }
101
102
103 bool MathInset::idxPrev(idx_type &, pos_type &) const
104 {
105         return false;
106 }
107
108
109 bool MathInset::idxLeft(idx_type &, pos_type &) const
110 {
111         return false;
112 }
113
114
115 bool MathInset::idxUp(idx_type &, pos_type &) const
116 {
117         return false;
118 }
119
120
121 bool MathInset::idxDown(idx_type &, pos_type &) const
122 {
123         return false;
124 }
125
126
127 bool MathInset::idxFirst(idx_type &, pos_type &) const
128 {
129         return false;
130 }
131
132
133 bool MathInset::idxLast(idx_type &, pos_type &) const
134 {
135         return false;
136 }
137
138
139 bool MathInset::idxHome(idx_type &, pos_type &) const
140 {
141         return false;
142 }
143
144
145 bool MathInset::idxEnd(idx_type &, pos_type &) const
146 {
147         return false;
148 }
149
150
151 void MathInset::idxDelete(idx_type &, bool & popit, bool & deleteit)
152 {
153         popit    = false;
154         deleteit = false;
155 }
156
157
158 void MathInset::idxDeleteRange(idx_type, idx_type)
159 {}
160
161
162 void MathInset::writeNormal(std::ostream & os) const
163 {
164         os << "[unknown ";
165         MathWriteInfo wi(0, os, false);
166         write(wi);
167         os << "] ";
168 }
169
170
171 void MathInset::dump() const
172 {
173         lyxerr << "---------------------------------------------\n";
174         MathWriteInfo wi(0, lyxerr, false);
175         write(wi);
176         lyxerr << "\n---------------------------------------------\n";
177 }
178
179
180 bool MathInset::covers(int, int) const
181 {
182         lyxerr << "MathInset::covers() called directly!\n";
183         return false;
184 }
185
186
187 void MathInset::validate(LaTeXFeatures &) const
188 {}
189
190
191 std::vector<MathInset::idx_type>
192         MathInset::idxBetween(idx_type from, idx_type to) const
193 {
194         std::vector<idx_type> res;
195         for (idx_type i = from; i <= to; ++i)
196                 res.push_back(i);
197         return res;
198 }
199
200
201 void MathInset::metrics(MathMetricsInfo const &) const
202 {
203         lyxerr << "MathInset::metrics() called directly!\n";
204 }
205
206
207 void MathInset::draw(Painter &, int, int) const
208 {
209         lyxerr << "MathInset::draw() called directly!\n";
210 }
211
212
213 void MathInset::write(MathWriteInfo &) const
214 {
215         lyxerr << "MathInset::write() called directly!\n";
216 }
217
218
219 string MathInset::octavize() const
220 {
221         ostringstream os;
222         writeNormal(os);
223         return os.str();
224         return string();
225 }
226
227
228 string MathInset::maplize() const
229 {
230         return octavize();
231 }
232
233
234 string MathInset::mathmlize() const
235 {
236         return string();
237 }