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>
15 MathExIntInset::MathExIntInset(string const & name)
16 : MathNestInset(4), symbol_(name)
25 auto_ptr<InsetBase> MathExIntInset::clone() const
27 return auto_ptr<InsetBase>(new MathExIntInset(*this));
31 void MathExIntInset::symbol(string const & symbol)
37 bool MathExIntInset::hasScripts() const
39 // take empty upper bound as "no scripts"
40 return !cell(3).empty();
45 void MathExIntInset::normalize(NormalStream & os) const
47 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
48 << cell(2) << ' ' << cell(3) << ']';
52 void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
54 lyxerr << "should not happen\n";
58 void MathExIntInset::draw(PainterInfo &, int, int) const
60 lyxerr << "should not happen\n";
64 void MathExIntInset::maple(MapleStream & os) const
73 os << '=' << cell(2) << ".." << cell(3);
78 void MathExIntInset::maxima(MaximaStream & os) const
80 if ( symbol_ == "int" )
90 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
95 void MathExIntInset::mathematica(MathematicaStream & os) const
97 if ( symbol_ == "int" )
99 else if (symbol_ == "sum")
102 os << symbol_ << '[';
105 os << cell(0) << ',';
109 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
111 os << cell(1) << ']';
115 void MathExIntInset::mathmlize(MathMLStream & os) const
117 boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
119 // mathmlize(sym, os);
122 os << cell(0) << "<mo> ⁢ </mo>"
123 << MTag("mrow") << "<mo> ⅆ </mo>"
124 << cell(1) << ETag("mrow");
128 void MathExIntInset::write(WriteStream &) const
130 lyxerr << "should not happen\n";