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