2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
#include "math_boxinset.h"
|
2002-01-03 12:02:54 +00:00
|
|
|
#include "math_support.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2002-07-10 09:09:48 +00:00
|
|
|
#include "support/LOstream.h"
|
2001-10-19 11:25:48 +00:00
|
|
|
|
2002-01-03 12:02:54 +00:00
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
MathBoxInset::MathBoxInset(string const & name)
|
2002-07-11 10:20:31 +00:00
|
|
|
: MathNestInset(1), name_(name)
|
2001-10-19 16:07:10 +00:00
|
|
|
{}
|
2001-10-19 11:25:48 +00:00
|
|
|
|
|
|
|
|
2003-06-16 11:49:38 +00:00
|
|
|
InsetBase * MathBoxInset::clone() const
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
|
|
|
return new MathBoxInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathBoxInset::write(WriteStream & os) const
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << '\\' << name_ << '{' << cell(0) << '}';
|
2001-10-19 11:25:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathBoxInset::normalize(NormalStream & os) const
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
2001-12-18 12:21:33 +00:00
|
|
|
os << '[' << name_ << ' ';
|
2001-10-19 11:25:48 +00:00
|
|
|
//text_->write(buffer(), os);
|
|
|
|
os << "] ";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
void MathBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
FontSetChanger dummy(mi.base, "textnormal");
|
2003-05-28 13:22:36 +00:00
|
|
|
cell(0).metrics(mi, dim_);
|
|
|
|
metricsMarkers();
|
2003-06-02 10:03:27 +00:00
|
|
|
dim = dim_;
|
2002-06-04 09:06:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathBoxInset::draw(PainterInfo & pi, int x, int y) const
|
2002-06-04 09:06:04 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
FontSetChanger dummy(pi.base, "textnormal");
|
2002-08-02 14:29:42 +00:00
|
|
|
cell(0).draw(pi, x, y);
|
2003-05-28 13:22:36 +00:00
|
|
|
drawMarkers(pi, x, y);
|
2001-10-24 19:09:31 +00:00
|
|
|
}
|
2002-07-10 07:15:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
void MathBoxInset::infoize(std::ostream & os) const
|
|
|
|
{
|
|
|
|
os << "Box: " << name_;
|
|
|
|
}
|