tasn pushed a commit to branch master.
commit b606de65cccd749baaf961d96b3d409c60e6debe
Author: Tom Hacohen <[email protected]>
Date: Thu Jun 13 13:47:10 2013 +0100
Hook on evas_new instead of elm_win_add when tracking Evas.
This makes it more general and thus suitable for non-elm applications.
---
src/lib/tsuite_evas_hook.c | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
diff --git a/src/lib/tsuite_evas_hook.c b/src/lib/tsuite_evas_hook.c
index bee6d47..6d2d633 100644
--- a/src/lib/tsuite_evas_hook.c
+++ b/src/lib/tsuite_evas_hook.c
@@ -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)
+EAPI Evas *
+evas_new(void)
{
- Evas_Object *win;
- Evas_Object * (* _elm_win_add) (Evas_Object *, const char *, Elm_Win_Type) =
- dlsym(RTLD_NEXT, "elm_win_add");
+ Evas *evas;
+ Evas * (*_evas_new)(void) = dlsym(RTLD_NEXT, __FUNCTION__);
- win = _elm_win_add(parent, name, type);
- evas_list = eina_list_append(evas_list, evas_object_evas_get(win));
+ 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_object_evas_get(win),
eina_list_count(evas_list));
+ printf("Appended EVAS=<%p> list size=<%d>\n", evas,
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");
-
- ts.e = _evas_new();
- return ts.e;
+ return evas;
}
-*/
static Eina_Bool
tsuite_feed_event(void *data)
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev