* the GNU General Public Licence version 2 or later.
*/
-#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
+BufferView * MathInset::view() const
{
- return ascent() + descent();
+ if (!mathcursor)
+ return 0;
+ return mathcursor->formula()->view();
}
-ostream & operator<<(ostream & os, MathAtom const & at)
+int MathInset::height() const
{
- WriteStream wi(os, false, false);
- at->write(wi);
- return os;
+ return ascent() + descent();
}
}
-void MathInset::metrics(MathMetricsInfo &) const
+void MathInset::metrics(MetricsInfo &) const
{
lyxerr << "MathInset::metrics() called directly!\n";
}
-void MathInset::draw(MathPainterInfo &, int, int) const
+void MathInset::draw(PainterInfo &, int, int) const
{
lyxerr << "MathInset::draw() called directly!\n";
}
-void MathInset::drawSelection(MathPainterInfo &,
+void MathInset::drawSelection(PainterInfo &,
idx_type, pos_type, idx_type, pos_type) const
{
lyxerr << "MathInset::drawSelection() called directly!\n";
void MathInset::write(WriteStream & os) const
{
- os << '\\' << name().c_str() << ' ';
+ os << '\\' << name().c_str();
+ os.pendingSpace(true);
}
}
-void MathInset::octavize(OctaveStream & os) const
+void MathInset::octave(OctaveStream & os) const
{
NormalStream ns(os.os());
normalize(ns);
}
-void MathInset::maplize(MapleStream & os) const
+void MathInset::maple(MapleStream & os) const
{
NormalStream ns(os.os());
normalize(ns);
}
-void MathInset::mathematicize(MathematicaStream & os) const
+void MathInset::maxima(MaximaStream & os) const
+{
+ MapleStream ns(os.os());
+ maple(ns);
+}
+
+
+void MathInset::mathematica(MathematicaStream & os) const
{
NormalStream ns(os.os());
normalize(ns);
}
-MathInset::result_type
- MathInset::dispatch(FuncRequest const &, idx_type &, pos_type &)
-{
- return UNDISPATCHED;
-}
-
-
string const & MathInset::getType() const
{
static string t("none");
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()
-{
- return mathcursor->formula()->view()->owner()->getLyXFunc();
-}