remove E_Drag->comp and E_Comp param from e_drag_new()
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 13 Mar 2015 20:14:48 +0000 (16:14 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 13 Mar 2015 20:21:15 +0000 (16:21 -0400)
src/bin/e_client.c
src/bin/e_dnd.c
src/bin/e_dnd.h
src/bin/e_fm.c
src/bin/e_gadcon.c
src/bin/e_int_menus.c
src/modules/gadman/e_mod_gadman.c
src/modules/ibar/e_mod_main.c
src/modules/ibox/e_mod_main.c
src/modules/pager/e_mod_main.c
src/modules/pager_plain/e_mod_main.c

index ebf5868..b1fa1c1 100644 (file)
@@ -2922,8 +2922,7 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
                        e_object_ref(E_OBJECT(ec));
                        e_comp_object_frame_icon_geometry_get(ec->frame, &x, &y, &w, &h);
 
-                       client_drag = e_drag_new(e_comp,
-                                                output->x, output->y,
+                       client_drag = e_drag_new(output->x, output->y,
                                                 drag_types, 1, ec, -1,
                                                 NULL,
                                                 _e_client_cb_drag_finished);
index 94ec2b8..89e0379 100644 (file)
@@ -171,7 +171,7 @@ e_drag_current_get(void)
 }
 
 EAPI E_Drag *
-e_drag_new(E_Comp *comp, int x, int y,
+e_drag_new(int x, int y,
            const char **types, unsigned int num_types,
            void *data, int size,
            void *(*convert_cb)(E_Drag * drag, const char *type),
@@ -191,10 +191,8 @@ e_drag_new(E_Comp *comp, int x, int y,
    drag->w = 24;
    drag->h = 24;
    drag->layer = E_LAYER_CLIENT_DRAG;
-   drag->comp = comp;
-   e_object_ref(E_OBJECT(drag->comp));
 
-   drag->evas = comp->evas;
+   drag->evas = e_comp->evas;
 
    drag->type = E_DRAG_NONE;
 
@@ -212,7 +210,7 @@ e_drag_new(E_Comp *comp, int x, int y,
    ecore_x_window_shadow_tree_flush();
 #endif
 
-   _drag_win_root = drag->comp->man->root;
+   _drag_win_root = e_comp->man->root;
 
    drag->cb.key_down = NULL;
    drag->cb.key_up = NULL;
@@ -276,14 +274,14 @@ e_drag_start(E_Drag *drag, int x, int y)
 
    if (_drag_win) return 0;
 #ifndef HAVE_WAYLAND_ONLY
-   _drag_win = ecore_x_window_input_new(drag->comp->win,
-                                        drag->comp->man->x, drag->comp->man->y,
-                                        drag->comp->man->w, drag->comp->man->h);
-   ecore_event_window_register(_drag_win, drag->comp->ee, drag->comp->evas,
+   _drag_win = ecore_x_window_input_new(e_comp->win,
+                                        e_comp->man->x, e_comp->man->y,
+                                        e_comp->man->w, e_comp->man->h);
+   ecore_event_window_register(_drag_win, e_comp->ee, e_comp->evas,
                                  NULL, NULL, NULL, NULL);
    ecore_x_window_show(_drag_win);
 #endif
-   _drag_win_root = drag->comp->man->root;
+   _drag_win_root = e_comp->man->root;
    if (!e_grabinput_get(_drag_win, 1, _drag_win))
      {
 #ifndef HAVE_WAYLAND_ONLY
@@ -342,9 +340,9 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
    if (_drag_win) return 0;
 #ifndef HAVE_WAYLAND_ONLY
    if (e_comp->comp_type != E_PIXMAP_TYPE_X) return 0;
-   _drag_win = ecore_x_window_input_new(drag->comp->win,
-                                        drag->comp->man->x, drag->comp->man->y,
-                                        drag->comp->man->w, drag->comp->man->h);
+   _drag_win = ecore_x_window_input_new(e_comp->win,
+                                        e_comp->man->x, e_comp->man->y,
+                                        e_comp->man->w, e_comp->man->h);
 
    ecore_x_window_show(_drag_win);
 #endif
@@ -1153,7 +1151,6 @@ _e_drag_free(E_Drag *drag)
 
    _drag_list = eina_list_remove(_drag_list, drag);
 
-   e_object_unref(E_OBJECT(drag->comp));
    evas_object_hide(drag->comp_object);
    E_FREE_FUNC(drag->comp_object, evas_object_del);
    for (i = 0; i < drag->num_types; i++)
index cdf7caa..bd90f12 100644 (file)
@@ -38,7 +38,6 @@ struct _E_Drag
       void  (*key_up)(E_Drag *drag, Ecore_Event_Key *e);
    } cb;
 
-   E_Comp           *comp;
    Evas              *evas;
    Evas_Object       *comp_object;
    Evas_Object       *object;
@@ -115,7 +114,7 @@ EAPI int             e_dnd_active(void);
 
 EAPI E_Drag         *e_drag_current_get(void);
 /* x and y are the top left coords of the object that is to be dragged */
-EAPI E_Drag         *e_drag_new(E_Comp *comp, int x, int y,
+EAPI E_Drag         *e_drag_new(int x, int y,
                                 const char **types, unsigned int num_types,
                                 void *data, int size,
                                 void *(*convert_cb)(E_Drag * drag, const char *type),
index 7b82826..c681301 100644 (file)
@@ -7671,7 +7671,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
              sel = (char*)eina_binbuf_string_steal(sbuf);
              eina_binbuf_free(sbuf);
 
-             d = e_drag_new(e_comp, 0, 0, drag_types, 1,
+             d = e_drag_new(0, 0, drag_types, 1,
                             sel, sel_length, NULL, _e_fm2_cb_drag_finished);
              if (layout)
                d->x = ic->sd->x, d->y = ic->sd->y;
index 0880da8..2d3b031 100644 (file)
@@ -2292,7 +2292,7 @@ _e_gadcon_client_drag_begin(E_Gadcon_Client *gcc, int x, int y)
 
    ecore_evas_pointer_xy_get(zone->comp->ee, &x, &y);
 
-   gcc->drag.drag = drag = e_drag_new(zone->comp, x, y,
+   gcc->drag.drag = drag = e_drag_new(x, y,
                                       drag_types, 1, gcc, -1, NULL,
                                       e_gadcon_drag_finished_cb);
    if (!drag) return;
index 18c0eba..fffb4a6 100644 (file)
@@ -985,7 +985,7 @@ _e_int_menus_apps_run(void *data, E_Menu *m, E_Menu_Item *mi __UNUSED__)
  */
 
 static void
-_e_int_menus_apps_drag(void *data, E_Menu *m, E_Menu_Item *mi)
+_e_int_menus_apps_drag(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi)
 {
    Efreet_Desktop *desktop;
 
@@ -1002,7 +1002,7 @@ _e_int_menus_apps_drag(void *data, E_Menu *m, E_Menu_Item *mi)
 
         evas_object_geometry_get(mi->icon_object, &x, &y, &w, &h);
         efreet_desktop_ref(desktop);
-        drag = e_drag_new(m->zone->comp, x, y, drag_types, 1, desktop, -1,
+        drag = e_drag_new(x, y, drag_types, 1, desktop, -1,
                           NULL, NULL);
 
         size = MIN(w, h);
index 4e3df35..9258b88 100644 (file)
@@ -1534,7 +1534,7 @@ on_move(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
    drag_gcc->dx = mx - ox;
    drag_gcc->dy = my - oy;
 
-   drag_gcc->drag.drag = drag = e_drag_new(gc->zone->comp, mx, my,
+   drag_gcc->drag.drag = drag = e_drag_new(mx, my,
                      drag_types, 1, drag_gcc, -1, NULL,
                      e_gadcon_drag_finished_cb);
    if (!drag) return;
index c948866..49b3f4f 100644 (file)
@@ -1829,8 +1829,7 @@ _ibar_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
         if (ic->ibar->inst->ci->lock_move) return;
 
         evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
-        d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->comp,
-                       x, y, drag_types, 1,
+        d = e_drag_new(x, y, drag_types, 1,
                        ic->app, -1, NULL, _ibar_cb_drag_finished);
         efreet_desktop_ref(ic->app);
         size = MAX(w, h);
index 014668b..2f78be0 100644 (file)
@@ -781,8 +781,7 @@ _ibox_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
              ic->drag.start = 0;
 
              evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
-             d = e_drag_new(ic->ibox->inst->gcc->gadcon->zone->comp,
-                            x, y, drag_types, 1,
+             d = e_drag_new(x, y, drag_types, 1,
                             ic->client, -1, NULL, _ibox_cb_drag_finished);
              o = e_client_icon_add(ic->client, e_drag_evas_get(d));
              e_drag_object_set(d, o);
index 5b7d596..799a56d 100644 (file)
@@ -1156,8 +1156,7 @@ _pager_window_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __U
    evas_object_geometry_get(pw->o_mirror, &x, &y, &w, &h);
    evas_object_hide(pw->o_mirror);
 
-   drag = e_drag_new(e_comp,
-                     x, y, drag_types, 2, pw->desk->pager, -1,
+   drag = e_drag_new(x, y, drag_types, 2, pw->desk->pager, -1,
                      _pager_window_cb_drag_convert,
                      _pager_window_cb_drag_finished);
 
@@ -1557,8 +1556,7 @@ _pager_desk_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
    if (pd->drag.in_pager && pd->pager)
      {
         evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
-        drag = e_drag_new(pd->pager->zone->comp,
-                          x, y, drag_types, 1, pd, -1,
+        drag = e_drag_new(x, y, drag_types, 1, pd, -1,
                           NULL, _pager_desk_cb_drag_finished);
         
         /* redraw the desktop theme above */
index bd1ea1b..a1f698f 100644 (file)
@@ -1917,8 +1917,7 @@ _pager_window_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __U
              evas_object_geometry_get(pw->o_window, &x, &y, &w, &h);
              evas_object_hide(pw->o_window);
 
-             drag = e_drag_new(pw->desk->pager->zone->comp,
-                               x, y, drag_types, 2, pw, -1,
+             drag = e_drag_new(x, y, drag_types, 2, pw, -1,
                                _pager_window_cb_drag_convert,
                                _pager_window_cb_drag_finished);
 
@@ -2296,8 +2295,7 @@ _pager_desk_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
    if (pd->drag.in_pager && pd->pager)
      {
         evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
-        drag = e_drag_new(pd->pager->zone->comp,
-                          x, y, drag_types, 1, pd, -1,
+        drag = e_drag_new(x, y, drag_types, 1, pd, -1,
                           NULL, _pager_desk_cb_drag_finished);
 
         /* redraw the desktop theme above */