]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/geometry.h
Enable loading of entry widgets from datafiles
[libs/gltk.git] / source / geometry.h
index fdef8ace97d45557d9450f4fca535c3fc2446e01..6559414dd0497ae5cdd8a8e8a0136ed6af062876 100644 (file)
@@ -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;
+
+       Alignment(): x(0), y(0) { }
+       Alignment(float x_, float y_): x(x_), y(y_) { }
+       void apply(Geometry &, const Geometry &) const;
+       void apply(Geometry &, const Geometry &, const Sides &) const;
+};
+
 } // namespace GLtk
 } // namespace Msp