summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-20 21:53:04 +0000
committerDana Jansens <danakj@orodu.net>2003-03-20 21:53:04 +0000
commitbf707e7240bbf86be7628c28319d463847738671 (patch)
tree5c5df1467cc6c0f1a100b088535895ade6c7aba8 /openbox
parent45f6d5271226813ac15ecd69118fe6a947996fb6 (diff)
add RECT_CONTAINS
Diffstat (limited to 'openbox')
-rw-r--r--openbox/geom.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/openbox/geom.h b/openbox/geom.h
index 89b69b12..c958f9c1 100644
--- a/openbox/geom.h
+++ b/openbox/geom.h
@@ -23,15 +23,18 @@ typedef struct Rect {
} Rect;
#define RECT_SET_POINT(r, nx, ny) \
- {r.x = ny; r.y = ny;}
+ {r.x = ny; r.y = ny;}
#define RECT_SET_SIZE(r, w, h) \
- {r.width = w; r.height = h;}
+ {r.width = w; r.height = h;}
#define RECT_SET(r, nx, ny, w, h) \
- {r.x = nx; r.y = ny; r.width = w; r.height = h;}
+ {r.x = nx; r.y = ny; r.width = w; r.height = h;}
#define RECT_EQUAL(r1, r2) (r1.x == r2.x && r1.y == r2.y && \
r1.width == r2.width && r1.height == r2.height)
+#define RECT_CONTAINS(r, x, y) \
+ (x >= r.x && x < r.x + r.width && y >= r.y && y < r.y + r.height)
+
typedef struct Strut {
int left;
int top;
@@ -40,10 +43,10 @@ typedef struct Strut {
} Strut;
#define STRUT_SET(s, l, t, r, b) \
- {s.left = l; s.top = t; s.right = r; s.bottom = b; }
+ {s.left = l; s.top = t; s.right = r; s.bottom = b; }
#define STRUT_ADD(s1, s2) \
- {s1.left = MAX(s1.left, s2.left); s1.right = MAX(s1.right, s2.right); \
- s1.top = MAX(s1.top, s2.top); s1.bottom = MAX(s1.bottom, s2.bottom); }
+ {s1.left = MAX(s1.left, s2.left); s1.right = MAX(s1.right, s2.right); \
+ s1.top = MAX(s1.top, s2.top); s1.bottom = MAX(s1.bottom, s2.bottom); }
#endif