]> git.lyx.org Git - lyx.git/blob - src/mathed/math_notinset.C
new special-purpose inset for \not
[lyx.git] / src / mathed / math_notinset.C
1 #include "math_notinset.h"
2 #include "math_parser.h"
3 #include "support.h"
4 #include "support/LOstream.h"
5
6
7 using std::ostream;
8
9 MathNotInset::MathNotInset()
10 {}
11
12
13 MathInset * MathNotInset::clone() const
14 {
15         return new MathNotInset(*this);
16 }
17
18
19 void MathNotInset::write(ostream & os, bool /* fragile */) const
20 {
21         os << "\\not ";
22 }
23
24
25 void MathNotInset::writeNormal(ostream & os) const
26 {
27         os << "[not] ";
28 }
29
30
31 void MathNotInset::metrics(MathStyles st) const
32 {
33         size(st);
34         mathed_char_dim(LM_TC_VAR, size_, '/', ascent_, descent_, width_);
35         width_ = 1;
36 }
37
38
39 void MathNotInset::draw(Painter & pain, int x, int y) const
40 {  
41         xo(x);
42         yo(y);
43
44         drawChar(pain, LM_TC_VAR, size_, x + 4, y, '/');
45 }