]> git.lyx.org Git - lyx.git/blob - src/mathed/math_casesinset.C
fix typo that put too many include paths for most people
[lyx.git] / src / mathed / math_casesinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_casesinset.h"
8 #include "math_parser.h"
9 #include "math_mathmlstream.h"
10 #include "math_support.h"
11 #include "Painter.h"
12
13
14 MathCasesInset::MathCasesInset(row_type n)
15         : MathGridInset(2, n, 'c', "ll")
16 {}
17
18
19 MathInset * MathCasesInset::clone() const
20 {
21         return new MathCasesInset(*this);
22 }
23
24
25 void MathCasesInset::metrics(MathMetricsInfo const & mi) const
26 {
27         MathGridInset::metrics(mi);
28         width_ += 8;
29 }
30
31
32 void MathCasesInset::draw(Painter & pain, int x, int y) const
33 {
34         mathed_draw_deco(pain, x + 1, y - ascent(), 6, height(), "{");
35         MathGridInset::draw(pain, x + 8, y);
36 }
37
38
39 void MathCasesInset::write(WriteStream & os) const
40 {
41         if (os.fragile())
42                 os << "\\protect";
43         os << "\\begin{cases}\n";
44         MathGridInset::write(os);
45         if (os.fragile())
46                 os << "\\protect";
47         os << "\\end{cases}";
48 }
49
50
51 void MathCasesInset::normalize(NormalStream & os) const
52 {
53         os << "[cases ";
54         MathGridInset::normalize(os);
55         os << "]";
56 }
57
58
59 void MathCasesInset::maplize(MapleStream & os) const
60 {
61         os << "cases(";
62         MathGridInset::maplize(os);
63         os << ")";
64 }