3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMath.h"
16 #include "MathStream.h"
20 #include "support/lstrings.h"
21 #include "support/textutils.h"
23 #include <boost/current_function.hpp>
31 MathData & InsetMath::cell(idx_type)
33 static MathData dummyCell;
34 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
39 MathData const & InsetMath::cell(idx_type) const
41 static MathData dummyCell;
42 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
47 void InsetMath::dump() const
49 lyxerr << "---------------------------------------------" << endl;
51 WriteStream wi(os, false, true);
53 lyxerr << to_utf8(os.str());
54 lyxerr << "\n---------------------------------------------" << endl;
58 void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const
60 lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
64 void InsetMath::drawT(TextPainter &, int, int) const
66 lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
70 void InsetMath::write(WriteStream & os) const
72 docstring const s = name();
74 // We need an extra ' ' unless this is a single-char-non-ASCII name
75 // or anything non-ASCII follows
76 if (s.size() != 1 || isAlphaASCII(s[0]))
77 os.pendingSpace(true);
81 int InsetMath::plaintext(Buffer const &, odocstream &,
82 OutputParams const &) const
84 // all math plain text output shall take place in InsetMathHull
90 void InsetMath::normalize(NormalStream & os) const
92 os << '[' << name() << "] ";
96 void InsetMath::octave(OctaveStream & os) const
98 NormalStream ns(os.os());
103 void InsetMath::maple(MapleStream & os) const
105 NormalStream ns(os.os());
110 void InsetMath::maxima(MaximaStream & os) const
112 MapleStream ns(os.os());
117 void InsetMath::mathematica(MathematicaStream & os) const
119 NormalStream ns(os.os());
124 void InsetMath::mathmlize(MathStream & os) const
126 NormalStream ns(os.os());
131 HullType InsetMath::getType() const
137 std::ostream & operator<<(std::ostream & os, MathAtom const & at)
139 odocstringstream oss;
140 WriteStream wi(oss, false, false);
142 return os << to_utf8(oss.str());
146 odocstream & operator<<(odocstream & os, MathAtom const & at)
148 WriteStream wi(os, false, false);