]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_mathmlstream.h
temporary reversal of the 'don't write spaces' stuff as this was buggy...
[lyx.git] / src / mathed / math_mathmlstream.h
index 6425e27d3bb8ec8ff6e99f2ec92caa19c81e3541..ebd7c652420dde39b2ab9c2bd96aa46564e4b1b9 100644 (file)
@@ -6,10 +6,70 @@
 // settled.
 
 
+#include "math_metricsinfo.h"
+
 #include <iosfwd>
 
 class MathArray;
 class MathInset;
+class MathAtom;
+
+//
+// LaTeX/LyX
+//
+
+class WriteStream {
+public:
+       ///
+       WriteStream(std::ostream & os, bool fragile, bool latex);
+       ///
+       explicit WriteStream(std::ostream & os_);
+       ///
+       ~WriteStream();
+       ///
+       int line() const { return line_; }
+       ///
+       bool fragile() const { return fragile_; }
+       ///
+       bool latex() const { return latex_; }
+       ///
+       std::ostream & os() { return os_; }
+       ///
+       bool & firstitem() { return firstitem_; }
+       ///
+       void addlines(unsigned int);
+       /// writes space if next thing is isalpha()
+       void pendingSpace(bool how);
+       /// writes space if next thing is isalpha()
+       bool pendingSpace() const { return pendingspace_; }
+private:
+       ///
+       std::ostream & os_;
+       /// do we have to write \\protect sometimes
+       bool fragile_;
+       /// are we at the beginning of an MathArray?
+       bool firstitem_;
+       /// are we writing to .tex?
+       int latex_;
+       /// do we have a space pending?
+       bool pendingspace_;
+       ///
+       int line_;
+};
+
+///
+WriteStream & operator<<(WriteStream &, MathAtom const &);
+///
+WriteStream & operator<<(WriteStream &, MathArray const &);
+///
+WriteStream & operator<<(WriteStream &, char const *);
+///
+WriteStream & operator<<(WriteStream &, char);
+///
+WriteStream & operator<<(WriteStream &, int);
+///
+WriteStream & operator<<(WriteStream &, unsigned int);
+
 
 
 //
@@ -56,7 +116,7 @@ private:
 };
 
 ///
-MathMLStream & operator<<(MathMLStream &, MathInset const *);
+MathMLStream & operator<<(MathMLStream &, MathAtom const &);
 ///
 MathMLStream & operator<<(MathMLStream &, MathArray const &);
 ///
@@ -86,7 +146,7 @@ private:
 };
 
 ///
-NormalStream & operator<<(NormalStream &, MathInset const *);
+NormalStream & operator<<(NormalStream &, MathAtom const &);
 ///
 NormalStream & operator<<(NormalStream &, MathArray const &);
 ///
@@ -117,7 +177,7 @@ private:
 
 
 ///
-MapleStream & operator<<(MapleStream &, MathInset const *);
+MapleStream & operator<<(MapleStream &, MathAtom const &);
 ///
 MapleStream & operator<<(MapleStream &, MathArray const &);
 ///
@@ -146,7 +206,7 @@ private:
 
 
 ///
-MathematicaStream & operator<<(MathematicaStream &, MathInset const *);
+MathematicaStream & operator<<(MathematicaStream &, MathAtom const &);
 ///
 MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
 ///
@@ -174,7 +234,7 @@ private:
 };
 
 ///
-OctaveStream & operator<<(OctaveStream &, MathInset const *);
+OctaveStream & operator<<(OctaveStream &, MathAtom const &);
 ///
 OctaveStream & operator<<(OctaveStream &, MathArray const &);
 ///
@@ -186,52 +246,4 @@ OctaveStream & operator<<(OctaveStream &, int);
 
 
 
-//
-// LaTeX/LyX
-//
-
-class WriteStream {
-public:
-       ///
-       WriteStream(std::ostream & os, bool fragile, bool latex);
-       ///
-       explicit WriteStream(std::ostream & os_);
-       ///
-       int line() const { return line_; }
-       ///
-       bool fragile() const { return fragile_; }
-       ///
-       bool latex() const { return latex_; }
-       ///
-       std::ostream & os() { return os_; }
-       ///
-       bool & firstitem() { return firstitem_; }
-       ///
-       void addlines(unsigned int);
-private:
-       ///
-       std::ostream & os_;
-       ///
-       bool fragile_;
-       /// are we writing to .tex?
-       int latex_;
-       /// are we at the beginning of an MathArray?
-       bool firstitem_;
-       ///
-       int line_;
-};
-
-///
-WriteStream & operator<<(WriteStream &, MathInset const *);
-///
-WriteStream & operator<<(WriteStream &, MathArray const &);
-///
-WriteStream & operator<<(WriteStream &, char const *);
-///
-WriteStream & operator<<(WriteStream &, char);
-///
-WriteStream & operator<<(WriteStream &, int);
-///
-WriteStream & operator<<(WriteStream &, unsigned int);
-
 #endif