mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-19 14:30:00 +00:00
e89625ef28
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15026 a592a061-630c-0410-9148-cb99ea01b6c8
77 lines
1.4 KiB
C
77 lines
1.4 KiB
C
/**
|
|
* \file InsetMathBoxed.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author André Pönitz
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "InsetMathBoxed.h"
|
|
#include "MathData.h"
|
|
#include "MathMLStream.h"
|
|
#include "MathParser.h"
|
|
#include "MathStream.h"
|
|
#include "LaTeXFeatures.h"
|
|
#include "LColor.h"
|
|
|
|
#include "support/std_ostream.h"
|
|
#include "frontends/Painter.h"
|
|
|
|
using std::auto_ptr;
|
|
|
|
|
|
InsetMathBoxed::InsetMathBoxed()
|
|
: InsetMathNest(1)
|
|
{}
|
|
|
|
|
|
auto_ptr<InsetBase> InsetMathBoxed::doClone() const
|
|
{
|
|
return auto_ptr<InsetBase>(new InsetMathBoxed(*this));
|
|
}
|
|
|
|
|
|
void InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
|
|
{
|
|
cell(0).metrics(mi, dim);
|
|
metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
|
|
dim_ = dim;
|
|
}
|
|
|
|
|
|
void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
|
|
{
|
|
pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
|
|
dim_.width() - 2, dim_.height() - 2, LColor::foreground);
|
|
cell(0).draw(pi, x + 3, y);
|
|
setPosCache(pi, x, y);
|
|
}
|
|
|
|
|
|
void InsetMathBoxed::write(WriteStream & os) const
|
|
{
|
|
os << "\\boxed{" << cell(0) << '}';
|
|
}
|
|
|
|
|
|
void InsetMathBoxed::normalize(NormalStream & os) const
|
|
{
|
|
os << "[boxed " << cell(0) << ']';
|
|
}
|
|
|
|
|
|
void InsetMathBoxed::infoize(std::ostream & os) const
|
|
{
|
|
os << "Boxed: ";
|
|
}
|
|
|
|
|
|
void InsetMathBoxed::validate(LaTeXFeatures & features) const
|
|
{
|
|
features.require("amsmath");
|
|
}
|