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