X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fgeom.h;h=003b0081dbe9f8221df8961db0eb4eeb02e5aae7;hb=c8d98d2586a22bdaaa20859c4d5db1bbf632a533;hp=43eb8ea3ab128b598174cb2e4948af7e6b5e4d21;hpb=eb6a2e9c4b334f53d714a2e7f10f73c63c3d2edd;p=chaz%2Fopenbox diff --git a/openbox/geom.h b/openbox/geom.h index 43eb8ea3..003b0081 100644 --- a/openbox/geom.h +++ b/openbox/geom.h @@ -20,6 +20,24 @@ #ifndef __geom_h #define __geom_h +#include + +typedef struct _GravityCoord { + gint pos; + gint denom; + gboolean center; + gboolean opposite; +} GravityCoord; + +typedef struct _GravityPoint { + GravityCoord x; + GravityCoord y; +} GravityPoint; + +#define GRAVITY_COORD_SET(c, p, cen, opp) \ + (c).pos = (p), (c).center = (cen), (c).opposite = (opp) + + typedef struct _Point { int x; int y; @@ -143,6 +161,6 @@ typedef struct _StrutPartial { (s1).bottom_end == (s2).bottom_end) #define RANGES_INTERSECT(r1x, r1w, r2x, r2w) \ - (r1x < r2x + r2w && r1x + r1w > r2x) + (r1w && r2w && r1x < r2x + r2w && r1x + r1w > r2x) #endif