Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src Modified Files: ewl_embed.c ewl_embed.h ewl_menu.c ewl_misc.c ewl_window.c Log Message: Prevent destroyed widgets from reaching new reference areas. Add a function to help map coords used by the widgets to screen coords. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewl_embed.c 27 Jan 2004 06:08:35 -0000 1.20 +++ ewl_embed.c 5 Feb 2004 17:21:36 -0000 1.21 @@ -340,6 +340,32 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * @param e: the embed to retrieve coord screen position + * @param xx: the x coord to map to a screen position + * @param yy: the y coord to map to a screen position + * @param x: storage for the mapped screen x position + * @param y: storage for the mapped screen y position + * @return Returns no value. + * @brief Maps coordinates from the Evas to screen coordinates + */ +void ewl_embed_coord_to_screen(Ewl_Embed *e, int xx, int yy, int *x, int *y) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("e", e); + + if (e->evas) { + if (x) + *x = (int)(evas_coord_world_x_to_screen(e->evas, + (Evas_Coord)(xx))); + if (y) + *y = (int)(evas_coord_world_y_to_screen(e->evas, + (Evas_Coord)(yy))); + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + void ewl_embed_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_Object *o; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_embed.h 3 Jan 2004 21:23:11 -0000 1.11 +++ ewl_embed.h 5 Feb 2004 17:21:36 -0000 1.12 @@ -52,6 +52,8 @@ void ewl_embed_next_tab_order(Ewl_Embed *e); void ewl_embed_remove_tab_order(Ewl_Embed *e, Ewl_Widget *w); void ewl_embed_push_tab_order(Ewl_Embed *e, Ewl_Widget *w); +void ewl_embed_coord_to_screen(Ewl_Embed *e, int xx, int yy, + int *x, int *y); /* * Internally used callbacks, override at your own risk. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_menu.c 16 Dec 2003 00:09:18 -0000 1.14 +++ ewl_menu.c 5 Feb 2004 17:21:36 -0000 1.15 @@ -55,7 +55,7 @@ void ewl_menu_expand_cb(Ewl_Widget * w, void *ev_data, void *user_data) { - int x = 0, y = 0; + int x = 0, y = 0, xx = 0, yy = 0; Ewl_Menu *menu; Ewl_Embed *emb; @@ -75,28 +75,25 @@ ewl_window_set_borderless(EWL_WINDOW(menu->base.popup)); ewl_object_set_fill_policy(EWL_OBJECT(menu->base.popup), EWL_FLAG_FILL_NONE); - - /* FIXME: We will need a real function for doing this from the embed - * perspective. - ewl_window_get_position(emb, &x, &y); - */ /* * Position the popup menu relative to the menu. */ - if (EWL_MENU_ITEM(w)->submenu) { - x += CURRENT_X(w) + CURRENT_W(w); - y += CURRENT_Y(w); + xx = CURRENT_X(w) + CURRENT_W(w); + yy = CURRENT_Y(w); } else { - x += CURRENT_X(w); - y += CURRENT_Y(w) + CURRENT_H(w); + xx = CURRENT_X(w); + yy = CURRENT_Y(w) + CURRENT_H(w); ewl_object_set_minimum_size(EWL_OBJECT(menu->base.popup), CURRENT_W(menu), MINIMUM_H(menu->base.popup)); } + ewl_embed_coord_to_screen(emb, xx, yy, &x, &y); + printf("Coords %d, %d, mapped to %d, %d\n", xx, yy, x, y); + ewl_widget_realize(EWL_WIDGET(menu->base.popup)); ewl_window_move(EWL_WINDOW(menu->base.popup), x, y); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -3 -r1.61 -r1.62 --- ewl_misc.c 4 Feb 2004 18:58:01 -0000 1.61 +++ ewl_misc.c 5 Feb 2004 17:21:36 -0000 1.62 @@ -307,6 +307,9 @@ DENTER_FUNCTION(DLEVEL_TESTING); DCHECK_PARAM_PTR("w", w); + if (ewl_object_has_queued(EWL_OBJECT(w), EWL_FLAG_QUEUED_DSCHEDULED)) + DRETURN(DLEVEL_STABLE); + emb = ewl_embed_find_by_widget(w); if (!emb) DRETURN(DLEVEL_STABLE); @@ -628,6 +631,9 @@ if (ewl_object_has_queued(EWL_OBJECT(w), EWL_FLAG_QUEUED_DSCHEDULED)) DRETURN(DLEVEL_STABLE); + if (ewl_object_has_queued(EWL_OBJECT(w), EWL_FLAG_QUEUED_CSCHEDULED)) + ewl_configure_cancel_request(w); + ewl_object_add_queued(EWL_OBJECT(w), EWL_FLAG_QUEUED_DSCHEDULED); /* =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -3 -r1.68 -r1.69 --- ewl_window.c 27 Jan 2004 06:08:36 -0000 1.68 +++ ewl_window.c 5 Feb 2004 17:21:36 -0000 1.69 @@ -480,6 +480,9 @@ IF_FREE(win->title); + if ((win = ewd_list_goto(ewl_window_list, win))) + ewd_list_remove(ewl_window_list); + DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs