]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathDiff.C
cursor is no more damaging the background. L-shaped cursor is broken right now....
[lyx.git] / src / mathed / InsetMathDiff.C
1 /**
2  * \file InsetMathDiff.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 "InsetMathDiff.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "debug.h"
17
18
19 namespace lyx {
20
21 using std::auto_ptr;
22 using std::endl;
23
24
25 InsetMathDiff::InsetMathDiff()
26         : InsetMathNest(1)
27 {}
28
29
30 auto_ptr<InsetBase> InsetMathDiff::doClone() const
31 {
32         return auto_ptr<InsetBase>(new InsetMathDiff(*this));
33 }
34
35
36 void InsetMathDiff::addDer(MathArray const & der)
37 {
38         cells_.push_back(der);
39 }
40
41
42 void InsetMathDiff::normalize(NormalStream & os) const
43 {
44         os << "[diff";
45         for (idx_type idx = 0; idx < nargs(); ++idx)
46                 os << ' ' << cell(idx);
47         os << ']';
48 }
49
50
51 void InsetMathDiff::metrics(MetricsInfo &, Dimension &) const
52 {
53         lyxerr << "should not happen" << endl;
54 }
55
56
57 void InsetMathDiff::draw(PainterInfo &, int, int) const
58 {
59         lyxerr << "should not happen" << endl;
60 }
61
62
63 void InsetMathDiff::maple(MapleStream & os) const
64 {
65         os << "diff(";
66         for (idx_type idx = 0; idx < nargs(); ++idx) {
67                 if (idx != 0)
68                         os << ',';
69                 os << cell(idx);
70         }
71         os << ')';
72 }
73
74
75 void InsetMathDiff::maxima(MaximaStream & os) const
76 {
77         os << "diff(";
78         for (idx_type idx = 0; idx < nargs(); ++idx) {
79                 if (idx != 0)
80                         os << ',';
81                 os << cell(idx);
82                 if (idx != 0)
83                         os << ",1";
84         }
85         os << ')';
86 }
87
88
89 void InsetMathDiff::mathematica(MathematicaStream & os) const
90 {
91         os << "D[";
92         for (idx_type idx = 0; idx < nargs(); ++idx) {
93                 if (idx != 0)
94                         os << ',';
95                 os << cell(idx);
96         }
97         os << ']';
98 }
99
100
101 void InsetMathDiff::mathmlize(MathStream & os) const
102 {
103         os << "diff(";
104         for (idx_type idx = 0; idx < nargs(); ++idx) {
105                 if (idx != 0)
106                         os << ',';
107                 os << cell(idx);
108         }
109         os << ')';
110 }
111
112
113 void InsetMathDiff::write(WriteStream &) const
114 {
115         lyxerr << "should not happen" << endl;
116 }
117
118
119 } // namespace lyx