]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_rootinset.C
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / math_rootinset.C
index d7dbad49431ce5a1034326669a5eb5e081d4d362..41162470f11f2ebc8a6ead22fc90c34706a4e171 100644 (file)
@@ -16,7 +16,7 @@
 #endif
 
 #include "math_rootinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
 #include "Painter.h"
 
 
@@ -54,41 +54,47 @@ void MathRootInset::draw(Painter & pain, int x, int y) const
        xp[2] = x + w;        yp[2] = y + d;
        xp[3] = x + w - 2;    yp[3] = y + (d - a)/2 + 2;
        xp[4] = x;            yp[4] = y + (d - a)/2 + 2;
-       pain.lines(xp, yp, 5, LColor::mathline);
+       pain.lines(xp, yp, 5, LColor::math);
 }
 
 
-void MathRootInset::write(MathWriteInfo & os) const
+void MathRootInset::write(WriteStream & os) const
 {
        os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
 }
 
 
-void MathRootInset::writeNormal(std::ostream & os) const
+void MathRootInset::normalize(NormalStream & os) const
 {
-       os << "[root ";
-       cell(1).writeNormal(os);  
-       os << " ";
-       cell(0).writeNormal(os);
-       os << "]";
+       os << "[root " << cell(1) << ' ' << cell(1) << ']';
 }
 
 
-bool MathRootInset::idxUp(int & idx, int & pos) const
+bool MathRootInset::idxUp(idx_type & idx) const
 {
        if (idx == 0)
                return false;
        idx = 0;
-       pos = cell(0).size();
        return true;
 }
 
 
-bool MathRootInset::idxDown(int & idx, int & pos) const
+bool MathRootInset::idxDown(idx_type & idx) const
 {
        if (idx == 1)
                return false;
        idx = 1;
-       pos = 0;
        return true;
 }
+
+
+void MathRootInset::octavize(OctaveStream & os) const
+{
+       os << "root(" << cell(1) << ',' << cell(0) <<')';
+}
+
+
+void MathRootInset::mathmlize(MathMLStream & os) const
+{
+       os << MTag("mroot") << cell(1) << cell(0) << ETag("mroot");
+}