]> git.lyx.org Git - lyx.git/blob - src/mathed/math_braceinset.C
remove unneeded member
[lyx.git] / src / mathed / math_braceinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
11 #include "support/LOstream.h"
12
13 using std::max;
14
15
16 MathBraceInset::MathBraceInset()
17         : MathNestInset(1)
18 {}
19
20
21 MathBraceInset::MathBraceInset(MathArray const & ar)
22         : MathNestInset(1)
23 {
24         cell(0) = ar;
25 }
26
27
28 MathInset * MathBraceInset::clone() const
29 {
30         return new MathBraceInset(*this);
31 }
32
33
34 void MathBraceInset::metrics(MathMetricsInfo & mi) const
35 {
36         xcell(0).metrics(mi);
37         int a, d;
38         mathed_char_dim(mi.base.font, '{', a, d, wid_);
39         ascent_  = max(xcell(0).ascent(), a);
40         descent_ = max(xcell(0).descent(), a);
41         width_   = xcell(0).width() + 2 * wid_;
42 }
43
44
45 void MathBraceInset::draw(MathPainterInfo & pi, int x, int y) const
46 {
47         LyXFont font = pi.base.font;
48         font.setColor(LColor::latex);
49         drawChar(pi, font, x, y, '{');
50         xcell(0).draw(pi, x + wid_, y);
51         drawChar(pi, font, x + width_ - wid_, y, '}');
52 }
53
54
55 void MathBraceInset::write(WriteStream & os) const
56 {
57         os << '{' << cell(0) << '}';
58 }
59
60
61 void MathBraceInset::normalize(NormalStream & os) const
62 {
63         os << "[block " << cell(0) << ']';
64 }
65
66
67 void MathBraceInset::infoize(std::ostream & os) const
68 {
69         os << "Nested Block: ";
70 }