]> git.lyx.org Git - lyx.git/blob - src/mathed/dimension.h
replace (ascent, descent, width) triples by a structure 'dimension'
[lyx.git] / src / mathed / dimension.h
1 #ifndef DIMENSION_H
2 #define DIMENSION_H
3
4 class Dimension {
5 public:
6         /// constructor
7         Dimension() : w(0), a(0), d(0) {}
8         /// initialize data
9         Dimension(int ww, int aa, int dd) : w(ww), a(aa), d(dd) {}
10
11         /// glue horizontally
12         void operator+=(Dimension const & dim);
13         /// set to empty box
14         void clear() { w = a = d = 0; }
15         /// get height
16         int height() const { return a + d; }
17         /// get ascent
18         int ascent() const { return a; }
19         /// get descent
20         int descent() const { return d; }
21         /// get width
22         int width() const { return w; }
23
24 public: 
25         /// width
26         int w;
27         /// ascent
28         int a;
29         /// descent
30         int d;
31 };
32
33 #endif