3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_GEOMETRY_H_
9 #define MSP_GLTK_GEOMETRY_H_
11 #include <msp/datafile/loader.h>
17 Specifies the position and size of a widget or graphic.
24 Geometry(): x(0), y(0), w(1), h(1) { }
25 Geometry(int x_, int y_, unsigned w_, unsigned h_): x(x_), y(y_), w(w_), h(h_) { }
26 bool is_inside(int, int) const;
27 bool is_inside_relative(int, int) const;
32 Specifies margins on the sides of an element.
36 class Loader: public DataFile::Loader
40 Sides &get_object() { return sides; }
55 Performs alignment of nested geometries, such as widgets and their parts.
62 Alignment(): x(0), y(0), w(1), h(1) { }
63 void apply(Geometry &, const Geometry &) const;
64 void apply(Geometry &, const Geometry &, const Sides &) const;