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"
19 #include "support/lstrings.h"
21 #include <boost/current_function.hpp>
29 MathArray & InsetMath::cell(idx_type)
31 static MathArray dummyCell;
32 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
37 MathArray const & InsetMath::cell(idx_type) const
39 static MathArray dummyCell;
40 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
45 void InsetMath::dump() const
47 lyxerr << "---------------------------------------------" << endl;
49 WriteStream wi(os, false, true);
51 lyxerr << to_utf8(os.str());
52 lyxerr << "\n---------------------------------------------" << endl;
56 void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const
59 lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
64 void InsetMath::drawT(TextPainter &, int, int) const
67 lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
73 void InsetMath::write(WriteStream & os) const
75 docstring const s = name();
77 // We need an extra ' ' unless this is a single-char-non-ASCII name
78 // or anything non-ASCII follows
79 if (s.size() != 1 || isalpha(s[0]))
80 os.pendingSpace(true);
84 void InsetMath::normalize(NormalStream & os) const
86 os << '[' << name() << "] ";
90 void InsetMath::octave(OctaveStream & os) const
92 NormalStream ns(os.os());
97 void InsetMath::maple(MapleStream & os) const
99 NormalStream ns(os.os());
104 void InsetMath::maxima(MaximaStream & os) const
106 MapleStream ns(os.os());
111 void InsetMath::mathematica(MathematicaStream & os) const
113 NormalStream ns(os.os());
118 void InsetMath::mathmlize(MathStream & os) const
120 NormalStream ns(os.os());
125 HullType InsetMath::getType() const
131 docstring InsetMath::name() const
133 return from_ascii("unknown");
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);