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, int, int)
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 xcell(0).draw(pain, x, y);
41 mathed_draw_deco(pain, x, y - dy, width(), dh, code);
45 void MathAccentInset::Write(ostream & os, bool fragile) const
47 latexkeys const * l = lm_get_key_by_id(code, LM_TK_ACCENT);
48 os << '\\' << l->name;
54 cell(0).Write(os, fragile);
61 void MathAccentInset::WriteNormal(ostream & os) const
63 latexkeys const * l = lm_get_key_by_id(code, LM_TK_ACCENT);
64 os << "[accent " << l->name << " ";
66 cell(0).WriteNormal(os);