]> git.lyx.org Git - lyx.git/blob - src/mathed/math_symbolinset.C
1ca489bd5b5f954c53ed405ca561da1302957a59
[lyx.git] / src / mathed / math_symbolinset.C
1 #include "math_symbolinset.h"
2 #include "math_parser.h"
3 #include "support.h"
4 #include "support/LOstream.h"
5
6
7 using std::ostream;
8
9 MathSymbolInset::MathSymbolInset(const latexkeys * l)
10         : sym_(l)
11 {}
12
13
14 MathInset * MathSymbolInset::clone() const
15 {
16         return new MathSymbolInset(*this);
17 }
18
19
20 void MathSymbolInset::write(ostream & os, bool /* fragile */) const
21 {
22         os << '\\' << sym_->name << ' ';
23 }
24
25
26 void MathSymbolInset::writeNormal(ostream & os) const
27 {
28         os << "[bigop " << sym_->name << "] ";
29 }
30
31
32 void MathSymbolInset::metrics(MathStyles st) const
33 {
34         size(st);
35         mathed_char_dim(LM_TC_SYMB, size_, sym_->id, ascent_, descent_, width_);
36 }
37
38
39 void MathSymbolInset::draw(Painter & pain, int x, int y) const
40 {  
41         xo(x);
42         yo(y);
43
44         drawChar(pain, LM_TC_SYMB, size_, x, y, sym_->id);
45 }
46
47
48 bool MathSymbolInset::isRelOp() const
49 {
50         return sym_->id == LM_leq || sym_->id == LM_geq;
51 }