2 * \file InsetMathBox.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathBox.h"
15 #include "MathStream.h"
16 #include "MathStream.h"
17 #include "support/std_ostream.h"
22 InsetMathBox::InsetMathBox(docstring const & name)
23 : InsetMathNest(1), name_(name)
27 Inset * InsetMathBox::clone() const
29 return new InsetMathBox(*this);
33 void InsetMathBox::write(WriteStream & os) const
35 os << '\\' << name_ << '{' << cell(0) << '}';
39 void InsetMathBox::normalize(NormalStream & os) const
41 os << '[' << name_ << ' ';
42 //text_->write(buffer(), os);
47 void InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const
49 FontSetChanger dummy(mi.base, "textnormal");
50 cell(0).metrics(mi, dim);
52 // Cache the inset dimension.
57 void InsetMathBox::draw(PainterInfo & pi, int x, int y) const
59 FontSetChanger dummy(pi.base, "textnormal");
60 cell(0).draw(pi, x, y);
61 drawMarkers(pi, x, y);
65 void InsetMathBox::infoize(odocstream & os) const
67 os << "Box: " << name_;