]> git.lyx.org Git - lyx.git/blob - src/mathed/math_inset.C
6c20b0e1817c740aca4973ddf20baecfd432d68e
[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 "math_inset.h"
23 #include "math_scriptinset.h"
24 #include "debug.h"
25
26
27 MathInset::MathInset()
28 {}
29
30
31 MathInset::~MathInset()
32 {}
33
34
35 int MathInset::height() const
36 {
37         return ascent() + descent();
38 }
39
40
41 std::ostream & operator<<(std::ostream & os, MathInset const & inset)
42 {
43         MathWriteInfo wi(0, 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 void MathInset::substitute(MathMacro const &)
86 {}
87
88
89 bool MathInset::idxNext(idx_type &, pos_type &) const
90 {
91         return false;
92 }
93
94
95 bool MathInset::idxRight(idx_type &, pos_type &) const
96 {
97         return false;
98 }
99
100
101 bool MathInset::idxPrev(idx_type &, pos_type &) const
102 {
103         return false;
104 }
105
106
107 bool MathInset::idxLeft(idx_type &, pos_type &) const
108 {
109         return false;
110 }
111
112
113 bool MathInset::idxUp(idx_type &, pos_type &) const
114 {
115         return false;
116 }
117
118
119 bool MathInset::idxDown(idx_type &, pos_type &) const
120 {
121         return false;
122 }
123
124
125 bool MathInset::idxFirst(idx_type &, pos_type &) const
126 {
127         return false;
128 }
129
130
131 bool MathInset::idxLast(idx_type &, pos_type &) const
132 {
133         return false;
134 }
135
136
137 bool MathInset::idxHome(idx_type &, pos_type &) const
138 {
139         return false;
140 }
141
142
143 bool MathInset::idxEnd(idx_type &, pos_type &) const
144 {
145         return false;
146 }
147
148
149 void MathInset::idxDelete(idx_type &, bool & popit, bool & deleteit)
150 {
151         popit    = false;
152         deleteit = false;
153 }
154
155
156 void MathInset::idxDeleteRange(idx_type, idx_type)
157 {}
158
159
160 void MathInset::writeNormal(std::ostream & os) const
161 {
162         os << "[unknown ";
163         MathWriteInfo wi(0, os, false);
164         write(wi);
165         os << "] ";
166 }
167
168
169 void MathInset::dump() const
170 {
171         lyxerr << "---------------------------------------------\n";
172         MathWriteInfo wi(0, lyxerr, false);
173         write(wi);
174         lyxerr << "\n---------------------------------------------\n";
175 }
176
177
178 bool MathInset::covers(int x, int y) const
179 {
180         lyxerr << "MathInset::covers() called directly!\n";
181         return false;
182 }
183
184
185 void MathInset::validate(LaTeXFeatures &) const
186 {}
187
188
189 std::vector<MathInset::idx_type>
190         MathInset::idxBetween(idx_type from, idx_type to) const
191 {
192         std::vector<idx_type> res;
193         for (idx_type i = from; i <= to; ++i)
194                 res.push_back(i);
195         return res;
196 }
197
198
199 void MathInset::metrics(MathMetricsInfo const &) const
200 {
201         lyxerr << "MathInset::metrics() called directly!\n";
202 }
203
204
205 void MathInset::draw(Painter &, int, int) const
206 {
207         lyxerr << "MathInset::draw() called directly!\n";
208 }
209
210
211 void MathInset::write(MathWriteInfo &) const
212 {
213         lyxerr << "MathInset::write() called directly!\n";
214 }