]> 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 6dc982727070ed2f09dbd357f94963922ee8d8e1..6559414dd0497ae5cdd8a8e8a0136ed6af062876 100644 (file)
@@ -26,6 +26,7 @@ struct Geometry
        bool is_inside(int, int) const;
 };
 
+
 /**
 Specifies margins on the sides of an element.
 */
@@ -48,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