]> git.lyx.org Git - lyx.git/blob - src/mathed/math_xarrowinset.C
fix typo that put too many include paths for most people
[lyx.git] / src / mathed / math_xarrowinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_xarrowinset.h"
8 #include "math_support.h"
9 #include "math_parser.h"
10 #include "math_mathmlstream.h"
11 #include "math_streamstr.h"
12
13
14 MathXArrowInset::MathXArrowInset(string const & name)
15         : MathNestInset(1), name_(name)
16 {}
17
18
19 MathInset * MathXArrowInset::clone() const
20 {
21         return new MathXArrowInset(*this);
22 }
23
24
25 void MathXArrowInset::metrics(MathMetricsInfo const & st) const
26 {
27         MathMetricsInfo mi = st;
28         smallerStyleScript(mi);
29         xcell(0).metrics(mi);
30         width_   = xcell(0).width() + 10;
31         ascent_  = xcell(0).height() + 10;
32         descent_ = 0;
33 }
34
35
36 void MathXArrowInset::draw(Painter & pain, int x, int y) const
37 {
38         xcell(0).draw(pain, x + 5, y - 10);
39         mathed_draw_deco(pain, x + 1, y - 7, width_ - 2, 5, name_);
40 }
41
42
43 void MathXArrowInset::write(WriteStream & os) const
44 {
45         os << '\\' << name_ << '{' << cell(0) << '}';
46 }
47
48
49 void MathXArrowInset::normalize(NormalStream & os) const
50 {
51         os << "[xarrow " << name_ << ' ' <<  cell(0) << ']';
52 }