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"
26 MathArray & MathInset::cell(idx_type)
28 static MathArray dummyCell;
29 lyxerr << "I don't have a cell 1" << endl;
34 MathArray const & MathInset::cell(idx_type) const
36 static MathArray dummyCell;
37 lyxerr << "I don't have a cell 2" << endl;
42 void MathInset::dump() const
44 lyxerr << "---------------------------------------------" << endl;
45 WriteStream wi(lyxerr, false, true);
47 lyxerr << "\n---------------------------------------------" << endl;
51 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
54 lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
59 void MathInset::drawT(TextPainter &, int, int) const
62 lyxerr << "MathInset::drawT(Text) called directly!" << endl;
68 void MathInset::write(WriteStream & os) const
70 string const s = name();
71 os << '\\' << s.c_str();
72 // We need an extra ' ' unless this is a single-char-non-ASCII name
73 // or anything non-ASCII follows
74 if (s.size() != 1 || isalpha(s[0]))
75 os.pendingSpace(true);
79 void MathInset::normalize(NormalStream & os) const
81 os << '[' << name().c_str() << "] ";
85 void MathInset::octave(OctaveStream & os) const
87 NormalStream ns(os.os());
92 void MathInset::maple(MapleStream & os) const
94 NormalStream ns(os.os());
99 void MathInset::maxima(MaximaStream & os) const
101 MapleStream ns(os.os());
106 void MathInset::mathematica(MathematicaStream & os) const
108 NormalStream ns(os.os());
113 void MathInset::mathmlize(MathMLStream & os) const
115 NormalStream ns(os.os());
120 string const & MathInset::getType() const
122 static string const t = "none";
127 string MathInset::name() const
133 ostream & operator<<(ostream & os, MathAtom const & at)
135 WriteStream wi(os, false, false);