X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgeometry.h;h=6fa8e7f1287ffd1f39942979f1f046889bc97ecc;hb=8f6f543758fb1b2b17ae2db519198d420eb9982d;hp=fdef8ace97d45557d9450f4fca535c3fc2446e01;hpb=131ac8ff2c06f94d40f4bf98d4a6ec0d113cdffc;p=libs%2Fgltk.git diff --git a/source/geometry.h b/source/geometry.h index fdef8ac..6fa8e7f 100644 --- a/source/geometry.h +++ b/source/geometry.h @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of libmspgltk +Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #ifndef MSP_GLTK_GEOMETRY_H_ #define MSP_GLTK_GEOMETRY_H_ @@ -19,6 +26,7 @@ struct Geometry bool is_inside(int, int) const; }; + /** Specifies margins on the sides of an element. */ @@ -41,6 +49,20 @@ struct Sides Sides(); }; + +/** +Performs alignment of nested geometries, such as widgets and their parts. +*/ +struct Alignment +{ + float x, y; + float w, h; + + Alignment(): x(0), y(0), w(1), h(1) { } + void apply(Geometry &, const Geometry &) const; + void apply(Geometry &, const Geometry &, const Sides &) const; +}; + } // namespace GLtk } // namespace Msp