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