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"
17 #include "support/std_ostream.h"
18 #include "frontends/Painter.h"
23 InsetMathFBox::InsetMathFBox()
28 Inset * InsetMathFBox::clone() const
30 return new InsetMathFBox(*this);
34 InsetMath::mode_type InsetMathFBox::currentMode() const
40 void InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const
42 FontSetChanger dummy(mi.base, "textnormal");
43 cell(0).metrics(mi, dim);
44 metricsMarkers(dim, 3); // 1 pixel space, 1 frame, 1 space
45 // Cache the inset dimension.
50 void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
52 Dimension const dim = dimension(*pi.base.bv);
53 pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
54 dim.width() - 2, dim.height() - 2, Color_foreground);
55 FontSetChanger dummy(pi.base, "textnormal");
56 cell(0).draw(pi, x + 3, y);
57 setPosCache(pi, x, y);
61 void InsetMathFBox::write(WriteStream & os) const
63 os << "\\fbox{" << cell(0) << '}';
67 void InsetMathFBox::normalize(NormalStream & os) const
69 os << "[fbox " << cell(0) << ']';
73 void InsetMathFBox::infoize(odocstream & os) const