Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_dnd.h e_dnd.c 


Log Message:
Name changes.
Only parse the type of a drop handler at drag start.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_dnd.h     1 May 2005 15:55:01 -0000       1.8
+++ e_dnd.h     1 May 2005 18:28:20 -0000       1.9
@@ -18,9 +18,10 @@
    struct {
        void (*drop)(void *data, const char *type, void *event);
        void (*move)(void *data, const char *type, void *event);
-   } func;
+   } cb;
    char *type;
    int x, y, w, h;
+   unsigned char active : 1;
 };
 
 struct _E_Drop_Event
@@ -45,8 +46,8 @@
 EAPI void e_drag_end(int x, int y);
 
 EAPI E_Drop_Handler *e_drop_handler_add(void *data,
-                                       void (*drop_func)(void *data, const 
char *type, void *event),
-                                       void (*move_func)(void *data, const 
char *type, void *event),
+                                       void (*drop_cb)(void *data, const char 
*type, void *event),
+                                       void (*move_cb)(void *data, const char 
*type, void *event),
                                        const char *type, int x, int y, int w, 
int h);
 EAPI void e_drop_handler_del(E_Drop_Handler *handler);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_dnd.c     1 May 2005 15:55:01 -0000       1.12
+++ e_dnd.c     1 May 2005 18:28:20 -0000       1.13
@@ -105,6 +105,7 @@
 e_drag_start(E_Container *con, const char *type, void *data,
             const char *icon_path, const char *icon)
 {
+   Evas_List *l;
    int w, h;
 
    drag_win = ecore_x_window_input_new(con->win, 
@@ -139,6 +140,15 @@
 
    drag_type = strdup(type);
    drag_data = data;
+
+   for (l = drop_handlers; l; l = l->next)
+     {
+       E_Drop_Handler *h;
+
+       h = l->data;
+       
+       h->active = !strcmp(h->type, drag_type);
+     }
 }
 
 void
@@ -195,12 +205,14 @@
        E_Drop_Handler *h;
 
        h = l->data;
+
+       if (!h->active)
+         continue;
        
-       if ((x >= h->x) && (x < h->x + h->w) && (y >= h->y) && (y < h->y + h->h)
-           && (!strcmp(h->type, drag_type))
-           && (h->func.drop))
+       if ((h->cb.drop)
+           && E_INSIDE(x, y, h->x, h->y, h->w, h->h))
          {
-            h->func.drop(h->data, drag_type, ev);
+            h->cb.drop(h->data, drag_type, ev);
          }
      }
 
@@ -213,8 +225,8 @@
 
 E_Drop_Handler *
 e_drop_handler_add(void *data,
-                  void (*drop_func)(void *data, const char *type, void *event),
-                  void (*move_func)(void *data, const char *type, void *event),
+                  void (*drop_cb)(void *data, const char *type, void *event),
+                  void (*move_cb)(void *data, const char *type, void *event),
                   const char *type, int x, int y, int w, int h)
 {
    E_Drop_Handler *handler;
@@ -223,8 +235,8 @@
    if (!handler) return NULL;
 
    handler->data = data;
-   handler->func.drop = drop_func;
-   handler->func.move = move_func;
+   handler->cb.drop = drop_cb;
+   handler->cb.move = move_cb;
    handler->type = strdup(type);
    handler->x = x;
    handler->y = y;




-------------------------------------------------------
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
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to