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