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