add e_util_size_debug_set() to allow easier size debugging of objects in e

SVN revision: 74221
This commit is contained in:
Mike Blumenkrantz 2012-07-20 08:54:14 +00:00
parent 67db80b0bb
commit a427ed3e82
2 changed files with 24 additions and 0 deletions

View File

@ -1795,3 +1795,26 @@ e_util_time_str_get(long int seconds)
}
return buf;
}
static void
_e_util_size_debug(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
int x, y, w, h;
evas_object_geometry_get(obj, &x, &y, &w, &h);
fprintf(stderr, "OBJ[%p]: (%d,%d) - %dx%d\n", obj, x, y, w, h);
}
EAPI void
e_util_size_debug_set(Evas_Object *obj, Eina_Bool enable)
{
if (enable)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _e_util_size_debug, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _e_util_size_debug, NULL);
}
else
{
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, _e_util_size_debug, NULL);
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _e_util_size_debug, NULL);
}
}

View File

@ -82,5 +82,6 @@ EAPI int e_util_container_desk_count_get(E_Container *con);
EAPI Eina_Bool e_util_fullscreen_curreny_any(void);
EAPI Eina_Bool e_util_fullscreen_any(void);
EAPI const char *e_util_time_str_get(long int seconds);
EAPI void e_util_size_debug_set(Evas_Object *obj, Eina_Bool enable);
#endif
#endif