2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file math_parinset.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-09-11 09:14:57 +00:00
|
|
|
|
|
2002-08-26 11:27:37 +00:00
|
|
|
|
#include <config.h>
|
2002-07-08 13:35:26 +00:00
|
|
|
|
|
|
|
|
|
#include "math_parinset.h"
|
2003-09-07 21:25:37 +00:00
|
|
|
|
#include "math_data.h"
|
2002-07-08 13:35:26 +00:00
|
|
|
|
#include "math_mathmlstream.h"
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_ostream.h"
|
2002-08-23 11:24:55 +00:00
|
|
|
|
|
2002-09-11 09:14:57 +00:00
|
|
|
|
|
2005-02-23 12:01:50 +00:00
|
|
|
|
using std::auto_ptr;
|
|
|
|
|
|
|
|
|
|
|
2002-08-23 11:24:55 +00:00
|
|
|
|
MathParInset::MathParInset(MathArray const & ar)
|
|
|
|
|
{
|
|
|
|
|
cells_[0] = ar;
|
|
|
|
|
}
|
2002-07-08 13:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void MathParInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-07-08 13:35:26 +00:00
|
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
|
FontSetChanger dummy1(mi.base, "textnormal");
|
2002-07-08 13:35:26 +00:00
|
|
|
|
MathGridInset::metrics(mi);
|
2003-06-02 10:03:27 +00:00
|
|
|
|
dim = dim_;
|
2002-07-08 13:35:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
|
void MathParInset::draw(PainterInfo & pi, int x, int y) const
|
2002-07-08 13:35:26 +00:00
|
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
|
FontSetChanger dummy1(pi.base, "textnormal");
|
2002-07-08 13:35:26 +00:00
|
|
|
|
MathGridInset::draw(pi, x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathParInset::write(WriteStream & os) const
|
|
|
|
|
{
|
|
|
|
|
for (idx_type i = 0; i < nargs(); ++i)
|
|
|
|
|
os << cell(i) << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathParInset::infoize(std::ostream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << "Type: Paragraph ";
|
|
|
|
|
}
|
2005-02-23 12:01:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto_ptr<InsetBase> MathParInset::doClone() const
|
|
|
|
|
{
|
|
|
|
|
return auto_ptr<InsetBase>(new MathParInset(*this));
|
|
|
|
|
}
|