3 #include "math_exintinset.h"
4 #include "math_support.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "math_symbolinset.h"
10 #include <boost/scoped_ptr.hpp>
16 MathExIntInset::MathExIntInset(string const & name)
17 : MathNestInset(4), symbol_(name)
26 auto_ptr<InsetBase> MathExIntInset::clone() const
28 return auto_ptr<InsetBase>(new MathExIntInset(*this));
32 void MathExIntInset::symbol(string const & symbol)
38 bool MathExIntInset::hasScripts() const
40 // take empty upper bound as "no scripts"
41 return !cell(3).empty();
46 void MathExIntInset::normalize(NormalStream & os) const
48 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
49 << cell(2) << ' ' << cell(3) << ']';
53 void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
55 lyxerr << "should not happen" << endl;
59 void MathExIntInset::draw(PainterInfo &, int, int) const
61 lyxerr << "should not happen" << endl;
65 void MathExIntInset::maple(MapleStream & os) const
74 os << '=' << cell(2) << ".." << cell(3);
79 void MathExIntInset::maxima(MaximaStream & os) const
81 if ( symbol_ == "int" )
91 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
96 void MathExIntInset::mathematica(MathematicaStream & os) const
98 if ( symbol_ == "int" )
100 else if (symbol_ == "sum")
103 os << symbol_ << '[';
106 os << cell(0) << ',';
110 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
112 os << cell(1) << ']';
116 void MathExIntInset::mathmlize(MathMLStream & os) const
118 boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
120 // mathmlize(sym, os);
123 os << cell(0) << "<mo> ⁢ </mo>"
124 << MTag("mrow") << "<mo> ⅆ </mo>"
125 << cell(1) << ETag("mrow");
129 void MathExIntInset::write(WriteStream &) const
131 lyxerr << "should not happen" << endl;