Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e.h
Log Message:
add some macros for usefulness
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- e.h 25 Sep 2007 14:26:36 -0000 1.72
+++ e.h 1 Apr 2008 20:51:04 -0000 1.73
@@ -140,6 +140,32 @@
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
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs