2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file math_substackinset.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2002-02-14 14:52:23 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "math_substackinset.h"
|
|
|
|
|
#include "math_mathmlstream.h"
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_ostream.h"
|
2002-02-14 14:52:23 +00:00
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
using std::auto_ptr;
|
|
|
|
|
|
2002-02-14 14:52:23 +00:00
|
|
|
|
|
|
|
|
|
MathSubstackInset::MathSubstackInset()
|
|
|
|
|
: MathGridInset(1, 1)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
auto_ptr<InsetBase> MathSubstackInset::clone() const
|
2002-02-14 14:52:23 +00:00
|
|
|
|
{
|
2003-07-25 17:11:25 +00:00
|
|
|
|
return auto_ptr<InsetBase>(new MathSubstackInset(*this));
|
2002-02-14 14:52:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void MathSubstackInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-02-14 14:52:23 +00:00
|
|
|
|
{
|
2002-05-30 07:09:54 +00:00
|
|
|
|
if (mi.base.style == LM_ST_DISPLAY) {
|
2003-03-21 14:20:48 +00:00
|
|
|
|
StyleChanger dummy(mi.base, LM_ST_TEXT);
|
2002-05-30 07:09:54 +00:00
|
|
|
|
MathGridInset::metrics(mi);
|
|
|
|
|
} else {
|
|
|
|
|
MathGridInset::metrics(mi);
|
|
|
|
|
}
|
2003-05-28 13:22:36 +00:00
|
|
|
|
metricsMarkers();
|
2003-06-02 10:03:27 +00:00
|
|
|
|
dim = dim_;
|
2003-05-14 16:29:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const
|
|
|
|
|
{
|
|
|
|
|
MathGridInset::draw(pi, x + 1, y);
|
2003-05-28 13:22:36 +00:00
|
|
|
|
drawMarkers(pi, x, y);
|
2003-05-14 16:29:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathSubstackInset::infoize(std::ostream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << "Substack ";
|
2002-02-14 14:52:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathSubstackInset::write(WriteStream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << "\\substack{";
|
|
|
|
|
MathGridInset::write(os);
|
|
|
|
|
os << "}\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathSubstackInset::normalize(NormalStream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << "[substack ";
|
|
|
|
|
MathGridInset::normalize(os);
|
2002-11-27 10:30:28 +00:00
|
|
|
|
os << ']';
|
2002-02-14 14:52:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void MathSubstackInset::maple(MapleStream & os) const
|
2002-02-14 14:52:23 +00:00
|
|
|
|
{
|
|
|
|
|
os << "substack(";
|
2003-02-14 14:30:09 +00:00
|
|
|
|
MathGridInset::maple(os);
|
2002-11-27 10:30:28 +00:00
|
|
|
|
os << ')';
|
2002-02-14 14:52:23 +00:00
|
|
|
|
}
|