2 * \file InsetMathBoxed.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 "InsetMathBoxed.h"
14 #include "MathArray.h"
15 #include "MathStream.h"
16 #include "LaTeXFeatures.h"
19 #include "support/std_ostream.h"
20 #include "frontends/Painter.h"
28 InsetMathBoxed::InsetMathBoxed()
33 auto_ptr<InsetBase> InsetMathBoxed::doClone() const
35 return auto_ptr<InsetBase>(new InsetMathBoxed(*this));
39 bool InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
41 cell(0).metrics(mi, dim);
42 metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
50 void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
52 pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
53 dim_.width() - 2, dim_.height() - 2, LColor::foreground);
54 cell(0).draw(pi, x + 3, y);
55 setPosCache(pi, x, y);
59 void InsetMathBoxed::write(WriteStream & os) const
61 os << "\\boxed{" << cell(0) << '}';
65 void InsetMathBoxed::normalize(NormalStream & os) const
67 os << "[boxed " << cell(0) << ']';
71 void InsetMathBoxed::infoize(odocstream & os) const
77 void InsetMathBoxed::validate(LaTeXFeatures & features) const
79 features.require("amsmath");