3 #include "math_bigopinset.h"
6 #include "mathed/support.h"
7 #include "support/LOstream.h"
11 MathBigopInset::MathBigopInset(string const & nam, int id, short st)
12 : MathedInset(nam, LM_OT_BIGOP, st), lims_(-1), sym_(id)
16 MathedInset * MathBigopInset::Clone()
18 return new MathBigopInset(name, sym_, GetStyle());
23 MathBigopInset::draw(Painter & pain, int x, int y)
28 if (sym_ < 256 || sym_ == LM_oint) {
29 s += (sym_ == LM_oint) ? LM_int : sym_;
35 if (sym_ == LM_oint) {
36 pain.arc(x, y - 5 * width / 4, width, width, 0, 360 * 64,
40 pain.text(x, y, s, mathed_get_font(t, size()));
44 void MathBigopInset::Write(ostream & os, bool /* fragile */)
46 bool const limp = GetLimits();
50 if (limp && !(sym_ != LM_int && sym_ != LM_oint
51 && (GetStyle() == LM_ST_DISPLAY)))
54 if (!limp && (sym_ != LM_int && sym_ != LM_oint
55 && (GetStyle() == LM_ST_DISPLAY)))
62 void MathBigopInset::WriteNormal(ostream & os)
64 bool const limp = GetLimits();
66 os << "{bigop " << name;
68 if (limp && !(sym_ != LM_int && sym_ != LM_oint
69 && (GetStyle() == LM_ST_DISPLAY)))
72 if (!limp && (sym_ != LM_int && sym_ != LM_oint
73 && (GetStyle() == LM_ST_DISPLAY)))
79 void MathBigopInset::Metrics()
85 if (sym_ < 256 || sym_ == LM_oint) {
86 char const c = (sym_ == LM_oint) ? LM_int: sym_;
93 mathed_string_height(t, size(), s, ascent, descent);
94 width = mathed_string_width(t, size(), s);
95 if (sym_ == LM_oint) width += 2;
99 bool MathBigopInset::GetLimits() const
103 return sym_ != LM_int &&
105 GetStyle() == LM_ST_DISPLAY;
113 void MathBigopInset::SetLimits(bool ls)