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