Enlightenment CVS committal Author : codewarrior Project : misc Module : engage
Dir : misc/engage/src/module Modified Files: e_mod_main.c Log Message: initial ecore_x_dnd integration =================================================================== RCS file: /cvsroot/enlightenment/misc/engage/src/module/e_mod_main.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- e_mod_main.c 11 Mar 2005 00:04:22 -0000 1.25 +++ e_mod_main.c 11 Mar 2005 11:23:30 -0000 1.26 @@ -47,6 +47,9 @@ static void _engage_app_change(void *data, E_App *a, E_App_Change ch); static void _engage_config_menu_new(Engage *e); +/* xdnd alpha code - this is a temp */ +static int _engage_cb_event_dnd_drop(void *data, int type, void *event); + static int _engage_cb_event_border_add(void *data, int type, void *event); static int _engage_cb_event_border_remove(void *data, int type, void *event); static int _engage_cb_event_border_iconify(void *data, int type, void *event); @@ -524,6 +527,13 @@ _engage_cb_event_border_iconify, eb); eb->uniconify_handler = ecore_event_handler_add(E_EVENT_BORDER_UNICONIFY, _engage_cb_event_border_uniconify, eb); + + /* xdnd alpha code - this shouldnt hurt or break anything */ + e_hints_window_visible_set(eb->con->bg_win); + ecore_x_dnd_aware_set(eb->con->bg_win, 1); + ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP, _engage_cb_event_dnd_drop , NULL); + + return eb; } @@ -822,6 +832,51 @@ e->config_menu = mn; } +/* xdnd alpha code */ + +char *atom_to_string(Ecore_X_Atom atom) { + if (atom == ECORE_X_DND_ACTION_COPY) + return "copy"; + + else if (atom == ECORE_X_DND_ACTION_MOVE) + return "move"; + + else if (atom == ECORE_X_DND_ACTION_LINK) + return "link"; + + else if (atom == ECORE_X_DND_ACTION_ASK) + return "ask"; + + else if (atom == ECORE_X_DND_ACTION_PRIVATE) + return "private"; + + else + return "unknown"; +} + + +static int +_engage_cb_event_dnd_drop(void *data, int type, void *event) +{ + Ecore_X_Rectangle rect; + Ecore_X_Event_Xdnd_Drop *dnd; + + dnd = event; + + printf("XDND Drop win %d source %d at %u action %s postion " + "{x: %d y: %d}\n", dnd->win, dnd->source, dnd->time, + atom_to_string(dnd->action), dnd->position.x, + dnd->position.y); + + rect.x = dnd->position.x; + rect.y = dnd->position.y; + rect.width = 1; /* not sure */ + rect.height = 1; /* not sure */ + + ecore_x_dnd_send_status(1, 0, rect, dnd->action); + +} + static int _engage_cb_event_border_add(void *data, int type, void *event) { ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs