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