2 * \file math_fboxinset.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 "math_fboxinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_parser.h"
17 #include "math_streamstr.h"
20 #include "support/std_ostream.h"
21 #include "frontends/Painter.h"
26 MathFboxInset::MathFboxInset()
31 auto_ptr<InsetBase> MathFboxInset::doClone() const
33 return auto_ptr<InsetBase>(new MathFboxInset(*this));
37 MathInset::mode_type MathFboxInset::currentMode() const
43 void MathFboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
45 FontSetChanger dummy(mi.base, "textnormal");
46 cell(0).metrics(mi, dim);
47 metricsMarkers(dim, 3); // 1 pixel space, 1 frame, 1 space
52 void MathFboxInset::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 FontSetChanger dummy(pi.base, "textnormal");
57 cell(0).draw(pi, x + 3, y);
58 setPosCache(pi, x, y);
62 void MathFboxInset::write(WriteStream & os) const
64 os << "\\fbox{" << cell(0) << '}';
68 void MathFboxInset::normalize(NormalStream & os) const
70 os << "[fbox " << cell(0) << ']';
74 void MathFboxInset::infoize(std::ostream & os) const