Hook on evas_new instead of elm_win_add when tracking Evas.
This makes it more general and thus suitable for non-elm applications.
This commit is contained in:
parent
b4b7e65edd
commit
b606de65cc
|
@ -36,6 +36,7 @@ static Lists_st *vr_list = NULL;
|
|||
static evas_hook_setting *_hook_setting = NULL;
|
||||
static Tsuite_Data ts;
|
||||
static Eina_List *evas_list = NULL; /* List of Evas pointers */
|
||||
static int ignore_evas_new = 0; /* Counter to know if we should ignore evas new or not. */
|
||||
|
||||
static void
|
||||
_tsuite_verbosef(const char *fmt, ...)
|
||||
|
@ -201,7 +202,11 @@ tsuite_shot_do(char *name, Evas *e)
|
|||
if (!pixels) return;
|
||||
ecore_evas_geometry_get(ee_orig, NULL, NULL, &w, &h);
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
|
||||
ignore_evas_new++;
|
||||
ee = ecore_evas_buffer_new(1, 1);
|
||||
ignore_evas_new--;
|
||||
|
||||
o = evas_object_image_add(ecore_evas_get(ee));
|
||||
evas_object_image_alpha_set(o, ecore_evas_alpha_get(ee_orig));
|
||||
evas_object_image_size_set(o, w, h);
|
||||
|
@ -287,34 +292,23 @@ ecore_shutdown(void)
|
|||
return _ecore_shutdown();
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
||||
{
|
||||
Evas_Object *win;
|
||||
Evas_Object * (* _elm_win_add) (Evas_Object *, const char *, Elm_Win_Type) =
|
||||
dlsym(RTLD_NEXT, "elm_win_add");
|
||||
|
||||
win = _elm_win_add(parent, name, type);
|
||||
evas_list = eina_list_append(evas_list, evas_object_evas_get(win));
|
||||
#ifdef DEBUG_TSUITE
|
||||
printf("Appended EVAS=<%p> list size=<%d>\n", evas_object_evas_get(win), eina_list_count(evas_list));
|
||||
#endif
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
/* We don't use this in the meantime because a new evas
|
||||
* is allocated at tsuite_shot_do, this changes ts.e
|
||||
EAPI Evas *
|
||||
evas_new(void)
|
||||
{
|
||||
Evas * (*_evas_new)(void) =
|
||||
dlsym(RTLD_NEXT, "evas_new");
|
||||
Evas *evas;
|
||||
Evas * (*_evas_new)(void) = dlsym(RTLD_NEXT, __FUNCTION__);
|
||||
|
||||
ts.e = _evas_new();
|
||||
return ts.e;
|
||||
evas = _evas_new();
|
||||
if (ignore_evas_new == 0)
|
||||
{
|
||||
evas_list = eina_list_append(evas_list, evas);
|
||||
#ifdef DEBUG_TSUITE
|
||||
printf("Appended EVAS=<%p> list size=<%d>\n", evas, eina_list_count(evas_list));
|
||||
#endif
|
||||
}
|
||||
|
||||
return evas;
|
||||
}
|
||||
*/
|
||||
|
||||
static Eina_Bool
|
||||
tsuite_feed_event(void *data)
|
||||
|
|
Loading…
Reference in New Issue