]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBox.cpp
efbfd4a43393986e99e4d5c760ca3e3c560e65e5
[lyx.git] / src / mathed / InsetMathBox.cpp
1 /**
2  * \file InsetMathBox.cpp
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 "InsetMathBox.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "MathStream.h"
17 #include "support/std_ostream.h"
18
19
20 namespace lyx {
21
22 InsetMathBox::InsetMathBox(docstring const & name)
23         : InsetMathNest(1), name_(name)
24 {}
25
26
27 Inset * InsetMathBox::clone() const
28 {
29         return new InsetMathBox(*this);
30 }
31
32
33 void InsetMathBox::write(WriteStream & os) const
34 {
35         os << '\\' << name_ << '{' << cell(0) << '}';
36 }
37
38
39 void InsetMathBox::normalize(NormalStream & os) const
40 {
41         os << '[' << name_ << ' ';
42         //text_->write(buffer(), os);
43         os << "] ";
44 }
45
46
47 void InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const
48 {
49         FontSetChanger dummy(mi.base, "textnormal");
50         cell(0).metrics(mi, dim);
51         metricsMarkers(dim);
52         dim_ = dim;
53 }
54
55
56 void InsetMathBox::draw(PainterInfo & pi, int x, int y) const
57 {
58         FontSetChanger dummy(pi.base, "textnormal");
59         cell(0).draw(pi, x, y);
60         drawMarkers(pi, x, y);
61 }
62
63
64 void InsetMathBox::infoize(odocstream & os) const
65 {
66         os << "Box: " << name_;
67 }
68
69
70 } // namespace lyx