5 #include "math_spaceinset.h"
6 #include "math_support.h"
9 #include "math_mathmlstream.h"
13 MathSpaceInset::MathSpaceInset(int sp)
18 MathInset * MathSpaceInset::clone() const
20 return new MathSpaceInset(*this);
24 void MathSpaceInset::metrics(MathMetricsInfo const & mi) const
26 width_ = space_ ? space_ * 2 : 2;
37 void MathSpaceInset::draw(Painter & pain, int x, int y) const
40 // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
42 // Sadly, HP-UX CC can't handle that kind of initialization.
47 xp[0] = ++x; yp[0] = y - 3;
49 xp[2] = x + width_ - 2; yp[2] = y;
50 xp[3] = x + width_ - 2; yp[3] = y - 3;
52 pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
56 void MathSpaceInset::incSpace()
58 space_ = (space_ + 1) % 6;
62 void MathSpaceInset::maplize(MapleStream & os) const
68 void MathSpaceInset::octavize(OctaveStream & os) const
74 void MathSpaceInset::normalize(NormalStream & os) const
76 os << "[space " << space_ << "] ";
80 void MathSpaceInset::write(WriteStream & os) const
82 if (space_ >= 0 && space_ < 6)
83 os << '\\' << latex_mathspace[space_] << ' ';