Enlightenment CVS committal
Author : sebastid
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e.h e_dnd.c
Log Message:
Add move callback
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e.h 13 Apr 2005 05:59:46 -0000 1.14
+++ e.h 1 May 2005 18:34:56 -0000 1.15
@@ -61,6 +61,7 @@
/* convenience macro to compress code and avoid typos */
#define E_FN_DEL(_fn, _h) if (_h) { _fn(_h); _h = NULL; }
#define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx) + (ww))) &&
((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
+#define E_INSIDE(x, y, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) < ((yy)
+ (hh))) && ((x) >= (xx)) && ((y) >= (yy)))
#define E_SPANS_COMMON(x1, w1, x2, w2) (!((((x2) + (w2)) <= (x1)) || ((x2) >=
((x1) + (w1)))))
#define E_REALLOC(p, s, n) p = realloc(p, sizeof(s) * n)
#define E_NEW(s, n) calloc(n, sizeof(s))
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- e_dnd.c 1 May 2005 18:28:20 -0000 1.13
+++ e_dnd.c 1 May 2005 18:34:56 -0000 1.14
@@ -154,6 +154,8 @@
void
e_drag_update(int x, int y)
{
+ Evas_List *l;
+ E_Move_Event *ev;
int w, h;
if (!drag_ee) return;
@@ -168,6 +170,31 @@
evas_object_geometry_get(drag_obj, NULL, NULL, &w, &h);
ecore_evas_move(drag_ee, x - (w / 2), y - (h / 2));
+
+ ev = E_NEW(E_Move_Event, 1);
+ if (!ev) goto end;
+ ev->x = x;
+ ev->y = y;
+
+ for (l = drop_handlers; l; l = l->next)
+ {
+ E_Drop_Handler *h;
+
+ h = l->data;
+
+ if (!h->active)
+ continue;
+
+ if ((h->cb.move)
+ && E_INSIDE(x, y, h->x, h->y, h->w, h->h))
+ {
+ h->cb.move(h->data, drag_type, ev);
+ }
+ }
+
+ free(ev);
+end:
+ return;
}
void
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs