]> git.lyx.org Git - lyx.git/blob - src/mathed/math_exintinset.C
fix the <...> delimiters
[lyx.git] / src / mathed / math_exintinset.C
1 #include <config.h>
2
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"
8 #include "debug.h"
9
10 #include <boost/scoped_ptr.hpp>
11
12 using std::endl;
13
14
15 MathExIntInset::MathExIntInset(string const & name)
16         : MathNestInset(4), symbol_(name)
17 {}
18
19 // 0 - core
20 // 1 - diff
21 // 2 - lower
22 // 3 - upper
23
24
25 MathInset * MathExIntInset::clone() const
26 {
27         return new MathExIntInset(*this);
28 }
29
30
31 void MathExIntInset::symbol(string const & symbol)
32 {
33         symbol_ = symbol;
34 }
35
36
37 bool MathExIntInset::hasScripts() const
38 {
39         // take empty upper bound as "no scripts"
40         return !cell(3).empty();
41 }
42
43
44
45 void MathExIntInset::normalize(NormalStream & os) const
46 {
47         os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
48            << cell(2) << ' ' << cell(3) << ']';
49 }
50
51
52 void MathExIntInset::metrics(MathMetricsInfo &) const
53 {
54         lyxerr << "should not happen" << endl;
55 }
56
57
58 void MathExIntInset::draw(MathPainterInfo &, int, int) const
59 {
60         lyxerr << "should not happen" << endl;
61 }
62
63
64 void MathExIntInset::maplize(MapleStream & os) const
65 {
66         os << symbol_ << '(';
67         if (cell(0).size())
68                 os << cell(0);
69         else
70                 os << '1';
71         os << ',' << cell(1);
72         if (hasScripts())
73                 os << '=' << cell(2) << ".." << cell(3);
74         os << ')';
75 }
76
77
78 void MathExIntInset::mathmlize(MathMLStream & os) const
79 {
80         boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
81         //if (hasScripts())
82         //      mathmlize(sym, os);
83         //else
84                 sym->mathmlize(os);
85         os << cell(0) << "<mo> &InvisibleTimes; </mo>"
86            << MTag("mrow") << "<mo> &DifferentialD; </mo>"
87            << cell(1) << ETag("mrow");
88 }
89
90
91 void MathExIntInset::write(WriteStream &) const
92 {
93         lyxerr << "should not happen" << endl;
94 }