]> git.lyx.org Git - lyx.git/blob - src/mathed/math_diffinset.C
merge MathArray and MathXArray classes.
[lyx.git] / src / mathed / math_diffinset.C
1 #include "math_diffinset.h"
2 #include "math_support.h"
3 #include "math_mathmlstream.h"
4 #include "math_symbolinset.h"
5 #include "debug.h"
6
7
8 MathDiffInset::MathDiffInset()
9         : MathNestInset(1)
10 {}
11
12
13 MathInset * MathDiffInset::clone() const
14 {
15         return new MathDiffInset(*this);
16 }
17
18
19 void MathDiffInset::addDer(MathArray const & der)
20 {
21         cells_.push_back(der);
22 }
23
24
25 void MathDiffInset::normalize(NormalStream & os) const
26 {
27         os << "[diff";
28         for (idx_type idx = 0; idx < nargs(); ++idx)
29                 os << ' ' << cell(idx);
30         os << ']';
31 }
32
33
34 void MathDiffInset::metrics(MathMetricsInfo &) const
35 {
36         lyxerr << "should not happen\n";
37 }
38
39
40 void MathDiffInset::draw(MathPainterInfo &, int, int) const
41 {
42         lyxerr << "should not happen\n";
43 }
44
45
46 void MathDiffInset::maplize(MapleStream & os) const
47 {
48         os << "diff(";
49         for (idx_type idx = 0; idx < nargs(); ++idx) {
50                 if (idx != 0)
51                         os << ',';
52                 os << cell(idx);
53         }
54         os << ')';
55 }
56
57
58 void MathDiffInset::mathematicize(MathematicaStream & os) const
59 {
60         os << "Dt[";
61         for (idx_type idx = 0; idx < nargs(); ++idx) {
62                 if (idx != 0)
63                         os << ',';
64                 os << cell(idx);
65         }
66         os << ']';
67 }
68
69
70 void MathDiffInset::mathmlize(MathMLStream & os) const
71 {
72         os << "diff(";
73         for (idx_type idx = 0; idx < nargs(); ++idx) {
74                 if (idx != 0)
75                         os << ',';
76                 os << cell(idx);
77         }
78         os << ')';
79 }
80
81
82 void MathDiffInset::write(WriteStream &) const
83 {
84         lyxerr << "should not happen\n";
85 }