mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Rename MathStream to MathMLStream.
This commit is contained in:
parent
8c67cb8c3a
commit
ecafea8227
@ -202,7 +202,7 @@ void InsetMath::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMath::mathmlize(MathStream & ms) const
|
||||
void InsetMath::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<!-- " << from_utf8(insetName(lyxCode())) << " -->";
|
||||
ms << MTag("mi");
|
||||
|
@ -104,7 +104,7 @@ class OctaveStream;
|
||||
class MapleStream;
|
||||
class MaximaStream;
|
||||
class MathematicaStream;
|
||||
class MathStream;
|
||||
class MathMLStream;
|
||||
class WriteStream;
|
||||
|
||||
class MathData;
|
||||
@ -241,7 +241,7 @@ public:
|
||||
/// write content as something readable by Mathematica
|
||||
virtual void mathematica(MathematicaStream &) const;
|
||||
/// write content as MathML
|
||||
virtual void mathmlize(MathStream &) const;
|
||||
virtual void mathmlize(MathMLStream &) const;
|
||||
/// write content as HTML, best we can.
|
||||
/// the idea for this, and some of the details, come from
|
||||
/// eLyXer, written by Alex Fernandez. no code is borrowed. rather,
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
void normalize(NormalStream &) const override;
|
||||
// Don't need mathmlize or htmlize, as this is handled by
|
||||
// InsetMathMatrix after being extracted in MathExtern.
|
||||
// void mathmlize(MathStream &) const override;
|
||||
// void mathmlize(MathMLStream &) const override;
|
||||
// void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
void validate(LaTeXFeatures & features) const override;
|
||||
|
@ -135,7 +135,7 @@ void InsetMathBig::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBig::mathmlize(MathStream & ms) const
|
||||
void InsetMathBig::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mo"))
|
||||
<< " form='prefix' fence='true' stretchy='true' symmetric='true'>"
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -107,7 +107,7 @@ void InsetMathBoldSymbol::write(WriteStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBoldSymbol::mathmlize(MathStream & ms) const
|
||||
void InsetMathBoldSymbol::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mstyle")) << " mathvariant='bold'>"
|
||||
<< cell(0)
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
///
|
||||
void write(WriteStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -57,7 +57,7 @@ void InsetMathBox::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBox::mathmlize(MathStream & ms) const
|
||||
void InsetMathBox::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// FIXME XHTML
|
||||
// Need to do something special for tags here.
|
||||
@ -163,7 +163,7 @@ void InsetMathFBox::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathFBox::mathmlize(MathStream & ms) const
|
||||
void InsetMathFBox::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
SetMode textmode(ms, true);
|
||||
ms << MTag("mstyle", "class='fbox'")
|
||||
@ -307,7 +307,7 @@ void InsetMathMakebox::infoize(odocstream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathMakebox::mathmlize(MathStream & ms) const
|
||||
void InsetMathMakebox::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// FIXME We could do something with the other arguments.
|
||||
std::string const cssclass = framebox_ ? "framebox" : "makebox";
|
||||
@ -391,7 +391,7 @@ void InsetMathBoxed::infoize(odocstream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBoxed::mathmlize(MathStream & ms) const
|
||||
void InsetMathBoxed::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << MTag("mstyle", "class='boxed'")
|
||||
<< cell(0)
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream & ns) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
///
|
||||
@ -68,7 +68,7 @@ public:
|
||||
/// write normalized content
|
||||
void normalize(NormalStream & ns) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
///
|
||||
@ -95,7 +95,7 @@ public:
|
||||
/// write normalized content
|
||||
void normalize(NormalStream & ns) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
///
|
||||
@ -128,7 +128,7 @@ public:
|
||||
///
|
||||
void write(WriteStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
/// write normalized content
|
||||
|
@ -96,7 +96,7 @@ void InsetMathBrace::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBrace::mathmlize(MathStream & ms) const
|
||||
void InsetMathBrace::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << MTag("mrow") << cell(0) << ETag("mrow");
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
///
|
||||
void octave(OctaveStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -138,7 +138,7 @@ void InsetMathCancel::htmlize(HtmlStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathCancel::mathmlize(MathStream & ms) const
|
||||
void InsetMathCancel::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
switch (kind_) {
|
||||
case cancel:
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
///
|
||||
InsetCode lyxCode() const override { return MATH_CANCEL_CODE; }
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
///
|
||||
InsetCode lyxCode() const override { return MATH_CANCELTO_CODE; }
|
||||
/// Nothing for now
|
||||
void mathmlize(MathStream &) const override {}
|
||||
void mathmlize(MathMLStream &) const override {}
|
||||
/// Nothing for HTML
|
||||
void htmlize(HtmlStream &) const override {}
|
||||
///
|
||||
|
@ -143,7 +143,7 @@ void InsetMathCases::maple(MapleStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathCases::mathmlize(MathStream & ms) const
|
||||
void InsetMathCases::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mo"))
|
||||
<< " form='prefix' fence='true' stretchy='true' symmetric='true'>"
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
///
|
||||
void maple(MapleStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -228,7 +228,7 @@ void InsetMathChar::octave(OctaveStream & os) const
|
||||
// mathalpha, then we'll treat it as an identifier, otherwise as an
|
||||
// operator.
|
||||
// Worst case: We get bad spacing, or bad italics.
|
||||
void InsetMathChar::mathmlize(MathStream & ms) const
|
||||
void InsetMathChar::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
std::string entity;
|
||||
switch (char_) {
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
///
|
||||
void octave(OctaveStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
/// identifies Charinsets
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
///
|
||||
void write(WriteStream & os) const override;
|
||||
/// FIXME XHTML For now, we do nothing with color.
|
||||
void mathmlize(MathStream &) const override {}
|
||||
void mathmlize(MathMLStream &) const override {}
|
||||
/// FIXME XHTML For now, we do nothing with color.
|
||||
void htmlize(HtmlStream &) const override {}
|
||||
///
|
||||
|
@ -83,7 +83,7 @@ void InsetMathComment::maple(MapleStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathComment::mathmlize(MathStream & ms) const
|
||||
void InsetMathComment::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << MTag("comment") << cell(0) << ETag("comment");
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
///
|
||||
void octave(OctaveStream &) const override {}
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -223,7 +223,7 @@ namespace {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void InsetMathDecoration::mathmlize(MathStream & ms) const
|
||||
void InsetMathDecoration::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
TranslationMap const & t = translationMap();
|
||||
TranslationMap::const_iterator cur = t.find(to_utf8(key_->name));
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
///
|
||||
InsetCode lyxCode() const override { return MATH_DECORATION_CODE; }
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
private:
|
||||
|
@ -179,7 +179,7 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathDelim::mathmlize(MathStream & ms) const
|
||||
void InsetMathDelim::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mo")) << " form='prefix' fence='true' stretchy='true' symmetric='true'>"
|
||||
<< convertDelimToXMLEscape(left_, ms.xmlMode())
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -85,7 +85,7 @@ void InsetMathDots::validate(LaTeXFeatures & features) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathDots::mathmlize(MathStream & ms) const
|
||||
void InsetMathDots::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// which symbols we support is decided by what is listed in
|
||||
// lib/symbols as generating a dots inset
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
///
|
||||
InsetCode lyxCode() const override { return MATH_DOTS_CODE; }
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & os) const override;
|
||||
protected:
|
||||
|
@ -69,7 +69,7 @@ void InsetMathEnsureMath::write(WriteStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathEnsureMath::mathmlize(MathStream & ms) const
|
||||
void InsetMathEnsureMath::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
SetMode mathmode(ms, false);
|
||||
ms << MTag("mstyle", "class='math'")
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
///
|
||||
void write(WriteStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -122,7 +122,7 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathExFunc::mathmlize(MathStream & ms) const
|
||||
void InsetMathExFunc::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mi")) << ">"
|
||||
<< name_
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -123,7 +123,7 @@ void InsetMathExInt::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathExInt::mathmlize(MathStream & ms) const
|
||||
void InsetMathExInt::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// At the moment, we are not extracting sums and the like for MathML.
|
||||
// If we should decide to do so later, then we'll need to re-merge
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -191,7 +191,7 @@ void InsetMathFont::htmlize(HtmlStream & os) const
|
||||
|
||||
|
||||
// The fonts we want to support are listed in lib/symbols
|
||||
void InsetMathFont::mathmlize(MathStream & ms) const
|
||||
void InsetMathFont::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// FIXME These are not quite right, because they do not nest
|
||||
// correctly. A proper fix would presumably involve tracking
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
///
|
||||
void validate(LaTeXFeatures & features) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -491,7 +491,7 @@ void InsetMathFrac::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathFrac::mathmlize(MathStream & ms) const
|
||||
void InsetMathFrac::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
switch (kind_) {
|
||||
case ATOP:
|
||||
@ -730,7 +730,7 @@ void InsetMathBinom::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBinom::mathmlize(MathStream & ms) const
|
||||
void InsetMathBinom::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
char ldelim = ' ';
|
||||
char rdelim = ' ';
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
///
|
||||
void octave(OctaveStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
@ -133,7 +133,7 @@ public:
|
||||
///
|
||||
bool extraBraces() const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -1158,7 +1158,7 @@ void InsetMathGrid::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathGrid::mathmlize(MathStream & ms) const
|
||||
void InsetMathGrid::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
bool const havetable = nrows() > 1 || ncols() > 1;
|
||||
if (havetable)
|
||||
|
@ -218,7 +218,7 @@ public:
|
||||
///
|
||||
//void maple(MapleStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -2404,7 +2404,7 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
|
||||
// With DocBook 5, MathML must be within its own namespace; defined in Buffer.cpp::writeDocBookSource as "m".
|
||||
// Output everything in a separate stream so that this does not interfere with the standard flow of DocBook tags.
|
||||
odocstringstream osmath;
|
||||
MathStream ms(osmath, "m", true);
|
||||
MathMLStream ms(osmath, "m", true);
|
||||
|
||||
// Output the MathML subtree.
|
||||
odocstringstream ls;
|
||||
@ -2427,7 +2427,7 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
|
||||
try {
|
||||
// First, generate the MathML expression.
|
||||
odocstringstream ostmp;
|
||||
MathStream mstmp(ostmp, ms.xmlns(), ms.xmlMode());
|
||||
MathMLStream mstmp(ostmp, ms.xmlns(), ms.xmlMode());
|
||||
InsetMathGrid::mathmlize(mstmp);
|
||||
|
||||
// Then, output it (but only if the generation can be done without errors!).
|
||||
@ -2505,7 +2505,7 @@ void InsetMathHull::htmlize(HtmlStream & os) const
|
||||
// this duplicates code from InsetMathGrid, but
|
||||
// we need access here to number information,
|
||||
// and we simply do not have that in InsetMathGrid.
|
||||
void InsetMathHull::mathmlize(MathStream & ms) const
|
||||
void InsetMathHull::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
bool const havenumbers = haveNumbers();
|
||||
bool const havetable = havenumbers || nrows() > 1 || ncols() > 1;
|
||||
@ -2592,7 +2592,7 @@ docstring InsetMathHull::xhtml(XMLStream & xs, OutputParams const & op) const
|
||||
// FIXME Eventually we would like to do this inset by inset.
|
||||
if (mathtype == BufferParams::MathML) {
|
||||
odocstringstream os;
|
||||
MathStream ms(os);
|
||||
MathMLStream ms(os);
|
||||
try {
|
||||
mathmlize(ms);
|
||||
success = true;
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
///
|
||||
docstring xhtml(XMLStream &, OutputParams const &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream & ns) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override { }
|
||||
void mathmlize(MathMLStream &) const override { }
|
||||
///
|
||||
void htmlize(HtmlStream &) const override { }
|
||||
///
|
||||
|
@ -169,7 +169,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream & ms) const override { ms << mathMacro_->cell(idx_); }
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override { ms << mathMacro_->cell(idx_); }
|
||||
void mathmlize(MathMLStream & ms) const override { ms << mathMacro_->cell(idx_); }
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override { ms << mathMacro_->cell(idx_); }
|
||||
///
|
||||
@ -1240,7 +1240,7 @@ void InsetMathMacro::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathMacro::mathmlize(MathStream & ms) const
|
||||
void InsetMathMacro::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// macro_ is 0 if this is an unknown macro
|
||||
LATTEST(d->macro_ || d->displayMode_ != DISPLAY_NORMAL);
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -92,7 +92,7 @@ void InsetMathMatrix::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathMatrix::mathmlize(MathStream & ms) const
|
||||
void InsetMathMatrix::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mo")) << " form='prefix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>"
|
||||
<< convertDelimToXMLEscape(left_, ms.xmlMode())
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -68,7 +68,7 @@ void InsetMathNumber::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathNumber::mathmlize(MathStream & ms) const
|
||||
void InsetMathNumber::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mn")) << ">"
|
||||
<< str_
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -103,7 +103,7 @@ void InsetMathOverset::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathOverset::mathmlize(MathStream & ms) const
|
||||
void InsetMathOverset::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("mover")) << " accent='false'>"
|
||||
<< cell(0) << cell(1)
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
///
|
||||
InsetCode lyxCode() const override { return MATH_PHANTOM_CODE; }
|
||||
/// Nothing for now
|
||||
void mathmlize(MathStream &) const override {}
|
||||
void mathmlize(MathMLStream &) const override {}
|
||||
/// Nothing for HTML
|
||||
void htmlize(HtmlStream &) const override {}
|
||||
/// request "external features"
|
||||
|
@ -216,7 +216,7 @@ void InsetMathRoot::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathRoot::mathmlize(MathStream & ms) const
|
||||
void InsetMathRoot::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << MTag("mroot") << cell(0) << cell(1) << ETag("mroot");
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -594,11 +594,11 @@ void InsetMathScript::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathScript::mathmlize(MathStream & ms) const
|
||||
void InsetMathScript::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
bool d = hasDown() && !down().empty();
|
||||
bool u = hasUp() && !up().empty();
|
||||
// FIXME: the MathStream should be able to give us this information
|
||||
// FIXME: the MathMLStream should be able to give us this information
|
||||
bool l = has_limits_;
|
||||
|
||||
if (u && d)
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
/// write content as something readable by Mathematica
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
/// write content as MathML
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
/// write content as HTML
|
||||
void htmlize(HtmlStream &) const override;
|
||||
/// write content as something readable by Octave
|
||||
|
@ -385,7 +385,7 @@ void InsetMathSideset::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSideset::mathmlize(MathStream & ms) const
|
||||
void InsetMathSideset::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// FIXME This is only accurate if both scriptl_ and scriptr_ are true
|
||||
if (!scriptl_)
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
/// write normalized content
|
||||
void normalize(NormalStream &) const override;
|
||||
/// write content as MathML
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
/// write content as HTML
|
||||
void htmlize(HtmlStream &) const override;
|
||||
|
||||
|
@ -73,7 +73,7 @@ void InsetMathSize::write(WriteStream & os) const
|
||||
// \scriptscriptstyle. The corresponding values of displaystyle and scriptlevel
|
||||
// for those TeX styles would be "true" and "0", "false" and "0", "false" and "1",
|
||||
// and "false" and "2", respectively.
|
||||
void InsetMathSize::mathmlize(MathStream & ms) const
|
||||
void InsetMathSize::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
string const & name = to_utf8(key_->name);
|
||||
bool dispstyle = (name == "displaystyle");
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
///
|
||||
void infoize(odocstream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -195,7 +195,7 @@ void InsetMathSpace::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSpace::mathmlize(MathStream & ms) const
|
||||
void InsetMathSpace::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
SpaceInfo const & si = space_info[space_];
|
||||
if (si.negative || !si.visible)
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
///
|
||||
void octave(OctaveStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
///
|
||||
|
@ -132,7 +132,7 @@ void InsetMathSpecialChar::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSpecialChar::mathmlize(MathStream & ms) const
|
||||
void InsetMathSpecialChar::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
switch (char_) {
|
||||
case '&':
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const override;
|
||||
void mathmlize(MathMLStream & ms) const override;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const override;
|
||||
/// identifies SpecialChar insets
|
||||
|
@ -186,7 +186,7 @@ void InsetMathSplit::infoize(odocstream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSplit::mathmlize(MathStream & ms) const
|
||||
void InsetMathSplit::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// split, gathered, aligned, alignedat
|
||||
// At the moment, those seem to display just fine without any
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
///
|
||||
void infoize(odocstream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -98,7 +98,7 @@ void InsetMathSqrt::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSqrt::mathmlize(MathStream & ms) const
|
||||
void InsetMathSqrt::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << MTag("msqrt") << cell(0) << ETag("msqrt");
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
///
|
||||
void octave(OctaveStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -141,7 +141,7 @@ void InsetMathStackrel::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathStackrel::mathmlize(MathStream & ms) const
|
||||
void InsetMathStackrel::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
if (nargs() > 2)
|
||||
ms << "<" << from_ascii(ms.namespacedTag("munderover")) << ">"
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -94,7 +94,7 @@ void InsetMathString::octave(OctaveStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathString::mathmlize(MathStream &) const
|
||||
void InsetMathString::mathmlize(MathMLStream &) const
|
||||
{
|
||||
// useless, no doubt, but we should not be here
|
||||
LATTEST(false);
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void write(WriteStream & os) const override;
|
||||
///
|
||||
|
@ -125,7 +125,7 @@ void InsetMathSubstack::maple(MapleStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSubstack::mathmlize(MathStream & ms) const
|
||||
void InsetMathSubstack::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
int movers = 0;
|
||||
row_type const numrows = nrows();
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
///
|
||||
void write(WriteStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -156,7 +156,7 @@ void InsetMathSymbol::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathSymbol::mathmlize(MathStream & ms) const
|
||||
void InsetMathSymbol::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
// FIXME We may need to do more interesting things
|
||||
// with MathMLtype.
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
/// \param spacing controls whether we print spaces around
|
||||
|
@ -92,7 +92,7 @@ void InsetMathUnderset::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathUnderset::mathmlize(MathStream & ms) const
|
||||
void InsetMathUnderset::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
ms << "<" << from_ascii(ms.namespacedTag("munder")) << " accent='false'>"
|
||||
<< cell(0) << cell(1)
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream & ns) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -89,7 +89,7 @@ void InsetMathUnknown::mathematica(MathematicaStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathUnknown::mathmlize(MathStream &) const
|
||||
void InsetMathUnknown::mathmlize(MathMLStream &) const
|
||||
{
|
||||
throw MathExportException();
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
///
|
||||
void mathematica(MathematicaStream &) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -84,7 +84,7 @@ void InsetMathXArrow::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathXArrow::mathmlize(MathStream & ms) const
|
||||
void InsetMathXArrow::mathmlize(MathMLStream & ms) const
|
||||
{
|
||||
char const * arrow;
|
||||
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
///
|
||||
void normalize(NormalStream & os) const override;
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
///
|
||||
|
@ -154,7 +154,7 @@ void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathXYMatrix::mathmlize(MathStream &) const
|
||||
void InsetMathXYMatrix::mathmlize(MathMLStream &) const
|
||||
{
|
||||
throw MathExportException();
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
///
|
||||
InsetCode lyxCode() const override { return MATH_XYMATRIX_CODE; }
|
||||
///
|
||||
void mathmlize(MathStream &) const override;
|
||||
void mathmlize(MathMLStream &) const override;
|
||||
///
|
||||
void htmlize(HtmlStream &) const override;
|
||||
|
||||
|
@ -1586,7 +1586,7 @@ void mathematica(MathData const & dat, MathematicaStream & os)
|
||||
}
|
||||
|
||||
|
||||
void mathmlize(MathData const & dat, MathStream & ms)
|
||||
void mathmlize(MathData const & dat, MathMLStream & ms)
|
||||
{
|
||||
MathData ar = dat;
|
||||
extractStructure(ar, MATHML);
|
||||
|
@ -21,7 +21,7 @@ class NormalStream;
|
||||
class MapleStream;
|
||||
class MaximaStream;
|
||||
class MathematicaStream;
|
||||
class MathStream;
|
||||
class MathMLStream;
|
||||
class OctaveStream;
|
||||
class WriteStream;
|
||||
class MathData;
|
||||
@ -32,7 +32,7 @@ void normalize(MathData const &, NormalStream &);
|
||||
void maple(MathData const &, MapleStream &);
|
||||
void maxima(MathData const &, MaximaStream &);
|
||||
void mathematica(MathData const &, MathematicaStream &);
|
||||
void mathmlize(MathData const &, MathStream &);
|
||||
void mathmlize(MathData const &, MathMLStream &);
|
||||
void octave(MathData const &, OctaveStream &);
|
||||
|
||||
bool extractNumber(MathData const & ar, int & i);
|
||||
|
@ -267,12 +267,12 @@ WriteStream & operator<<(WriteStream & ws, unsigned int i)
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
MathStream::MathStream(odocstream & os, std::string const & xmlns, bool xmlMode)
|
||||
MathMLStream::MathMLStream(odocstream & os, std::string const & xmlns, bool xmlMode)
|
||||
: os_(os), tab_(0), line_(0), in_text_(false), xmlns_(xmlns), xml_mode_(xmlMode)
|
||||
{}
|
||||
|
||||
|
||||
void MathStream::cr()
|
||||
void MathMLStream::cr()
|
||||
{
|
||||
os() << '\n';
|
||||
for (int i = 0; i < tab(); ++i)
|
||||
@ -280,60 +280,60 @@ void MathStream::cr()
|
||||
}
|
||||
|
||||
|
||||
void MathStream::defer(docstring const & s)
|
||||
void MathMLStream::defer(docstring const & s)
|
||||
{
|
||||
deferred_ << s;
|
||||
}
|
||||
|
||||
|
||||
void MathStream::defer(string const & s)
|
||||
void MathMLStream::defer(string const & s)
|
||||
{
|
||||
deferred_ << from_utf8(s);
|
||||
}
|
||||
|
||||
|
||||
docstring MathStream::deferred() const
|
||||
docstring MathMLStream::deferred() const
|
||||
{
|
||||
return deferred_.str();
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, MathAtom const & at)
|
||||
MathMLStream & operator<<(MathMLStream & ms, MathAtom const & at)
|
||||
{
|
||||
at->mathmlize(ms);
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, MathData const & ar)
|
||||
MathMLStream & operator<<(MathMLStream & ms, MathData const & ar)
|
||||
{
|
||||
mathmlize(ar, ms);
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, char const * s)
|
||||
MathMLStream & operator<<(MathMLStream & ms, char const * s)
|
||||
{
|
||||
ms.os() << s;
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, char c)
|
||||
MathMLStream & operator<<(MathMLStream & ms, char c)
|
||||
{
|
||||
ms.os() << c;
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, char_type c)
|
||||
MathMLStream & operator<<(MathMLStream & ms, char_type c)
|
||||
{
|
||||
ms.os().put(c);
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, MTag const & t)
|
||||
MathMLStream & operator<<(MathMLStream & ms, MTag const & t)
|
||||
{
|
||||
++ms.tab();
|
||||
ms.cr();
|
||||
@ -345,7 +345,7 @@ MathStream & operator<<(MathStream & ms, MTag const & t)
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, ETag const & t)
|
||||
MathMLStream & operator<<(MathMLStream & ms, ETag const & t)
|
||||
{
|
||||
ms.cr();
|
||||
if (ms.tab() > 0)
|
||||
@ -355,7 +355,7 @@ MathStream & operator<<(MathStream & ms, ETag const & t)
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, CTag const & t)
|
||||
MathMLStream & operator<<(MathMLStream & ms, CTag const & t)
|
||||
{
|
||||
ms.cr();
|
||||
ms.os() << "<" << from_ascii(ms.namespacedTag(t.tag_));
|
||||
@ -366,7 +366,7 @@ MathStream & operator<<(MathStream & ms, CTag const & t)
|
||||
}
|
||||
|
||||
|
||||
MathStream & operator<<(MathStream & ms, docstring const & s)
|
||||
MathMLStream & operator<<(MathMLStream & ms, docstring const & s)
|
||||
{
|
||||
ms.os() << s;
|
||||
return ms;
|
||||
@ -461,7 +461,7 @@ HtmlStream & operator<<(HtmlStream & ms, docstring const & s)
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
SetMode::SetMode(MathStream & ms, bool text)
|
||||
SetMode::SetMode(MathMLStream & ms, bool text)
|
||||
: ms_(ms)
|
||||
{
|
||||
was_text_ = ms_.inText();
|
||||
|
@ -341,10 +341,10 @@ public:
|
||||
class MathExportException : public std::exception {};
|
||||
|
||||
|
||||
class MathStream {
|
||||
class MathMLStream {
|
||||
public:
|
||||
/// Builds a stream proxy for os; the MathML namespace is given by xmlns (supposed to be already defined elsewhere in the document).
|
||||
explicit MathStream(odocstream & os, std::string const & xmlns = "", bool xmlMode = false);
|
||||
explicit MathMLStream(odocstream & os, std::string const & xmlns = "", bool xmlMode = false);
|
||||
///
|
||||
void cr();
|
||||
///
|
||||
@ -354,7 +354,7 @@ public:
|
||||
///
|
||||
int & tab() { return tab_; }
|
||||
///
|
||||
friend MathStream & operator<<(MathStream &, char const *);
|
||||
friend MathMLStream & operator<<(MathMLStream &, char const *);
|
||||
///
|
||||
void defer(docstring const &);
|
||||
///
|
||||
@ -393,35 +393,35 @@ private:
|
||||
};
|
||||
|
||||
///
|
||||
MathStream & operator<<(MathStream &, MathAtom const &);
|
||||
MathMLStream & operator<<(MathMLStream &, MathAtom const &);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, MathData const &);
|
||||
MathMLStream & operator<<(MathMLStream &, MathData const &);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, docstring const &);
|
||||
MathMLStream & operator<<(MathMLStream &, docstring const &);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, char const *);
|
||||
MathMLStream & operator<<(MathMLStream &, char const *);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, char);
|
||||
MathMLStream & operator<<(MathMLStream &, char);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, char_type);
|
||||
MathMLStream & operator<<(MathMLStream &, char_type);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, MTag const &);
|
||||
MathMLStream & operator<<(MathMLStream &, MTag const &);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, ETag const &);
|
||||
MathMLStream & operator<<(MathMLStream &, ETag const &);
|
||||
///
|
||||
MathStream & operator<<(MathStream &, CTag const &);
|
||||
MathMLStream & operator<<(MathMLStream &, CTag const &);
|
||||
|
||||
|
||||
/// A simpler version of ModeSpecifier, for MathML
|
||||
class SetMode {
|
||||
public:
|
||||
///
|
||||
explicit SetMode(MathStream & ms, bool text);
|
||||
explicit SetMode(MathMLStream & ms, bool text);
|
||||
///
|
||||
~SetMode();
|
||||
private:
|
||||
///
|
||||
MathStream & ms_;
|
||||
MathMLStream & ms_;
|
||||
///
|
||||
bool was_text_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user