3 #include "math_deliminset.h"
5 #include "math_parser.h"
8 #include "mathed/support.h"
9 #include "support/LOstream.h"
14 MathDelimInset::MathDelimInset(int l, int r, short st)
15 : MathParInset(st, "", LM_OT_DELIM), left(l), right(r) {}
18 MathedInset * MathDelimInset::Clone()
20 MathDelimInset * p = new MathDelimInset(left, right, GetStyle());
22 p->SetData(it.Copy());
28 void MathDelimInset::Write(ostream & os, bool fragile)
30 latexkeys * l = (left != '|') ? lm_get_key_by_id(left, LM_TK_SYM): 0;
31 latexkeys * r = (right != '|') ? lm_get_key_by_id(right, LM_TK_SYM): 0;
34 os << '\\' << l->name << ' ';
36 if (left == '{' || left == '}') {
37 os << '\\' << char(left) << ' ';
39 os << char(left) << ' ';
42 MathParInset::Write(os, fragile);
45 os << '\\' << r->name << ' ';
47 if (right == '{' || right == '}') {
48 os << '\\' << char(right) << ' ';
50 os << char(right) << ' ';
58 MathDelimInset::draw(Painter & pain, int x, int y)
61 MathParInset::draw(pain, x + dw + 2, y - dh);
64 pain.line(x + 4, yo - ascent,
66 LColor::mathcursor, Painter::line_onoffdash);
68 mathed_draw_deco(pain, x, y - ascent, dw, Height(), left);
69 x += Width() - dw - 2;
71 pain.line(x + 4, yo - ascent,
73 LColor::mathcursor, Painter::line_onoffdash);
75 mathed_draw_deco(pain, x, y-ascent, dw, Height(), right);
80 MathDelimInset::Metrics()
82 MathParInset::Metrics();
85 mathed_char_height(LM_TC_CONST, size, 'I', d, dh);