7 #include "math_spaceinset.h"
10 #include "mathed/support.h"
11 #include "support/LOstream.h"
16 MathSpaceInset::MathSpaceInset(int sp, short ot, short st)
17 : MathedInset("", ot, st), space_(sp)
21 MathedInset * MathSpaceInset::Clone()
23 return new MathSpaceInset(space_, GetType(), GetStyle());
27 void MathSpaceInset::draw(Painter & pain, int x, int y)
30 // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
32 // Sadly, HP-UX CC can't handle that kind of initialization.
37 xp[0] = ++x; yp[0] = y - 3;
39 xp[2] = x + width - 2; yp[2] = y;
40 xp[3] = x + width - 2; yp[3] = y - 3;
42 pain.lines(xp, yp, 4, (space_) ? LColor::latex : LColor::math);
46 void MathSpaceInset::Write(ostream & os, bool /* fragile */)
48 if (space_ >= 0 && space_ < 6) {
49 os << '\\' << latex_mathspace[space_] << ' ';
53 void MathSpaceInset::WriteNormal(ostream & os)
55 os << "[space " << space_ << "] ";
59 void MathSpaceInset::Metrics()
61 width = space_ ? space_ * 2 : 2;
72 void MathSpaceInset::SetSpace(int sp)
79 int MathSpaceInset::GetSpace()