]> git.lyx.org Git - lyx.git/blob - src/mathed/math_notinset.C
use stream-like syntax for LaTeX output
[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(MathWriteInfo & os) 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(MathMetricsInfo const & st) const
32 {
33         size_ = st;
34         if (math_font_available(LM_TC_CMSY))
35                 mathed_char_dim(LM_TC_CMSY, size(), 54, ascent_, descent_, width_);
36         else
37                 mathed_char_dim(LM_TC_VAR, size(), '/', ascent_, descent_, width_);
38         width_ = 0;
39 }
40
41
42 void MathNotInset::draw(Painter & pain, int x, int y) const
43 {  
44         xo(x);
45         yo(y);
46
47         if (math_font_available(LM_TC_CMSY))
48                 drawChar(pain, LM_TC_CMSY, size(), x, y, 54);
49         else
50                 drawChar(pain, LM_TC_VAR, size(), x, y, '/');
51 }