]> git.lyx.org Git - lyx.git/blob - src/mathed/math_boxinset.C
some more changes
[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 #include "support/LOstream.h"
12
13
14 MathBoxInset::MathBoxInset(string const & name)
15         : MathNestInset(1), name_(name)
16 {}
17
18
19 MathInset * MathBoxInset::clone() const
20 {
21         return new MathBoxInset(*this);
22 }
23
24
25 void MathBoxInset::write(WriteStream & os) const
26 {
27         os << "\\" << name_ << "{" << cell(0) << "}";
28 }
29
30
31 void MathBoxInset::normalize(NormalStream & os) const
32 {
33         os << '[' << name_ << ' ';
34         //text_->write(buffer(), os);
35         os << "] ";
36 }
37
38
39 void MathBoxInset::rebreak()
40 {
41         //lyxerr << "trying to rebreak...\n";
42 }
43
44
45 void MathBoxInset::metrics(MathMetricsInfo & mi) const
46 {
47         MathFontSetChanger dummy(mi.base, "textnormal");
48         xcell(0).metrics(mi);
49         dim_ = xcell(0).dim();
50         metricsMarkers2();
51 }
52
53
54 void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const
55 {
56         MathFontSetChanger dummy(pi.base, "textnormal");
57         xcell(0).draw(pi, x, y);
58         drawMarkers2(pi, x + 1, y);
59 }
60
61
62 void MathBoxInset::infoize(std::ostream & os) const
63 {
64         os << "Box: " << name_;
65 }