]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBox.cpp
Rename files in src/mathed and src/graphics from .C to .cpp, step 2
[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 using std::string;
23 using std::auto_ptr;
24
25
26 InsetMathBox::InsetMathBox(docstring const & name)
27         : InsetMathNest(1), name_(name)
28 {}
29
30
31 auto_ptr<InsetBase> InsetMathBox::doClone() const
32 {
33         return auto_ptr<InsetBase>(new InsetMathBox(*this));
34 }
35
36
37 void InsetMathBox::write(WriteStream & os) const
38 {
39         os << '\\' << name_ << '{' << cell(0) << '}';
40 }
41
42
43 void InsetMathBox::normalize(NormalStream & os) const
44 {
45         os << '[' << name_ << ' ';
46         //text_->write(buffer(), os);
47         os << "] ";
48 }
49
50
51 bool InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const
52 {
53         FontSetChanger dummy(mi.base, "textnormal");
54         cell(0).metrics(mi, dim);
55         metricsMarkers(dim);
56         if (dim_ == dim)
57                 return false;
58         dim_ = dim;
59         return true;
60 }
61
62
63 void InsetMathBox::draw(PainterInfo & pi, int x, int y) const
64 {
65         FontSetChanger dummy(pi.base, "textnormal");
66         cell(0).draw(pi, x, y);
67         drawMarkers(pi, x, y);
68 }
69
70
71 void InsetMathBox::infoize(odocstream & os) const
72 {
73         os << "Box: " << name_;
74 }
75
76
77 } // namespace lyx