]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
Prepare mathed for unified two-stage drawing
[lyx.git] / src / mathed / math_kerninset.C
1 #include <config.h>
2
3
4 #include "math_kerninset.h"
5 #include "math_extern.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
8 #include "math_support.h"
9
10
11 MathKernInset::MathKernInset()
12 {}
13
14
15 MathKernInset::MathKernInset(LyXLength const & w)
16         : wid_(w)
17 {}
18
19
20 MathKernInset::MathKernInset(string const & s)
21         : wid_(s)
22 {}
23
24
25 MathInset * MathKernInset::clone() const
26 {
27         return new MathKernInset(*this);
28 }
29
30
31 Dimension MathKernInset::metrics(MetricsInfo & mi) const
32 {
33         Dimension dim;
34         dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
35         dim.asc = 0;
36         dim.des = 0;
37         return dim;
38 }
39
40
41 void MathKernInset::draw(PainterInfo &, int, int) const
42 {}
43
44
45 void MathKernInset::write(WriteStream & os) const
46 {
47         os << "\\kern" << wid_.asLatexString() << ' ';
48 }
49
50
51 void MathKernInset::normalize(NormalStream & os) const
52 {
53         os << "[kern " << wid_.asLatexString() << ']';
54 }