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 bool InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
43 cell(0).metrics(mi, dim);
44 metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
52 void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
54 pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
55 dim_.width() - 2, dim_.height() - 2, LColor::foreground);
56 cell(0).draw(pi, x + 3, y);
57 setPosCache(pi, x, y);
61 void InsetMathBoxed::write(WriteStream & os) const
63 os << "\\boxed{" << cell(0) << '}';
67 void InsetMathBoxed::normalize(NormalStream & os) const
69 os << "[boxed " << cell(0) << ']';
73 void InsetMathBoxed::infoize(odocstream & os) const
79 void InsetMathBoxed::validate(LaTeXFeatures & features) const
81 features.require("amsmath");