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"
34 BufferView * MathInset::view() const
36 return mathcursor ? mathcursor->formula()->view() : 0;
40 MathInset::size_type MathInset::nargs() const
48 MathArray & MathInset::cell(idx_type)
50 lyxerr << "I don't have a cell 1\n";
55 MathArray const & MathInset::cell(idx_type) const
57 lyxerr << "I don't have a cell 2\n";
62 MathInset::idx_type MathInset::index(row_type row, col_type col) const
65 lyxerr << "illegal row: " << row << "\n";
67 lyxerr << "illegal col: " << col << "\n";
71 void MathInset::substitute(MathMacro const &)
75 bool MathInset::idxNext(idx_type &, pos_type &) const
81 bool MathInset::idxRight(idx_type &, pos_type &) const
87 bool MathInset::idxPrev(idx_type &, pos_type &) const
93 bool MathInset::idxLeft(idx_type &, pos_type &) const
99 bool MathInset::idxUpDown(idx_type &, pos_type &, bool, int) const
105 bool MathInset::idxUpDown2(idx_type &, pos_type &, bool, int) const
111 bool MathInset::idxFirst(idx_type &, pos_type &) const
117 bool MathInset::idxLast(idx_type &, pos_type &) const
123 bool MathInset::idxHome(idx_type &, pos_type &) const
129 bool MathInset::idxEnd(idx_type &, pos_type &) const
135 void MathInset::getPos(idx_type, pos_type, int & x, int & y) const
137 lyxerr << "MathInset::getPos() called directly!\n";
142 void MathInset::dump() const
144 lyxerr << "---------------------------------------------\n";
145 WriteStream wi(lyxerr, false, true);
147 lyxerr << "\n---------------------------------------------\n";
151 bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
153 return from <= idx && idx <= to;
157 void MathInset::drawSelection(PainterInfo &,
158 idx_type, pos_type, idx_type, pos_type) const
160 lyxerr << "MathInset::drawSelection() called directly!\n";
164 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
167 lyxerr << "MathInset::metricsT(Text) called directly!\n";
172 void MathInset::drawT(TextPainter &, int, int) const
175 lyxerr << "MathInset::drawT(Text) called directly!\n";
181 void MathInset::write(WriteStream & os) const
183 os << '\\' << name().c_str();
184 os.pendingSpace(true);
188 void MathInset::normalize(NormalStream & os) const
190 os << '[' << name().c_str() << "] ";
194 void MathInset::octave(OctaveStream & os) const
196 NormalStream ns(os.os());
201 void MathInset::maple(MapleStream & os) const
203 NormalStream ns(os.os());
208 void MathInset::maxima(MaximaStream & os) const
210 MapleStream ns(os.os());
215 void MathInset::mathematica(MathematicaStream & os) const
217 NormalStream ns(os.os());
222 void MathInset::mathmlize(MathMLStream & os) const
224 NormalStream ns(os.os());
229 int MathInset::ascii(std::ostream &, int) const
235 int MathInset::linuxdoc(std::ostream &) const
241 int MathInset::docbook(std::ostream &, bool) const
247 string const & MathInset::getType() const
249 static string const t("none");
254 string MathInset::name() const
260 ostream & operator<<(ostream & os, MathAtom const & at)
262 WriteStream wi(os, false, false);
268 string MathInset::fileInsetLabel() const