]> git.lyx.org Git - lyx.git/blob - src/mathed/math_boxinset.C
First shot at inset-unification mathed & rest of the world
[lyx.git] / src / mathed / math_boxinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_boxinset.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11
12
13 MathBoxInset::MathBoxInset(string const & name)
14         : MathGridInset(1, 1), name_(name)
15 {}
16
17
18 MathInset * MathBoxInset::clone() const
19 {
20         return new MathBoxInset(*this);
21 }
22
23
24 void MathBoxInset::write(WriteStream & os) const
25 {
26         os << "\\" << name_ << "{" << cell(0) << "}";
27 }
28
29
30 void MathBoxInset::normalize(NormalStream & os) const
31 {
32         os << '[' << name_ << ' ';
33         //text_->write(buffer(), os);
34         os << "] ";
35 }
36
37
38 void MathBoxInset::rebreak()
39 {
40         //lyxerr << "trying to rebreak...\n";
41 }
42
43
44 void MathBoxInset::metrics(MathMetricsInfo & mi) const
45 {
46         MathFontSetChanger dummy(mi.base, "textnormal");
47         MathGridInset::metrics(mi);
48 }
49
50
51 void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const
52 {
53         MathFontSetChanger dummy(pi.base, "textnormal");
54         MathGridInset::draw(pi, x, y);
55         mathed_draw_framebox(pi, x, y, this);
56 }