3 #include "math_bigopinset.h"
6 #include "mathed/support.h"
7 #include "support/LOstream.h"
11 bool MathBigopInset::GetLimits() const
15 return sym != LM_int && sym != LM_oint && GetStyle() == LM_ST_DISPLAY;
23 void MathBigopInset::SetLimits(bool ls)
29 MathBigopInset::MathBigopInset(string const & nam, int id, short st)
30 : MathedInset(nam, LM_OT_BIGOP, st), sym(id)
36 MathedInset * MathBigopInset::Clone()
38 return new MathBigopInset(name, sym, GetStyle());
43 MathBigopInset::draw(Painter & pain, int x, int y)
48 if (sym < 256 || sym == LM_oint) {
49 s += (sym == LM_oint) ? LM_int : sym;
56 pain.arc(x, y - 5 * width / 4, width, width, 0, 360*64,
60 pain.text(x, y, s, mathed_get_font(t, size()));
65 MathBigopInset::Metrics()
71 if (sym < 256 || sym == LM_oint) {
72 char c = (sym == LM_oint) ? LM_int: sym;
79 mathed_string_height(t, size(), s, ascent, descent);
80 width = mathed_string_width(t, size(), s);
81 if (sym == LM_oint) width += 2;
85 void MathBigopInset::Write(ostream & os, bool /* fragile */)
87 bool limp = GetLimits();
91 if (limp && !(sym != LM_int && sym != LM_oint
92 && (GetStyle() == LM_ST_DISPLAY)))
95 if (!limp && (sym != LM_int && sym != LM_oint
96 && (GetStyle() == LM_ST_DISPLAY)))