]> Dogcows Code - chaz/openbox/blobdiff - openbox/geom.h
xinerama support
[chaz/openbox] / openbox / geom.h
index a4c1752aaffb7db9d7e93bc57d9a0caff462dc49..5f2c030c381a6217ad2cb1677a30a498260fa89f 100644 (file)
@@ -34,8 +34,14 @@ typedef struct Rect {
                             (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)
+    ((x) >= (r).x && (x) < (r).x + (r).width && \
+     (y) >= (r).y && (y) < (r).y + (r).height)
+#define RECT_CONTAINS_RECT(r, o) \
+    ((o).x >= (r).x && (o).x + (o).width <= (r).x + (r).width && \
+     (o).y >= (r).y && (o).y + (o).height <= (r).y + (r).height)
+#define RECT_INTERSECTS_RECT(r, o) \
+    ((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \
+     (o).y < (r).y + (r).height && (o).y + (o).height > (r).y)
 
 typedef struct Strut {
     int left;
This page took 0.019863 seconds and 4 git commands to generate.