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"
15 #include "MathArray.h"
16 #include "MathStream.h"
20 #include "support/lstrings.h"
21 #include "support/textutils.h"
23 #include <boost/current_function.hpp>
31 MathArray & InsetMath::cell(idx_type)
33 static MathArray dummyCell;
34 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
39 MathArray const & InsetMath::cell(idx_type) const
41 static MathArray 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
61 lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
66 void InsetMath::drawT(TextPainter &, int, int) const
69 lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
75 void InsetMath::write(WriteStream & os) const
77 docstring const s = name();
79 // We need an extra ' ' unless this is a single-char-non-ASCII name
80 // or anything non-ASCII follows
81 if (s.size() != 1 || isAlphaASCII(s[0]))
82 os.pendingSpace(true);
86 int InsetMath::plaintext(Buffer const &, odocstream &,
87 OutputParams const &) const
89 // all math plain text output shall take place in InsetMathHull
95 void InsetMath::normalize(NormalStream & os) const
97 os << '[' << name() << "] ";
101 void InsetMath::octave(OctaveStream & os) const
103 NormalStream ns(os.os());
108 void InsetMath::maple(MapleStream & os) const
110 NormalStream ns(os.os());
115 void InsetMath::maxima(MaximaStream & os) const
117 MapleStream ns(os.os());
122 void InsetMath::mathematica(MathematicaStream & os) const
124 NormalStream ns(os.os());
129 void InsetMath::mathmlize(MathStream & os) const
131 NormalStream ns(os.os());
136 HullType InsetMath::getType() const
142 docstring InsetMath::name() const
144 return from_ascii("unknown");
148 std::ostream & operator<<(std::ostream & os, MathAtom const & at)
150 odocstringstream oss;
151 WriteStream wi(oss, false, false);
153 return os << to_utf8(oss.str());
157 odocstream & operator<<(odocstream & os, MathAtom const & at)
159 WriteStream wi(os, false, false);