]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
Finish the task of removing all cruft from the header files.
[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::auto_ptr;
20
21
22 MathKernInset::MathKernInset()
23 {}
24
25
26 MathKernInset::MathKernInset(LyXLength const & w)
27         : wid_(w)
28 {}
29
30
31 MathKernInset::MathKernInset(string const & s)
32         : wid_(s)
33 {}
34
35
36 auto_ptr<InsetBase> MathKernInset::clone() const
37 {
38         return auto_ptr<InsetBase>(new MathKernInset(*this));
39 }
40
41
42 void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) const
43 {
44         dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
45         dim.asc = 0;
46         dim.des = 0;
47 }
48
49
50 void MathKernInset::draw(PainterInfo &, int, int) const
51 {}
52
53
54 void MathKernInset::write(WriteStream & os) const
55 {
56         os << "\\kern" << wid_.asLatexString() << ' ';
57 }
58
59
60 void MathKernInset::normalize(NormalStream & os) const
61 {
62         os << "[kern " << wid_.asLatexString() << ']';
63 }