From 70217ba676c64587e30365cdcb7e0b333d829dd3 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 14 Nov 2009 21:11:23 +0000 Subject: [PATCH] Initial work on InsetMathBox. This doesn't really work yet, for reasons given in the FIXME. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31993 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathBox.cpp | 13 ++++++++++++- src/mathed/InsetMathBox.h | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp index 07866610de..d432794fc0 100644 --- a/src/mathed/InsetMathBox.cpp +++ b/src/mathed/InsetMathBox.cpp @@ -52,6 +52,17 @@ void InsetMathBox::normalize(NormalStream & os) const } +void InsetMathBox::mathmlize(MathStream & ms) const +{ + // FIXME This doesn't actually work yet. We need to be able to signal + // that we are in text mode and then just call ms << cell(0). So we + // need something like ModeSpecifier for MathStream. + ms << MTag("mtext"); + ms.os() << cell(0); + ms << ETag("mtext"); +} + + void InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, "textnormal"); @@ -69,7 +80,7 @@ void InsetMathBox::draw(PainterInfo & pi, int x, int y) const void InsetMathBox::infoize(odocstream & os) const -{ +{ os << "Box: " << name_; } diff --git a/src/mathed/InsetMathBox.h b/src/mathed/InsetMathBox.h index fd8cc4ffb3..4ef299401d 100644 --- a/src/mathed/InsetMathBox.h +++ b/src/mathed/InsetMathBox.h @@ -35,6 +35,8 @@ public: /// void normalize(NormalStream & ns) const; /// + void mathmlize(MathStream & ms) const; + /// void infoize(odocstream & os) const; /// void validate(LaTeXFeatures & features) const; @@ -64,6 +66,8 @@ public: /// write normalized content void normalize(NormalStream & ns) const; /// + //void mathmlize(MathStream & ms) const; + /// void infoize(odocstream & os) const; private: /// @@ -85,6 +89,8 @@ public: /// write normalized content void normalize(NormalStream & ns) const; /// + //void mathmlize(MathStream & ms) const; + /// mode_type currentMode() const { return TEXT_MODE; } /// void infoize(odocstream & os) const; @@ -109,6 +115,8 @@ public: void draw(PainterInfo & pi, int x, int y) const; /// void write(WriteStream & os) const; + /// + //void mathmlize(MathStream & ms) const; /// write normalized content void normalize(NormalStream & ns) const; ///