A bit more re-organization.
[lyx.git] / src / mathed / InsetMathDiff.cpp
blob1e990d7ffb15a4a05a83054335ddcb79bed97304
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.
6 * \author André Pönitz
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "InsetMathDiff.h"
14 #include "MathData.h"
15 #include "MathStream.h"
17 #include "support/debug.h"
20 namespace lyx {
22 InsetMathDiff::InsetMathDiff(Buffer * buf)
23 : InsetMathNest(buf, 1)
27 Inset * InsetMathDiff::clone() const
29 return new InsetMathDiff(*this);
33 void InsetMathDiff::addDer(MathData const & der)
35 cells_.push_back(der);
39 void InsetMathDiff::normalize(NormalStream & os) const
41 os << "[diff";
42 for (idx_type idx = 0; idx < nargs(); ++idx)
43 os << ' ' << cell(idx);
44 os << ']';
48 void InsetMathDiff::metrics(MetricsInfo &, Dimension &) const
50 LYXERR0("should not happen");
54 void InsetMathDiff::draw(PainterInfo &, int, int) const
56 LYXERR0("should not happen");
60 void InsetMathDiff::maple(MapleStream & os) const
62 os << "diff(";
63 for (idx_type idx = 0; idx < nargs(); ++idx) {
64 if (idx != 0)
65 os << ',';
66 os << cell(idx);
68 os << ')';
72 void InsetMathDiff::maxima(MaximaStream & os) const
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";
82 os << ')';
86 void InsetMathDiff::mathematica(MathematicaStream & os) const
88 os << "D[";
89 for (idx_type idx = 0; idx < nargs(); ++idx) {
90 if (idx != 0)
91 os << ',';
92 os << cell(idx);
94 os << ']';
98 void InsetMathDiff::mathmlize(MathStream & os) const
100 os << "diff(";
101 for (idx_type idx = 0; idx < nargs(); ++idx) {
102 if (idx != 0)
103 os << ',';
104 os << cell(idx);
106 os << ')';
110 void InsetMathDiff::write(WriteStream &) const
112 LYXERR0("should not happen");
116 } // namespace lyx