forked from enlightenment/enlightenment
remove E_Drag->comp and E_Comp param from e_drag_new()
This commit is contained in:
parent
2a9296e0ec
commit
bacf638d73
|
@ -2922,8 +2922,7 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
|
||||||
e_object_ref(E_OBJECT(ec));
|
e_object_ref(E_OBJECT(ec));
|
||||||
e_comp_object_frame_icon_geometry_get(ec->frame, &x, &y, &w, &h);
|
e_comp_object_frame_icon_geometry_get(ec->frame, &x, &y, &w, &h);
|
||||||
|
|
||||||
client_drag = e_drag_new(e_comp,
|
client_drag = e_drag_new(output->x, output->y,
|
||||||
output->x, output->y,
|
|
||||||
drag_types, 1, ec, -1,
|
drag_types, 1, ec, -1,
|
||||||
NULL,
|
NULL,
|
||||||
_e_client_cb_drag_finished);
|
_e_client_cb_drag_finished);
|
||||||
|
|
|
@ -171,7 +171,7 @@ e_drag_current_get(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI E_Drag *
|
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,
|
const char **types, unsigned int num_types,
|
||||||
void *data, int size,
|
void *data, int size,
|
||||||
void *(*convert_cb)(E_Drag * drag, const char *type),
|
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->w = 24;
|
||||||
drag->h = 24;
|
drag->h = 24;
|
||||||
drag->layer = E_LAYER_CLIENT_DRAG;
|
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;
|
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();
|
ecore_x_window_shadow_tree_flush();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_drag_win_root = drag->comp->man->root;
|
_drag_win_root = e_comp->man->root;
|
||||||
|
|
||||||
drag->cb.key_down = NULL;
|
drag->cb.key_down = NULL;
|
||||||
drag->cb.key_up = 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;
|
if (_drag_win) return 0;
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
_drag_win = ecore_x_window_input_new(drag->comp->win,
|
_drag_win = ecore_x_window_input_new(e_comp->win,
|
||||||
drag->comp->man->x, drag->comp->man->y,
|
e_comp->man->x, e_comp->man->y,
|
||||||
drag->comp->man->w, drag->comp->man->h);
|
e_comp->man->w, e_comp->man->h);
|
||||||
ecore_event_window_register(_drag_win, drag->comp->ee, drag->comp->evas,
|
ecore_event_window_register(_drag_win, e_comp->ee, e_comp->evas,
|
||||||
NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL);
|
||||||
ecore_x_window_show(_drag_win);
|
ecore_x_window_show(_drag_win);
|
||||||
#endif
|
#endif
|
||||||
_drag_win_root = drag->comp->man->root;
|
_drag_win_root = e_comp->man->root;
|
||||||
if (!e_grabinput_get(_drag_win, 1, _drag_win))
|
if (!e_grabinput_get(_drag_win, 1, _drag_win))
|
||||||
{
|
{
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
|
@ -342,9 +340,9 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
|
||||||
if (_drag_win) return 0;
|
if (_drag_win) return 0;
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
if (e_comp->comp_type != E_PIXMAP_TYPE_X) return 0;
|
if (e_comp->comp_type != E_PIXMAP_TYPE_X) return 0;
|
||||||
_drag_win = ecore_x_window_input_new(drag->comp->win,
|
_drag_win = ecore_x_window_input_new(e_comp->win,
|
||||||
drag->comp->man->x, drag->comp->man->y,
|
e_comp->man->x, e_comp->man->y,
|
||||||
drag->comp->man->w, drag->comp->man->h);
|
e_comp->man->w, e_comp->man->h);
|
||||||
|
|
||||||
ecore_x_window_show(_drag_win);
|
ecore_x_window_show(_drag_win);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1153,7 +1151,6 @@ _e_drag_free(E_Drag *drag)
|
||||||
|
|
||||||
_drag_list = eina_list_remove(_drag_list, drag);
|
_drag_list = eina_list_remove(_drag_list, drag);
|
||||||
|
|
||||||
e_object_unref(E_OBJECT(drag->comp));
|
|
||||||
evas_object_hide(drag->comp_object);
|
evas_object_hide(drag->comp_object);
|
||||||
E_FREE_FUNC(drag->comp_object, evas_object_del);
|
E_FREE_FUNC(drag->comp_object, evas_object_del);
|
||||||
for (i = 0; i < drag->num_types; i++)
|
for (i = 0; i < drag->num_types; i++)
|
||||||
|
|
|
@ -38,7 +38,6 @@ struct _E_Drag
|
||||||
void (*key_up)(E_Drag *drag, Ecore_Event_Key *e);
|
void (*key_up)(E_Drag *drag, Ecore_Event_Key *e);
|
||||||
} cb;
|
} cb;
|
||||||
|
|
||||||
E_Comp *comp;
|
|
||||||
Evas *evas;
|
Evas *evas;
|
||||||
Evas_Object *comp_object;
|
Evas_Object *comp_object;
|
||||||
Evas_Object *object;
|
Evas_Object *object;
|
||||||
|
@ -115,7 +114,7 @@ EAPI int e_dnd_active(void);
|
||||||
|
|
||||||
EAPI E_Drag *e_drag_current_get(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 */
|
/* 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,
|
const char **types, unsigned int num_types,
|
||||||
void *data, int size,
|
void *data, int size,
|
||||||
void *(*convert_cb)(E_Drag * drag, const char *type),
|
void *(*convert_cb)(E_Drag * drag, const char *type),
|
||||||
|
|
|
@ -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);
|
sel = (char*)eina_binbuf_string_steal(sbuf);
|
||||||
eina_binbuf_free(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);
|
sel, sel_length, NULL, _e_fm2_cb_drag_finished);
|
||||||
if (layout)
|
if (layout)
|
||||||
d->x = ic->sd->x, d->y = ic->sd->y;
|
d->x = ic->sd->x, d->y = ic->sd->y;
|
||||||
|
|
|
@ -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);
|
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,
|
drag_types, 1, gcc, -1, NULL,
|
||||||
e_gadcon_drag_finished_cb);
|
e_gadcon_drag_finished_cb);
|
||||||
if (!drag) return;
|
if (!drag) return;
|
||||||
|
|
|
@ -985,7 +985,7 @@ _e_int_menus_apps_run(void *data, E_Menu *m, E_Menu_Item *mi __UNUSED__)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
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;
|
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);
|
evas_object_geometry_get(mi->icon_object, &x, &y, &w, &h);
|
||||||
efreet_desktop_ref(desktop);
|
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);
|
NULL, NULL);
|
||||||
|
|
||||||
size = MIN(w, h);
|
size = MIN(w, h);
|
||||||
|
|
|
@ -1534,7 +1534,7 @@ on_move(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
|
||||||
drag_gcc->dx = mx - ox;
|
drag_gcc->dx = mx - ox;
|
||||||
drag_gcc->dy = my - oy;
|
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,
|
drag_types, 1, drag_gcc, -1, NULL,
|
||||||
e_gadcon_drag_finished_cb);
|
e_gadcon_drag_finished_cb);
|
||||||
if (!drag) return;
|
if (!drag) return;
|
||||||
|
|
|
@ -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;
|
if (ic->ibar->inst->ci->lock_move) return;
|
||||||
|
|
||||||
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
|
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
|
||||||
d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->comp,
|
d = e_drag_new(x, y, drag_types, 1,
|
||||||
x, y, drag_types, 1,
|
|
||||||
ic->app, -1, NULL, _ibar_cb_drag_finished);
|
ic->app, -1, NULL, _ibar_cb_drag_finished);
|
||||||
efreet_desktop_ref(ic->app);
|
efreet_desktop_ref(ic->app);
|
||||||
size = MAX(w, h);
|
size = MAX(w, h);
|
||||||
|
|
|
@ -781,8 +781,7 @@ _ibox_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
||||||
ic->drag.start = 0;
|
ic->drag.start = 0;
|
||||||
|
|
||||||
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
|
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
|
||||||
d = e_drag_new(ic->ibox->inst->gcc->gadcon->zone->comp,
|
d = e_drag_new(x, y, drag_types, 1,
|
||||||
x, y, drag_types, 1,
|
|
||||||
ic->client, -1, NULL, _ibox_cb_drag_finished);
|
ic->client, -1, NULL, _ibox_cb_drag_finished);
|
||||||
o = e_client_icon_add(ic->client, e_drag_evas_get(d));
|
o = e_client_icon_add(ic->client, e_drag_evas_get(d));
|
||||||
e_drag_object_set(d, o);
|
e_drag_object_set(d, o);
|
||||||
|
|
|
@ -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_geometry_get(pw->o_mirror, &x, &y, &w, &h);
|
||||||
evas_object_hide(pw->o_mirror);
|
evas_object_hide(pw->o_mirror);
|
||||||
|
|
||||||
drag = e_drag_new(e_comp,
|
drag = e_drag_new(x, y, drag_types, 2, pw->desk->pager, -1,
|
||||||
x, y, drag_types, 2, pw->desk->pager, -1,
|
|
||||||
_pager_window_cb_drag_convert,
|
_pager_window_cb_drag_convert,
|
||||||
_pager_window_cb_drag_finished);
|
_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)
|
if (pd->drag.in_pager && pd->pager)
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
|
evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
|
||||||
drag = e_drag_new(pd->pager->zone->comp,
|
drag = e_drag_new(x, y, drag_types, 1, pd, -1,
|
||||||
x, y, drag_types, 1, pd, -1,
|
|
||||||
NULL, _pager_desk_cb_drag_finished);
|
NULL, _pager_desk_cb_drag_finished);
|
||||||
|
|
||||||
/* redraw the desktop theme above */
|
/* redraw the desktop theme above */
|
||||||
|
|
|
@ -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_geometry_get(pw->o_window, &x, &y, &w, &h);
|
||||||
evas_object_hide(pw->o_window);
|
evas_object_hide(pw->o_window);
|
||||||
|
|
||||||
drag = e_drag_new(pw->desk->pager->zone->comp,
|
drag = e_drag_new(x, y, drag_types, 2, pw, -1,
|
||||||
x, y, drag_types, 2, pw, -1,
|
|
||||||
_pager_window_cb_drag_convert,
|
_pager_window_cb_drag_convert,
|
||||||
_pager_window_cb_drag_finished);
|
_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)
|
if (pd->drag.in_pager && pd->pager)
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
|
evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
|
||||||
drag = e_drag_new(pd->pager->zone->comp,
|
drag = e_drag_new(x, y, drag_types, 1, pd, -1,
|
||||||
x, y, drag_types, 1, pd, -1,
|
|
||||||
NULL, _pager_desk_cb_drag_finished);
|
NULL, _pager_desk_cb_drag_finished);
|
||||||
|
|
||||||
/* redraw the desktop theme above */
|
/* redraw the desktop theme above */
|
||||||
|
|
Loading…
Reference in New Issue