]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.C
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_inset.C
index d0b2655b55bfa7594c3efd6613a7504d5d02838e..7b1b8cfba162b1dcdcf732f8e718d3f4ac20d679 100644 (file)
 #include "Lsstream.h"
 #include "math_inset.h"
 #include "math_scriptinset.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 
 
-MathInset::MathInset()
-{}
-
-
-MathInset::~MathInset()
-{}
-
-
 int MathInset::height() const
 {
        return ascent() + descent();
@@ -43,7 +36,7 @@ int MathInset::height() const
 
 std::ostream & operator<<(std::ostream & os, MathInset const & inset)
 {
-       MathWriteInfo wi(0, os, false);
+       WriteStream wi(os, false);
        inset.write(wi);
        return os;
 }
@@ -85,6 +78,15 @@ MathArray const & MathInset::cell(idx_type) const
 }
 
 
+MathInset::idx_type MathInset::index(row_type row, col_type col) const
+{
+       if (row != 0)
+               lyxerr << "illegal row: " << row << "\n";
+       if (col != 0)
+               lyxerr << "illegal col: " << col << "\n";
+       return 0;
+}
+
 void MathInset::substitute(MathMacro const &)
 {}
 
@@ -113,13 +115,13 @@ bool MathInset::idxLeft(idx_type &, pos_type &) const
 }
 
 
-bool MathInset::idxUp(idx_type &, pos_type &) const
+bool MathInset::idxUp(idx_type &) const
 {
        return false;
 }
 
 
-bool MathInset::idxDown(idx_type &, pos_type &) const
+bool MathInset::idxDown(idx_type &) const
 {
        return false;
 }
@@ -160,10 +162,10 @@ void MathInset::idxDeleteRange(idx_type, idx_type)
 {}
 
 
-void MathInset::writeNormal(std::ostream & os) const
+void MathInset::normalize(NormalStream & os) const
 {
        os << "[unknown ";
-       MathWriteInfo wi(0, os, false);
+       WriteStream wi(os.os(), false);
        write(wi);
        os << "] ";
 }
@@ -172,19 +174,12 @@ void MathInset::writeNormal(std::ostream & os) const
 void MathInset::dump() const
 {
        lyxerr << "---------------------------------------------\n";
-       MathWriteInfo wi(0, lyxerr, false);
+       WriteStream wi(lyxerr, false);
        write(wi);
        lyxerr << "\n---------------------------------------------\n";
 }
 
 
-bool MathInset::covers(int, int) const
-{
-       lyxerr << "MathInset::covers() called directly!\n";
-       return false;
-}
-
-
 void MathInset::validate(LaTeXFeatures &) const
 {}
 
@@ -211,28 +206,28 @@ void MathInset::draw(Painter &, int, int) const
 }
 
 
-void MathInset::write(MathWriteInfo &) const
+void MathInset::write(WriteStream &) const
 {
        lyxerr << "MathInset::write() called directly!\n";
 }
 
 
-string MathInset::octavize() const
+void MathInset::octavize(OctaveStream & os) const
 {
-       ostringstream os;
-       writeNormal(os);
-       return os.str();
-       return string();
+       NormalStream ns(os.os());
+       normalize(ns);
 }
 
 
-string MathInset::maplize() const
+void MathInset::maplize(MapleStream & os) const
 {
-       return octavize();
+       NormalStream ns(os.os());
+       normalize(ns);
 }
 
 
-string MathInset::mathmlize() const
+void MathInset::mathmlize(MathMLStream & os) const
 {
-       return string();
+       NormalStream ns(os.os());
+       normalize(ns);
 }