]> git.lyx.org Git - lyx.git/blob - src/mathed/dimension.h
forgotten files
[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 width
20         int width() const { return w; }
21
22 public: 
23         /// width
24         int w;
25         /// ascent
26         int a;
27         /// descent
28         int d;
29 };
30
31 #endif