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"
16 #include "MathStream.h"
17 #include "MetricsInfo.h"
24 InsetMathBox::InsetMathBox(docstring const & name)
25 : InsetMathNest(1), name_(name)
29 Inset * InsetMathBox::clone() const
31 return new InsetMathBox(*this);
35 void InsetMathBox::write(WriteStream & os) const
37 os << '\\' << name_ << '{' << cell(0) << '}';
41 void InsetMathBox::normalize(NormalStream & os) const
43 os << '[' << name_ << ' ';
44 //text_->write(buffer(), os);
49 void InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const
51 FontSetChanger dummy(mi.base, "textnormal");
52 cell(0).metrics(mi, dim);
54 // Cache the inset dimension.
59 void InsetMathBox::draw(PainterInfo & pi, int x, int y) const
61 FontSetChanger dummy(pi.base, "textnormal");
62 cell(0).draw(pi, x, y);
63 drawMarkers(pi, x, y);
67 void InsetMathBox::infoize(odocstream & os) const
69 os << "Box: " << name_;