]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathKern.cpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / mathed / InsetMathKern.cpp
1 /**
2  * \file InsetMathKern.cpp
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 "InsetMathKern.h"
14 #include "MathStream.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17 #include "Dimension.h"
18
19
20 namespace lyx {
21
22 using std::string;
23 using std::auto_ptr;
24
25
26 InsetMathKern::InsetMathKern()
27 {
28 }
29
30
31 InsetMathKern::InsetMathKern(Length const & w)
32         : wid_(w)
33 {
34 }
35
36
37 InsetMathKern::InsetMathKern(docstring const & s)
38         : wid_(to_utf8(s))
39 {
40 }
41
42
43 auto_ptr<Inset> InsetMathKern::doClone() const
44 {
45         return auto_ptr<Inset>(new InsetMathKern(*this));
46 }
47
48
49 bool InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const
50 {
51         dim.asc = 0;
52         dim.des = 0;
53         dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
54         if (dim == dim_)
55                 return false;
56         dim_ = dim;
57         return true;
58 }
59
60
61 void InsetMathKern::draw(PainterInfo &, int, int) const
62 {}
63
64
65 void InsetMathKern::write(WriteStream & os) const
66 {
67         os << "\\kern" << from_utf8(wid_.asLatexString()) << ' ';
68 }
69
70
71 void InsetMathKern::normalize(NormalStream & os) const
72 {
73         os << "[kern " << from_utf8(wid_.asLatexString()) << ']';
74 }
75
76
77 } // namespace lyx