X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Falignment.h;fp=source%2Falignment.h;h=c89148d1cadc826ac4db661780dfa823a08d5af9;hb=c1f038acb91eb3bfaa34dfd4729d19ed3f871a42;hp=0000000000000000000000000000000000000000;hpb=1b5097c11b1226e14e23a0827c5238ba5d3ba444;p=libs%2Fgltk.git diff --git a/source/alignment.h b/source/alignment.h new file mode 100644 index 0000000..c89148d --- /dev/null +++ b/source/alignment.h @@ -0,0 +1,25 @@ +#ifndef MSP_GLTK_ALIGNMENT_H_ +#define MSP_GLTK_ALIGNMENT_H_ + +namespace Msp { +namespace GLtk { + +class Geometry; + +/** +Handles alignment of widget parts. Both x and y components can have values -1 +(left / bottom), 0 (center) or 1 (right / top). +*/ +struct Alignment +{ + int x, y; + + Alignment(): x(0), y(0) { } + Alignment(int x_, int y_): x(x_), y(y_) { } + void apply(const Geometry &, unsigned, unsigned) const; +}; + +} // namespace GLtk +} // namespace Msp + +#endif