e dnd xds handler now passes type string param as well as data

SVN revision: 78157
This commit is contained in:
Mike Blumenkrantz 2012-10-18 08:04:03 +00:00
parent 57d8dd8f9b
commit 46d2653dbc
4 changed files with 8 additions and 8 deletions

View File

@ -358,7 +358,7 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
} }
EAPI void EAPI void
e_drop_handler_xds_set(E_Drop_Handler *handler, Ecore_Task_Cb cb) e_drop_handler_xds_set(E_Drop_Handler *handler, Eina_Bool (*cb)(void *data, const char *type))
{ {
handler->cb.xds = cb; handler->cb.xds = cb;
} }
@ -1436,7 +1436,7 @@ _e_dnd_cb_event_dnd_drop(void *data __UNUSED__, int type __UNUSED__, void *event
if (!h->active) continue; if (!h->active) continue;
if (_e_drag_win_matches(h, ev->win, 1) && h->entered && h->cb.xds) if (_e_drag_win_matches(h, ev->win, 1) && h->entered && h->cb.xds)
{ {
req = h->cb.xds(h->cb.data); req = h->cb.xds(h->cb.data, _xdnd->type);
} }
} }
if (req) ecore_x_selection_xdnd_request(ev->win, _xdnd->type); if (req) ecore_x_selection_xdnd_request(ev->win, _xdnd->type);

View File

@ -67,7 +67,7 @@ struct _E_Drop_Handler
void (*move)(void *data, const char *type, void *event); void (*move)(void *data, const char *type, void *event);
void (*leave)(void *data, const char *type, void *event); void (*leave)(void *data, const char *type, void *event);
void (*drop)(void *data, const char *type, void *event); void (*drop)(void *data, const char *type, void *event);
Ecore_Task_Cb xds; Eina_Bool (*xds)(void *data, const char *type);
void *data; void *data;
} cb; } cb;
@ -129,7 +129,7 @@ EAPI int e_drag_start(E_Drag *drag, int x, int y);
EAPI int e_drag_xdnd_start(E_Drag *drag, int x, int y); EAPI int e_drag_xdnd_start(E_Drag *drag, int x, int y);
EAPI void e_drop_xds_update(Eina_Bool enable, const char *value); EAPI void e_drop_xds_update(Eina_Bool enable, const char *value);
EAPI void e_drop_handler_xds_set(E_Drop_Handler *handler, Ecore_Task_Cb cb); EAPI void e_drop_handler_xds_set(E_Drop_Handler *handler, Eina_Bool (*cb)(void *data, const char *type));
EAPI E_Drop_Handler *e_drop_handler_add(E_Object *obj, EAPI E_Drop_Handler *e_drop_handler_add(E_Object *obj,
void *data, void *data,
void (*enter_cb)(void *data, const char *type, void *event), void (*enter_cb)(void *data, const char *type, void *event),

View File

@ -847,7 +847,7 @@ e_fm2_add(Evas *evas)
} }
static Eina_Bool static Eina_Bool
_e_fm2_cb_dnd_drop(void *data) _e_fm2_cb_dnd_drop(void *data, const char *type)
{ {
E_Fm2_Smart_Data *sd = data; E_Fm2_Smart_Data *sd = data;
Eina_Bool allow; Eina_Bool allow;
@ -1556,7 +1556,7 @@ e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj)
drop, 4, drop, 4,
sd->x, sd->y, sd->w, sd->h); sd->x, sd->y, sd->w, sd->h);
e_drop_handler_responsive_set(sd->drop_handler); e_drop_handler_responsive_set(sd->drop_handler);
e_drop_handler_xds_set(sd->drop_handler, (Ecore_Task_Cb)_e_fm2_cb_dnd_drop); e_drop_handler_xds_set(sd->drop_handler, _e_fm2_cb_dnd_drop);
} }
EAPI void EAPI void

View File

@ -186,7 +186,7 @@ out:
} }
static Eina_Bool static Eina_Bool
_box_button_cb_dnd_drop(void *data) _box_button_cb_dnd_drop(void *data, const char *type __UNUSED__)
{ {
Instance *inst = data; Instance *inst = data;
Eina_List *l; Eina_List *l;
@ -331,7 +331,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
evas_object_event_callback_add(inst->o_scroll, EVAS_CALLBACK_MOVE, _gc_moveresize, inst); evas_object_event_callback_add(inst->o_scroll, EVAS_CALLBACK_MOVE, _gc_moveresize, inst);
evas_object_event_callback_add(inst->o_scroll, EVAS_CALLBACK_RESIZE, _gc_moveresize, inst); evas_object_event_callback_add(inst->o_scroll, EVAS_CALLBACK_RESIZE, _gc_moveresize, inst);
e_drop_handler_responsive_set(inst->dnd_handler); e_drop_handler_responsive_set(inst->dnd_handler);
e_drop_handler_xds_set(inst->dnd_handler, (Ecore_Task_Cb)_box_button_cb_dnd_drop); e_drop_handler_xds_set(inst->dnd_handler, _box_button_cb_dnd_drop);
instances = eina_list_append(instances, inst); instances = eina_list_append(instances, inst);