]> git.lyx.org Git - lyx.git/blob - src/mathed/math_dotsinset.C
some support for matrix operations with maple ('M-x math-extern maple evalm')
[lyx.git] / src / mathed / math_dotsinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_dotsinset.h"
6 #include "math_mathmlstream.h"
7 #include "math_support.h"
8
9
10 MathDotsInset::MathDotsInset(string const & name)
11         : name_(name)
12 {}
13
14
15 MathInset * MathDotsInset::clone() const
16 {
17         return new MathDotsInset(*this);
18 }     
19
20
21 void MathDotsInset::draw(Painter & pain, int x, int y) const
22 {
23         mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
24         char const c = name_[0];
25         if (c == 'v' || c == 'd')
26                 ++x;
27         if (c != 'v')
28                 --y;
29         mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
30 }
31
32
33 void MathDotsInset::metrics(MathMetricsInfo const & mi) const
34 {
35         mathed_char_dim(LM_TC_VAR, mi, 'M', ascent_, descent_, width_);
36         switch (name_[0]) {
37                 case 'l': dh_ = 0; break;
38                 case 'c': dh_ = ascent_ / 2; break;
39                 case 'v': width_ /= 2;
40                 case 'd': dh_ = ascent_; break;
41         }
42
43
44
45 void MathDotsInset::write(WriteStream & os) const
46 {
47         os << '\\' << name_.c_str() << ' ';
48 }
49
50
51 void MathDotsInset::normalize(NormalStream & os) const
52 {
53         os << "[" << name_.c_str() << "] ";
54 }