3 #include "math_accentinset.h"
4 #include "mathed/support.h"
5 #include "math_parser.h"
6 #include "support/LOstream.h"
10 MathAccentInset::MathAccentInset(int f)
11 : MathInset(1), code(f)
15 MathInset * MathAccentInset::clone() const
17 return new MathAccentInset(*this);
20 void MathAccentInset::Metrics(MathStyles st)
23 ascent_ = xcell(0).ascent();
24 descent_ = xcell(0).descent();
25 width_ = xcell(0).width();
38 void MathAccentInset::draw(Painter & pain, int x, int y)
40 int const dw = width() - 2;
41 xcell(0).draw(pain, x, y);
42 x += (code == LM_not) ? (width() - dw) / 2 : 2;
43 mathed_draw_deco(pain, x, y - dy, dw, dh, code);
47 void MathAccentInset::Write(ostream & os, bool fragile) const
49 latexkeys const * l = lm_get_key_by_id(code, LM_TK_ACCENT);
50 os << '\\' << l->name;
56 cell(0).Write(os, fragile);
63 void MathAccentInset::WriteNormal(ostream & os) const
65 latexkeys const * l = lm_get_key_by_id(code, LM_TK_ACCENT);
66 os << "[accent " << l->name << " ";
68 cell(0).WriteNormal(os);