2 * ion/ioncore/rectangle.h
4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
12 #ifndef ION_IONCORE_RECTANGLE_H
13 #define ION_IONCORE_RECTANGLE_H
17 #include <libextl/extl.h>
19 INTRSTRUCT(WRectangle);
21 DECLSTRUCT(WRectangle){
26 #define RECTANGLE_SAME 0x00
27 #define RECTANGLE_X_DIFF 0x01
28 #define RECTANGLE_Y_DIFF 0x02
29 #define RECTANGLE_POS_DIFF (RECTANGLE_X_DIFF|RECTANGLE_Y_DIFF)
30 #define RECTANGLE_W_DIFF 0x04
31 #define RECTANGLE_H_DIFF 0x08
32 #define RECTANGLE_SZ_DIFF (RECTANGLE_W_DIFF|RECTANGLE_H_DIFF)
34 extern int rectangle_compare(const WRectangle *g, const WRectangle *h);
35 extern bool rectangle_contains(const WRectangle *g, int x, int y);
36 extern void rectangle_constrain(WRectangle *g, const WRectangle *bounds);
38 extern void rectange_debugprint(const WRectangle *g, const char *n);
40 #endif /* ION_IONCORE_RECTANGLE_H */