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