]> git.lyx.org Git - lyx.git/blob - src/mathed/math_exintinset.C
translate '\int_0^1 e^x dx' to 'int(e^(x),x=0..1)'
[lyx.git] / src / mathed / math_exintinset.C
1 #include "math_exintinset.h"
2 #include "math_support.h"
3 #include "debug.h"
4 #include "math_mathmlstream.h"
5 #include "math_symbolinset.h"
6
7
8 MathExIntInset::MathExIntInset()
9         : int_(new MathSymbolInset("int"))
10 {}
11
12
13 MathInset * MathExIntInset::clone() const
14 {
15         return new MathExIntInset(*this);
16 }
17
18
19 void MathExIntInset::differential(MathArray const & ar)
20 {
21         diff_ = ar;
22 }
23
24
25 void MathExIntInset::core(MathArray const & ar)
26 {
27         core_ = ar;
28 }
29
30
31 void MathExIntInset::scripts(MathAtom const & at)
32 {
33         scripts_ = at;
34 }
35
36
37 void MathExIntInset::symbol(MathAtom const & at)
38 {
39         int_ = at;
40 }
41
42
43 bool MathExIntInset::hasScripts() const
44 {
45         return scripts_.hasNucleus();
46 }
47
48
49
50 void MathExIntInset::normalize(NormalStream & os) const
51 {
52         os << "[int ";
53         if (hasScripts())
54                 os << scripts_.nucleus();
55         else 
56                 os << "{}";
57         os << ' ' << core_ << ' ' << diff_ << ']';
58 }
59
60
61 void MathExIntInset::metrics(MathMetricsInfo const &) const
62 {
63         lyxerr << "should not happen\n";
64 }
65
66
67 void MathExIntInset::draw(Painter &, int, int) const
68 {  
69         lyxerr << "should not happen\n";
70 }
71
72
73 void MathExIntInset::maplize(MapleStream & os) const
74 {
75         os << int_.nucleus() << '(' << core_ << ',' << diff_;
76         if (hasScripts()) {
77                 MathScriptInset * p = scripts_->asScriptInset();
78                 os << '=' << p->down().data_ << ".." << p->up().data_;
79         }
80         os << ')';
81 }
82
83
84 void MathExIntInset::mathmlize(MathMLStream & os) const
85 {
86         //os << name_.c_str() << '(' << cell(0) << ')';
87 }
88
89
90 void MathExIntInset::write(WriteStream & os) const
91 {
92         if (hasScripts())
93                 os << scripts_.nucleus();
94         os << core_ << "d" << diff_;
95 }
96