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.
20 #include "math_inset.h"
21 #include "math_scriptinset.h"
22 #include "math_mathmlstream.h"
23 #include "math_cursor.h"
26 #include "frontends/LyXView.h"
27 #include "frontends/Dialogs.h"
28 #include "BufferView.h"
29 #include "formulabase.h"
35 BufferView * MathInset::view() const
37 return mathcursor ? mathcursor->formula()->view() : 0;
41 MathInset::size_type MathInset::nargs() const
49 MathArray & MathInset::cell(idx_type)
51 lyxerr << "I don't have a cell 1" << endl;
56 MathArray const & MathInset::cell(idx_type) const
58 lyxerr << "I don't have a cell 2" << endl;
63 MathInset::idx_type MathInset::index(row_type row, col_type col) const
66 lyxerr << "illegal row: " << row << endl;
68 lyxerr << "illegal col: " << col << endl;
72 void MathInset::substitute(MathMacro const &)
76 bool MathInset::idxNext(idx_type &, pos_type &) const
82 bool MathInset::idxRight(idx_type &, pos_type &) const
88 bool MathInset::idxPrev(idx_type &, pos_type &) const
94 bool MathInset::idxLeft(idx_type &, pos_type &) const
100 bool MathInset::idxUpDown(idx_type &, pos_type &, bool, int) const
106 bool MathInset::idxUpDown2(idx_type &, pos_type &, bool, int) const
112 bool MathInset::idxFirst(idx_type &, pos_type &) const
118 bool MathInset::idxLast(idx_type &, pos_type &) const
124 bool MathInset::idxHome(idx_type &, pos_type &) const
130 bool MathInset::idxEnd(idx_type &, pos_type &) const
136 void MathInset::getPos(idx_type, pos_type, int & x, int & y) const
138 lyxerr << "MathInset::getPos() called directly!" << endl;
143 void MathInset::dump() const
145 lyxerr << "---------------------------------------------" << endl;
146 WriteStream wi(lyxerr, false, true);
148 lyxerr << "\n---------------------------------------------" << endl;
152 bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
154 return from <= idx && idx <= to;
158 void MathInset::drawSelection(PainterInfo &,
159 idx_type, pos_type, idx_type, pos_type) const
161 lyxerr << "MathInset::drawSelection() called directly!" << endl;
165 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
168 lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
173 void MathInset::drawT(TextPainter &, int, int) const
176 lyxerr << "MathInset::drawT(Text) called directly!" << endl;
182 void MathInset::write(WriteStream & os) const
184 os << '\\' << name().c_str();
185 os.pendingSpace(true);
189 void MathInset::normalize(NormalStream & os) const
191 os << '[' << name().c_str() << "] ";
195 void MathInset::octave(OctaveStream & os) const
197 NormalStream ns(os.os());
202 void MathInset::maple(MapleStream & os) const
204 NormalStream ns(os.os());
209 void MathInset::maxima(MaximaStream & os) const
211 MapleStream ns(os.os());
216 void MathInset::mathematica(MathematicaStream & os) const
218 NormalStream ns(os.os());
223 void MathInset::mathmlize(MathMLStream & os) const
225 NormalStream ns(os.os());
230 int MathInset::ascii(std::ostream &, int) const
236 int MathInset::linuxdoc(std::ostream &) const
242 int MathInset::docbook(std::ostream &, bool) const
248 string const & MathInset::getType() const
250 static string const t("none");
255 string MathInset::name() const
261 ostream & operator<<(ostream & os, MathAtom const & at)
263 WriteStream wi(os, false, false);
269 string MathInset::fileInsetLabel() const