]> git.lyx.org Git - features.git/blob - src/mathed/math_boxinset.C
Replace LString.h with support/std_string.h,
[features.git] / src / mathed / math_boxinset.C
1 /**
2  * \file math_boxinset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_boxinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "support/std_ostream.h"
17
18 using std::auto_ptr;
19
20
21 MathBoxInset::MathBoxInset(string const & name)
22         : MathNestInset(1), name_(name)
23 {}
24
25
26 auto_ptr<InsetBase> MathBoxInset::clone() const
27 {
28         return auto_ptr<InsetBase>(new MathBoxInset(*this));
29 }
30
31
32 void MathBoxInset::write(WriteStream & os) const
33 {
34         os << '\\' << name_ << '{' << cell(0) << '}';
35 }
36
37
38 void MathBoxInset::normalize(NormalStream & os) const
39 {
40         os << '[' << name_ << ' ';
41         //text_->write(buffer(), os);
42         os << "] ";
43 }
44
45
46 void MathBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const
47 {
48         FontSetChanger dummy(mi.base, "textnormal");
49         cell(0).metrics(mi, dim_);
50         metricsMarkers();
51         dim = dim_;
52 }
53
54
55 void MathBoxInset::draw(PainterInfo & pi, int x, int y) const
56 {
57         FontSetChanger dummy(pi.base, "textnormal");
58         cell(0).draw(pi, x, y);
59         drawMarkers(pi, x, y);
60 }
61
62
63 void MathBoxInset::infoize(std::ostream & os) const
64 {
65         os << "Box: " << name_;
66 }