]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
move around stuff, remove unneeded declarations etc
[lyx.git] / src / mathed / math_kerninset.C
1 /**
2  * \file math_kerninset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_kerninset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "math_support.h"
17 #include "dimension.h"
18
19 using std::string;
20 using std::auto_ptr;
21
22
23 MathKernInset::MathKernInset()
24 {}
25
26
27 MathKernInset::MathKernInset(LyXLength const & w)
28         : wid_(w)
29 {}
30
31
32 MathKernInset::MathKernInset(string const & s)
33         : wid_(s)
34 {}
35
36
37 auto_ptr<InsetBase> MathKernInset::clone() const
38 {
39         return auto_ptr<InsetBase>(new MathKernInset(*this));
40 }
41
42
43 void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) const
44 {
45         dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
46         dim.asc = 0;
47         dim.des = 0;
48 }
49
50
51 void MathKernInset::draw(PainterInfo &, int, int) const
52 {}
53
54
55 void MathKernInset::write(WriteStream & os) const
56 {
57 #ifdef WITH_WARNINGS
58 #warning this crashs on startup!
59 #endif
60         //os << "\\kern" << wid_.asLatexString() << ' ';
61         os << "\\kern0mm ";
62 }
63
64
65 void MathKernInset::normalize(NormalStream & os) const
66 {
67         os << "[kern " << wid_.asLatexString() << ']';
68 }