From: Enlightenment C. <no...@cv...> - 2006-09-09 04:07:53
|
Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_embed.c ewl_embed.h Log Message: Send correct status messages on DND position events, and ignore events on windows that EWL doesn't know about. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -3 -r1.79 -r1.80 --- ewl_embed.c 8 Sep 2006 07:12:43 -0000 1.79 +++ ewl_embed.c 9 Sep 2006 04:07:51 -0000 1.80 @@ -771,15 +771,16 @@ * @return Returns no value. * @brief Sends the event for a DND position into an embed. */ -void +const char * ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y, int* px, int* py, int* pw, int* ph) { + const char *result = NULL; Ewl_Widget *widget = NULL; Ewl_Event_Dnd_Position ev; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("embed", embed); - DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); + DCHECK_PARAM_PTR_RET("embed", embed, NULL); + DCHECK_TYPE_RET("embed", embed, EWL_EMBED_TYPE, NULL); ev.x = x; ev.y = y; @@ -788,11 +789,13 @@ widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed), x, y); if (widget) { + int i; Ewl_Widget *parent; /* If the last position event was over a different widget, * feed the leaving widget a 'null' */ if (embed->dnd_last_position != widget) { + if (embed->dnd_last_position) { parent = embed->dnd_last_position; @@ -826,6 +829,14 @@ ewl_dnd_position_windows_set(EWL_WIDGET(embed)); embed->dnd_last_position = widget; + /* Request a DND data request */ + for (i = 0; i < embed->dnd_types.num_types; i++) { + if (ewl_dnd_accepted_types_contains(widget, embed->dnd_types.types[i])) { + result = embed->dnd_types.types[i]; + break; + } + } + *px = CURRENT_X(widget); *py = CURRENT_Y(widget); *pw = CURRENT_W(widget); @@ -834,7 +845,7 @@ DWARNING("Could not find widget for dnd position event"); } - DLEAVE_FUNCTION(DLEVEL_STABLE); + DRETURN_PTR(result, DLEVEL_STABLE); } /** =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- ewl_embed.h 8 Sep 2006 07:12:43 -0000 1.25 +++ ewl_embed.h 9 Sep 2006 04:07:51 -0000 1.26 @@ -104,7 +104,7 @@ void ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int modifiers); -void ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y,int*,int*,int*,int*); +const char *embed_dnd_position_feed(Ewl_Embed *embed, int x, int y,int*,int*,int*,int*); const char *ewl_embed_dnd_drop_feed(Ewl_Embed* embed, int x, int y, int internal); void ewl_embed_dnd_data_feed(Ewl_Embed* embed, void *data, unsigned int len); void ewl_embed_selection_data_feed(Ewl_Embed *embed, char *type, void *data, unsigned int len); |