]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.C
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / math_inset.C
index 683bf3d99f22580f915cb4c91480df057ec1ddf1..4c8038cc09056a19607f53c389cc1d50a6d849ae 100644 (file)
  *   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();
 }
 
 
@@ -209,7 +204,8 @@ void MathInset::drawT(TextPainter &, int, int) const
 
 void MathInset::write(WriteStream & os) const
 {
-       os << '\\' << name().c_str() << ' ';
+       os << '\\' << name().c_str();
+       os.pendingSpace(true);
 }
 
 
@@ -219,21 +215,28 @@ void MathInset::normalize(NormalStream & os) const
 }
 
 
-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);
@@ -265,12 +268,6 @@ int MathInset::docbook(std::ostream &, bool) const
 }
 
 
-int MathInset::dispatch(FuncRequest const &, idx_type, pos_type) 
-{
-       return 0; // undispatched
-}
-
-
 string const & MathInset::getType() const
 {
        static string t("none");
@@ -289,7 +286,7 @@ string asString(MathArray const & ar)
        std::ostringstream os;
        WriteStream ws(os);
        ws << ar;
-       return os.str();
+       return STRCONV(os.str());
 }
 
 
@@ -301,13 +298,10 @@ MathArray asArray(string const & 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();
-}