2 * \file InsetMathFBox.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 "InsetMathFBox.h"
15 #include "MathStream.h"
18 #include "support/std_ostream.h"
19 #include "frontends/Painter.h"
24 InsetMathFBox::InsetMathFBox()
29 Inset * InsetMathFBox::clone() const
31 return new InsetMathFBox(*this);
35 InsetMath::mode_type InsetMathFBox::currentMode() const
41 void InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const
43 FontSetChanger dummy(mi.base, "textnormal");
44 cell(0).metrics(mi, dim);
45 metricsMarkers(dim, 3); // 1 pixel space, 1 frame, 1 space
46 // Cache the inset dimension.
51 void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
53 Dimension const dim = dimension(*pi.base.bv);
54 pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
55 dim.width() - 2, dim.height() - 2, Color::foreground);
56 FontSetChanger dummy(pi.base, "textnormal");
57 cell(0).draw(pi, x + 3, y);
58 setPosCache(pi, x, y);
62 void InsetMathFBox::write(WriteStream & os) const
64 os << "\\fbox{" << cell(0) << '}';
68 void InsetMathFBox::normalize(NormalStream & os) const
70 os << "[fbox " << cell(0) << ']';
74 void InsetMathFBox::infoize(odocstream & os) const