]> git.lyx.org Git - lyx.git/blob - src/mathed/math_diffinset.C
d81bbd8c0d6484299d1ea2f278f4c0f8594b9d96
[lyx.git] / src / mathed / math_diffinset.C
1 /**
2  * \file math_diffinset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_diffinset.h"
14 #include "math_support.h"
15 #include "math_mathmlstream.h"
16 #include "math_symbolinset.h"
17 #include "debug.h"
18
19 using std::auto_ptr;
20 using std::endl;
21
22
23 MathDiffInset::MathDiffInset()
24         : MathNestInset(1)
25 {}
26
27
28 auto_ptr<InsetBase> MathDiffInset::clone() const
29 {
30         return auto_ptr<InsetBase>(new MathDiffInset(*this));
31 }
32
33
34 void MathDiffInset::addDer(MathArray const & der)
35 {
36         cells_.push_back(der);
37 }
38
39
40 void MathDiffInset::normalize(NormalStream & os) const
41 {
42         os << "[diff";
43         for (idx_type idx = 0; idx < nargs(); ++idx)
44                 os << ' ' << cell(idx);
45         os << ']';
46 }
47
48
49 void MathDiffInset::metrics(MetricsInfo &, Dimension &) const
50 {
51         lyxerr << "should not happen" << endl;
52 }
53
54
55 void MathDiffInset::draw(PainterInfo &, int, int) const
56 {
57         lyxerr << "should not happen" << endl;
58 }
59
60
61 void MathDiffInset::maple(MapleStream & os) const
62 {
63         os << "diff(";
64         for (idx_type idx = 0; idx < nargs(); ++idx) {
65                 if (idx != 0)
66                         os << ',';
67                 os << cell(idx);
68         }
69         os << ')';
70 }
71
72
73 void MathDiffInset::mathematica(MathematicaStream & os) const
74 {
75         os << "Dt[";
76         for (idx_type idx = 0; idx < nargs(); ++idx) {
77                 if (idx != 0)
78                         os << ',';
79                 os << cell(idx);
80         }
81         os << ']';
82 }
83
84
85 void MathDiffInset::mathmlize(MathMLStream & os) const
86 {
87         os << "diff(";
88         for (idx_type idx = 0; idx < nargs(); ++idx) {
89                 if (idx != 0)
90                         os << ',';
91                 os << cell(idx);
92         }
93         os << ')';
94 }
95
96
97 void MathDiffInset::write(WriteStream &) const
98 {
99         lyxerr << "should not happen" << endl;
100 }