* the GNU General Public Licence version 2 or later.
*/
+#include <config.h>
+
#ifdef __GNUG__
#pragma implementation
#endif
-#include <config.h>
-
-#include "Lsstream.h"
#include "math_inset.h"
+#include "Lsstream.h"
#include "math_scriptinset.h"
#include "math_mathmlstream.h"
#include "math_cursor.h"
#include "BufferView.h"
#include "formulabase.h"
-
using std::ostream;
-using std::vector;
int MathInset::height() const
}
-ostream & operator<<(ostream & os, MathAtom const & at)
-{
- if (at.nucleus())
- os << *(at.nucleus());
- else
- os << "(nil)";
- return os;
-}
-
-
-ostream & operator<<(ostream & os, MathInset const & inset)
-{
- WriteStream wi(os, false, false);
- inset.write(wi);
- return os;
-}
-
-
MathInset::size_type MathInset::nargs() const
{
return 0;
}
-MathXArray dummyCell;
+MathArray dummyCell;
-MathXArray & MathInset::xcell(idx_type)
+MathArray & MathInset::cell(idx_type)
{
lyxerr << "I don't have a cell 1\n";
return dummyCell;
}
-MathXArray const & MathInset::xcell(idx_type) const
+MathArray const & MathInset::cell(idx_type) const
{
lyxerr << "I don't have a cell 2\n";
return dummyCell;
}
-MathArray & MathInset::cell(idx_type)
-{
- lyxerr << "I don't have a cell 3\n";
- return dummyCell.data();
-}
-
-
-MathArray const & MathInset::cell(idx_type) const
-{
- lyxerr << "I don't have a cell 4\n";
- return dummyCell.data();
-}
-
-
MathInset::idx_type MathInset::index(row_type row, col_type col) const
{
if (row != 0)
}
-void MathInset::normalize(NormalStream & os) const
-{
- os << "[unknown ";
- WriteStream wi(os.os(), false, true);
- write(wi);
- os << "] ";
-}
-
-
void MathInset::dump() const
{
lyxerr << "---------------------------------------------\n";
}
-void MathInset::validate(LaTeXFeatures &) const
-{}
-
-
-vector<MathInset::idx_type>
- MathInset::idxBetween(idx_type from, idx_type to) const
+bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
{
- vector<idx_type> res;
- for (idx_type i = from; i <= to; ++i)
- res.push_back(i);
- return res;
+ return from <= idx && idx <= to;
}
-void MathInset::write(WriteStream &) const
+void MathInset::write(WriteStream & os) const
{
- lyxerr << "MathInset::write() called directly!\n";
+ os << '\\' << name().c_str();
+ os.pendingSpace(true);
+}
+
+
+void MathInset::normalize(NormalStream & os) const
+{
+ os << '[' << name().c_str() << "] ";
}
}
+void MathInset::maximize(MaximaStream & os) const
+{
+ MapleStream ns(os.os());
+ maplize(ns);
+}
+
+
void MathInset::mathematicize(MathematicaStream & os) const
{
NormalStream ns(os.os());
}
-int MathInset::dispatch(string const &, idx_type, pos_type)
-{
- return 0; // undispatched
-}
-
-
-std::vector<string> MathInset::getLabelList() const
+MathInset::result_type
+ MathInset::dispatch(FuncRequest const &, idx_type &, pos_type &)
{
- return std::vector<string>();
+ return UNDISPATCHED;
}
std::ostringstream os;
WriteStream ws(os);
ws << ar;
- return os.str();
+ return STRCONV(os.str());
}
}
-Dialogs * getDialogs()
+ostream & operator<<(ostream & os, MathAtom const & at)
{
- return mathcursor->formula()->view()->owner()->getDialogs();
+ WriteStream wi(os, false, false);
+ at->write(wi);
+ return os;
}
-LyXFunc * getLyXFunc()
+Dialogs & getDialogs()
{
- return mathcursor->formula()->view()->owner()->getLyXFunc();
+ return mathcursor->formula()->view()->owner()->getDialogs();
}