]> git.lyx.org Git - lyx.git/blob - src/mathed/math_braceinset.C
fix typo that put too many include paths for most people
[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
12
13 using std::max;
14
15
16 MathBraceInset::MathBraceInset()
17         : MathNestInset(1)
18 {}
19
20
21 MathInset * MathBraceInset::clone() const
22 {
23         return new MathBraceInset(*this);
24 }
25
26
27 void MathBraceInset::metrics(MathMetricsInfo const & mi) const
28 {
29         xcell(0).metrics(mi);
30         int a, d;
31         whichFont(font_, LM_TC_TEX, mi);
32         mathed_char_dim(font_, '{', a, d, wid_);
33         ascent_  = max(xcell(0).ascent(), a);
34         descent_ = max(xcell(0).descent(), a);
35         width_   = xcell(0).width() + 2 * wid_;
36 }
37
38
39 void MathBraceInset::draw(Painter & pain, int x, int y) const
40 {
41         drawChar(pain, font_, x, y, '{');
42         xcell(0).draw(pain, x + wid_, y);
43         drawChar(pain, font_, x + width_ - wid_, y, '}');
44 }
45
46
47 void MathBraceInset::write(WriteStream & os) const
48 {
49         os << '{' << cell(0) << '}';
50 }
51
52
53 void MathBraceInset::normalize(NormalStream & os) const
54 {
55         os << "[block " << cell(0) << ']';
56 }