3 * Purpose: Implementation of insets for mathed
4 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
5 * Created: January 1996
8 * Dependencies: Xlib, XForms
10 * Copyright: 1996, 1997 Alejandro Aguilar Sierra
14 * You are free to use and modify this code under the terms of
15 * the GNU General Public Licence version 2 or later.
19 #pragma implementation
25 #include "math_inset.h"
26 #include "math_scriptinset.h"
27 #include "math_mathmlstream.h"
35 int MathInset::height() const
37 return ascent() + descent();
41 ostream & operator<<(ostream & os, MathAtom const & at)
44 os << *(at.nucleus());
51 ostream & operator<<(ostream & os, MathInset const & inset)
53 WriteStream wi(os, false, false);
58 MathInset::size_type MathInset::nargs() const
66 MathXArray & MathInset::xcell(idx_type)
68 lyxerr << "I don't have a cell 1\n";
73 MathXArray const & MathInset::xcell(idx_type) const
75 lyxerr << "I don't have a cell 2\n";
80 MathArray & MathInset::cell(idx_type)
82 lyxerr << "I don't have a cell 3\n";
83 return dummyCell.data_;
87 MathArray const & MathInset::cell(idx_type) const
89 lyxerr << "I don't have a cell 4\n";
90 return dummyCell.data_;
94 MathInset::idx_type MathInset::index(row_type row, col_type col) const
97 lyxerr << "illegal row: " << row << "\n";
99 lyxerr << "illegal col: " << col << "\n";
103 void MathInset::substitute(MathMacro const &)
107 bool MathInset::idxNext(idx_type &, pos_type &) const
113 bool MathInset::idxRight(idx_type &, pos_type &) const
119 bool MathInset::idxPrev(idx_type &, pos_type &) const
125 bool MathInset::idxLeft(idx_type &, pos_type &) const
131 bool MathInset::idxUpDown(idx_type &, bool) const
137 bool MathInset::idxFirst(idx_type &, pos_type &) const
143 bool MathInset::idxLast(idx_type &, pos_type &) const
149 bool MathInset::idxHome(idx_type &, pos_type &) const
155 bool MathInset::idxEnd(idx_type &, pos_type &) const
161 void MathInset::normalize(NormalStream & os) const
164 WriteStream wi(os.os(), false, true);
170 void MathInset::dump() const
172 lyxerr << "---------------------------------------------\n";
173 WriteStream wi(lyxerr, false, true);
175 lyxerr << "\n---------------------------------------------\n";
179 void MathInset::validate(LaTeXFeatures &) const
183 vector<MathInset::idx_type>
184 MathInset::idxBetween(idx_type from, idx_type to) const
186 vector<idx_type> res;
187 for (idx_type i = from; i <= to; ++i)
193 void MathInset::metrics(MathMetricsInfo const &) const
195 lyxerr << "MathInset::metrics() called directly!\n";
199 void MathInset::draw(Painter &, int, int) const
201 lyxerr << "MathInset::draw() called directly!\n";
205 void MathInset::metricsT(TextMetricsInfo const &) const
208 lyxerr << "MathInset::metricsT(Text) called directly!\n";
213 void MathInset::drawT(TextPainter &, int, int) const
216 lyxerr << "MathInset::drawT(Text) called directly!\n";
222 void MathInset::write(WriteStream &) const
224 lyxerr << "MathInset::write() called directly!\n";
228 void MathInset::octavize(OctaveStream & os) const
230 NormalStream ns(os.os());
235 void MathInset::maplize(MapleStream & os) const
237 NormalStream ns(os.os());
242 void MathInset::mathmlize(MathMLStream & os) const
244 NormalStream ns(os.os());