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"
15 #include "MathStream.h"
16 #include "LaTeXFeatures.h"
19 #include "support/std_ostream.h"
20 #include "frontends/Painter.h"
25 InsetMathBoxed::InsetMathBoxed()
30 Inset * InsetMathBoxed::clone() const
32 return new InsetMathBoxed(*this);
36 bool InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
38 cell(0).metrics(mi, dim);
39 metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
47 void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
49 pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
50 dim_.width() - 2, dim_.height() - 2, Color::foreground);
51 cell(0).draw(pi, x + 3, y);
52 setPosCache(pi, x, y);
56 void InsetMathBoxed::write(WriteStream & os) const
58 os << "\\boxed{" << cell(0) << '}';
62 void InsetMathBoxed::normalize(NormalStream & os) const
64 os << "[boxed " << cell(0) << ']';
68 void InsetMathBoxed::infoize(odocstream & os) const
74 void InsetMathBoxed::validate(LaTeXFeatures & features) const
76 features.require("amsmath");