]> git.tdb.fi Git - libs/gltk.git/blob - source/alignment.h
Initial revision
[libs/gltk.git] / source / alignment.h
1 #ifndef MSP_GLTK_ALIGNMENT_H_
2 #define MSP_GLTK_ALIGNMENT_H_
3
4 namespace Msp {
5 namespace GLtk {
6
7 class Geometry;
8
9 /**
10 Handles alignment of widget parts.  Both x and y components can have values -1
11 (left / bottom), 0 (center) or 1 (right / top).
12 */
13 struct Alignment
14 {
15         int x, y;
16
17         Alignment(): x(0), y(0) { }
18         Alignment(int x_, int y_): x(x_), y(y_) { }
19         void apply(const Geometry &, unsigned, unsigned) const;
20 };
21
22 } // namespace GLtk
23 } // namespace Msp
24
25 #endif