]>
Dogcows Code - chaz/openbox/blob - openbox/geom.h
9 #define POINT_SET(pt, nx, ny) (pt).x = (nx), (pt).y = (ny)
16 #define SIZE_SET(sz, w, h) (sz).width = (w), (sz).height = (h)
25 #define RECT_SET_POINT(r, nx, ny) \
26 (r).x = (ny), (r).y = (ny)
27 #define RECT_SET_SIZE(r, w, h) \
28 (r).width = (w), (r).height = (h)
29 #define RECT_SET(r, nx, ny, w, h) \
30 (r).x = (nx), (r).y = (ny), (r).width = (w), (r).height = (h)
32 #define RECT_EQUAL(r1, r2) ((r1).x == (r2).x && (r1).y == (r2).y && \
33 (r1).width == (r2).width && \
34 (r1).height == (r2).height)
36 #define RECT_CONTAINS(r, x, y) \
37 ((x) >= (r).x && (x) < (r).x + (r).width && \
38 (y) >= (r).y && (y) < (r).y + (r).height)
39 #define RECT_CONTAINS_RECT(r, o) \
40 ((o).x >= (r).x && (o).x + (o).width <= (r).x + (r).width && \
41 (o).y >= (r).y && (o).y + (o).height <= (r).y + (r).height)
42 #define RECT_INTERSECTS_RECT(r, o) \
43 ((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \
44 (o).y < (r).y + (r).height && (o).y + (o).height > (r).y)
46 typedef struct Strut
{
53 #define STRUT_SET(s, l, t, r, b) \
54 (s).left = (l), (s).top = (t), (s).right = (r), (s).bottom = (b)
56 #define STRUT_ADD(s1, s2) \
57 (s1).left = MAX((s1).left, (s2).left), \
58 (s1).right = MAX((s1).right, (s2).right), \
59 (s1).top = MAX((s1).top, (s2).top), \
60 (s1).bottom = MAX((s1).bottom, (s2).bottom)
This page took 0.038968 seconds and 4 git commands to generate.