]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathDiff.cpp
visual mode for bidi cursor movement
[lyx.git] / src / mathed / InsetMathDiff.cpp
1 /**
2  * \file InsetMathDiff.cpp
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 "support/debug.h"
17
18
19 namespace lyx {
20
21 InsetMathDiff::InsetMathDiff()
22         : InsetMathNest(1)
23 {}
24
25
26 Inset * InsetMathDiff::clone() const
27 {
28         return new InsetMathDiff(*this);
29 }
30
31
32 void InsetMathDiff::addDer(MathData const & der)
33 {
34         cells_.push_back(der);
35 }
36
37
38 void InsetMathDiff::normalize(NormalStream & os) const
39 {
40         os << "[diff";
41         for (idx_type idx = 0; idx < nargs(); ++idx)
42                 os << ' ' << cell(idx);
43         os << ']';
44 }
45
46
47 void InsetMathDiff::metrics(MetricsInfo &, Dimension &) const
48 {
49         LYXERR0("should not happen");
50 }
51
52
53 void InsetMathDiff::draw(PainterInfo &, int, int) const
54 {
55         LYXERR0("should not happen");
56 }
57
58
59 void InsetMathDiff::maple(MapleStream & os) const
60 {
61         os << "diff(";
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 InsetMathDiff::maxima(MaximaStream & 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                 if (idx != 0)
79                         os << ",1";
80         }
81         os << ')';
82 }
83
84
85 void InsetMathDiff::mathematica(MathematicaStream & os) const
86 {
87         os << "D[";
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 InsetMathDiff::mathmlize(MathStream & os) const
98 {
99         os << "diff(";
100         for (idx_type idx = 0; idx < nargs(); ++idx) {
101                 if (idx != 0)
102                         os << ',';
103                 os << cell(idx);
104         }
105         os << ')';
106 }
107
108
109 void InsetMathDiff::write(WriteStream &) const
110 {
111         LYXERR0("should not happen");
112 }
113
114
115 } // namespace lyx