* edje: Cleanup drag part of Edje_Real_Part.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 11 Aug 2009 10:17:14 +0000 (10:17 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 11 Aug 2009 10:17:14 +0000 (10:17 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@41682 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_callbacks.c
src/lib/edje_load.c
src/lib/edje_private.h

index ecd1153..5a97aa0 100644 (file)
@@ -89,12 +89,12 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
        _edje_emit(ed, buf, rp->part->name);
      }
 
-   if (rp->events_to)
+   if (rp->drag.events_to)
      {
        int x = 0, y = 0;
        Edje_Real_Part *events;
 
-       events = rp->events_to;
+       events = rp->drag.events_to;
        evas_object_geometry_get(rp->object, &x, &y, NULL, NULL);
 
        if ((events->part->dragable.x) || (events->part->dragable.y))
@@ -200,9 +200,9 @@ _edje_mouse_up_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
        _edje_emit(ed, buf, rp->part->name);
      }
 
-   if (rp->events_to)
+   if (rp->drag.events_to)
      {
-       rp = rp->events_to;
+       rp = rp->drag.events_to;
        if (!ignored)
          {
             snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button);
@@ -254,7 +254,7 @@ _edje_mouse_move_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
    ed = data;
    rp = evas_object_data_get(obj, "real_part");
    if (!rp) return;
-   if (rp->events_to) rp = rp->events_to;
+   if (rp->drag.events_to) rp = rp->drag.events_to;
 
    ignored = rp->part->ignore_flags & ev->event_flags;
 
index ec1dddc..4143211 100644 (file)
@@ -468,12 +468,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
                       /* replay events for dragable */
                       if (rp->part->dragable.events_id >= 0)
                         {
-                           rp->events_to =
+                           rp->drag.events_to =
                              ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size];
                            /* events_to may be used only with dragable */
-                           if (!rp->events_to->part->dragable.x &&
-                               !rp->events_to->part->dragable.y)
-                             rp->events_to = NULL;
+                           if (!rp->drag.events_to->part->dragable.x &&
+                               !rp->drag.events_to->part->dragable.y)
+                             rp->drag.events_to = NULL;
                         }
                       
                       rp->swallow_params.min.w = 0;
index 615a52e..6369802 100644 (file)
@@ -615,6 +615,7 @@ struct _Edje_Part_Description
 
 typedef struct _Edje Edje;
 typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
+typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
 typedef struct _Edje_Real_Part Edje_Real_Part;
 typedef struct _Edje_Running_Program Edje_Running_Program;
 typedef struct _Edje_Signal_Callback Edje_Signal_Callback;
@@ -772,6 +773,21 @@ struct _Edje_Real_Part_State
 }; // 20
 // WITH EDJE_CALC_CACHE 140
 
+struct _Edje_Real_Part_Drag
+{
+   double               x, y; // 16
+   Edje_Position_Scale  val, size, step, page; // 64
+   struct {
+      unsigned int      count; // 4
+      int               x, y; // 8
+   } down;
+   struct {
+      int               x, y; // 8
+   } tmp;
+   unsigned char        need_reset : 1; // 4
+   Edje_Real_Part      *events_to; // 4
+}; // 104 // FIME: make drag pointer to struct optional
+
 struct _Edje_Real_Part
 {
    Edje                     *edje; // 4
@@ -789,18 +805,7 @@ struct _Edje_Real_Part
       Edje_Size min, max; // 16
       Edje_Aspect aspect; // 12
    } swallow_params; // 28 // FIXME: only if type SWALLOW
-   struct {
-      double        x, y; // 16
-      Edje_Position_Scale val, size, step, page; // 64
-      struct {
-        unsigned int count; // 4
-        int  x, y; // 8
-      } down;
-      struct {
-        int  x, y; // 8
-      } tmp;
-      unsigned char need_reset : 1; // 4
-   } drag; // 104 // FIME: make drag pointer to struct optional
+   Edje_Real_Part_Drag drag; // 104 // FIME: make drag pointer to struct optional
    struct {
       Edje_Real_Part        *source; // 4
       Edje_Real_Part        *text_source; // 4
@@ -836,10 +841,9 @@ struct _Edje_Real_Part
    Edje_Real_Part           *clip_to; // 4
 
    Edje_Running_Program     *program; // 4
-   Edje_Real_Part           *events_to; // 4
 
    int                       clicked_button; // 4
-   int                       gradient_id; // 4
+   int                       gradient_id; // 4 // FIXME: only for gradient
 
    unsigned char             calculated; // 1
    unsigned char             calculating; // 1