]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
Reduce Michael's buglist.
[lyx.git] / src / mathed / math_kerninset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_kerninset.h"
6 #include "math_mathmlstream.h"
7 #include "math_support.h"
8
9
10 MathKernInset::MathKernInset()
11 {}
12
13
14 MathKernInset::MathKernInset(LyXLength const & w)
15         : wid_(w)
16 {}
17
18
19 MathKernInset::MathKernInset(string const & s)
20         : wid_(s)
21 {}
22
23
24 MathInset * MathKernInset::clone() const
25 {
26         return new MathKernInset(*this);
27 }
28
29
30 void MathKernInset::draw(Painter &, int, int) const
31 {}
32
33
34 void MathKernInset::metrics(MathMetricsInfo const &) const
35 {
36         ascent_  = 0;
37         descent_ = 0;
38 #ifdef WITH_WARNINGS
39 #warning fix this once the interface to LyXLength has improved
40 #endif
41         // this uses the numerical valu in pixels, even if the unit is cm or ex!
42         width_   = static_cast<int>(wid_.value());
43         //cerr << "handling kern of width " << wid_.value() << "\n";
44 }
45
46
47 void MathKernInset::write(WriteStream & os) const
48 {
49         os << "\\kern" << wid_.asLatexString().c_str() << " ";
50 }
51
52
53 void MathKernInset::normalize(NormalStream & os) const
54 {
55         os << "[kern " << wid_.asLatexString().c_str() << "]";
56 }
57