]> 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 52bbd38fc58bd7c04c55d140d8749722b9f82df6..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
-{
-       return ascent() + descent();
-}
 
 
-ostream & operator<<(ostream & os, MathAtom const & at)
+BufferView * MathInset::view() const
 {
-       if (at.nucleus())
-               os << *(at.nucleus());
-       else
-               os << "(nil)";
-       return os;
+       if (!mathcursor)
+               return 0;
+       return mathcursor->formula()->view();
 }
 
 
-ostream & operator<<(ostream & os, MathInset const & inset)
+int MathInset::height() const
 {
-       WriteStream wi(os, false, false);
-       inset.write(wi);
-       return os;
+       return ascent() + descent();
 }
 
 
@@ -219,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);
 }
 
 
@@ -229,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);
@@ -275,12 +268,6 @@ int MathInset::docbook(std::ostream &, bool) const
 }
 
 
-int MathInset::dispatch(string const &, idx_type, pos_type) 
-{
-       return 0; // undispatched
-}
-
-
 string const & MathInset::getType() const
 {
        static string t("none");
@@ -299,7 +286,7 @@ string asString(MathArray const & ar)
        std::ostringstream os;
        WriteStream ws(os);
        ws << ar;
-       return os.str();
+       return STRCONV(os.str());
 }
 
 
@@ -311,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();
-}