2016-10-04 22:25:38 +00:00
|
|
|
/**
|
|
|
|
* \file InsetMathClass.cpp
|
|
|
|
* 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 "InsetMathClass.h"
|
|
|
|
|
|
|
|
#include "support/docstream.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
InsetMathClass::InsetMathClass(Buffer * buf, MathClass mc)
|
|
|
|
: InsetMathNest(buf, 1), math_class_(mc)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
Inset * InsetMathClass::clone() const
|
|
|
|
{
|
|
|
|
return new InsetMathClass(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-09 08:39:49 +00:00
|
|
|
Limits InsetMathClass::defaultLimits(bool display) const
|
|
|
|
{
|
|
|
|
if (allowsLimitsChange() && display)
|
|
|
|
return LIMITS;
|
|
|
|
else
|
|
|
|
return NO_LIMITS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-10-04 22:25:38 +00:00
|
|
|
void InsetMathClass::metrics(MetricsInfo & mi, Dimension & dim) const
|
|
|
|
{
|
|
|
|
cell(0).metrics(mi, dim);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InsetMathClass::draw(PainterInfo & pi, int x, int y) const
|
|
|
|
{
|
2017-01-06 08:52:10 +00:00
|
|
|
cell(0).draw(pi, x, y);
|
2016-10-04 22:25:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-26 19:04:36 +00:00
|
|
|
void InsetMathClass::write(TeXMathStream & os) const
|
2020-12-09 08:39:49 +00:00
|
|
|
{
|
|
|
|
InsetMathNest::write(os);
|
|
|
|
writeLimits(os);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-10-04 22:25:38 +00:00
|
|
|
docstring InsetMathClass::name() const
|
|
|
|
{
|
|
|
|
return class_to_string(math_class_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InsetMathClass::infoize(odocstream & os) const
|
|
|
|
{
|
|
|
|
os << name() << " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|