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