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