[Pkg-e-commits] [SCM] Enlightenment 17 branch, upstream-vcs, updated. a8698069ec4eec9c2a189198fa5eec9854b168ac
raster
raster at alioth.debian.org
Sun May 4 21:40:08 UTC 2008
The following commit has been merged in the upstream-vcs branch:
commit 749e8c5030309f97a0afe803c2e0e206ddfe75a1
Author: raster <raster>
Date: Tue Apr 1 20:51:04 2008 +0000
add some macros for usefulness
diff --git a/src/bin/e.h b/src/bin/e.h
index 5afc2fd..fb5ce84 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -140,6 +140,32 @@ typedef struct _E_Rect E_Rect;
while (0)
#define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x))
+#define E_RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \
+ { \
+ if (E_INTERSECTS(_x, _y, _w, _h, _cx, _cy, _cw, _ch)) \
+ { \
+ if (_x < (_cx)) \
+ { \
+ _w += _x - (_cx); \
+ _x = (_cx); \
+ if (_w < 0) _w = 0; \
+ } \
+ if ((_x + _w) > ((_cx) + (_cw))) \
+ _w = (_cx) + (_cw) - _x; \
+ if (_y < (_cy)) \
+ { \
+ _h += _y - (_cy); \
+ _y = (_cy); \
+ if (_h < 0) _h = 0; \
+ } \
+ if ((_y + _h) > ((_cy) + (_ch))) \
+ _h = (_cy) + (_ch) - _y; \
+ } \
+ else \
+ { \
+ _w = 0; _h = 0; \
+ } \
+ }
#define E_REMOTE_OPTIONS 1
#define E_REMOTE_OUT 2
--
Enlightenment 17
More information about the Pkg-e-commits
mailing list