summaryrefslogtreecommitdiff
path: root/openbox/geom.h
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-16 21:11:39 +0000
committerDana Jansens <danakj@orodu.net>2003-03-16 21:11:39 +0000
commitf8a47de5ec444c452093371e3db16857eb39a490 (patch)
tree31db2567842d98232775f9980f7a8d2586c0ac71 /openbox/geom.h
parent8ba0586bcbdc7fe9648f1063812126d71a041670 (diff)
merge the C branch into HEAD
Diffstat (limited to 'openbox/geom.h')
-rw-r--r--openbox/geom.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/openbox/geom.h b/openbox/geom.h
new file mode 100644
index 00000000..89b69b12
--- /dev/null
+++ b/openbox/geom.h
@@ -0,0 +1,49 @@
+#ifndef __geom_h
+#define __geom_h
+
+typedef struct Point {
+ int x;
+ int y;
+} Point;
+
+#define POINT_SET(pt, nx, ny) {pt.x = nx; pt.y = ny;}
+
+typedef struct Size {
+ int width;
+ int height;
+} Size;
+
+#define SIZE_SET(sz, w, h) {sz.width = w; sz.height = h;}
+
+typedef struct Rect {
+ int x;
+ int y;
+ int width;
+ int height;
+} Rect;
+
+#define RECT_SET_POINT(r, nx, ny) \
+ {r.x = ny; r.y = ny;}
+#define RECT_SET_SIZE(r, w, 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;}
+
+#define RECT_EQUAL(r1, r2) (r1.x == r2.x && r1.y == r2.y && \
+ r1.width == r2.width && r1.height == r2.height)
+
+typedef struct Strut {
+ int left;
+ int top;
+ int right;
+ int bottom;
+} Strut;
+
+#define STRUT_SET(s, l, t, r, 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); }
+
+#endif