]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/alignment.h
Initial revision
[libs/gltk.git] / source / alignment.h
diff --git a/source/alignment.h b/source/alignment.h
new file mode 100644 (file)
index 0000000..c89148d
--- /dev/null
@@ -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