]> git.lyx.org Git - features.git/commitdiff
don't #include too much stuff in .h
authorAndré Pönitz <poenitz@gmx.net>
Thu, 8 Nov 2001 12:06:56 +0000 (12:06 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 8 Nov 2001 12:06:56 +0000 (12:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2984 a592a061-630c-0410-9148-cb99ea01b6c8

79 files changed:
src/mathed/Makefile.am
src/mathed/array.C
src/mathed/array.h
src/mathed/formula.C
src/mathed/formula.h
src/mathed/formulamacro.C
src/mathed/math_arrayinset.C
src/mathed/math_arrayinset.h
src/mathed/math_binaryopinset.C
src/mathed/math_binaryopinset.h
src/mathed/math_binominset.C
src/mathed/math_binominset.h
src/mathed/math_boxinset.C
src/mathed/math_boxinset.h
src/mathed/math_braceinset.C
src/mathed/math_braceinset.h
src/mathed/math_charinset.C
src/mathed/math_charinset.h
src/mathed/math_cursor.C
src/mathed/math_decorationinset.C
src/mathed/math_decorationinset.h
src/mathed/math_deliminset.C
src/mathed/math_deliminset.h
src/mathed/math_dotsinset.C
src/mathed/math_dotsinset.h
src/mathed/math_exfuncinset.C
src/mathed/math_exfuncinset.h
src/mathed/math_exintinset.C [new file with mode: 0644]
src/mathed/math_exintinset.h [new file with mode: 0644]
src/mathed/math_fracbase.C
src/mathed/math_fracinset.C
src/mathed/math_fracinset.h
src/mathed/math_funcinset.C
src/mathed/math_funcinset.h
src/mathed/math_funcliminset.C
src/mathed/math_funcliminset.h
src/mathed/math_gridinset.C
src/mathed/math_gridinset.h
src/mathed/math_inset.C
src/mathed/math_inset.h
src/mathed/math_kerninset.C
src/mathed/math_kerninset.h
src/mathed/math_lefteqninset.C
src/mathed/math_lefteqninset.h
src/mathed/math_macro.C
src/mathed/math_macro.h
src/mathed/math_macroarg.C
src/mathed/math_macroarg.h
src/mathed/math_macrotable.C
src/mathed/math_macrotemplate.C
src/mathed/math_mathmlstream.C
src/mathed/math_mathmlstream.h
src/mathed/math_matrixinset.C
src/mathed/math_matrixinset.h
src/mathed/math_nestinset.C
src/mathed/math_notinset.C
src/mathed/math_notinset.h
src/mathed/math_parser.C
src/mathed/math_rootinset.C
src/mathed/math_rootinset.h
src/mathed/math_scriptinset.C
src/mathed/math_scriptinset.h
src/mathed/math_sizeinset.C
src/mathed/math_sizeinset.h
src/mathed/math_spaceinset.C
src/mathed/math_spaceinset.h
src/mathed/math_specialcharinset.C
src/mathed/math_specialcharinset.h
src/mathed/math_splitinset.C
src/mathed/math_sqrtinset.C
src/mathed/math_sqrtinset.h
src/mathed/math_stackrelinset.C
src/mathed/math_stackrelinset.h
src/mathed/math_stringinset.C
src/mathed/math_stringinset.h
src/mathed/math_symbolinset.C
src/mathed/math_symbolinset.h
src/mathed/support.C
src/mathed/xarray.C

index 10e26703d62ca31861263d1a49e8914cd9bacb2a..bc7108aaa4e725150e42879c057fd992cfa98c6c 100644 (file)
@@ -45,6 +45,8 @@ libmathed_la_SOURCES = \
        math_dotsinset.h \
        math_exfuncinset.C \
        math_exfuncinset.h \
+       math_exintinset.C \
+       math_exintinset.h \
        math_factory.C \
        math_factory.h \
        math_fracinset.C \
index cc53477b0cfaf760db5218658141872d364acd65..c65e069f9a04f192e0ab167081ef17ab484a96e8 100644 (file)
@@ -6,15 +6,12 @@
 #include "math_charinset.h"
 #include "math_scriptinset.h"
 #include "math_stringinset.h"
+#include "math_mathmlstream.h"
+#include "support.h"
 #include "debug.h"
 #include "array.h"
-#include "mathed/support.h"
 #include "support/LAssert.h"
 
-using std::ostream;
-using std::endl;
-
-
 
 MathArray::MathArray()
 {}
@@ -133,24 +130,19 @@ MathAtom & MathArray::back()
 }
 
 
-void MathArray::dump2(ostream & os) const
+void MathArray::dump2() const
 {
+       NormalStream ns(lyxerr);
        for (const_iterator it = begin(); it != end(); ++it)
-               os << it->nucleus() << ' ';
+               ns << it->nucleus() << ' ';
 }
 
 
-void MathArray::dump(ostream & os) const
+void MathArray::dump() const
 {
+       NormalStream ns(lyxerr);
        for (const_iterator it = begin(); it != end(); ++it)
-               os << "<" << it->nucleus() << ">";
-}
-
-
-std::ostream & operator<<(std::ostream & os, MathArray const & ar)
-{
-       ar.dump2(os);
-       return os;
+               ns << "<" << it->nucleus() << ">";
 }
 
 
@@ -231,7 +223,7 @@ void MathArray::write(MathWriteInfo & wi) const
 }
 
 
-void MathArray::writeNormal(ostream & os) const
+void MathArray::writeNormal(NormalStream & os) const
 {
        MathArray ar = glueChars();
        for (const_iterator it = ar.begin(); it != ar.end(); ++it) {
@@ -281,7 +273,7 @@ void MathArray::mathmlize(MathMLStream & os) const
        else if (ar.size() == 1)
                os << ar.begin()->nucleus();
        else {
-               os << "<mrow>";
+               os << MTag("mrow");
                for (const_iterator it = ar.begin(); it != ar.end(); ++it) {
                        MathInset const * p = it->nucleus();
                        if (MathScriptInset const * q = ar.asScript(it)) {
@@ -290,7 +282,7 @@ void MathArray::mathmlize(MathMLStream & os) const
                        } else 
                                p->mathmlize(os);
                }
-               os << "</mrow>";
+               os << ETag("mrow");
        }
 }
 
index e4d854cbc0291cd11e71f274de7c1738ed771790..007d75850ee8ea4bd80f283b878712495aeebfa3 100644 (file)
@@ -17,7 +17,6 @@
 #define MATHEDARRAY_H
 
 #include <vector>
-#include <iosfwd>
 
 #include "math_atom.h"
 #include "LString.h"
@@ -26,10 +25,12 @@ class MathScriptInset;
 class MathMacro;
 class MathWriteInfo;
 class MathMetricsInfo;
-class MathMLStream;
+class LaTeXFeatures;
+class NormalStream;
 class MapleStream;
+class MathMLStream;
 class OctaveStream;
-class LaTeXFeatures;
+
 
 #ifdef __GNUG__
 #pragma interface
@@ -93,9 +94,9 @@ public:
        MathAtom & back();
 
        ///
-       void dump(std::ostream &) const;
+       void dump() const;
        ///
-       void dump2(std::ostream &) const;
+       void dump2() const;
        ///
        void substitute(MathMacro const &);
 
@@ -106,7 +107,7 @@ public:
        /// glue chars if necessary
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
@@ -139,8 +140,4 @@ private:
        buffer_type bf_;
 };
 
-
-std::ostream & operator<<(std::ostream & os, MathArray const & ar);
-
-
 #endif
index 2de2bfd602827b702de9cefcfa7cf761f29af7df..59fdb97cc05822c3d62abcf5b849c1ced79d010d 100644 (file)
@@ -41,7 +41,8 @@
 #include "Painter.h"
 #include "lyxrc.h"
 #include "math_matrixinset.h"
-#include "mathed/support.h"
+#include "support.h"
+#include "math_mathmlstream.h"
 
 using std::ostream;
 using std::ifstream;
@@ -86,6 +87,12 @@ namespace {
                                "subs(`\\,`=`\\cdot `,"
                                        "eval(`latex/latex/*`)):\n";
 
+               // replace spurious \\noalign{\\medskip} in table output
+               header += 
+                       "`latex/latex/matrix`:= "
+                               "subs(`\\\\\\\\\\\\noalign{\\\\medskip}` = `\\\\\\\\`,"
+                                       "eval(`latex/latex/matrix`)):\n";
+
                //"#`latex/latex/symbol` "
                //      " := subs((\\'_\\' = \\'`\\_`\\',eval(`latex/latex/symbol`)): ";
 
@@ -217,8 +224,9 @@ namespace {
 
                // create normalized expression
                ostringstream os;
+               NormalStream ns(os);
                os << "[" << extra << ' ';
-               ar.writeNormal(os); 
+               ar.writeNormal(ns); 
                os << "]";
                string data = os.str().c_str();
 
@@ -305,10 +313,12 @@ int InsetFormula::linuxdoc(Buffer const * buf, ostream & os) const
 int InsetFormula::docbook(Buffer const * buf, ostream & os) const
 {
        MathMLStream ms(os);
-       ms << "<equation><alt>";
+       ms << MTag("equation") << MTag("alt");
        int res = ascii(buf, ms.os_, 0);
-       ms << "</alt>\n<math>" << par_.nucleus() << "<math></equation>";
-       return res + 1;
+       ms << ETag("alt") << MTag("math");
+       ms << par_.nucleus();
+       ms << ETag("math") << ETag("equation");
+       return ms.line_ + res;
 }
 
 
@@ -508,7 +518,7 @@ void InsetFormula::handleExtern(const string & arg)
        MathArray ar;
        if (selected) {
                mathcursor->selGet(ar);
-               lyxerr << "use selection: " << ar << "\n";
+               //lyxerr << "use selection: " << ar << "\n";
        } else {
                mathcursor->end();
                mathcursor->stripFromLastEqualSign();
index 94c6d602b6671a11696bb69d2b02b483aee5dd74..38b41cbccbcbdaa042692b40df1576ffe46a203f 100644 (file)
@@ -21,7 +21,7 @@
 #pragma interface
 #endif
 
-#include "mathed/formulabase.h"
+#include "formulabase.h"
 #include "math_defs.h"
 #include "math_atom.h"
 
index e2e28577b3337a060ea98c7da5d22cf52f34b51c..f5a75c4bd39e2344ed39c112320bfb7898387b91 100644 (file)
@@ -38,6 +38,7 @@
 #include "lyxlex.h"
 #include "lyxtext.h"
 #include "lyxfont.h"
+#include "math_mathmlstream.h"
 
 using std::ostream;
 
index 4a48f11e84a9dc533b12628a5007cc3102a97bfd..4b98267d5dd55975351b23d992487ea40752f470 100644 (file)
@@ -6,6 +6,7 @@
 #include "math_parser.h"
 #include "support/LOstream.h"
 #include "Lsstream.h"
+#include "math_mathmlstream.h"
 
 using std::vector;
 
@@ -73,7 +74,7 @@ void MathArrayInset::write(MathWriteInfo & os) const
 }
 
 
-void MathArrayInset::writeNormal(std::ostream & os) const
+void MathArrayInset::writeNormal(NormalStream & os) const
 {
        os << "[array ";
        MathGridInset::writeNormal(os);
index 13f2ee5736548020ad6d0773904ab553790b4d1c..06d092e413b06fd3c5743ce16735382fd52700db 100644 (file)
@@ -22,7 +22,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 4ceb067faadc11cf7cd192514f61cb5c00b7fe52..ff67faf7a95e670c4f2bb0a7427d55863ed34561 100644 (file)
@@ -6,6 +6,7 @@
 #include "Painter.h"
 #include "support/LOstream.h"
 #include "support.h"
+#include "math_mathmlstream.h"
 
 
 MathBinaryOpInset::MathBinaryOpInset(char op)
@@ -50,11 +51,7 @@ void MathBinaryOpInset::write(MathWriteInfo & os) const
 }
 
 
-void MathBinaryOpInset::writeNormal(std::ostream & os) const
+void MathBinaryOpInset::writeNormal(NormalStream & os) const
 {
-       os << "[binop " << op_ << ' ';
-       cell(0).writeNormal(os); 
-       os << " ";
-       cell(1).writeNormal(os); 
-       os << "]";
+       os << "[binop " << op_ << ' ' << cell(0) << ' ' << cell(1) << ']';
 }
index ccd5f085f49270b7809a571ac75d5caff8960f56..2eca9519dacb46736fa9db0e93408f99fdcad4de 100644 (file)
@@ -23,7 +23,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
 private:
index 85e9de308b499f8c20e3a053f69216026b8d8687..71b32bdb3c46ae6cfb83591b1fd8e451124e9377 100644 (file)
@@ -5,6 +5,7 @@
 #include "math_binominset.h"
 #include "support.h"
 #include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 MathBinomInset::MathBinomInset()
@@ -56,7 +57,7 @@ void MathBinomInset::write(MathWriteInfo & os) const
 }
 
 
-void MathBinomInset::writeNormal(std::ostream & os) const
+void MathBinomInset::writeNormal(NormalStream & os) const
 {
        os << "[binom ";
        cell(0).writeNormal(os);
index b991a2700ab8c32ea8870480d55b844410e6e0f4..35f5933c0b2b3a31a239c90bf597b750535acee1 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 39b3b1c931d0d94b53fa07eea10e1183ec39ab12..7eb163fe9895900902ac7870f9ae8b3d6baa1dc7 100644 (file)
@@ -9,6 +9,7 @@
 #include "Painter.h"
 #include "math_cursor.h"
 #include "insets/insettext.h"
+#include "math_mathmlstream.h"
 
 
 MathBoxInset::MathBoxInset(string const & name)
@@ -46,11 +47,11 @@ UpdatableInset * MathBoxInset::asHyperActiveInset() const
 
 void MathBoxInset::write(MathWriteInfo & os) const
 {
-       os << "\\" << name_ << "{" << cell(0) << "}";
+       os << "\\" << name_.c_str() << "{" << cell(0) << "}";
 }
 
 
-void MathBoxInset::writeNormal(std::ostream & os) const
+void MathBoxInset::writeNormal(NormalStream & os) const
 {
        os << "[mbox ";
        //text_->write(buffer(), os);
index b866bbe5b81942c60730238975b2ee813c0d3895..8812296605840c78cc0cd38cdc9aaffc801a9ff5 100644 (file)
@@ -32,7 +32,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const &) const;
        /// identifies BoxInsets
index 93b37336d6c3ed3ecb0c881a911564a60407881a..88fd33a5bd541bcf904648d12033e2e0486af202 100644 (file)
@@ -6,10 +6,8 @@
 
 #include "math_braceinset.h"
 #include "math_parser.h"
-#include "mathed/support.h"
-#include "support/LOstream.h"
-
-using std::max;
+#include "support.h"
+#include "math_mathmlstream.h"
 
 
 MathBraceInset::MathBraceInset()
@@ -29,7 +27,7 @@ void MathBraceInset::write(MathWriteInfo & os) const
 }
 
 
-void MathBraceInset::writeNormal(std::ostream & os) const
+void MathBraceInset::writeNormal(NormalStream & os) const
 {
        os << "[block ";
        cell(0).writeNormal(os);
index b7ed9514ff8537e454e3c062ee0a9b86dfe75742..960f674b82c3f905cf9efd238548242f691ba884 100644 (file)
@@ -24,7 +24,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        /// write normalized content
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
 
index 89c3378a783825e587fcec70345a392fb9037a62..0986be73e08d13c13267dc150db155044bf815f6 100644 (file)
@@ -8,9 +8,10 @@
 #include "LColor.h"
 #include "Painter.h"
 #include "support/LOstream.h"
-#include "mathed/support.h"
+#include "support.h"
 #include "math_parser.h"
 #include "debug.h"
+#include "math_mathmlstream.h"
 
 
 MathCharInset::MathCharInset(char c)
@@ -101,7 +102,7 @@ void MathCharInset::write(MathWriteInfo & os) const
 }
 
 
-void MathCharInset::writeNormal(std::ostream & os) const
+void MathCharInset::writeNormal(NormalStream & os) const
 {
        os << "[char " << char_ << " " << "mathalpha" << "]";
 }
index 3d844729ba4e6f4ad7c1cc89c27f3bea931d3d2c..790453440a18f9d4e8bcff864ac7bb2d92ddb980 100644 (file)
@@ -35,7 +35,7 @@ public:
        ///
        void writeRaw(std::ostream &) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        /// 
        int ascent() const;
        ///
index beeb60793eb66647ad01f5516497878b9f98c0f0..aa8394ab474f10b88490d3684ae687fcf88613cf 100644 (file)
@@ -40,6 +40,7 @@
 #include "math_scriptinset.h"
 #include "math_spaceinset.h"
 #include "math_specialcharinset.h"
+#include "math_mathmlstream.h"
 
 #define FILEDEBUG 0
 
index 7c76cee6eb7b1a85225a0a7dd48720522a7aa4a7..33829502e0a7e17d236408ecf9ca70019e4a70b7 100644 (file)
@@ -3,12 +3,9 @@
 #endif
 
 #include "math_decorationinset.h"
-#include "mathed/support.h"
+#include "support.h"
 #include "math_parser.h"
-#include "support/LOstream.h"
-
-
-using std::ostream;
+#include "math_mathmlstream.h"
 
 
 MathDecorationInset::MathDecorationInset(string const & name)
@@ -98,13 +95,11 @@ void MathDecorationInset::write(MathWriteInfo & os) const
 {
        if (os.fragile && protect())
                os << "\\protect";
-       os << '\\' << name_ << '{' << cell(0) << '}';
+       os << '\\' << name_.c_str() << '{' << cell(0) << '}';
 }
 
 
-void MathDecorationInset::writeNormal(ostream & os) const
+void MathDecorationInset::writeNormal(NormalStream & os) const
 {
-       os << "[" << name_ << " ";
-       cell(0).writeNormal(os);
-       os << "] ";
+       os << "[deco " << name_.c_str() << ' ' <<  cell(0) << ']';
 }
index 1808b2f474d42775e0e4273ffb91d1ff11e1418e..5a18067de55798befd7057479be41e43228a82d3 100644 (file)
@@ -26,7 +26,7 @@ public:
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
-       void writeNormal(std::ostream & os) const;
+       void writeNormal(NormalStream & os) const;
        ///
        bool isScriptable() const;
 
index d0191cc87bbcde8e724d42ccfd9f2694ade5933e..dd4f3ef08bf6bd48ee8af4c7d54c2718ba7c3391 100644 (file)
@@ -6,10 +6,9 @@
 
 #include "math_deliminset.h"
 #include "math_parser.h"
-#include "mathed/support.h"
+#include "support.h"
 #include "support/LOstream.h"
-
-using std::max;
+#include "math_mathmlstream.h"
 
 
 MathDelimInset::MathDelimInset(string const & l, string const & r)
@@ -45,16 +44,15 @@ string MathDelimInset::latexName(string const & name)
 
 void MathDelimInset::write(MathWriteInfo & os) const
 {
-       os << "\\left" << latexName(left_) << cell(0)
-          << "\\right" << latexName(right_);
+       os << "\\left" << latexName(left_).c_str() << cell(0)
+          << "\\right" << latexName(right_).c_str();
 }
 
 
-void MathDelimInset::writeNormal(std::ostream & os) const
+void MathDelimInset::writeNormal(NormalStream & os) const
 {
-       os << "[delim " << latexName(left_) << ' ' << latexName(right_) << ' ';
-       cell(0).writeNormal(os);
-       os << "]";
+       os << "[delim " << latexName(left_).c_str() << ' '
+               << latexName(right_).c_str() << ' ' << cell(0) << ']';
 }
 
 
@@ -77,8 +75,8 @@ void MathDelimInset::metrics(MathMetricsInfo const & mi) const
        int h0   = (a + d) / 2;
        int a0   = std::max(xcell(0).ascent(), a)   - h0;
        int d0   = std::max(xcell(0).descent(), d)  + h0;
-       ascent_  = max(a0, d0) + h0;
-       descent_ = max(a0, d0) - h0;
+       ascent_  = std::max(a0, d0) + h0;
+       descent_ = std::max(a0, d0) - h0;
        width_   = xcell(0).width() + 2 * dw() + 4;
 }
 
index e5d5d4aa609cb75df20b31aa95e9c3629a0d9843..e0a00d9b57c0076e5d2270523b0f248ee204172a 100644 (file)
@@ -24,7 +24,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        /// write normalized content
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 47a79a7d4a7d51d926b96df70fe0f50e019d41df..1f3aad23141fe4930541562c2ac7d5897cf48325 100644 (file)
@@ -3,10 +3,8 @@
 #endif
 
 #include "math_dotsinset.h"
-#include "mathed/support.h"
-#include "support/LOstream.h"
-
-using std::ostream;
+#include "math_mathmlstream.h"
+#include "support.h"
 
 
 MathDotsInset::MathDotsInset(string const & name)
@@ -46,11 +44,11 @@ void MathDotsInset::metrics(MathMetricsInfo const & mi) const
 
 void MathDotsInset::write(MathWriteInfo & os) const
 {
-       os << '\\' << name_ << ' ';
+       os << '\\' << name_.c_str() << ' ';
 }
 
 
-void MathDotsInset::writeNormal(ostream & os) const
+void MathDotsInset::writeNormal(NormalStream & os) const
 {
-       os << "[" << name_ << "] ";
+       os << "[" << name_.c_str() << "] ";
 }
index 2fcc333c2511ed571fe340d7b211815a29590d6c..c13943d5ae0457039e39133514adc9feac4e0e8a 100644 (file)
@@ -21,7 +21,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
 protected:
index 3ca79da57f1f19731f680d3b5dbca095b9f1776e..d1da3f4119c583871419b006c50ab98656588c9e 100644 (file)
@@ -1,7 +1,6 @@
 #include "math_exfuncinset.h"
 #include "support.h"
-#include "debug.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 using std::ostream;
@@ -20,17 +19,13 @@ MathInset * MathExFuncInset::clone() const
 
 void MathExFuncInset::write(MathWriteInfo & os) const
 {
-       os << '\\' << name_ << '{';
-       cell(0).write(os);
-       os << '}';
+       os << '\\' << name_.c_str() << '{' << cell(0) << '}';
 }
 
 
-void MathExFuncInset::writeNormal(ostream & os) const
+void MathExFuncInset::writeNormal(NormalStream & os) const
 {
-       os << "[" << name_ << ' ';
-       cell(0).writeNormal(os);
-       os << "] ";
+       os << '[' << name_.c_str() << ' ' << cell(0) << ']';
 }
 
 
@@ -38,14 +33,12 @@ void MathExFuncInset::metrics(MathMetricsInfo const & mi) const
 {
        mi_ = mi;
        mathed_string_dim(LM_TC_TEXTRM, mi_, name_, ascent_, descent_, width_);
-       lyxerr << "should not happen\n";
 }
 
 
 void MathExFuncInset::draw(Painter & pain, int x, int y) const
 {  
        drawStr(pain, LM_TC_TEXTRM, mi_, x, y, name_);
-       lyxerr << "should not happen\n";
 }
 
 
index 7ff103b01d89bd29430b493b7cbe6f8c17195ff4..951449673f27c71905b55566890f37bb21b68abd 100644 (file)
@@ -16,7 +16,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
diff --git a/src/mathed/math_exintinset.C b/src/mathed/math_exintinset.C
new file mode 100644 (file)
index 0000000..7ebd2b9
--- /dev/null
@@ -0,0 +1,54 @@
+#include "math_exintinset.h"
+#include "support.h"
+#include "debug.h"
+#include "math_mathmlstream.h"
+#include "math_symbolinset.h"
+
+
+MathExIntInset::MathExIntInset(MathScriptInset const & scripts,
+               MathArray const & core, MathArray const & diff)
+       : int_(new MathSymbolInset("int")),
+               scripts_(scripts), core_(core), diff_(diff)
+{}
+
+
+MathInset * MathExIntInset::clone() const
+{
+       return new MathExIntInset(*this);
+}
+
+
+void MathExIntInset::write(MathWriteInfo & os) const
+{
+       scripts_.write(int_.nucleus(), os);
+       os << core_ << "d" << diff_;
+}
+
+
+void MathExIntInset::writeNormal(NormalStream & os) const
+{
+       //os << "[int " << scripts_ << ' ' << core_ << ' ' << diff_ << ']'
+}
+
+
+void MathExIntInset::metrics(MathMetricsInfo const &) const
+{
+       lyxerr << "should not happen\n";
+}
+
+
+void MathExIntInset::draw(Painter &, int, int) const
+{  
+       lyxerr << "should not happen\n";
+}
+
+
+void MathExIntInset::maplize(MapleStream & os) const
+{
+       //os << name_.c_str() << '(' << cell(0) << ')';
+}
+
+void MathExIntInset::mathmlize(MathMLStream & os) const
+{
+       //os << name_.c_str() << '(' << cell(0) << ')';
+}
diff --git a/src/mathed/math_exintinset.h b/src/mathed/math_exintinset.h
new file mode 100644 (file)
index 0000000..0d1214e
--- /dev/null
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+#ifndef MATH_EXINTINSET_H
+#define MATH_EXINTINSET_H
+
+// /\int_l^u f(x) dxin one block (as opposed to 'f','(','x',')' or 'f','x')
+// for interfacing external programs
+
+#include "math_scriptinset.h"
+
+class MathExIntInset : public MathInset {
+public:
+       ///
+       MathExIntInset(MathScriptInset const &, MathArray const &, MathArray const &);
+       ///
+       MathInset * clone() const;
+       ///
+       void metrics(MathMetricsInfo const & st) const;
+       ///
+       void draw(Painter &, int x, int y) const;
+       ///
+       void write(MathWriteInfo & os) const;
+       ///
+       void writeNormal(NormalStream &) const;
+       ///
+       void maplize(MapleStream &) const;
+       ///
+       void mathmlize(MathMLStream &) const;
+private:
+       ///
+       MathAtom int_;
+       ///
+       MathScriptInset scripts_;
+       ///
+       MathArray core_;
+       ///
+       MathArray diff_;
+};
+#endif
index 0cb0086bb2fb93e0403091b9df4853d6a0062a7b..5efcc40b26786879a94a7ee354a7c7e6e1b01133 100644 (file)
@@ -3,6 +3,7 @@
 #endif
 
 #include "math_fracbase.h"
+#include "math_mathmlstream.h"
 
 
 MathFracbaseInset::MathFracbaseInset()
index 22fc7eeb23807f0fee286d390e3f9c5641ff4f01..455da87e6a6d87e1d1812aca04a0223125f00d83 100644 (file)
@@ -3,9 +3,9 @@
 #endif
 
 #include "math_fracinset.h"
-#include "mathed/support.h"
+#include "support.h"
 #include "Painter.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 MathFracInset::MathFracInset(bool atop)
@@ -50,7 +50,7 @@ void MathFracInset::write(MathWriteInfo & os) const
 }
 
 
-void MathFracInset::writeNormal(std::ostream & os) const
+void MathFracInset::writeNormal(NormalStream & os) const
 {
        if (atop_) 
                os << "[atop ";
@@ -71,5 +71,5 @@ void MathFracInset::maplize(MapleStream & os) const
 
 void MathFracInset::mathmlize(MathMLStream & os) const
 {
-       os << "<mfrac>" << cell(0) << cell(1) << "</mfrac>";
+       os << MTag("mfrac") << cell(0) << cell(1) << ETag("mfrac");
 }
index 479e0c8e8748d4a19349888889f84cc70c5f912f..c66e9fb2f403118747c952b7020afa0364f9d398 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index d36c8b4c5f3f465ef2e17d0bfd5b7d9ce4283c52..af1bebebeb0ec155481056670818f13a5d63731f 100644 (file)
@@ -5,11 +5,10 @@
 #include "math_funcinset.h"
 #include "font.h"
 #include "Painter.h"
-#include "mathed/support.h"
-#include "support/LOstream.h"
+#include "support.h"
+#include "math_mathmlstream.h"
 
 
-using std::ostream;
 
 extern LyXFont WhichFont(short type, int size);
 
@@ -39,13 +38,13 @@ void MathFuncInset::setName(string const & n)
 
 void MathFuncInset::write(MathWriteInfo & os) const
 {
-       os << "\\" << name_ << ' ';
+       os << "\\" << name_.c_str() << ' ';
 }
 
 
-void MathFuncInset::writeNormal(std::ostream & os) const
+void MathFuncInset::writeNormal(NormalStream & os) const
 {
-       os << "[" << name_ << "] ";
+       os << "[func " << name_.c_str() << ']';
 }
 
 
@@ -70,7 +69,7 @@ void MathFuncInset::maplize(MapleStream & os) const
 
 void MathFuncInset::mathmlize(MathMLStream & os) const
 {
-       os << "<mi>" << name_.c_str() << "</mi>";
+       os << MTag("mi") << name_.c_str() << ETag("mi");
 }
 
 
index b1468fc37dbdc793efb574a18d40a876eea65505..4196e73d7b50ddf05f324285c12cf99741afb458 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        void write(MathWriteInfo &) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        string const & name() const;
        ///
index 472b6e0807279267cc3379f9d313a66ba3ac61b6..ac3469cb17c300a6a52ae55e6c555fc7d1ed655c 100644 (file)
@@ -1,10 +1,8 @@
 #include "math_funcliminset.h"
+#include "math_mathmlstream.h"
 #include "support.h"
-#include "support/LOstream.h"
 
 
-using std::ostream;
-
 MathFuncLimInset::MathFuncLimInset(string const & name)
        : name_(name)
 {}
@@ -24,13 +22,13 @@ bool MathFuncLimInset::isScriptable() const
 
 void MathFuncLimInset::write(MathWriteInfo & os) const
 {
-       os << '\\' << name_ << ' ';
+       os << '\\' << name_.c_str() << ' ';
 }
 
 
-void MathFuncLimInset::writeNormal(ostream & os) const
+void MathFuncLimInset::writeNormal(NormalStream & os) const
 {
-       os << "[" << name_ << "] ";
+       os << "[funclim " << name_.c_str() << ']';
 }
 
 
index 86736136ac306faa9275b551303a23a2a61ebda1..02c533e853248a37ae7c915b8ebcb88a2ed89859 100644 (file)
@@ -16,7 +16,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 75d9e8e200d7893c52eba39206df53d5c29518aa..c9c5546d02ca0be9a67258ec78a1f6edc97ff3bd 100644 (file)
@@ -3,8 +3,8 @@
 #endif
 
 #include "math_gridinset.h"
+#include "math_mathmlstream.h"
 #include "lyxfont.h"
-#include "support/LOstream.h"
 #include "debug.h"
 
 
@@ -266,25 +266,22 @@ void MathGridInset::write(MathWriteInfo & os) const
 {
        for (row_type row = 0; row < nrows(); ++row) {
                for (col_type col = 0; col < ncols(); ++col) 
-                       os << cell(index(row, col)) << eocString(col);
-               os << eolString(row);
+                       os << cell(index(row, col)) << eocString(col).c_str();
+               os << eolString(row).c_str();
        }
 }
 
 
-void MathGridInset::writeNormal(std::ostream & os) const
+void MathGridInset::writeNormal(NormalStream & os) const
 {
        os << "[grid ";
        for (row_type row = 0; row < nrows(); ++row) {
                os << "[row ";
-               for (col_type col = 0; col < ncols(); ++col) {
-                       os << "[cell ";
-                       cell(index(row, col)).writeNormal(os);
-                       os << "]";
-               }
-               os << "]";
+               for (col_type col = 0; col < ncols(); ++col)
+                       os << "[cell " << cell(index(row, col)) << ']';
+               os << ']';
        }
-       os << "]";
+       os << ']';
 }
 
 
@@ -607,14 +604,14 @@ void MathGridInset::maplize(MapleStream & os) const
 
 void MathGridInset::mathmlize(MathMLStream & os) const
 {
-       os << "<mtable>";
+       os << MTag("mtable");
        for (row_type row = 0; row < nrows(); ++row) {
-               os << "<mtr>";
+               os << MTag("mtr");
                for (col_type col = 0; col < ncols(); ++col) 
                        os << cell(index(row, col));
-               os << "</mtr>";
+               os << ETag("mtr");
        }
-       os << "</mtable>";
+       os << ETag("mtable");
 }
 
 
index e87a537cf2a18aa33edfd634129ffdd15212d198..cc2414f42e9d8ef2ee8924fcac0ad33c47cff0dc 100644 (file)
@@ -66,7 +66,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 2d73be133aab4772366f1d3c1a72a40545458f74..c5dfea37d93f833d1dc7e40b7791ecdffe66cbbe 100644 (file)
@@ -24,6 +24,7 @@
 #include "Lsstream.h"
 #include "math_inset.h"
 #include "math_scriptinset.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 
 
@@ -160,10 +161,10 @@ void MathInset::idxDeleteRange(idx_type, idx_type)
 {}
 
 
-void MathInset::writeNormal(std::ostream & os) const
+void MathInset::writeNormal(NormalStream & os) const
 {
        os << "[unknown ";
-       MathWriteInfo wi(0, os, false);
+       MathWriteInfo wi(0, os.os_, false);
        write(wi);
        os << "] ";
 }
@@ -219,17 +220,20 @@ void MathInset::write(MathWriteInfo &) const
 
 void MathInset::octavize(OctaveStream & os) const
 {
-       writeNormal(os.os_);
+       NormalStream ns(os.os_);
+       writeNormal(ns);
 }
 
 
 void MathInset::maplize(MapleStream & os) const
 {
-       writeNormal(os.os_);
+       NormalStream ns(os.os_);
+       writeNormal(ns);
 }
 
 
 void MathInset::mathmlize(MathMLStream & os) const
 {
-       writeNormal(os.os_);
+       NormalStream ns(os.os_);
+       writeNormal(ns);
 }
index 013fd1e59d429f5b9a7e81159199850608561ca1..dc9020cc072afb962e0ba676ad0002206ca9c980 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "xarray.h"
 #include "math_defs.h"
-#include "math_mathmlstream.h"
 
 /** Abstract base class for all math objects.
     A math insets is for use of the math editor only, it isn't a
@@ -50,44 +49,8 @@ class MathSpaceInset;
 class MathMacroTemplate;
 
 class LaTeXFeatures;
-class Buffer;
 class BufferView;
 class UpdatableInset;
-class MathOctaveInfo;
-
-
-struct MathWriteInfo {
-       ///
-       MathWriteInfo(Buffer const * buffer_, std::ostream & os_, bool fragile_)
-               : buffer(buffer_), os(os_), fragile(fragile_)
-       {}
-       ///
-       explicit MathWriteInfo(std::ostream & os_)
-               : buffer(0), os(os_), fragile(false)
-       {}
-
-       ///
-       template <class T>
-       MathWriteInfo & operator<<(T const & t)
-       {
-               os << t;
-               return *this;
-       }
-       ///
-       MathWriteInfo & operator<<(MathArray const & ar)
-       {
-               ar.write(*this);
-               return *this;
-       }
-
-
-       ///
-       Buffer const * buffer;
-       ///
-       std::ostream & os;
-       ///
-       bool fragile;
-};
 
 
 class MathInset {
@@ -112,8 +75,6 @@ public:
        virtual void draw(Painter &, int x, int y) const;
        /// write LaTeX and Lyx code
        virtual void write(MathWriteInfo & os) const;
-       /// write normalized content
-       virtual void writeNormal(std::ostream &) const;
        /// reproduce itself
        virtual MathInset * clone() const = 0;
        ///substitutes macro arguments if necessary
@@ -254,12 +215,14 @@ public:
        ///
        virtual void handleFont(MathTextCodes) {}
 
-       ///
-       virtual void octavize(OctaveStream &) const;
+       /// write normalized content
+       virtual void writeNormal(NormalStream &) const;
        ///
        virtual void maplize(MapleStream &) const;
        ///
        virtual void mathmlize(MathMLStream &) const;
+       ///
+       virtual void octavize(OctaveStream &) const;
 };
 
 std::ostream & operator<<(std::ostream &, MathInset const &);
index 6a282351774fe46ae9f0cbd94cf47d1cbfb7bc3a..ae18d84790c7723f1368a1135b9384a94c9212b8 100644 (file)
@@ -3,8 +3,8 @@
 #endif
 
 #include "math_kerninset.h"
+#include "math_mathmlstream.h"
 #include "support.h"
-#include "support/LOstream.h"
 
 
 MathKernInset::MathKernInset()
@@ -31,18 +31,6 @@ void MathKernInset::draw(Painter &, int, int) const
 {}
 
 
-void MathKernInset::write(MathWriteInfo & os) const
-{
-       os << "\\kern" << wid_.asLatexString() << " ";
-}
-
-
-void MathKernInset::writeNormal(std::ostream & os) const
-{
-       os << "[kern " << wid_.asLatexString() << "]";
-}
-
-
 void MathKernInset::metrics(MathMetricsInfo const &) const
 {
        ascent_  = 0;
@@ -54,3 +42,16 @@ void MathKernInset::metrics(MathMetricsInfo const &) const
        width_   = static_cast<int>(wid_.value());
        //cerr << "handling kern of width " << wid_.value() << "\n";
 }
+
+
+void MathKernInset::write(MathWriteInfo & os) const
+{
+       os << "\\kern" << wid_.asLatexString().c_str() << " ";
+}
+
+
+void MathKernInset::writeNormal(NormalStream & os) const
+{
+       os << "[kern " << wid_.asLatexString().c_str() << "]";
+}
+
index 0a707cae7f214ad3d74398beb9bf7a83033c6d35..d2b7aabe600ad69dd0b74aac233e81e601155041 100644 (file)
@@ -27,7 +27,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
 private:
index 3f4382d8eab624cd027e1dbda7397f470ebf6e51..8628abce060da9bcad59cc5f5c17889a5785e747 100644 (file)
@@ -3,10 +3,10 @@
 #endif
 
 #include "math_lefteqninset.h"
-#include "support/LOstream.h"
 #include "LColor.h"
 #include "Painter.h"
 #include "math_cursor.h"
+#include "math_mathmlstream.h"
 
 
 MathLefteqnInset::MathLefteqnInset()
@@ -20,6 +20,15 @@ MathInset * MathLefteqnInset::clone() const
 }
 
 
+void MathLefteqnInset::metrics(MathMetricsInfo const & mi) const
+{
+       MathNestInset::metrics(mi);
+       ascent_  = xcell(0).ascent() + 2;
+       descent_ = xcell(0).descent() + 2;
+       width_   = 4;
+}
+
+
 void MathLefteqnInset::draw(Painter & pain, int x, int y) const
 {
        xcell(0).draw(pain, x + 2, y);
@@ -36,19 +45,10 @@ void MathLefteqnInset::write(MathWriteInfo & os) const
 }
 
 
-void MathLefteqnInset::writeNormal(std::ostream & os) const
+void MathLefteqnInset::writeNormal(NormalStream & os) const
 {
        os << "[lefteqn ";
-       MathWriteInfo wi(os);
+       MathWriteInfo wi(os.os_);
        cell(0).write(wi);
-       os << "] ";
-}
-
-
-void MathLefteqnInset::metrics(MathMetricsInfo const & mi) const
-{
-       MathNestInset::metrics(mi);
-       ascent_  = xcell(0).ascent() + 2;
-       descent_ = xcell(0).descent() + 2;
-       width_   = 4;
+       os << "]";
 }
index 15c37262a973cd176ccc5383e170760f7c0b46ec..78525d8663d1b00e39b0d50282c7fc25ef8f2708 100644 (file)
@@ -21,7 +21,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
 };
index f65f7c551e395be5c38dcff7c1d57c63d05cf4a9..c0c63266d23492f2cbe135bb73e73342d098155c 100644 (file)
@@ -27,6 +27,7 @@
 #include "math_cursor.h"
 #include "math_macrotable.h"
 #include "math_macrotemplate.h"
+#include "math_mathmlstream.h"
 #include "Painter.h"
 #include "LaTeXFeatures.h"
 
@@ -171,7 +172,7 @@ void MathMacro::write(MathWriteInfo & os) const
 }
 
 
-void MathMacro::writeNormal(std::ostream & os) const
+void MathMacro::writeNormal(NormalStream & os) const
 {
        os << "[macro " << name() << " ";
        for (idx_type i = 0; i < nargs(); ++i) {
index 39fb630aff559ffd141de4738293dccc0166724e..ce9e3b928f8c9782695ef106faac634d23239e4d 100644 (file)
@@ -50,7 +50,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void dump() const;
 
index 77c817305fb26e9c7e0328f5b205e1727c2f471e..6a6a639b43e079f852bcc3cc8e9b48cda67fb24e 100644 (file)
@@ -5,7 +5,8 @@
 #include "math_macroarg.h"
 #include "math_macro.h"
 #include "math_defs.h"
-#include "mathed/support.h"
+#include "math_mathmlstream.h"
+#include "support.h"
 #include "debug.h"
 
 
@@ -57,7 +58,7 @@ void MathMacroArgument::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathMacroArgument::writeNormal(std::ostream & os) const
+void MathMacroArgument::writeNormal(NormalStream & os) const
 {
        os << "[macroarg " << number_ << "] ";
 }
index 25755677d0d05c4cccd451a33e28c277cdabced8..f001f21b3b9d20563c674085e4717140cdac8ce4 100644 (file)
@@ -24,7 +24,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void substitute(MathMacro const & macro);
        ///
index 89065350ab1f7d185db7c497feb8698d012cfe00..392897de2b380b0b64c279137671edf36f15b0f4 100644 (file)
@@ -10,6 +10,7 @@
 #include "math_macro.h"
 #include "math_macrotemplate.h"
 #include "math_parser.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 #include "support.h" // math_font_available
 
@@ -19,6 +20,7 @@ MathMacroTable::table_type MathMacroTable::macro_table;
 
 void MathMacroTable::dump()
 {
+/*
        lyxerr << "\n------------------------------------------\n";
        table_type::const_iterator it;
        for (it = macro_table.begin(); it != macro_table.end(); ++it)
@@ -26,6 +28,7 @@ void MathMacroTable::dump()
                        << " [" << it->second->asMacroTemplate()->nargs() << "] : "
                        << it->second->cell(0) << "\n";
        lyxerr << "------------------------------------------\n";
+*/
 }
 
 
index 2e9c9d2ef10bc5963d307e9a6a477134067ea308..d1791592844172484e6901d9b32f63a6cc35ccbd 100644 (file)
@@ -3,6 +3,7 @@
 #endif
 
 #include "math_macrotemplate.h"
+#include "math_mathmlstream.h"
 #include "Painter.h"
 #include "debug.h"
 
@@ -47,15 +48,6 @@ string const & MathMacroTemplate::name() const
 }
 
 
-void MathMacroTemplate::write(MathWriteInfo & os) const
-{
-       os << "\n\\newcommand{\\" << name_ << '}';
-       if (numargs_ > 0)
-               os << '[' << numargs_ << ']';
-       os << '{' << cell(0) << "}\n";
-}
-
-
 void MathMacroTemplate::metrics(MathMetricsInfo const & mi) const
 {
        xcell(0).metrics(mi);
@@ -70,3 +62,12 @@ void MathMacroTemplate::draw(Painter & pain, int x, int y) const
        xcell(0).draw(pain, x + 2, y + 1);
        pain.rectangle(x, y - ascent(), width(), height(), LColor::blue);
 }
+
+
+void MathMacroTemplate::write(MathWriteInfo & os) const
+{
+       os << "\n\\newcommand{\\" << name_.c_str() << '}';
+       if (numargs_ > 0)
+               os << '[' << ('0' + numargs_) << ']';
+       os << '{' << cell(0) << "}\n";
+}
index 2843602c3cc3da6268cd82cfd277cd922a770d21..3f87f143b08ea2d4dc2797cfcca413b413edaeb4 100644 (file)
@@ -1,9 +1,13 @@
 
-#include "support/LOstream.h"
 #include "math_inset.h"
 #include "math_mathmlstream.h"
 
 
+MathMLStream::MathMLStream(std::ostream & os)
+       : os_(os), tab_(0), line_(0)
+{}
+
+
 MathMLStream & MathMLStream::operator<<(MathInset const * p)
 {
        p->mathmlize(*this);
@@ -32,6 +36,35 @@ MathMLStream & MathMLStream::operator<<(char c)
 }
 
 
+MathMLStream & MathMLStream::operator<<(MTag const & t)
+{
+       ++tab_;
+       cr();
+       os_ << '<' << t.tag_ << '>';
+       return *this;           
+}
+
+
+MathMLStream & MathMLStream::operator<<(ETag const & t)
+{
+       cr();
+       if (tab_ > 0)
+               --tab_;
+       os_ << "</" << t.tag_ << '>';
+       return *this;           
+}
+
+
+void MathMLStream::cr()
+{
+       os_ << '\n';
+       for (int i = 0; i < tab_; ++i)
+               os_ << ' ';
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
 
 
 MapleStream & MapleStream::operator<<(MathInset const * p)
@@ -63,6 +96,8 @@ MapleStream & MapleStream::operator<<(char c)
 
 
 
+//////////////////////////////////////////////////////////////////////
+
 
 OctaveStream & OctaveStream::operator<<(MathInset const * p)
 {
@@ -91,3 +126,78 @@ OctaveStream & OctaveStream::operator<<(char c)
        return *this;           
 }
 
+
+//////////////////////////////////////////////////////////////////////
+
+
+NormalStream & NormalStream::operator<<(MathInset const * p)
+{
+       p->writeNormal(*this);
+       return *this;           
+}
+
+
+NormalStream & NormalStream::operator<<(MathArray const & ar)
+{
+       ar.writeNormal(*this);
+       return *this;           
+}
+
+
+NormalStream & NormalStream::operator<<(char const * s)
+{
+       os_ << s;
+       return *this;           
+}
+
+
+NormalStream & NormalStream::operator<<(char c)
+{
+       os_ << c;
+       return *this;           
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+MathWriteInfo::MathWriteInfo
+               (Buffer const * buffer_, std::ostream & os_, bool fragile_)
+       : buffer(buffer_), os(os_), fragile(fragile_)
+{}
+
+
+MathWriteInfo::MathWriteInfo(std::ostream & os_)
+       : buffer(0), os(os_), fragile(false)
+{}
+
+
+MathWriteInfo & MathWriteInfo::operator<<(MathInset const * p)
+{
+       p->write(*this);
+       return *this;           
+}
+
+
+MathWriteInfo & MathWriteInfo::operator<<(MathArray const & ar)
+{
+       ar.write(*this);
+       return *this;           
+}
+
+
+MathWriteInfo & MathWriteInfo::operator<<(char const * s)
+{
+       os << s;
+       return *this;           
+}
+
+
+MathWriteInfo & MathWriteInfo::operator<<(char c)
+{
+       os << c;
+       return *this;           
+}
+
+
index 10d14301198c875dc9bccbb2ca1c69114e05ad06..1d1839359caa5f12be78fa95fa74c1b0c8cb52ee 100644 (file)
@@ -1,14 +1,30 @@
-#ifndef MATH_MATH_MLSTREAM
-#define MATH_MATH_MLSTREAM
+#ifndef MATH_MATHMLSTREAM_H
+#define MATH_MATHMLSTREAM_H
 
 #include <iosfwd>
+#include "support/LOstream.h"
 
+struct MathArray;
+struct MathInset;
+struct Buffer;
 
-struct MathMLStream {
+struct MTag {
        ///
-       explicit MathMLStream(std::ostream & os) : os_(os) {}
+       MTag(char const * const tag) : tag_(tag) {}
        ///
-       std::ostream & os_;
+       char const * const tag_;
+};
+
+struct ETag {
+       ///
+       ETag(char const * const tag) : tag_(tag) {}
+       ///
+       char const * const tag_;
+};
+
+struct MathMLStream {
+       ///
+       explicit MathMLStream(std::ostream & os);
        ///
        MathMLStream & operator<<(MathInset const *);
        ///
@@ -17,6 +33,35 @@ struct MathMLStream {
        MathMLStream & operator<<(char const *);
        ///
        MathMLStream & operator<<(char);
+       ///
+       MathMLStream & operator<<(MTag const &);
+       ///
+       MathMLStream & operator<<(ETag const &);
+       ///
+       void cr();
+
+       ///
+       std::ostream & os_;
+       ///
+       int tab_;
+       ///
+       int line_;
+};
+
+
+struct NormalStream {
+       ///
+       explicit NormalStream(std::ostream & os) : os_(os) {}
+       ///
+       std::ostream & os_;
+       ///
+       NormalStream & operator<<(MathInset const *);
+       ///
+       NormalStream & operator<<(MathArray const &);
+       ///
+       NormalStream & operator<<(char const *);
+       ///
+       NormalStream & operator<<(char);
 };
 
 
@@ -51,4 +96,29 @@ struct OctaveStream {
        OctaveStream & operator<<(char);
 };
 
+
+struct MathWriteInfo {
+       ///
+       MathWriteInfo(Buffer const * buffer_, std::ostream & os_, bool fragile_);
+       ///
+       explicit MathWriteInfo(std::ostream & os_);
+
+       ///
+       MathWriteInfo & operator<<(MathInset const *);
+       ///
+       MathWriteInfo & operator<<(MathArray const &);
+       ///
+       MathWriteInfo & operator<<(char const *);
+       ///
+       MathWriteInfo & operator<<(char);
+
+       ///
+       Buffer const * buffer;
+       ///
+       std::ostream & os;
+       ///
+       bool fragile;
+};
+
+
 #endif
index cfdbb1b1bdd0a1c3f64a6cadd6adf3118a2eddf4..6f846961350f05440886f83e459799f1a893f7cf 100644 (file)
@@ -7,9 +7,9 @@
 #include "math_matrixinset.h"
 #include "support.h"
 #include "debug.h"
-#include "support/LOstream.h"
 #include "Painter.h"
 #include "LaTeXFeatures.h"
+#include "math_mathmlstream.h"
 
 
 namespace {
@@ -185,36 +185,6 @@ void MathMatrixInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathMatrixInset::write(MathWriteInfo & os) const
-{
-  header_write(os.os);
-
-       bool n = numberedType();
-
-       for (row_type row = 0; row < nrows(); ++row) {
-               for (col_type col = 0; col < ncols(); ++col) 
-                       os << cell(index(row, col)) << eocString(col);
-               if (n) {
-                       if (!label_[row].empty())
-                               os << "\\label{" << label_[row] << "}";
-                       if (nonum_[row])
-                               os << "\\nonumber ";
-               }
-               os << eolString(row);
-       }
-
-  footer_write(os.os);
-}
-
-
-void MathMatrixInset::writeNormal(std::ostream & os) const
-{
-       os << "[formula " << normalName(getType()) << " ";
-       MathGridInset::writeNormal(os);
-       os << "] ";
-}
-
-
 void MathMatrixInset::mathmlize(MathMLStream & os) const
 {
        MathGridInset::mathmlize(os);
@@ -673,3 +643,35 @@ void MathMatrixInset::mutate(MathInsetTypes newtype)
                                << "' to '" << newtype << "' not implemented\n";
        }
 }
+
+
+void MathMatrixInset::write(MathWriteInfo & os) const
+{
+  header_write(os.os);
+
+       bool n = numberedType();
+
+       for (row_type row = 0; row < nrows(); ++row) {
+               for (col_type col = 0; col < ncols(); ++col) 
+                       os << cell(index(row, col)) << eocString(col).c_str();
+               if (n) {
+                       if (!label_[row].empty())
+                               os << "\\label{" << label_[row].c_str() << "}";
+                       if (nonum_[row])
+                               os << "\\nonumber ";
+               }
+               os << eolString(row).c_str();
+       }
+
+  footer_write(os.os);
+}
+
+
+void MathMatrixInset::writeNormal(NormalStream & os) const
+{
+       os << "[formula " << normalName(getType()).c_str() << " ";
+       MathGridInset::writeNormal(os);
+       os << "] ";
+}
+
+
index 2a06385053247c2a87f62ee15cba92c9854c67d7..3f43597336132e9b9969521298c30a56feb66df9 100644 (file)
@@ -29,7 +29,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 0a9d8affb4839a08c89bb8af63b17720a173a4e1..57384587766241bfa396fcd1537eb9d2cff2d299 100644 (file)
@@ -3,10 +3,9 @@
 #endif
 
 #include "math_nestinset.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 
-using std::max;
-using std::min;
 
 MathNestInset::MathNestInset(idx_type nargs)
        : MathDimInset(), cells_(nargs)
@@ -172,10 +171,10 @@ bool MathNestInset::covers(int x, int y) const
        int x1 = xcell(0).xo() + xcell(0).width();
        int y1 = xcell(0).yo() + xcell(0).descent();
        for (idx_type i = 1; i < nargs(); ++i) {
-               x0 = min(x0, xcell(i).xo());
-               y0 = min(y0, xcell(i).yo() - xcell(i).ascent());
-               x1 = max(x1, xcell(i).xo() + xcell(i).width());
-               y1 = max(y1, xcell(i).yo() + xcell(i).descent());
+               x0 = std::min(x0, xcell(i).xo());
+               y0 = std::min(y0, xcell(i).yo() - xcell(i).ascent());
+               x1 = std::max(x1, xcell(i).xo() + xcell(i).width());
+               y1 = std::max(y1, xcell(i).yo() + xcell(i).descent());
        }
        return x >= x0 && x <= x1 && y >= y0 && y <= y1;
 }
index da26ba0a3b02c6ecf2eb88a463756425a644159d..9d55ce2f4cbf4bd9216bc50b3c470a63990d1ddd 100644 (file)
@@ -1,11 +1,9 @@
 #include "math_notinset.h"
 #include "math_parser.h"
+#include "math_mathmlstream.h"
 #include "support.h"
-#include "support/LOstream.h"
 
 
-using std::ostream;
-
 MathNotInset::MathNotInset()
 {}
 
@@ -22,7 +20,7 @@ void MathNotInset::write(MathWriteInfo & os) const
 }
 
 
-void MathNotInset::writeNormal(ostream & os) const
+void MathNotInset::writeNormal(NormalStream & os) const
 {
        os << "[not] ";
 }
index 0f945420427f7f79dd04b8c1bd5295c8e84c3019..faf1e731fb99dbb25f04e4ae3a592826fb75e9c0 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 498daee1d2947edb155fa818a02e2e7f54a563bf..4f59e333fe7a3e9fcf11ce41dd4df259d19a3791 100644 (file)
@@ -741,12 +741,14 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                else if (t.cat() == catEnd) {
                        if (flags & FLAG_BRACE_LAST)
                                return;
-                       lyxerr << "found '}' unexpectedly, array: '" << array << "'\n";
+                       //lyxerr << "found '}' unexpectedly, array: '" << array << "'\n";
+                       lyxerr << "found '}' unexpectedly\n";
                        add(array, '}', LM_TC_TEX);
                }
                
                else if (t.cat() == catAlign) {
-                       lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
+                       //lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
+                       lyxerr << "found tab unexpectedly\n";
                        add(array, '&', LM_TC_TEX);
                }
                
@@ -789,7 +791,8 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
 
                else if (t.cs() == "\\") {
                        curr_skip_ = getArg('[', ']');
-                       lyxerr << "found newline unexpectedly, array: '" << array << "'\n";
+                       //lyxerr << "found newline unexpectedly, array: '" << array << "'\n";
+                       lyxerr << "found newline unexpectedly\n";
                        array.push_back(createMathInset("\\"));
                }
        
@@ -830,7 +833,7 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                
                else if (t.cs() == "right") {
                        if (!(flags & FLAG_RIGHT)) {
-                               lyxerr << "got so far: '" << array << "'\n";
+                               //lyxerr << "got so far: '" << array << "'\n";
                                error("Unmatched right delimiter");
                        }
                        return;
index 1625545fe9c3b1456e8ee7f3009ffeb7afc7b7e9..187a9529e3cb6f1f6d522781832cca3d563e30db 100644 (file)
@@ -16,7 +16,7 @@
 #endif
 
 #include "math_rootinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 #include "Painter.h"
 
 
@@ -64,7 +64,7 @@ void MathRootInset::write(MathWriteInfo & os) const
 }
 
 
-void MathRootInset::writeNormal(std::ostream & os) const
+void MathRootInset::writeNormal(NormalStream & os) const
 {
        os << "[root ";
        cell(1).writeNormal(os);  
index 9a1a8bb22ac275556fd60e1cde54914368925920..200ddc7cc72e28db567761432e3979dd64c2f065 100644 (file)
@@ -36,7 +36,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index c017deb4e5dc76e21d6b8a0f420679cd32cdd8a6..feb398f1914334cfa0284880564cb9d08ebf0a0a 100644 (file)
@@ -1,20 +1,12 @@
-
-#include <config.h>
-#include "Lsstream.h"
-
-#include "debug.h"
-#include "support.h"
-#include "support/LOstream.h"
-#include "support/LAssert.h"
-
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
 #include "math_scriptinset.h"
-
-using std::ostream;
-using std::ostringstream;
+#include "debug.h"
+#include "support.h"
+#include "math_mathmlstream.h"
+#include "support/LAssert.h"
 
 
 MathScriptInset::MathScriptInset()
@@ -227,72 +219,6 @@ void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
 }
 
 
-void MathScriptInset::write(MathWriteInfo & os) const
-{  
-       //lyxerr << "unexpected call to MathScriptInset::write()\n";
-       write(0, os);
-}
-
-
-void MathScriptInset::write(MathInset const * nuc, MathWriteInfo & os) const
-{
-       if (nuc) {
-               nuc->write(os);
-               if (nuc->takesLimits()) {
-                       if (limits_ == -1)
-                               os << "\\nolimits ";
-                       if (limits_ == 1)
-                               os << "\\limits ";
-               }
-       }
-       else
-               os << "{}";
-
-       if (hasDown() && down().data_.size())
-               os << "_{" << down().data_ << '}';
-
-       if (hasUp() && up().data_.size())
-               os << "^{" << up().data_ << '}';
-}
-
-
-void MathScriptInset::writeNormal(ostream & os) const
-{  
-       //lyxerr << "unexpected call to MathScriptInset::writeNormal()\n";
-       writeNormal(0, os);
-}
-
-
-void MathScriptInset::writeNormal(MathInset const * nuc, ostream & os) const
-{
-       bool d = hasDown() && down().data_.size();
-       bool u = hasUp() && up().data_.size();
-
-       ostringstream osb;
-       if (nuc)
-               nuc->writeNormal(osb);
-       else
-               osb << "[par]";
-       string base = osb.str();
-
-       if (u && d) {
-               os << "[sup [sub " << osb.str() << " ";
-               down().data_.writeNormal(os);
-               os << "] ";
-               up().data_.writeNormal(os);
-               os << ']';
-       } else if (u) {
-               os << "[sup " << osb.str() << " ";
-               up().data_.writeNormal(os);
-               os << ']';
-       } else if (d) {
-               os << "[sub " << osb.str() << " ";
-               down().data_.writeNormal(os);
-               os << ']';
-       }
-}
-
-
 bool MathScriptInset::hasLimits(MathInset const * nuc) const
 {
        return limits_ == 1 || (limits_ == 0 && nuc && nuc->isScriptable());
@@ -346,18 +272,65 @@ bool MathScriptInset::idxLeft(MathInset::idx_type &,
 }
 
 
-void MathScriptInset::maplize(MathInset const * nuc, MapleStream & os) const
+void MathScriptInset::write(MathWriteInfo & os) const
+{  
+       //lyxerr << "unexpected call to MathScriptInset::write()\n";
+       write(0, os);
+}
+
+
+void MathScriptInset::write(MathInset const * nuc, MathWriteInfo & os) const
 {
-       if (nuc)
+       if (nuc) {
                os << nuc;
+               if (nuc->takesLimits()) {
+                       if (limits_ == -1)
+                               os << "\\nolimits ";
+                       if (limits_ == 1)
+                               os << "\\limits ";
+               }
+       }
+       else
+               os << "{}";
+
        if (hasDown() && down().data_.size())
-               os << '[' << down().data_ << ']';
+               os << "_{" << down().data_ << '}';
+
        if (hasUp() && up().data_.size())
-               os << "^(" << up().data_ << ')';
+               os << "^{" << up().data_ << '}';
 }
 
 
-void MathScriptInset::octavize(MathInset const * nuc, OctaveStream & os) const
+void MathScriptInset::writeNormal(NormalStream & os) const
+{  
+       //lyxerr << "unexpected call to MathScriptInset::writeNormal()\n";
+       writeNormal(0, os);
+}
+
+
+void MathScriptInset::writeNormal(MathInset const * nuc, NormalStream & os) const
+{
+       bool d = hasDown() && down().data_.size();
+       bool u = hasUp() && up().data_.size();
+
+       if (u) 
+               os << "[sup ";
+       if (d)
+               os << "[sub ";
+       
+       if (nuc)
+               os << nuc << ' ';
+       else
+               os << "[par]";
+
+       if (d)
+               os << down().data_ << ']';
+       if (u) 
+               os << up().data_ << ']';
+}
+
+
+void MathScriptInset::maplize(MathInset const * nuc, MapleStream & os) const
 {
        if (nuc)
                os << nuc;
@@ -373,20 +346,35 @@ void MathScriptInset::mathmlize(MathInset const * nuc, MathMLStream & os) const
        bool d = hasDown() && down().data_.size();
        bool u = hasUp() && up().data_.size();
 
-       if (u)
-               os << "<sup>";
-
-       if (d)
-               os << "<sub>";
+       if (u && d)
+               os << MTag("msubsup");
+       else if (u)
+               os << MTag("msup");
+       else if (d)
+               os << MTag("msub");
 
        if (nuc)
                os << nuc;
        else
                os << "<mrow/>";
 
-       if (d)
-               os << down().data_ << "</sub>";
+       if (u && d)
+               os << down().data_ << up().data_ << ETag("msubsup");
+       else if (u)
+               os << up().data_ << ETag("msup");
+       else if (d)
+               os << down().data_ << ETag("msub");
+}
+
 
-       if (u)
-               os << up().data_ << "</sup>";
+void MathScriptInset::octavize(MathInset const * nuc, OctaveStream & os) const
+{
+       if (nuc)
+               os << nuc;
+       if (hasDown() && down().data_.size())
+               os << '[' << down().data_ << ']';
+       if (hasUp() && up().data_.size())
+               os << "^(" << up().data_ << ')';
 }
+
+
index fe72988fdc3f1cdbdd7bbd1ce24692fba3e2ab1d..904cbe0c2ed9850fad685c6c011961960de847c5 100644 (file)
@@ -23,26 +23,22 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream & os) const;
+       void writeNormal(NormalStream & os) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
        void draw(Painter &, int x, int y) const;
 
        ///
-       void write(MathInset const *, MathWriteInfo & os) const;
+       void metrics(MathInset const * nuc, MathMetricsInfo const & st) const;
        ///
-       void writeNormal(MathInset const *, std::ostream & os) const;
+       void draw(MathInset const * nuc, Painter &, int x, int y) const;
        ///
-       void metrics(MathInset const * nucleus, MathMetricsInfo const & st) const;
+       int ascent(MathInset const * nuc) const;
        ///
-       void draw(MathInset const * nucleus, Painter &, int x, int y) const;
+       int descent(MathInset const * nuc) const;
        ///
-       int ascent(MathInset const * nucleus) const;
-       ///
-       int descent(MathInset const * nucleus) const;
-       ///
-       int width(MathInset const * nucleus) const;
+       int width(MathInset const * nuc) const;
 
        ///
        bool idxLeft(MathInset::idx_type &, MathInset::pos_type &) const;
@@ -59,7 +55,7 @@ public:
        /// 
        int limits() const { return limits_; }
        ///
-       bool hasLimits(MathInset const * nucleus) const;
+       bool hasLimits(MathInset const * nuc) const;
        /// true if we have an "inner" position
        MathXArray const & up() const;
        /// returns subscript
@@ -81,6 +77,10 @@ public:
        ///
        void ensure(bool up);
 
+       ///
+       void write(MathInset const * nuc, MathWriteInfo & os) const;
+       ///
+       void writeNormal(MathInset const * nuc, NormalStream & os) const;
        ///
        void octavize(MathInset const * nuc, OctaveStream & os) const;
        ///
index a06896ba0fe76d45f0a6bbe916c25bdeca81fa93..68219334bf7a0b7dfb8961f069ce45b7537f01e0 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "math_sizeinset.h"
 #include "math_parser.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 MathSizeInset::MathSizeInset(latexkeys const * l)
@@ -37,13 +37,11 @@ void MathSizeInset::metrics(MathMetricsInfo const & mi) const
 
 void MathSizeInset::write(MathWriteInfo & os) const
 {
-       os << "{\\" << key_->name << ' ' << cell(0) << '}';
+       os << "{\\" << key_->name.c_str() << ' ' << cell(0) << '}';
 }
 
 
-void MathSizeInset::writeNormal(std::ostream & os) const
+void MathSizeInset::writeNormal(NormalStream & os) const
 {
-       os << "[" << key_->name << " ";
-       cell(0).writeNormal(os);
-       os << "]";
+       os << "[" << key_->name.c_str() << ' ' << cell(0) << ']';
 }
index b4e25958c71a2397a76f5fcda0c8ae801ea01ebf..e1b0e50fcf0424db040224c6bc1fc56728b34e54 100644 (file)
@@ -28,7 +28,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
 
 private:
        /// 
index 77be8e3a19f2ec01b2865cda9a9e7a4aef98faeb..bf640cb4faaf90aac3b39bacf8590630ab264e32 100644 (file)
@@ -6,7 +6,7 @@
 #include "support.h"
 #include "LColor.h"
 #include "Painter.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 
@@ -28,7 +28,7 @@ void MathSpaceInset::write(MathWriteInfo & os) const
 }
 
 
-void MathSpaceInset::writeNormal(std::ostream & os) const
+void MathSpaceInset::writeNormal(NormalStream & os) const
 {
        os << "[space " << space_ << "] ";
 }
index fddaed61301a878f467044814133039182d4ac1b..21fee9249c13371ae2177c6061db7758edf97fd0 100644 (file)
@@ -21,7 +21,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index fad43219c75a04661eb4332967a69c9a4c243471..e108151eabb9005da0b516b1bc2381f83dbe61bd 100644 (file)
@@ -3,7 +3,7 @@
 #endif
 
 #include "math_specialcharinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 #include "support.h"
 
 
@@ -54,7 +54,7 @@ void MathSpecialCharInset::write(MathWriteInfo & os) const
 }
 
 
-void MathSpecialCharInset::writeNormal(std::ostream & os) const
+void MathSpecialCharInset::writeNormal(NormalStream & os) const
 {
        os << "\\" << char_;
 }
index 1fbcc91301c506019a07d7784e5b6bc0a014e80f..0adb5267ae1f1ede835d5fa5f78b3f6372c3ee59 100644 (file)
@@ -26,7 +26,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        /// 
        int ascent() const;
        ///
index 46eab1d065dc1286d2d7bc05e866e9fd7056ae75..6f9d9c8e9bfbdf9030ceee100c3b840e52642e8c 100644 (file)
@@ -3,7 +3,7 @@
 #endif
 
 #include "math_splitinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 MathSplitInset::MathSplitInset(int n)
index 5e488bba80fb03b8c89ee71e631eeb5d45c2f445..65337dc5c63284a8083be01a4f4e01568aeccaf6 100644 (file)
@@ -3,9 +3,9 @@
 #endif
 
 #include "math_sqrtinset.h"
+#include "math_mathmlstream.h"
 #include "LColor.h"
 #include "Painter.h"
-#include "support/LOstream.h"
 
 
 MathSqrtInset::MathSqrtInset()
@@ -49,7 +49,7 @@ void MathSqrtInset::write(MathWriteInfo & os) const
 }
 
 
-void MathSqrtInset::writeNormal(std::ostream & os) const
+void MathSqrtInset::writeNormal(NormalStream & os) const
 {
        os << "[sqrt ";
        cell(0).writeNormal(os); 
index 769d085c240abcd383c192be1444cc1e2a2226e4..ac774cbe7b7d0fafee4798551e154f9ed7082275 100644 (file)
@@ -22,7 +22,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index eb19b0ba0f3f22585f1571ff3d12c632394f0a14..69cb5105cdb82f8999be5cfdbc848ede9c4ded1e 100644 (file)
@@ -3,8 +3,8 @@
 #endif
 
 #include "math_stackrelinset.h"
-#include "mathed/support.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
+#include "support.h"
 
 
 MathStackrelInset::MathStackrelInset()
@@ -43,7 +43,7 @@ void MathStackrelInset::write(MathWriteInfo & os) const
 }
 
 
-void MathStackrelInset::writeNormal(std::ostream & os) const
+void MathStackrelInset::writeNormal(NormalStream & os) const
 {
        os << "[stackrel ";
        cell(0).writeNormal(os);
index 5c66bdcb79ea6ef4fdbac2ff8b09b393b382fd22..e1122bfa816a0af08bde9d35fc48a64aa3d8fcb5 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index 61461a9d655849997627a94299b01b0455c5278c..b3cb3767677fb4fea738ab84e80ed3c67f12db51 100644 (file)
@@ -5,9 +5,9 @@
 #include <cctype>
 
 #include "math_stringinset.h"
+#include "math_mathmlstream.h"
 #include "LColor.h"
 #include "Painter.h"
-#include "support/LOstream.h"
 #include "support.h"
 #include "math_parser.h"
 #include "debug.h"
@@ -58,15 +58,15 @@ void MathStringInset::draw(Painter & pain, int x, int y) const
 void MathStringInset::write(MathWriteInfo & os) const
 {
        if (math_font_name(code_)) 
-               os << '\\' << math_font_name(code_) << '{' << str_ << '}';
+               os << '\\' << math_font_name(code_) << '{' << str_.c_str() << '}';
        else 
-               os << str_;
+               os << str_.c_str();
 }
 
 
-void MathStringInset::writeNormal(std::ostream & os) const
+void MathStringInset::writeNormal(NormalStream & os) const
 {
-       os << "[string " << str_ << " " << "mathalpha" << "]";
+       os << "[string " << str_.c_str() << ' ' << "mathalpha" << "]";
 }
 
 
index edcaafe5c6ac41078982ecef658d2dd527ab1890..1d4e28f095dc2f1d7faede6c216b4394b833f29a 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        /// 
        int ascent() const;
        ///
index 94d5697be0aecb6506d4a84b4056c2aca9b71de2..1cfb56460206b4684e09e9afe1e098e8ff03391f 100644 (file)
@@ -1,12 +1,10 @@
 #include "math_symbolinset.h"
 #include "math_parser.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 #include "support.h"
-#include "support/LOstream.h"
 
 
-using std::ostream;
-
 MathSymbolInset::MathSymbolInset(const latexkeys * l)
        : sym_(l), h_(0)
 {}
@@ -20,13 +18,13 @@ MathInset * MathSymbolInset::clone() const
 
 void MathSymbolInset::write(MathWriteInfo & os) const
 {
-       os << '\\' << sym_->name << ' ';
+       os << '\\' << sym_->name.c_str() << ' ';
 }
 
 
-void MathSymbolInset::writeNormal(ostream & os) const
+void MathSymbolInset::writeNormal(NormalStream & os) const
 {
-       os << "[symbol " << sym_->name << "]";
+       os << "[symbol " << sym_->name.c_str() << "]";
 }
 
 
index 6a6ea11df5fac58d374bfb2065481acd86b2bfd3..7514c0a7bead8ed99fa8170b242a0ecbc6339331 100644 (file)
@@ -14,11 +14,13 @@ public:
        ///
        explicit MathSymbolInset(latexkeys const *);
        ///
+       explicit MathSymbolInset(char const *);
+       ///
        MathInset * clone() const;
        ///
        void write(MathWriteInfo & os) const;
        ///
-       void writeNormal(std::ostream &) const;
+       void writeNormal(NormalStream &) const;
        ///
        void metrics(MathMetricsInfo const & st) const;
        ///
index bf19f55d65b854686ee2710f10b090ce4e2002e4..5c474058a9e99088b6032b8a867205975bcf9f24 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <map>
 
-#include "mathed/support.h"
+#include "support.h"
 #include "lyxfont.h"
 #include "FontLoader.h"
 #include "font.h"
index 54b83322bafa6f8ec9a74cb184c9aecd6ca98565..42da38dd0da0ef22b05fbd901e6ae2a9e8a8cf2a 100644 (file)
@@ -7,7 +7,7 @@
 #include "xarray.h"
 #include "math_inset.h"
 #include "math_scriptinset.h"
-#include "mathed/support.h"
+#include "support.h"
 #include "math_defs.h"
 #include "Painter.h"
 #include "debug.h"
@@ -116,10 +116,3 @@ MathArray::size_type MathXArray::x2pos(int targetx) const
                --it;
        return it - begin();
 }
-
-
-std::ostream & operator<<(std::ostream & os, MathXArray const & ar)
-{
-       os << ar.data_;
-       return os;
-}