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 "math_inset.h"
15 #include "math_data.h"
16 #include "math_mathmlstream.h"
19 #include "support/lstrings.h"
21 #include <boost/current_function.hpp>
28 MathArray & MathInset::cell(idx_type)
30 static MathArray dummyCell;
31 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
36 MathArray const & MathInset::cell(idx_type) const
38 static MathArray dummyCell;
39 lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
44 void MathInset::dump() const
46 lyxerr << "---------------------------------------------" << endl;
47 WriteStream wi(lyxerr, false, true);
49 lyxerr << "\n---------------------------------------------" << endl;
53 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
56 lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
61 void MathInset::drawT(TextPainter &, int, int) const
64 lyxerr << "MathInset::drawT(Text) called directly!" << endl;
70 void MathInset::write(WriteStream & os) const
72 string const s = name();
73 os << '\\' << s.c_str();
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 || isalpha(s[0]))
77 os.pendingSpace(true);
81 void MathInset::normalize(NormalStream & os) const
83 os << '[' << name().c_str() << "] ";
87 void MathInset::octave(OctaveStream & os) const
89 NormalStream ns(os.os());
94 void MathInset::maple(MapleStream & os) const
96 NormalStream ns(os.os());
101 void MathInset::maxima(MaximaStream & os) const
103 MapleStream ns(os.os());
108 void MathInset::mathematica(MathematicaStream & os) const
110 NormalStream ns(os.os());
115 void MathInset::mathmlize(MathMLStream & os) const
117 NormalStream ns(os.os());
122 string const & MathInset::getType() const
124 static string const t = "none";
129 string MathInset::name() const
135 ostream & operator<<(ostream & os, MathAtom const & at)
137 WriteStream wi(os, false, false);