Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests/dnd_snoop Modified Files: ewl_dnd_snoop.c Log Message: Update to ecore_x selection request structure change. Add support for data request handling. Update DND test to support sending DND drop results. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/dnd_snoop/ewl_dnd_snoop.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_dnd_snoop.c 7 Dec 2006 20:05:07 -0000 1.5 +++ ewl_dnd_snoop.c 11 Dec 2006 23:16:49 -0000 1.6 @@ -95,7 +95,6 @@ ewl_callback_append(o, EWL_CALLBACK_DND_POSITION, ewl_dnd_snoop_cb_dnd_position, NULL); ewl_callback_append(o, EWL_CALLBACK_DND_DROP, ewl_dnd_snoop_cb_dnd_drop, NULL); ewl_callback_append(o, EWL_CALLBACK_DND_DATA_RECEIVED, ewl_dnd_snoop_cb_dnd_data, NULL); - ewl_callback_append(o, EWL_CALLBACK_DND_DATA_REQUEST, ewl_dnd_snoop_cb_dnd_data_request, NULL); ewl_widget_name_set(o, "entry"); ewl_entry_multiline_set(EWL_ENTRY(o), TRUE); ewl_text_wrap_set(EWL_TEXT(o), TRUE); @@ -138,6 +137,7 @@ o = ewl_button_new(); ewl_button_label_set(EWL_BUTTON(o), "Drag This"); + ewl_callback_append(o, EWL_CALLBACK_DND_DATA_REQUEST, ewl_dnd_snoop_cb_dnd_data_request, NULL); ewl_dnd_provided_types_set(o, text_types); ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE); ewl_container_child_append(box, o); @@ -181,8 +181,16 @@ ewl_dnd_snoop_cb_dnd_data_request(Ewl_Widget *w, void *event, void *data __UNUSED__) { + Ewl_Embed *emb; Ewl_Event_Dnd_Data_Request *ev = event; + printf("Data request on widget %p: type %s\n", w, ev->type); + printf("\tSending response: %s\n", w->inheritance); + emb = ewl_embed_widget_find(w); + if (emb) + ewl_engine_embed_dnd_drag_data_send(emb, ev->handle, + (void *)w->inheritance, + strlen(w->inheritance) + 1); } static int @@ -358,7 +366,10 @@ snprintf(buf, sizeof(buf), "\nSelection Request\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n", event->win); + snprintf(buf, sizeof(buf), "\tOwner: %d\n", event->owner); + ewl_dnd_snoop_output(buf); + + snprintf(buf, sizeof(buf), "\tRequestor: %d\n", event->requestor); ewl_dnd_snoop_output(buf); snprintf(buf, sizeof(buf), "\tTime: %d\n", event->time); ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs