math_dotsinset.h \
math_exfuncinset.C \
math_exfuncinset.h \
+ math_exintinset.C \
+ math_exintinset.h \
math_factory.C \
math_factory.h \
math_fracinset.C \
#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()
{}
}
-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() << ">";
}
}
-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) {
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)) {
} else
p->mathmlize(os);
}
- os << "</mrow>";
+ os << ETag("mrow");
}
}
#define MATHEDARRAY_H
#include <vector>
-#include <iosfwd>
#include "math_atom.h"
#include "LString.h"
class MathMacro;
class MathWriteInfo;
class MathMetricsInfo;
-class MathMLStream;
+class LaTeXFeatures;
+class NormalStream;
class MapleStream;
+class MathMLStream;
class OctaveStream;
-class LaTeXFeatures;
+
#ifdef __GNUG__
#pragma interface
MathAtom & back();
///
- void dump(std::ostream &) const;
+ void dump() const;
///
- void dump2(std::ostream &) const;
+ void dump2() const;
///
void substitute(MathMacro const &);
/// glue chars if necessary
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void validate(LaTeXFeatures &) const;
///
buffer_type bf_;
};
-
-std::ostream & operator<<(std::ostream & os, MathArray const & ar);
-
-
#endif
#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;
"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`)): ";
// create normalized expression
ostringstream os;
+ NormalStream ns(os);
os << "[" << extra << ' ';
- ar.writeNormal(os);
+ ar.writeNormal(ns);
os << "]";
string data = os.str().c_str();
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;
}
MathArray ar;
if (selected) {
mathcursor->selGet(ar);
- lyxerr << "use selection: " << ar << "\n";
+ //lyxerr << "use selection: " << ar << "\n";
} else {
mathcursor->end();
mathcursor->stripFromLastEqualSign();
#pragma interface
#endif
-#include "mathed/formulabase.h"
+#include "formulabase.h"
#include "math_defs.h"
#include "math_atom.h"
#include "lyxlex.h"
#include "lyxtext.h"
#include "lyxfont.h"
+#include "math_mathmlstream.h"
using std::ostream;
#include "math_parser.h"
#include "support/LOstream.h"
#include "Lsstream.h"
+#include "math_mathmlstream.h"
using std::vector;
}
-void MathArrayInset::writeNormal(std::ostream & os) const
+void MathArrayInset::writeNormal(NormalStream & os) const
{
os << "[array ";
MathGridInset::writeNormal(os);
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#include "Painter.h"
#include "support/LOstream.h"
#include "support.h"
+#include "math_mathmlstream.h"
MathBinaryOpInset::MathBinaryOpInset(char op)
}
-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) << ']';
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
private:
#include "math_binominset.h"
#include "support.h"
#include "support/LOstream.h"
+#include "math_mathmlstream.h"
MathBinomInset::MathBinomInset()
}
-void MathBinomInset::writeNormal(std::ostream & os) const
+void MathBinomInset::writeNormal(NormalStream & os) const
{
os << "[binom ";
cell(0).writeNormal(os);
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#include "Painter.h"
#include "math_cursor.h"
#include "insets/insettext.h"
+#include "math_mathmlstream.h"
MathBoxInset::MathBoxInset(string const & name)
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);
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const &) const;
/// identifies BoxInsets
#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()
}
-void MathBraceInset::writeNormal(std::ostream & os) const
+void MathBraceInset::writeNormal(NormalStream & os) const
{
os << "[block ";
cell(0).writeNormal(os);
///
void write(MathWriteInfo & os) const;
/// write normalized content
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
#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)
}
-void MathCharInset::writeNormal(std::ostream & os) const
+void MathCharInset::writeNormal(NormalStream & os) const
{
os << "[char " << char_ << " " << "mathalpha" << "]";
}
///
void writeRaw(std::ostream &) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
int ascent() const;
///
#include "math_scriptinset.h"
#include "math_spaceinset.h"
#include "math_specialcharinset.h"
+#include "math_mathmlstream.h"
#define FILEDEBUG 0
#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)
{
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) << ']';
}
///
void metrics(MathMetricsInfo const & st) const;
///
- void writeNormal(std::ostream & os) const;
+ void writeNormal(NormalStream & os) const;
///
bool isScriptable() const;
#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)
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) << ']';
}
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;
}
///
void write(MathWriteInfo & os) const;
/// write normalized content
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#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)
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() << "] ";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
protected:
#include "math_exfuncinset.h"
#include "support.h"
-#include "debug.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
using std::ostream;
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) << ']';
}
{
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";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
--- /dev/null
+#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) << ')';
+}
--- /dev/null
+// -*- 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
#endif
#include "math_fracbase.h"
+#include "math_mathmlstream.h"
MathFracbaseInset::MathFracbaseInset()
#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)
}
-void MathFracInset::writeNormal(std::ostream & os) const
+void MathFracInset::writeNormal(NormalStream & os) const
{
if (atop_)
os << "[atop ";
void MathFracInset::mathmlize(MathMLStream & os) const
{
- os << "<mfrac>" << cell(0) << cell(1) << "</mfrac>";
+ os << MTag("mfrac") << cell(0) << cell(1) << ETag("mfrac");
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#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);
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() << ']';
}
void MathFuncInset::mathmlize(MathMLStream & os) const
{
- os << "<mi>" << name_.c_str() << "</mi>";
+ os << MTag("mi") << name_.c_str() << ETag("mi");
}
///
void write(MathWriteInfo &) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
string const & name() const;
///
#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)
{}
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() << ']';
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#endif
#include "math_gridinset.h"
+#include "math_mathmlstream.h"
#include "lyxfont.h"
-#include "support/LOstream.h"
#include "debug.h"
{
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 << ']';
}
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");
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#include "Lsstream.h"
#include "math_inset.h"
#include "math_scriptinset.h"
+#include "math_mathmlstream.h"
#include "debug.h"
{}
-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 << "] ";
}
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);
}
#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
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 {
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
///
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 &);
#endif
#include "math_kerninset.h"
+#include "math_mathmlstream.h"
#include "support.h"
-#include "support/LOstream.h"
MathKernInset::MathKernInset()
{}
-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;
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() << "]";
+}
+
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
private:
#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()
}
+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);
}
-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 << "]";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
};
#include "math_cursor.h"
#include "math_macrotable.h"
#include "math_macrotemplate.h"
+#include "math_mathmlstream.h"
#include "Painter.h"
#include "LaTeXFeatures.h"
}
-void MathMacro::writeNormal(std::ostream & os) const
+void MathMacro::writeNormal(NormalStream & os) const
{
os << "[macro " << name() << " ";
for (idx_type i = 0; i < nargs(); ++i) {
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void dump() const;
#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"
}
-void MathMacroArgument::writeNormal(std::ostream & os) const
+void MathMacroArgument::writeNormal(NormalStream & os) const
{
os << "[macroarg " << number_ << "] ";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void substitute(MathMacro const & macro);
///
#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
void MathMacroTable::dump()
{
+/*
lyxerr << "\n------------------------------------------\n";
table_type::const_iterator it;
for (it = macro_table.begin(); it != macro_table.end(); ++it)
<< " [" << it->second->asMacroTemplate()->nargs() << "] : "
<< it->second->cell(0) << "\n";
lyxerr << "------------------------------------------\n";
+*/
}
#endif
#include "math_macrotemplate.h"
+#include "math_mathmlstream.h"
#include "Painter.h"
#include "debug.h"
}
-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);
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";
+}
-#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);
}
+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)
+//////////////////////////////////////////////////////////////////////
+
OctaveStream & OctaveStream::operator<<(MathInset const * p)
{
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;
+}
+
+
-#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 *);
///
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);
};
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
#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 {
}
-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);
<< "' 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 << "] ";
+}
+
+
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#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)
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;
}
#include "math_notinset.h"
#include "math_parser.h"
+#include "math_mathmlstream.h"
#include "support.h"
-#include "support/LOstream.h"
-using std::ostream;
-
MathNotInset::MathNotInset()
{}
}
-void MathNotInset::writeNormal(ostream & os) const
+void MathNotInset::writeNormal(NormalStream & os) const
{
os << "[not] ";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
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);
}
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("\\"));
}
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;
#endif
#include "math_rootinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
#include "Painter.h"
}
-void MathRootInset::writeNormal(std::ostream & os) const
+void MathRootInset::writeNormal(NormalStream & os) const
{
os << "[root ";
cell(1).writeNormal(os);
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
-
-#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()
}
-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());
}
-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;
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_ << ')';
}
+
+
///
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;
///
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
///
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;
///
#include "math_sizeinset.h"
#include "math_parser.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
MathSizeInset::MathSizeInset(latexkeys const * l)
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) << ']';
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
private:
///
#include "support.h"
#include "LColor.h"
#include "Painter.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
}
-void MathSpaceInset::writeNormal(std::ostream & os) const
+void MathSpaceInset::writeNormal(NormalStream & os) const
{
os << "[space " << space_ << "] ";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#endif
#include "math_specialcharinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
#include "support.h"
}
-void MathSpecialCharInset::writeNormal(std::ostream & os) const
+void MathSpecialCharInset::writeNormal(NormalStream & os) const
{
os << "\\" << char_;
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
int ascent() const;
///
#endif
#include "math_splitinset.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
MathSplitInset::MathSplitInset(int n)
#endif
#include "math_sqrtinset.h"
+#include "math_mathmlstream.h"
#include "LColor.h"
#include "Painter.h"
-#include "support/LOstream.h"
MathSqrtInset::MathSqrtInset()
}
-void MathSqrtInset::writeNormal(std::ostream & os) const
+void MathSqrtInset::writeNormal(NormalStream & os) const
{
os << "[sqrt ";
cell(0).writeNormal(os);
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#endif
#include "math_stackrelinset.h"
-#include "mathed/support.h"
-#include "support/LOstream.h"
+#include "math_mathmlstream.h"
+#include "support.h"
MathStackrelInset::MathStackrelInset()
}
-void MathStackrelInset::writeNormal(std::ostream & os) const
+void MathStackrelInset::writeNormal(NormalStream & os) const
{
os << "[stackrel ";
cell(0).writeNormal(os);
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
void metrics(MathMetricsInfo const & st) const;
///
#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"
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" << "]";
}
///
void write(MathWriteInfo & os) const;
///
- void writeNormal(std::ostream &) const;
+ void writeNormal(NormalStream &) const;
///
int ascent() const;
///
#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)
{}
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() << "]";
}
///
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;
///
#include <map>
-#include "mathed/support.h"
+#include "support.h"
#include "lyxfont.h"
#include "FontLoader.h"
#include "font.h"
#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"
--it;
return it - begin();
}
-
-
-std::ostream & operator<<(std::ostream & os, MathXArray const & ar)
-{
- os << ar.data_;
- return os;
-}