Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_dnd.c e_dnd.h e_zone.c 


Log Message:
Cleanup

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_dnd.c     23 Apr 2005 13:13:56 -0000      1.1
+++ e_dnd.c     24 Apr 2005 16:04:08 -0000      1.2
@@ -4,7 +4,7 @@
 #include "e.h"
 
 static Evas_List *event_handlers = NULL;
-static Evas_List *dnd_handlers = NULL;
+static Evas_List *drop_handlers = NULL;
 
 static Ecore_X_Window drag_win;
 static Ecore_Evas  *drag_ee = NULL;
@@ -61,15 +61,15 @@
    evas_list_free(event_handlers);
    event_handlers = NULL;
 
-   for (l = dnd_handlers; l; l = l->next)
+   for (l = drop_handlers; l; l = l->next)
      {
-       E_DND_Handler *h;
+       E_Drop_Handler *h;
 
        h = l->data;
-       e_dnd_handler_del(h);
+       e_drop_handler_del(h);
      }
-   evas_list_free(dnd_handlers);
-   dnd_handlers = NULL;
+   evas_list_free(drop_handlers);
+   drop_handlers = NULL;
 
    return 1;
 }
@@ -146,9 +146,9 @@
    ecore_x_keyboard_ungrab();
    ecore_x_window_del(drag_win);
 
-   for (l = dnd_handlers; l; l = l->next)
+   for (l = drop_handlers; l; l = l->next)
      {
-       E_DND_Handler *h;
+       E_Drop_Handler *h;
 
        h = l->data;
        
@@ -163,14 +163,16 @@
      }
 
    free(drag_type);
+   drag_type = NULL;
+   drag_data = NULL;
 }
 
-E_DND_Handler *
-e_dnd_handler_add(void *data, void (*func)(void *data, const char *type, void 
*drop), const char *type, int x, int y, int w, int h)
+E_Drop_Handler *
+e_drop_handler_add(void *data, void (*func)(void *data, const char *type, void 
*drop), const char *type, int x, int y, int w, int h)
 {
-   E_DND_Handler *handler;
+   E_Drop_Handler *handler;
 
-   handler = E_NEW(E_DND_Handler, 1);
+   handler = E_NEW(E_Drop_Handler, 1);
    if (!handler) return NULL;
 
    handler->data = data;
@@ -181,13 +183,13 @@
    handler->w = w;
    handler->h = h;
 
-   dnd_handlers = evas_list_append(dnd_handlers, handler);
+   drop_handlers = evas_list_append(drop_handlers, handler);
 
    return handler;
 }
 
 void
-e_dnd_handler_del(E_DND_Handler *handler)
+e_drop_handler_del(E_Drop_Handler *handler)
 {
    free(handler->type);
    free(handler);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_dnd.h     23 Apr 2005 13:13:56 -0000      1.1
+++ e_dnd.h     24 Apr 2005 16:04:09 -0000      1.2
@@ -4,13 +4,13 @@
 
 #ifdef E_TYPEDEFS
 
-typedef struct _E_DND_Handler E_DND_Handler;
+typedef struct _E_Drop_Handler E_Drop_Handler;
 
 #else
 #ifndef E_DND_H
 #define E_DND_H
 
-struct _E_DND_Handler
+struct _E_Drop_Handler
 {
    void *data;
    void (*func)(void *data, const char *type, void *drop);
@@ -25,8 +25,8 @@
 EAPI void e_drag_update(int x, int y);
 EAPI void e_drag_end(int x, int y);
 
-EAPI E_DND_Handler *e_dnd_handler_add(void *data, void (*func)(void *data, 
const char *type, void *drop), const char *type, int x, int y, int w, int h);
-EAPI void e_dnd_handler_del(E_DND_Handler *handler);
+EAPI E_Drop_Handler *e_drop_handler_add(void *data, void (*func)(void *data, 
const char *type, void *drop), const char *type, int x, int y, int w, int h);
+EAPI void e_drop_handler_del(E_Drop_Handler *handler);
 
 #endif
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_zone.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- e_zone.c    23 Apr 2005 13:13:57 -0000      1.36
+++ e_zone.c    24 Apr 2005 16:04:09 -0000      1.37
@@ -17,13 +17,14 @@
 static int  _e_zone_cb_mouse_out(void *data, int type, void *event);
 static int  _e_zone_cb_timer(void *data);
 static void _e_zone_update_flip(E_Zone *zone);
-static int _e_zone_flip_up(E_Zone *zone, int x, int y);
-static int _e_zone_flip_right(E_Zone *zone, int x, int y);
-static int _e_zone_flip_down(E_Zone *zone, int x, int y);
-static int _e_zone_flip_left(E_Zone *zone, int x, int y);
 
 int E_EVENT_ZONE_DESK_COUNT_SET = 0;
 
+#define E_ZONE_FLIP_UP(zone) ((zone)->desk_y_current > 0)
+#define E_ZONE_FLIP_RIGHT(zone) (((zone)->desk_x_current + 1) < 
(zone)->desk_x_count)
+#define E_ZONE_FLIP_DOWN(zone) (((zone)->desk_y_current + 1) < 
(zone)->desk_y_count)
+#define E_ZONE_FLIP_LEFT(zone) ((zone)->desk_x_current > 0)
+
 int
 e_zone_init(void)
 {
@@ -238,7 +239,7 @@
 void
 e_zone_flip_coords_handle(E_Zone *zone, int x, int y)
 {
-   if ((y == 0) && _e_zone_flip_up(zone, x, y))
+   if ((y == 0) && E_ZONE_FLIP_UP(zone))
      {
        /* top */
        if (zone->flip.timer)
@@ -246,7 +247,7 @@
        zone->flip.timer = ecore_timer_add(0.5, _e_zone_cb_timer, zone);
        zone->flip.direction = E_DIRECTION_UP;
      }
-   else if ((x == (zone->w - 1)) && _e_zone_flip_right(zone, x, y))
+   else if ((x == (zone->w - 1)) && E_ZONE_FLIP_RIGHT(zone))
      {
        /* right */
        if (zone->flip.timer)
@@ -254,7 +255,7 @@
        zone->flip.timer = ecore_timer_add(0.5, _e_zone_cb_timer, zone);
        zone->flip.direction = E_DIRECTION_RIGHT;
      }
-   else if ((y == (zone->h - 1)) && _e_zone_flip_down(zone, x, y))
+   else if ((y == (zone->h - 1)) && E_ZONE_FLIP_DOWN(zone))
      {
        /* bottom */
        if (zone->flip.timer)
@@ -262,7 +263,7 @@
        zone->flip.timer = ecore_timer_add(0.5, _e_zone_cb_timer, zone);
        zone->flip.direction = E_DIRECTION_DOWN;
      }
-   else if ((x == 0) && _e_zone_flip_left(zone, x, y))
+   else if ((x == 0) && E_ZONE_FLIP_LEFT(zone))
      {
        /* left */
        if (zone->flip.timer)
@@ -572,7 +573,7 @@
    switch (zone->flip.direction)
      {
       case E_DIRECTION_UP:
-        if (_e_zone_flip_up(zone, zone->desk_x_current, zone->desk_y_current))
+        if (E_ZONE_FLIP_UP(zone))
           {
              desk = e_desk_at_xy_get(zone, zone->desk_x_current, 
zone->desk_y_current - 1);
              if (desk)
@@ -584,7 +585,7 @@
           }
         break;
       case E_DIRECTION_RIGHT:
-        if (_e_zone_flip_right(zone, zone->desk_x_current, 
zone->desk_y_current))
+        if (E_ZONE_FLIP_RIGHT(zone))
           {
              desk = e_desk_at_xy_get(zone, zone->desk_x_current + 1, 
zone->desk_y_current);
              if (desk)
@@ -596,7 +597,7 @@
           }
         break;
       case E_DIRECTION_DOWN:
-        if (_e_zone_flip_down(zone, zone->desk_x_current, 
zone->desk_y_current))
+        if (E_ZONE_FLIP_DOWN(zone))
           {
              desk = e_desk_at_xy_get(zone, zone->desk_x_current, 
zone->desk_y_current + 1);
              if (desk)
@@ -608,7 +609,7 @@
           }
         break;
       case E_DIRECTION_LEFT:
-        if (_e_zone_flip_left(zone, zone->desk_x_current, 
zone->desk_y_current))
+        if (E_ZONE_FLIP_LEFT(zone))
           {
              desk = e_desk_at_xy_get(zone, zone->desk_x_current - 1, 
zone->desk_y_current);
              if (desk)
@@ -630,55 +631,23 @@
 _e_zone_update_flip(E_Zone *zone)
 {
 
-   if (_e_zone_flip_up(zone, zone->desk_x_current, zone->desk_y_current))
+   if (E_ZONE_FLIP_UP(zone))
      ecore_x_window_show(zone->flip.top);
    else
      ecore_x_window_hide(zone->flip.top);
 
-   if (_e_zone_flip_right(zone, zone->desk_x_current, zone->desk_y_current))
+   if (E_ZONE_FLIP_RIGHT(zone))
      ecore_x_window_show(zone->flip.right);
    else
      ecore_x_window_hide(zone->flip.right);
 
-   if (_e_zone_flip_down(zone, zone->desk_x_current, zone->desk_y_current))
+   if (E_ZONE_FLIP_DOWN(zone))
      ecore_x_window_show(zone->flip.bottom);
    else
      ecore_x_window_hide(zone->flip.bottom);
 
-   if (_e_zone_flip_left(zone, zone->desk_x_current, zone->desk_y_current))
+   if (E_ZONE_FLIP_LEFT(zone))
      ecore_x_window_show(zone->flip.left);
    else
      ecore_x_window_hide(zone->flip.left);
 }
-
-static int
-_e_zone_flip_up(E_Zone *zone, int x, int y)
-{
-   if (zone->desk_y_current > 0)
-     return 1;
-   return 0;
-}
-
-static int
-_e_zone_flip_right(E_Zone *zone, int x, int y)
-{
-   if ((zone->desk_x_current + 1) < zone->desk_x_count)
-     return 1;
-   return 0;
-}
-
-static int
-_e_zone_flip_down(E_Zone *zone, int x, int y)
-{
-   if ((zone->desk_y_current + 1) < zone->desk_y_count)
-     return 1;
-   return 0;
-}
-
-static int
-_e_zone_flip_left(E_Zone *zone, int x, int y)
-{
-   if (zone->desk_x_current > 0)
-     return 1;
-   return 0;
-}




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to