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>
24 #include <boost/assert.hpp>
32 MathData & InsetMath::cell(idx_type)
34 static MathData dummyCell;
35 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
40 MathData const & InsetMath::cell(idx_type) const
42 static MathData dummyCell;
43 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
48 void InsetMath::dump() const
50 lyxerr << "---------------------------------------------" << endl;
52 WriteStream wi(os, false, true);
54 lyxerr << to_utf8(os.str());
55 lyxerr << "\n---------------------------------------------" << endl;
59 void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const
61 lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
65 void InsetMath::drawT(TextPainter &, int, int) const
67 lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
71 void InsetMath::write(WriteStream & os) const
73 docstring const s = name();
75 // We need an extra ' ' unless this is a single-char-non-ASCII name
76 // or anything non-ASCII follows
77 if (s.size() != 1 || isAlphaASCII(s[0]))
78 os.pendingSpace(true);
82 int InsetMath::plaintext(Buffer const &, odocstream &,
83 OutputParams const &) const
85 // all math plain text output shall take place in InsetMathHull
91 void InsetMath::normalize(NormalStream & os) const
93 os << '[' << name() << "] ";
97 void InsetMath::octave(OctaveStream & os) const
99 NormalStream ns(os.os());
104 void InsetMath::maple(MapleStream & os) const
106 NormalStream ns(os.os());
111 void InsetMath::maxima(MaximaStream & os) const
113 MapleStream ns(os.os());
118 void InsetMath::mathematica(MathematicaStream & os) const
120 NormalStream ns(os.os());
125 void InsetMath::mathmlize(MathStream & os) const
127 NormalStream ns(os.os());
132 HullType InsetMath::getType() const
138 std::ostream & operator<<(std::ostream & os, MathAtom const & at)
140 odocstringstream oss;
141 WriteStream wi(oss, false, false);
143 return os << to_utf8(oss.str());
147 odocstream & operator<<(odocstream & os, MathAtom const & at)
149 WriteStream wi(os, false, false);