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"
31 int MathInset::height() const
33 return ascent() + descent();
37 std::ostream & operator<<(std::ostream & os, MathInset const & inset)
39 WriteStream wi(os, false);
45 MathInset::size_type MathInset::nargs() const
53 MathXArray & MathInset::xcell(idx_type)
55 lyxerr << "I don't have a cell 1\n";
60 MathXArray const & MathInset::xcell(idx_type) const
62 lyxerr << "I don't have a cell 2\n";
67 MathArray & MathInset::cell(idx_type)
69 lyxerr << "I don't have a cell 3\n";
70 return dummyCell.data_;
74 MathArray const & MathInset::cell(idx_type) const
76 lyxerr << "I don't have a cell 4\n";
77 return dummyCell.data_;
81 MathInset::idx_type MathInset::index(row_type row, col_type col) const
84 lyxerr << "illegal row: " << row << "\n";
86 lyxerr << "illegal col: " << col << "\n";
90 void MathInset::substitute(MathMacro const &)
94 bool MathInset::idxNext(idx_type &, pos_type &) const
100 bool MathInset::idxRight(idx_type &, pos_type &) const
106 bool MathInset::idxPrev(idx_type &, pos_type &) const
112 bool MathInset::idxLeft(idx_type &, pos_type &) const
118 bool MathInset::idxUp(idx_type &) const
124 bool MathInset::idxDown(idx_type &) const
130 bool MathInset::idxFirst(idx_type &, pos_type &) const
136 bool MathInset::idxLast(idx_type &, pos_type &) const
142 bool MathInset::idxHome(idx_type &, pos_type &) const
148 bool MathInset::idxEnd(idx_type &, pos_type &) const
154 void MathInset::idxDelete(idx_type &, bool & popit, bool & deleteit)
161 void MathInset::normalize(NormalStream & os) const
164 WriteStream wi(os.os(), false);
170 void MathInset::dump() const
172 lyxerr << "---------------------------------------------\n";
173 WriteStream wi(lyxerr, false);
175 lyxerr << "\n---------------------------------------------\n";
179 void MathInset::validate(LaTeXFeatures &) const
183 std::vector<MathInset::idx_type>
184 MathInset::idxBetween(idx_type from, idx_type to) const
186 std::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::write(WriteStream &) const
207 lyxerr << "MathInset::write() called directly!\n";
211 void MathInset::octavize(OctaveStream & os) const
213 NormalStream ns(os.os());
218 void MathInset::maplize(MapleStream & os) const
220 NormalStream ns(os.os());
225 void MathInset::mathmlize(MathMLStream & os) const
227 NormalStream ns(os.os());