2 * \file InsetMathBoxed.C
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 "InsetMathBoxed.h"
15 #include "MathStream.h"
16 #include "MathParser.h"
17 #include "MathStream.h"
18 #include "LaTeXFeatures.h"
21 #include "support/std_ostream.h"
22 #include "frontends/Painter.h"
30 InsetMathBoxed::InsetMathBoxed()
35 auto_ptr<InsetBase> InsetMathBoxed::doClone() const
37 return auto_ptr<InsetBase>(new InsetMathBoxed(*this));
41 void InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
43 cell(0).metrics(mi, dim);
44 metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
49 void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
51 pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
52 dim_.width() - 2, dim_.height() - 2, LColor::foreground);
53 cell(0).draw(pi, x + 3, y);
54 setPosCache(pi, x, y);
58 void InsetMathBoxed::write(WriteStream & os) const
60 os << "\\boxed{" << cell(0) << '}';
64 void InsetMathBoxed::normalize(NormalStream & os) const
66 os << "[boxed " << cell(0) << ']';
70 void InsetMathBoxed::infoize(odocstream & os) const
76 void InsetMathBoxed::validate(LaTeXFeatures & features) const
78 features.require("amsmath");