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