]> git.lyx.org Git - lyx.git/blob - src/mathed/math_inset.C
Reduce Michael's buglist.
[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 <config.h>
23
24 #include "Lsstream.h"
25 #include "math_inset.h"
26 #include "math_scriptinset.h"
27 #include "math_mathmlstream.h"
28 #include "debug.h"
29
30
31 MathInset::MathInset()
32 {}
33
34
35 MathInset::~MathInset()
36 {}
37
38
39 int MathInset::height() const
40 {
41         return ascent() + descent();
42 }
43
44
45 std::ostream & operator<<(std::ostream & os, MathInset const & inset)
46 {
47         WriteStream wi(0, os, false);
48         inset.write(wi);
49         return os;
50 }
51
52
53 MathInset::size_type MathInset::nargs() const
54 {
55         return 0;
56 }
57
58
59 MathXArray dummyCell;
60
61 MathXArray & MathInset::xcell(idx_type)
62 {
63         lyxerr << "I don't have a cell 1\n";
64         return dummyCell;
65 }
66
67
68 MathXArray const & MathInset::xcell(idx_type) const
69 {
70         lyxerr << "I don't have a cell 2\n";
71         return dummyCell;
72 }
73
74
75 MathArray & MathInset::cell(idx_type)
76 {
77         lyxerr << "I don't have a cell 3\n";
78         return dummyCell.data_;
79 }
80
81
82 MathArray const & MathInset::cell(idx_type) const
83 {
84         lyxerr << "I don't have a cell 4\n";
85         return dummyCell.data_;
86 }
87
88
89 void MathInset::substitute(MathMacro const &)
90 {}
91
92
93 bool MathInset::idxNext(idx_type &, pos_type &) const
94 {
95         return false;
96 }
97
98
99 bool MathInset::idxRight(idx_type &, pos_type &) const
100 {
101         return false;
102 }
103
104
105 bool MathInset::idxPrev(idx_type &, pos_type &) const
106 {
107         return false;
108 }
109
110
111 bool MathInset::idxLeft(idx_type &, pos_type &) const
112 {
113         return false;
114 }
115
116
117 bool MathInset::idxUp(idx_type &, pos_type &) const
118 {
119         return false;
120 }
121
122
123 bool MathInset::idxDown(idx_type &, pos_type &) const
124 {
125         return false;
126 }
127
128
129 bool MathInset::idxFirst(idx_type &, pos_type &) const
130 {
131         return false;
132 }
133
134
135 bool MathInset::idxFirstUp(idx_type &, pos_type &) const
136 {
137         return false;
138 }
139
140
141 bool MathInset::idxFirstDown(idx_type &, pos_type &) const
142 {
143         return false;
144 }
145
146
147 bool MathInset::idxLast(idx_type &, pos_type &) const
148 {
149         return false;
150 }
151
152
153 bool MathInset::idxLastUp(idx_type &, pos_type &) const
154 {
155         return false;
156 }
157
158
159 bool MathInset::idxLastDown(idx_type &, pos_type &) const
160 {
161         return false;
162 }
163
164
165 bool MathInset::idxHome(idx_type &, pos_type &) const
166 {
167         return false;
168 }
169
170
171 bool MathInset::idxEnd(idx_type &, pos_type &) const
172 {
173         return false;
174 }
175
176
177 void MathInset::idxDelete(idx_type &, bool & popit, bool & deleteit)
178 {
179         popit    = false;
180         deleteit = false;
181 }
182
183
184 void MathInset::idxDeleteRange(idx_type, idx_type)
185 {}
186
187
188 void MathInset::normalize(NormalStream & os) const
189 {
190         os << "[unknown ";
191         WriteStream wi(0, os.os_, false);
192         write(wi);
193         os << "] ";
194 }
195
196
197 void MathInset::dump() const
198 {
199         lyxerr << "---------------------------------------------\n";
200         WriteStream wi(0, lyxerr, false);
201         write(wi);
202         lyxerr << "\n---------------------------------------------\n";
203 }
204
205
206 bool MathInset::covers(int, int) const
207 {
208         lyxerr << "MathInset::covers() called directly!\n";
209         return false;
210 }
211
212
213 void MathInset::validate(LaTeXFeatures &) const
214 {}
215
216
217 std::vector<MathInset::idx_type>
218         MathInset::idxBetween(idx_type from, idx_type to) const
219 {
220         std::vector<idx_type> res;
221         for (idx_type i = from; i <= to; ++i)
222                 res.push_back(i);
223         return res;
224 }
225
226
227 void MathInset::metrics(MathMetricsInfo const &) const
228 {
229         lyxerr << "MathInset::metrics() called directly!\n";
230 }
231
232
233 void MathInset::draw(Painter &, int, int) const
234 {
235         lyxerr << "MathInset::draw() called directly!\n";
236 }
237
238
239 void MathInset::write(WriteStream &) const
240 {
241         lyxerr << "MathInset::write() called directly!\n";
242 }
243
244
245 void MathInset::octavize(OctaveStream & os) const
246 {
247         NormalStream ns(os.os_);
248         normalize(ns);
249 }
250
251
252 void MathInset::maplize(MapleStream & os) const
253 {
254         NormalStream ns(os.os_);
255         normalize(ns);
256 }
257
258
259 void MathInset::mathmlize(MathMLStream & os) const
260 {
261         NormalStream ns(os.os_);
262         normalize(ns);
263 }