1 #ifndef MSP_GLTK_GEOMETRY_H_
2 #define MSP_GLTK_GEOMETRY_H_
4 #include <msp/datafile/objectloader.h>
5 #include "mspgltk_api.h"
11 Specifies the position and size of a widget or graphic.
13 struct MSPGLTK_API Geometry
18 Geometry(): x(0), y(0), w(1), h(1) { }
19 Geometry(int x_, int y_, unsigned w_, unsigned h_): x(x_), y(y_), w(w_), h(h_) { }
20 bool is_inside(int, int) const;
21 bool is_inside_relative(int, int) const;
26 Specifies margins on the sides of an element.
28 struct MSPGLTK_API Sides
30 class Loader: public DataFile::ObjectLoader<Sides>
35 void horizontal(unsigned);
36 void vertical(unsigned);
46 Sides(unsigned, unsigned);
47 Sides(unsigned, unsigned, unsigned);
48 Sides(unsigned, unsigned, unsigned, unsigned);
53 Performs alignment of nested geometries, such as widgets and their parts.
55 struct MSPGLTK_API Alignment
60 Alignment(): x(0), y(0), w(1), h(1) { }
61 void apply(Geometry &, const Geometry &) const;
62 void apply(Geometry &, const Geometry &, const Sides &) const;