Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_embed.c ewl_embed.h Log Message: add ewl_embed_last_mouse_position_get() =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -3 -r1.119 -r1.120 --- ewl_embed.c 1 Apr 2007 21:48:06 -0000 1.119 +++ ewl_embed.c 28 May 2007 18:00:07 -0000 1.120 @@ -4,6 +4,9 @@ #include "ewl_macros.h" #include "ewl_debug.h" +static int ewl_embed_last_mouse_x = 0; +static int ewl_embed_last_mouse_y = 0; + Ecore_List *ewl_embed_list = NULL; static Evas_Smart *embedded_smart = NULL; static Ewl_Embed *ewl_embed_active_embed = NULL; @@ -353,6 +356,29 @@ } /** + * @param x: a pointer to the location to save the x coordinate + * @param y: a pointer to the location to save the y coordinate + * @return Returns no value. + * @brief Get the last tracked mouse position + * + * Get the last tracked mouse position. Ewl only tracks mouse postion, which + * are recognized by EWL that mean it only gives you the last mouse positon + * that is recognized inside of an Ewl_Embed. + * + * The x and y pointer may be NULL. + */ +void +ewl_embed_last_mouse_position_get(int *x, int *y) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + + if (x) *x = ewl_embed_last_mouse_x; + if (y) *y = ewl_embed_last_mouse_y; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** * @param embed: the embed where the key event is to occur * @param keyname: the key press to trigger * @param mods: the mask of key modifiers currently pressed @@ -500,6 +526,12 @@ DCHECK_PARAM_PTR("embed", embed); DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); + /* + * Keep track on the mouse position + */ + ewl_embed_last_mouse_x = x + embed->x; + ewl_embed_last_mouse_y = y + embed->y; + ewl_embed_active_set(embed, TRUE); widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed), x, y); @@ -603,6 +635,13 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("embed", embed); DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); + + /* + * Keep track on the mouse position + */ + ewl_embed_last_mouse_x = x + embed->x; + ewl_embed_last_mouse_y = y + embed->y; + ewl_embed_active_set(embed, TRUE); @@ -648,6 +687,12 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("embed", embed); DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); + + /* + * Keep track on the mouse position + */ + ewl_embed_last_mouse_x = x + embed->x; + ewl_embed_last_mouse_y = y + embed->y; ewl_embed_active_set(embed, TRUE); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- ewl_embed.h 4 Mar 2007 00:52:01 -0000 1.44 +++ ewl_embed.h 28 May 2007 18:00:08 -0000 1.45 @@ -107,6 +107,8 @@ void ewl_embed_active_set(Ewl_Embed *embed, unsigned int act); Ewl_Embed *ewl_embed_active_embed_get(void); +void ewl_embed_last_mouse_position_get(int *x, int *y); + void ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname, unsigned int modifiers); void ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname, ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs