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