2 * ion/ioncore/rectangle.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_RECTANGLE_H
10 #define ION_IONCORE_RECTANGLE_H
14 #include <libextl/extl.h>
16 INTRSTRUCT(WRectangle
);
18 DECLSTRUCT(WRectangle
){
23 #define RECTANGLE_SAME 0x00
24 #define RECTANGLE_X_DIFF 0x01
25 #define RECTANGLE_Y_DIFF 0x02
26 #define RECTANGLE_POS_DIFF (RECTANGLE_X_DIFF|RECTANGLE_Y_DIFF)
27 #define RECTANGLE_W_DIFF 0x04
28 #define RECTANGLE_H_DIFF 0x08
29 #define RECTANGLE_SZ_DIFF (RECTANGLE_W_DIFF|RECTANGLE_H_DIFF)
31 extern int rectangle_compare(const WRectangle
*g
, const WRectangle
*h
);
32 extern bool rectangle_contains(const WRectangle
*g
, int x
, int y
);
33 extern void rectangle_constrain(WRectangle
*g
, const WRectangle
*bounds
);
35 extern void rectange_debugprint(const WRectangle
*g
, const char *n
);
37 #endif /* ION_IONCORE_RECTANGLE_H */