From 07a0bface3d703028f96b55b48a6c75e9ce385d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 6 Oct 2020 09:06:44 -0300 Subject: [PATCH 01/35] win32: Enable exactness --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index d4162af987..741a1bfd9f 100644 --- a/meson.build +++ b/meson.build @@ -495,7 +495,6 @@ subprojects = [ if sys_windows ignored_subprojects = [ # temporarily ignored - 'exactness', ] else ignored_subprojects = [] From 99390e1948b1694307dcd36213e5456034691ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 6 Oct 2020 17:43:47 -0300 Subject: [PATCH 02/35] exactness: meson should not use directly '/' when possible --- src/bin/exactness/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build index 4d048f18c9..d60883fa2e 100644 --- a/src/bin/exactness/meson.build +++ b/src/bin/exactness/meson.build @@ -23,7 +23,7 @@ edjs = custom_target('player_entry', input : 'player_entry.edc', output : 'player_entry.edj', install : true, - install_dir : 'share/exactness', + install_dir : join_paths('share', 'exactness'), command : edje_cc_exe + [ '-id', join_paths(meson.source_root(), 'data', 'elementary', 'themes', 'img'), '-sd', join_paths(meson.source_root(), 'data', 'elementary', 'themes', 'snd'), From e6879cef586395959709afdca0494f12f41e1998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 6 Oct 2020 17:24:42 -0300 Subject: [PATCH 03/35] exactness: fix implicit conversion - The warning was: ../src/bin/exactness/recorder.c(143,27): warning: implicit conversion from enumeration type 'Efl_Pointer_Flags' to different enumeration type 'Evas_Button_Flags' (aka 'enum _Evas_Button_Flags') [-Wenum-conversion] fx, fy, flags }; --- src/bin/exactness/recorder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index 4e703c49b9..0727966565 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -139,7 +139,7 @@ _event_pointer_cb(void *data, const Efl_Event *event) Eina_Position2D pos = efl_input_pointer_position_get(evp); Efl_Pointer_Flags flags = efl_input_pointer_button_flags_get(evp); Exactness_Action_Multi_Event t = { tool, b, pos.x, pos.y, rad, radx, rady, pres, ang, - fx, fy, flags }; + fx, fy, (Evas_Button_Flags)flags }; if (n_evas >= 0) _add_to_list(evt, n_evas, timestamp, &t, sizeof(t)); break; } From c3c64ed4cfc6456e7e9b3db9483d5db7783b6a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 8 Oct 2020 09:38:00 -0300 Subject: [PATCH 04/35] exactness: add .py extension to python executable scripts Extensions are needed by Windows. --- src/bin/exactness/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build index d60883fa2e..1c7790393e 100644 --- a/src/bin/exactness/meson.build +++ b/src/bin/exactness/meson.build @@ -53,14 +53,14 @@ exactness_env.set_quoted('VERSION', meson.project_version()) configure_file( input: 'exactness_record.in', - output: 'exactness_record', + output: 'exactness_record.py', configuration: exactness_env, install_dir: get_option('bindir'), install_mode: 'rwxr-xr-x') configure_file( input: 'exactness_play.in', - output: 'exactness_play', + output: 'exactness_play.py', configuration: exactness_env, install_dir: get_option('bindir'), install_mode: 'rwxr-xr-x') From 4b158235aab1781a1d4ed9240cead1216989d0a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 8 Oct 2020 11:39:22 -0300 Subject: [PATCH 05/35] exactness: run edje_cc in-tree --- src/bin/exactness/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build index 1c7790393e..39f0d3a434 100644 --- a/src/bin/exactness/meson.build +++ b/src/bin/exactness/meson.build @@ -27,6 +27,7 @@ edjs = custom_target('player_entry', command : edje_cc_exe + [ '-id', join_paths(meson.source_root(), 'data', 'elementary', 'themes', 'img'), '-sd', join_paths(meson.source_root(), 'data', 'elementary', 'themes', 'snd'), + '-in-tree', '@INPUT@', '@OUTPUT@'], depends : edje_depends) From 1d9bb533307825aaadae79cea7854eec8e14f669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 13 Oct 2020 11:35:25 -0300 Subject: [PATCH 06/35] exactness: Fix lib preload path --- src/bin/exactness/meson.build | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build index 39f0d3a434..f2b47edf75 100644 --- a/src/bin/exactness/meson.build +++ b/src/bin/exactness/meson.build @@ -31,7 +31,7 @@ edjs = custom_target('player_entry', '@INPUT@', '@OUTPUT@'], depends : edje_depends) -exactness_play_bin = library('exactness_play', +exactness_play_lib = library('exactness_play', [ 'player.c', 'common.c', 'common.h', edjs ], dependencies: [ elementary, dl], c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', @@ -39,7 +39,7 @@ exactness_play_bin = library('exactness_play', version : meson.project_version() ) -exactness_record_bin = library('exactness_record', +exactness_record_lib = library('exactness_record', [ 'recorder.c', 'common.c', 'common.h' ], dependencies: [ elementary, dl], c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', @@ -47,9 +47,16 @@ exactness_record_bin = library('exactness_record', version : meson.project_version() ) +exactness_play_lib_path = join_paths( + get_option('prefix'), get_option('libdir'), + 'lib' + exactness_play_lib.name() + '.so.' + meson.project_version() ) +exactness_record_lib_path = join_paths( + get_option('prefix'), get_option('libdir'), + 'lib' + exactness_record_lib.name() + '.so.' + meson.project_version() ) + exactness_env = configuration_data() -exactness_env.set_quoted('EXACTNESS_PLAY_PRELOAD_PATH', exactness_play_bin.full_path()) -exactness_env.set_quoted('EXACTNESS_RECORD_PRELOAD_PATH', exactness_record_bin.full_path()) +exactness_env.set_quoted('EXACTNESS_PLAY_PRELOAD_PATH', exactness_play_lib_path) +exactness_env.set_quoted('EXACTNESS_RECORD_PRELOAD_PATH', exactness_record_lib_path) exactness_env.set_quoted('VERSION', meson.project_version()) configure_file( From 9a0d862d35325e17612dd9644511afe80c4db2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 13 Oct 2020 11:33:58 -0300 Subject: [PATCH 07/35] win32: Add exactness-win32 option to build system --- configure.bat | 1 + meson.build | 3 +++ meson_options.txt | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/configure.bat b/configure.bat index 57eef43029..4207191f6a 100644 --- a/configure.bat +++ b/configure.bat @@ -139,6 +139,7 @@ exit /B 0 -Dlibmount=false^ "-Devas-loaders-disabler=gst,pdf,ps,raw,svg,rsvg,xcf,bmp,dds,generic,gif,ico,jp2k,pmaps,psd,tga,tgv,tiff,wbmp,webp,xpm,json"^ -Dopengl=none^ + -Dexactness-win32=true^ "-Demotion-loaders-disabler=gstreamer1,libvlc,xine"^ -Dbindings=^ --buildtype=debug^ diff --git a/meson.build b/meson.build index 741a1bfd9f..318474bc69 100644 --- a/meson.build +++ b/meson.build @@ -496,6 +496,9 @@ if sys_windows ignored_subprojects = [ # temporarily ignored ] + if get_option('exactness-win32') == false + ignored_subprojects += ['exactness'] + endif else ignored_subprojects = [] endif diff --git a/meson_options.txt b/meson_options.txt index d63e7084d1..c79ee8341b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -344,6 +344,12 @@ option('dotnet', description: 'Enable building C# bindings with dotnet instead of mono' ) +option('exactness-win32', + type: 'boolean', + value: false, + description: 'Enable building Exactness on Windows' +) + option('lua-interpreter', type: 'combo', choices: ['luajit', 'lua'], From 9c55204ba2c276db8900934c1d2bc0c7a9f14ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 13 Oct 2020 11:58:03 -0300 Subject: [PATCH 08/35] ecore: add exactness-win32 --- src/lib/ecore/ecore_main.c | 19 +++++++++++++++++++ src/lib/ecore/meson.build | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 4bca7759f1..3858dd638f 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -1299,8 +1299,27 @@ ecore_main_loop_iterate_may_block(int may_block) return efl_loop_iterate_may_block(ML_OBJ, may_block); } +#ifdef EFL_EXACTNESS_WIN32 +typedef void(*ecore_main_loop_begin_t)(void); +ECORE_API ecore_main_loop_begin_t ecore_main_loop_begin_redirect = NULL; + +ECORE_API void +ecore_main_loop_begin(void) +{ + fprintf(stderr, "\n\n >>>>>>> ECORE: EFL_EXACTNESS_WIN32 ENABLED! <<<<<<<< \n\n"); + ERR("\n\n >>>>>>> ECORE: EFL_EXACTNESS_WIN32 ENABLED! <<<<<<<< \n\n"); + if (ecore_main_loop_begin_redirect) + ecore_main_loop_begin_redirect(); + else + ecore_main_loop_begin_original(); +} + +ECORE_API void +ecore_main_loop_begin_original(void) +#else ECORE_API void ecore_main_loop_begin(void) +#endif { DBG("ecore_main_loop_begin"); EINA_MAIN_LOOP_CHECK_RETURN; diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build index 14376c32e5..e346072512 100644 --- a/src/lib/ecore/meson.build +++ b/src/lib/ecore/meson.build @@ -197,6 +197,10 @@ if get_option('g-mainloop') == true endif endif +if sys_windows and get_option('exactness-win32') + config_h.set('EFL_EXACTNESS_WIN32', '1') +endif + ecore_lib = library('ecore', ecore_src, pub_eo_file_target, dependencies: ecore_pub_deps + [ecore_deps, ecore_ext_deps], From 5c4b93f1a8d16a9b03d5fca78293f5d9311e7714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 09:31:56 -0300 Subject: [PATCH 09/35] exactness: fix dlfcn and other headers --- src/bin/exactness/player.c | 9 +++++---- src/bin/exactness/recorder.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 278c72422f..83a84030ff 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -7,10 +7,11 @@ #include #ifndef _MSC_VER # include -#endif - -#ifdef HAVE_DLSYM -# include +# ifdef HAVE_DLSYM +# include +# endif +#else +# include #endif #ifdef HAVE_FORK diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index 0727966565..ebb7b06a08 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -7,10 +7,11 @@ #include #ifndef _MSC_VER # include -#endif - -#ifdef HAVE_DLSYM -# include +# ifdef HAVE_DLSYM +# include +# endif +#else +# include #endif #include From 70c3108d1f6d67a6d00a91efa8196344f196ea60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:17:16 -0300 Subject: [PATCH 10/35] exacness: Add DllMain and functions to exactness preload --- src/bin/exactness/player.c | 57 ++++++++++++++++++++++++++++++++++++ src/bin/exactness/recorder.c | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 83a84030ff..4781c0f378 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -1150,3 +1150,60 @@ eina_shutdown(void) return original_return; } + +#ifdef _WIN32 + +void exactness_init(void) +{ + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + + eina_init_redirect = eina_init; + eina_shutdown_redirect = eina_shutdown; + efl_loop_begin_redirect = efl_loop_begin; + elm_init_redirect = elm_init; + ecore_evas_init_redirect = ecore_evas_init; + ecore_main_loop_begin_redirect = ecore_main_loop_begin; +} + +void exactness_shutdown(void) +{ + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + + eina_init_redirect = NULL; + eina_shutdown_redirect = NULL; + efl_loop_begin_redirect = NULL; + elm_init_redirect = NULL; + ecore_evas_init_redirect = NULL; + ecore_main_loop_begin_redirect = NULL; +} + +BOOL WINAPI +DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +{ + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + switch (reason) + { + case DLL_PROCESS_ATTACH: + fprintf(stderr, "\n >>> DLL_PROCESS_ATTACH <<< \n"); + exactness_init(); + break; + case DLL_PROCESS_DETACH: + fprintf(stderr, "\n >>> DLL_PROCESS_DETACH <<< \n"); + exactness_shutdown(); + break; + case DLL_THREAD_ATTACH: + fprintf(stderr, "\n >>> DLL_THREAD_ATTACH <<< \n"); + exactness_init(); + break; + case DLL_THREAD_DETACH: + fprintf(stderr, "\n >>> DLL_THREAD_DETACH <<< \n"); + exactness_shutdown(); + break; + default: + break; + } + + return TRUE; +} + +#endif /* _WIN32 */ diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index ebb7b06a08..053a723e83 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -398,3 +398,60 @@ eina_shutdown(void) return original_return; } + +#ifdef _WIN32 + +void exactness_init(void) +{ + fprintf(stderr, " >>> %s:%s \n", __FILE__, __func__); + + eina_init_redirect = eina_init; + eina_shutdown_redirect = eina_shutdown; + efl_loop_begin_redirect = efl_loop_begin; + elm_init_redirect = elm_init; + ecore_evas_init_redirect = ecore_evas_init; + ecore_main_loop_begin_redirect = ecore_main_loop_begin; +} + +void exactness_shutdown(void) +{ + fprintf(stderr, " >>> %s:%s \n", __FILE__, __func__); + + eina_init_redirect = NULL; + eina_shutdown_redirect = NULL; + efl_loop_begin_redirect = NULL; + elm_init_redirect = NULL; + ecore_evas_init_redirect = NULL; + ecore_main_loop_begin_redirect = NULL; +} + +BOOL WINAPI +DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +{ + fprintf(stderr, " >>> %s:%s \n", __FILE__, __func__); + switch (reason) + { + case DLL_PROCESS_ATTACH: + fprintf(stderr, " >>> DLL_PROCESS_ATTACH \n"); + exactness_init(); + break; + case DLL_PROCESS_DETACH: + fprintf(stderr, " >>> DLL_PROCESS_DETACH \n"); + exactness_shutdown(); + break; + case DLL_THREAD_ATTACH: + fprintf(stderr, "\n >>> DLL_THREAD_ATTACH <<< \n"); + exactness_init(); + break; + case DLL_THREAD_DETACH: + fprintf(stderr, "\n >>> DLL_THREAD_DETACH <<< \n"); + exactness_shutdown(); + break; + default: + break; + } + + return TRUE; +} + +#endif /* _WIN32 */ From b07811de8d608c53789dc3335e5935e52d60003c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:20:34 -0300 Subject: [PATCH 11/35] eina: add exactness preload support --- src/lib/eina/eina_main.c | 38 ++++++++++++++++++++++++++++++++++++++ src/lib/eina/eina_main.h | 10 ++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 3d3bdb6458..903724e90c 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -280,9 +280,29 @@ _eina_threads_do_shutdown(void) */ EINA_API Eina_Version *eina_version = &_version; +#ifdef EFL_EXACTNESS_WIN32 +typedef int(*eina_init_t)(void); +EINA_API eina_init_t eina_init_redirect = NULL; +EINA_API int eina_init_original(void); + +EINA_API int +eina_init(void) +{ + exactness_preload(); + if (eina_init_redirect) + return eina_init_redirect(); + else + return eina_init_original(); +} + +EINA_API int +eina_init_original(void) +#else EINA_API int eina_init(void) +#endif { + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); const struct eina_desc_setup *itr, *itr_end; if (EINA_LIKELY(_eina_main_count > 0)) @@ -351,9 +371,27 @@ eina_init(void) return 1; } +#ifdef EFL_EXACTNESS_WIN32 +EINA_API eina_shutdown_t eina_shutdown_redirect = NULL; + +EINA_API int +eina_shutdown(void) +{ + exactness_preload(); + if (eina_shutdown_redirect) + return eina_shutdown_redirect(); + else + return eina_shutdown_original(); +} + +EINA_API int +eina_shutdown_original(void) +#else EINA_API int eina_shutdown(void) +#endif { + fprintf(stderr, "\n >>> %s:%s (original) <<< \n", __FILE__, __func__); if (_eina_main_count <= 0) { ERR("Init count not greater than 0 in shutdown."); diff --git a/src/lib/eina/eina_main.h b/src/lib/eina/eina_main.h index 7b38917de4..36bb49c93a 100644 --- a/src/lib/eina/eina_main.h +++ b/src/lib/eina/eina_main.h @@ -175,6 +175,11 @@ EINA_API extern Eina_Error EINA_ERROR_NOT_IMPLEMENTED; * threads, but requires Eina to be compiled with such feature. * */ +#ifdef EFL_EXACTNESS_WIN32 +typedef int(*eina_init_t)(void); +EINA_API eina_init_t eina_init_redirect; +EINA_API int eina_init_original(void); +#endif EINA_API int eina_init(void); /** @@ -191,6 +196,11 @@ EINA_API int eina_init(void); * not call any of the Eina functions anymore. You must call * eina_init() again to use the Eina functions again. */ +#ifdef EFL_EXACTNESS_WIN32 +typedef int(*eina_shutdown_t)(void); +extern EINA_API eina_shutdown_t eina_shutdown_redirect; +EINA_API int eina_shutdown_original(void); +#endif EINA_API int eina_shutdown(void); /** From 208b78c144beadd892a730b3c01a288d684a60a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:29:11 -0300 Subject: [PATCH 12/35] elementary: add exactness preload support --- src/lib/elementary/elm_general.h | 19 +++++++++++++-- src/lib/elementary/elm_main.c | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h index 5c278f90e0..a5194948ad 100644 --- a/src/lib/elementary/elm_general.h +++ b/src/lib/elementary/elm_general.h @@ -525,13 +525,21 @@ typedef Eina_Bool (*Elm_Event_Cb)(void *data, Evas_Object *obj, Evas ELM_API extern double _elm_startup_time; #ifndef ELM_LIB_QUICKLAUNCH -#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ +#ifdef EFL_EXACTNESS_WIN32 +# define ELM_MAIN() int main(int argc, char **argv) { exactness_preload(); int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ +#else +# define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ +#endif #else /** @deprecated macro to be used after the elm_main() function. * Do not define ELM_LIB_QUICKLAUNCH * Compile your programs with -fpie and -pie -rdynamic instead, to generate a single binary (linkable executable). */ -#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } +#ifdef EFL_EXACTNESS_WIN32 +# define ELM_MAIN() int main(int argc, char **argv) { exactness_preload(); int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } +#else +#endif +# define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } #endif #define __EFL_UI_IS_REQUIRED @@ -573,6 +581,13 @@ ELM_API extern double _elm_startup_time; * @see elm_shutdown(). * @ingroup Elm_General */ +#ifdef EFL_EXACTNESS_WIN32 +typedef int(*elm_init_t)(int argc, char **argv); +extern ELM_API elm_init_t elm_init_redirect; +ELM_API Eina_Bool exactness_preload(void); + +ELM_API int elm_init_original(int argc, char **argv); +#endif ELM_API int elm_init(int argc, char **argv); /** diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index d39dd3ec01..10b6fccabd 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -419,9 +419,49 @@ _efl_ui_theme_apply_error_init(void) // This is necessary to keep backward compatibility static const char *bcargv[] = { "exe" }; +#ifdef EFL_EXACTNESS_WIN32 +ELM_API elm_init_t elm_init_redirect = NULL; + +ELM_API Eina_Bool +exactness_preload(void) +{ + //if (getenv("EXACTNESS_PRELOAD_WIN32")) + { + fprintf(stderr, "\n >>> %s:%s: redirect? %s <<< \n", __FILE__, __func__, (elm_init_redirect ? "YES" : "NULL")); + if (!eina_init_redirect) + { + HINSTANCE dll = LoadLibraryA("C:/Users/joaoantoniocardoso/efl/build/src/bin/exactness/exactness_play-1.dll"); + if (!dll) + { + fprintf(stderr, "\n >>> Failed loading exactness_play-1.dll <<< \n"); + return EINA_FALSE; + } + + fprintf(stderr, "\n >>> exactness_play-1.dll Loaded! <<< \n"); + return EINA_TRUE; + } + } + return EINA_FALSE; +} + ELM_API int elm_init(int argc, char **argv) { + exactness_preload(); + if (elm_init_redirect) + return elm_init_redirect(argc, argv); + else + return elm_init_original(argc, argv); +} + +ELM_API int +elm_init_original(int argc, char **argv) +#else +ELM_API int +elm_init(int argc, char **argv) +#endif +{ + fprintf(stderr, "\n >>> %s:%s (original) <<< \n", __FILE__, __func__); _elm_init_count++; if (_elm_init_count > 1) return _elm_init_count; EINA_SAFETY_ON_FALSE_RETURN_VAL(elm_quicklaunch_init(argc, argv ? argv : (char**) bcargv), --_elm_init_count); From 49c82cb71cc9a974b141710f38ffbd726bcce53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:31:40 -0300 Subject: [PATCH 13/35] ecore_evas: add exactness preload support --- src/lib/ecore_evas/Ecore_Evas.h | 5 +++++ src/lib/ecore_evas/ecore_evas.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 29e235941a..61aa8b66aa 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -159,6 +159,11 @@ ECORE_EVAS_API int ecore_evas_engine_type_supported_get(Ecore_Evas_Engin * * @see ecore_evas_shutdown() */ +#ifdef EFL_EXACTNESS_WIN32 +typedef int(*ecore_evas_init_t)(void); +extern ECORE_EVAS_API ecore_evas_init_t ecore_evas_init_redirect; +ECORE_EVAS_API int ecore_evas_init_original(void); +#endif ECORE_EVAS_API int ecore_evas_init(void); /** diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 1767de4a1a..a282bc8cf7 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -605,8 +605,26 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine) }; } + +#ifdef EFL_EXACTNESS_WIN32 +ECORE_EVAS_API ecore_evas_init_t ecore_evas_init_redirect = NULL; + ECORE_EVAS_API int ecore_evas_init(void) +{ + exactness_preload(); + if (ecore_evas_init_redirect) + return ecore_evas_init_redirect(); + else + return ecore_evas_init_original(); +} + +ECORE_EVAS_API int +ecore_evas_init_original(void) +#else +ECORE_EVAS_API int +ecore_evas_init(void) +#endif { Ecore_Evas_Object_Animator_Interface iface; From 487b2baa4b2012866a3ed92149a2b3dd25b7d578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:33:42 -0300 Subject: [PATCH 14/35] efl: add exactness preload support --- src/lib/ecore/Ecore.h | 8 ++++++++ src/lib/ecore/Ecore_Common.h | 5 +++++ src/lib/ecore/ecore_main.c | 5 ++--- src/lib/ecore/efl_loop.c | 17 +++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index 623f296cef..ef68a5c40e 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -306,6 +306,14 @@ extern "C" { ECORE_API double _ecore_main_loop_wakeup_time_get(void); +#ifdef EFL_EXACTNESS_WIN32 +# include "efl_loop_data.h" +typedef Eina_Value *(*efl_loop_begin_t)(Eo *obj, Efl_Loop_Data *pd); + +extern ECORE_API efl_loop_begin_t efl_loop_begin_redirect; +ECORE_API Eina_Value *efl_loop_begin_original(Eo *obj, Efl_Loop_Data *pd); +#endif + #ifdef __cplusplus } #endif diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h index aa2e8423db..d6841f3440 100644 --- a/src/lib/ecore/Ecore_Common.h +++ b/src/lib/ecore/Ecore_Common.h @@ -311,6 +311,11 @@ ECORE_API void ecore_main_loop_glib_always_integrate_disable(void); * timeout for the timers can be changed using * ecore_main_loop_select_func_set(). */ +#ifdef EFL_EXACTNESS_WIN32 +typedef void(*ecore_main_loop_begin_t)(void); +extern ECORE_API ecore_main_loop_begin_t ecore_main_loop_begin_redirect; +ECORE_API void ecore_main_loop_begin_original(void); +#endif ECORE_API void ecore_main_loop_begin(void); /** diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 3858dd638f..d0f5d7d347 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -1300,14 +1300,13 @@ ecore_main_loop_iterate_may_block(int may_block) } #ifdef EFL_EXACTNESS_WIN32 -typedef void(*ecore_main_loop_begin_t)(void); ECORE_API ecore_main_loop_begin_t ecore_main_loop_begin_redirect = NULL; +ECORE_API void ecore_main_loop_begin_original(void); ECORE_API void ecore_main_loop_begin(void) { - fprintf(stderr, "\n\n >>>>>>> ECORE: EFL_EXACTNESS_WIN32 ENABLED! <<<<<<<< \n\n"); - ERR("\n\n >>>>>>> ECORE: EFL_EXACTNESS_WIN32 ENABLED! <<<<<<<< \n\n"); + exactness_preload(); if (ecore_main_loop_begin_redirect) ecore_main_loop_begin_redirect(); else diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c index 84aa3f2c47..a102825df7 100644 --- a/src/lib/ecore/efl_loop.c +++ b/src/lib/ecore/efl_loop.c @@ -56,8 +56,25 @@ _efl_loop_iterate_may_block(Eo *obj, Efl_Loop_Data *pd, int may_block) return _ecore_main_loop_iterate_may_block(obj, pd, may_block); } +#ifdef EFL_EXACTNESS_WIN32 +ECORE_API efl_loop_begin_t efl_loop_begin_redirect = NULL; + +EOLIAN static Eina_Value * +_efl_loop_begin(Eo *obj, Efl_Loop_Data *pd) +{ + exactness_preload(); + if (efl_loop_begin_redirect) + return efl_loop_begin_redirect(obj, pd); + else + return efl_loop_begin_original(obj, pd); +} + +EOLIAN static Eina_Value * +efl_loop_begin_original(Eo *obj, Efl_Loop_Data *pd) +#else EOLIAN static Eina_Value * _efl_loop_begin(Eo *obj, Efl_Loop_Data *pd) +#endif { _ecore_main_loop_begin(obj, pd); if (pd->thread_children) From f9c1f49525ffa46a460114a3e5d89769e8e19b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:30:40 -0300 Subject: [PATCH 15/35] ecore: move efl_loop_data to its own file [fixup] efl_loop_data [Fixup] Add missing efl_loop_data.h --- src/lib/ecore/Ecore.h | 6 +-- src/lib/ecore/ecore_main.c | 1 - src/lib/ecore/ecore_private.h | 73 +-------------------------------- src/lib/ecore/efl_loop.c | 23 +++++++++-- src/lib/ecore/efl_loop_data.h | 76 +++++++++++++++++++++++++++++++++++ src/lib/ecore/meson.build | 1 + 6 files changed, 101 insertions(+), 79 deletions(-) create mode 100644 src/lib/ecore/efl_loop_data.h diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index ef68a5c40e..eb7a638bef 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -308,10 +308,10 @@ ECORE_API double _ecore_main_loop_wakeup_time_get(void); #ifdef EFL_EXACTNESS_WIN32 # include "efl_loop_data.h" -typedef Eina_Value *(*efl_loop_begin_t)(Eo *obj, Efl_Loop_Data *pd); - +typedef Eina_Value *(*efl_loop_begin_t)(Eo *obj); extern ECORE_API efl_loop_begin_t efl_loop_begin_redirect; -ECORE_API Eina_Value *efl_loop_begin_original(Eo *obj, Efl_Loop_Data *pd); +ECORE_API ECORE_API_WEAK Eina_Value *efl_loop_begin_original(Eo *obj); + #endif #ifdef __cplusplus diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index d0f5d7d347..c56d06528c 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -1301,7 +1301,6 @@ ecore_main_loop_iterate_may_block(int may_block) #ifdef EFL_EXACTNESS_WIN32 ECORE_API ecore_main_loop_begin_t ecore_main_loop_begin_redirect = NULL; -ECORE_API void ecore_main_loop_begin_original(void); ECORE_API void ecore_main_loop_begin(void) diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index 5576bb99e7..5cfa65b61c 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -10,6 +10,8 @@ #include "ecore_event_message.eo.h" #include "ecore_event_message_handler.eo.h" +#include "efl_loop_data.h" + extern int _ecore_log_dom; #ifdef _ECORE_DEFAULT_LOG_DOM # undef _ECORE_DEFAULT_LOG_DOM @@ -62,9 +64,6 @@ typedef struct _Ecore_Factorized_Idle Ecore_Factorized_Idle; typedef struct _Efl_Loop_Promise_Simple_Data Efl_Loop_Promise_Simple_Data; -typedef struct _Efl_Loop_Timer_Data Efl_Loop_Timer_Data; -typedef struct _Efl_Loop_Data Efl_Loop_Data; - typedef struct _Efl_Task_Data Efl_Task_Data; typedef struct _Efl_Appthread_Data Efl_Appthread_Data; @@ -78,74 +77,6 @@ struct _Message Eina_Bool delete_me; }; -struct _Efl_Loop_Data -{ - double loop_time; - - Efl_Loop_Message_Handler *future_message_handler; - - Efl_Loop_Timer *poll_high; - Efl_Loop_Timer *poll_medium; - Efl_Loop_Timer *poll_low; - - Eina_List *exes; // only used in main loop (for now?) - - Eina_List *fd_handlers_obj; - - Ecore_Fd_Handler *fd_handlers; - Eina_List *fd_handlers_with_prep; - Eina_List *file_fd_handlers; - Eina_List *always_fd_handlers; - Eina_List *fd_handlers_with_buffer; - Eina_List *fd_handlers_to_delete; - Ecore_Fd_Handler *fd_handlers_to_call; - Ecore_Fd_Handler *fd_handlers_to_call_current; - -# ifdef _WIN32 - Ecore_Win32_Handler *win32_handlers; - Ecore_Win32_Handler *win32_handler_current; - Eina_List *win32_handlers_to_delete; -# endif - - Eina_List *thread_children; - - Eina_Inlist *message_queue; - Eina_Inlist *message_pending_queue; - unsigned int message_walking; - - unsigned int throttle; - - int epoll_fd; - pid_t epoll_pid; - int timer_fd; - - double last_check; - Eina_Inlist *timers; - Eina_Inlist *suspended; - Efl_Loop_Timer_Data *timer_current; - int timers_added; - - Eina_Value exit_code; - - int idlers; - int in_loop; - unsigned int loop_active; - - struct { - int high; - int medium; - int low; - } pollers; - - struct { - char **environ_ptr; - char **environ_copy; - } env; - - Eina_Bool do_quit : 1; - Eina_Bool quit_on_last_thread_child_del : 1; -}; - struct _Efl_Task_Data { Eina_Stringshare *command; diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c index a102825df7..b688f948a2 100644 --- a/src/lib/ecore/efl_loop.c +++ b/src/lib/ecore/efl_loop.c @@ -19,6 +19,7 @@ #include "Ecore.h" #include "ecore_private.h" +#include "efl_loop_data.h" #include "ecore_main_common.h" @@ -59,18 +60,23 @@ _efl_loop_iterate_may_block(Eo *obj, Efl_Loop_Data *pd, int may_block) #ifdef EFL_EXACTNESS_WIN32 ECORE_API efl_loop_begin_t efl_loop_begin_redirect = NULL; +EOLIAN static Eina_Value * +_efl_loop_begin_original(Eo *obj, Efl_Loop_Data *pd); + +ECORE_API ECORE_API_WEAK EFL_FUNC_BODY(efl_loop_begin_original, Eina_Value *, NULL); + EOLIAN static Eina_Value * _efl_loop_begin(Eo *obj, Efl_Loop_Data *pd) { exactness_preload(); if (efl_loop_begin_redirect) - return efl_loop_begin_redirect(obj, pd); + return efl_loop_begin_redirect(obj); else - return efl_loop_begin_original(obj, pd); + return efl_loop_begin_original(obj); } EOLIAN static Eina_Value * -efl_loop_begin_original(Eo *obj, Efl_Loop_Data *pd) +_efl_loop_begin_original(Eo *obj, Efl_Loop_Data *pd) #else EOLIAN static Eina_Value * _efl_loop_begin(Eo *obj, Efl_Loop_Data *pd) @@ -713,9 +719,18 @@ efl_loop_future_scheduler_get(const Eo *obj) return NULL; } -#define EFL_LOOP_EXTRA_OPS \ + +#ifdef EFL_EXACTNESS_WIN32 +# define EFL_LOOP_EXTRA_OPS \ + EFL_OBJECT_OP_FUNC(efl_loop_begin_original, _efl_loop_begin_original), \ EFL_OBJECT_OP_FUNC(efl_loop_message_process, _efl_loop_message_process), \ EFL_OBJECT_OP_FUNC(efl_loop_register, _efl_loop_register), \ EFL_OBJECT_OP_FUNC(efl_loop_unregister, _efl_loop_unregister) +#else +# define EFL_LOOP_EXTRA_OPS \ + EFL_OBJECT_OP_FUNC(efl_loop_message_process, _efl_loop_message_process), \ + EFL_OBJECT_OP_FUNC(efl_loop_register, _efl_loop_register), \ + EFL_OBJECT_OP_FUNC(efl_loop_unregister, _efl_loop_unregister) +#endif #include "efl_loop.eo.c" diff --git a/src/lib/ecore/efl_loop_data.h b/src/lib/ecore/efl_loop_data.h new file mode 100644 index 0000000000..15b6aa02f9 --- /dev/null +++ b/src/lib/ecore/efl_loop_data.h @@ -0,0 +1,76 @@ +#ifndef _EFL_LOOP_DATA_H +#define _EFL_LOOP_DATA_H + +typedef struct _Efl_Loop_Data Efl_Loop_Data; +typedef struct _Efl_Loop_Timer_Data Efl_Loop_Timer_Data; + +struct _Efl_Loop_Data +{ + double loop_time; + + Efl_Loop_Message_Handler *future_message_handler; + + Efl_Loop_Timer *poll_high; + Efl_Loop_Timer *poll_medium; + Efl_Loop_Timer *poll_low; + + Eina_List *exes; // only used in main loop (for now?) + + Eina_List *fd_handlers_obj; + + Ecore_Fd_Handler *fd_handlers; + Eina_List *fd_handlers_with_prep; + Eina_List *file_fd_handlers; + Eina_List *always_fd_handlers; + Eina_List *fd_handlers_with_buffer; + Eina_List *fd_handlers_to_delete; + Ecore_Fd_Handler *fd_handlers_to_call; + Ecore_Fd_Handler *fd_handlers_to_call_current; + +# ifdef _WIN32 + Ecore_Win32_Handler *win32_handlers; + Ecore_Win32_Handler *win32_handler_current; + Eina_List *win32_handlers_to_delete; +# endif + + Eina_List *thread_children; + + Eina_Inlist *message_queue; + Eina_Inlist *message_pending_queue; + unsigned int message_walking; + + unsigned int throttle; + + int epoll_fd; + pid_t epoll_pid; + int timer_fd; + + double last_check; + Eina_Inlist *timers; + Eina_Inlist *suspended; + Efl_Loop_Timer_Data *timer_current; + int timers_added; + + Eina_Value exit_code; + + int idlers; + int in_loop; + unsigned int loop_active; + + struct { + int high; + int medium; + int low; + } pollers; + + struct { + char **environ_ptr; + char **environ_copy; + } env; + + Eina_Bool do_quit : 1; + Eina_Bool quit_on_last_thread_child_del : 1; +}; + + +#endif diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build index e346072512..58d88ea41f 100644 --- a/src/lib/ecore/meson.build +++ b/src/lib/ecore/meson.build @@ -101,6 +101,7 @@ ecore_header_src = [ 'ecore_api.h', 'ecore_exe_eo.legacy.h', 'efl_loop_timer_eo.legacy.h', + 'efl_loop_data.h', ] ecore_src = files([ From 2efb258b36b59f40356b9568db15156b412d1939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 20 Oct 2020 11:11:06 -0300 Subject: [PATCH 16/35] exactness: preload added to eina --- src/lib/eina/eina_main.c | 48 ++++++++++++++++++++++++++++++-- src/lib/eina/eina_main.h | 2 +- src/lib/elementary/elm_general.h | 13 ++------- src/lib/elementary/elm_main.c | 22 --------------- 4 files changed, 48 insertions(+), 37 deletions(-) diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 903724e90c..75731d336f 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -281,9 +281,51 @@ _eina_threads_do_shutdown(void) EINA_API Eina_Version *eina_version = &_version; #ifdef EFL_EXACTNESS_WIN32 -typedef int(*eina_init_t)(void); EINA_API eina_init_t eina_init_redirect = NULL; -EINA_API int eina_init_original(void); + +static Eina_Bool _exactness_preload(void); + +static Eina_Bool +_exactness_preload(void) +{ + char *env = getenv("EXACTNESS_PRELOAD_WIN32"); + if (env) + { + fprintf(stderr, "\n >>> %s:%s: redirected? %s <<< \n", __FILE__, __func__, (eina_init_redirect ? "YES" : "NO")); + if (!eina_init_redirect) + { + static HINSTANCE dll = NULL; + if (!dll) + { + if (!strcmp(env, "PLAY")) + { + fprintf(stderr, "\n >>> %s:%s: Loadging library exactness_play-1.dll... <<< \n", __FILE__, __func__); + dll = LoadLibraryA("C:/Users/joaoantoniocardoso/efl/build/src/bin/exactness/exactness_play-1.dll"); + if (!dll) + { + fprintf(stderr, "\n >>> Failed loading exactness_play-1.dll <<< \n"); + return EINA_FALSE; + } + fprintf(stderr, "\n >>> exactness_play-1.dll Loaded! <<< \n"); + return EINA_TRUE; + } + else if (!strcmp(env, "RECORD")) + { + fprintf(stderr, "\n >>> %s:%s: Loadging library exactness_record-1.dll... <<< \n", __FILE__, __func__); + dll = LoadLibraryA("C:/Users/joaoantoniocardoso/efl/build/src/bin/exactness/exactness_record-1.dll"); + if (!dll) + { + fprintf(stderr, "\n >>> Failed loading exactness_record-1.dll <<< \n"); + return EINA_FALSE; + } + fprintf(stderr, "\n >>> exactness_record-1.dll Loaded! <<< \n"); + return EINA_TRUE; + } + } + } + } + return EINA_FALSE; +} EINA_API int eina_init(void) @@ -302,7 +344,7 @@ EINA_API int eina_init(void) #endif { - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + fprintf(stderr, "\n >>> %s:%s <<< (original) \n", __FILE__, __func__); const struct eina_desc_setup *itr, *itr_end; if (EINA_LIKELY(_eina_main_count > 0)) diff --git a/src/lib/eina/eina_main.h b/src/lib/eina/eina_main.h index 36bb49c93a..e0eb79ce4a 100644 --- a/src/lib/eina/eina_main.h +++ b/src/lib/eina/eina_main.h @@ -177,7 +177,7 @@ EINA_API extern Eina_Error EINA_ERROR_NOT_IMPLEMENTED; */ #ifdef EFL_EXACTNESS_WIN32 typedef int(*eina_init_t)(void); -EINA_API eina_init_t eina_init_redirect; +extern EINA_API eina_init_t eina_init_redirect; EINA_API int eina_init_original(void); #endif EINA_API int eina_init(void); diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h index a5194948ad..121c6200c5 100644 --- a/src/lib/elementary/elm_general.h +++ b/src/lib/elementary/elm_general.h @@ -525,21 +525,13 @@ typedef Eina_Bool (*Elm_Event_Cb)(void *data, Evas_Object *obj, Evas ELM_API extern double _elm_startup_time; #ifndef ELM_LIB_QUICKLAUNCH -#ifdef EFL_EXACTNESS_WIN32 -# define ELM_MAIN() int main(int argc, char **argv) { exactness_preload(); int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ -#else -# define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ -#endif +#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); ret__ = elm_main(argc, argv); elm_shutdown(); return ret__; } /**< macro to be used after the elm_main() function */ #else /** @deprecated macro to be used after the elm_main() function. * Do not define ELM_LIB_QUICKLAUNCH * Compile your programs with -fpie and -pie -rdynamic instead, to generate a single binary (linkable executable). */ -#ifdef EFL_EXACTNESS_WIN32 -# define ELM_MAIN() int main(int argc, char **argv) { exactness_preload(); int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } -#else -#endif -# define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } +#define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; } #endif #define __EFL_UI_IS_REQUIRED @@ -584,7 +576,6 @@ ELM_API extern double _elm_startup_time; #ifdef EFL_EXACTNESS_WIN32 typedef int(*elm_init_t)(int argc, char **argv); extern ELM_API elm_init_t elm_init_redirect; -ELM_API Eina_Bool exactness_preload(void); ELM_API int elm_init_original(int argc, char **argv); #endif diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index 10b6fccabd..afc8c5d1d5 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -422,28 +422,6 @@ static const char *bcargv[] = { "exe" }; #ifdef EFL_EXACTNESS_WIN32 ELM_API elm_init_t elm_init_redirect = NULL; -ELM_API Eina_Bool -exactness_preload(void) -{ - //if (getenv("EXACTNESS_PRELOAD_WIN32")) - { - fprintf(stderr, "\n >>> %s:%s: redirect? %s <<< \n", __FILE__, __func__, (elm_init_redirect ? "YES" : "NULL")); - if (!eina_init_redirect) - { - HINSTANCE dll = LoadLibraryA("C:/Users/joaoantoniocardoso/efl/build/src/bin/exactness/exactness_play-1.dll"); - if (!dll) - { - fprintf(stderr, "\n >>> Failed loading exactness_play-1.dll <<< \n"); - return EINA_FALSE; - } - - fprintf(stderr, "\n >>> exactness_play-1.dll Loaded! <<< \n"); - return EINA_TRUE; - } - } - return EINA_FALSE; -} - ELM_API int elm_init(int argc, char **argv) { From 8842d42163f4b52e1399b6f5925c4e3098b7285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 20 Oct 2020 11:26:55 -0300 Subject: [PATCH 17/35] win32: add -DEFL_EXACTNESS_WIN32 when exactness-win32 option used --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 318474bc69..969324f500 100644 --- a/meson.build +++ b/meson.build @@ -225,6 +225,9 @@ foreach lang : ['c', 'objc', 'cpp'] error('Version of targetted Windows incorrect') endif add_global_arguments('-D__USE_MINGW_ANSI_STDIO', language: lang) + if get_option('exactness-win32') + add_global_arguments('-DEFL_EXACTNESS_WIN32', language: lang) + endif endif endforeach @@ -503,7 +506,6 @@ else ignored_subprojects = [] endif - _subprojects = [] foreach package : subprojects package_name = package[0] From 2886b6e01a9c73de03f42370f349c0d24e93ce21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 09:15:56 -0300 Subject: [PATCH 18/35] exactness: add support to exactness preload method --- src/bin/exactness/exactness_play.in | 6 +++++- src/bin/exactness/exactness_record.in | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bin/exactness/exactness_play.in b/src/bin/exactness/exactness_play.in index 38200d9ba1..80a7f67681 100644 --- a/src/bin/exactness/exactness_play.in +++ b/src/bin/exactness/exactness_play.in @@ -48,7 +48,11 @@ if G.version: exit(0) spawn_env = os.environ.copy() -spawn_env["LD_PRELOAD"] = @EXACTNESS_PLAY_PRELOAD_PATH@ +if os.name == 'nt': + # Windows + spawn_env["EXACTNESS_PRELOAD_WIN32"] = "PLAY" +else: + spawn_env["LD_PRELOAD"] = @EXACTNESS_PLAY_PRELOAD_PATH@ if G.tests == None and G.external_injection == True: print("no test file specified") diff --git a/src/bin/exactness/exactness_record.in b/src/bin/exactness/exactness_record.in index 377d465199..11534dd9ac 100644 --- a/src/bin/exactness/exactness_record.in +++ b/src/bin/exactness/exactness_record.in @@ -45,7 +45,11 @@ if G.version: exit(0) spawn_env = os.environ.copy() -spawn_env["LD_PRELOAD"] = @EXACTNESS_RECORD_PRELOAD_PATH@ +if os.name == 'nt': + # Windows + spawn_env["EXACTNESS_PRELOAD_WIN32"] = "RECORD" +else: + spawn_env["LD_PRELOAD"] = @EXACTNESS_PLAY_PRELOAD_PATH@ if G.tests != None: spawn_env["EXACTNESS_DEST"] = G.tests From 422a8ef016719a322aba0cdbff49e02aa83bad29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 21 Oct 2020 10:13:02 -0300 Subject: [PATCH 19/35] exactness_record: fix ORIGINAL_CALL macros to support win32 --- src/bin/exactness/player.c | 53 +++++++++++++++++++++++++----------- src/bin/exactness/recorder.c | 32 ++++++++++++++-------- 2 files changed, 57 insertions(+), 28 deletions(-) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 4781c0f378..2d8a551838 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -1031,27 +1031,36 @@ _write_unit_file(void) exactness_unit_file_write(_dest_unit, _dest); } } -#ifdef HAVE_DLSYM + +#ifndef _WIN32 +# ifdef HAVE_DLSYM +# define ORIGINAL_CALL_T(t, name, ...) \ + t (*_original_init_cb)(); \ + _original_init_cb = dlsym(RTLD_NEXT, #name); \ + original_return = _original_init_cb(__VA_ARGS__); +# else +# define ORIGINAL_CALL_T(t, name, ...) \ + printf("THIS IS NOT SUPPORTED WITHOUT DLSYM\n"); \ + abort(); +# endif +#else # define ORIGINAL_CALL_T(t, name, ...) \ + fprintf(stderr, "\n >>>> calling " #name "_original() <<<< \n"); \ t (*_original_init_cb)(); \ - _original_init_cb = dlsym(RTLD_NEXT, name); \ + _original_init_cb = & name ## _original; \ original_return = _original_init_cb(__VA_ARGS__); -#else -# define ORIGINAL_CALL_T(t, name, ...) \ - printf("THIS IS NOT SUPPORTED ON WINDOWS\n"); \ - abort(); #endif #define ORIGINAL_CALL(name, ...) \ - ORIGINAL_CALL_T(int, name, __VA_ARGS__) + ORIGINAL_CALL_T(int , name, __VA_ARGS__) int eina_init(void) { int original_return; + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); - ORIGINAL_CALL("eina_init"); - + ORIGINAL_CALL(eina_init); ex_set_original_envvar(); if (original_return == 1) @@ -1092,9 +1101,10 @@ int ecore_evas_init(void) { int original_return; + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); - ORIGINAL_CALL("ecore_evas_init") - + ORIGINAL_CALL(ecore_evas_init); + fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app() && original_return == 1) { _setup_ee_creation(); @@ -1108,8 +1118,10 @@ int elm_init(int argc, char **argv) { int original_return; - ORIGINAL_CALL("elm_init", argc, argv) + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + ORIGINAL_CALL(elm_init, argc, argv); + fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app() && original_return == 1) ex_prepare_elm_overlay(); @@ -1120,17 +1132,23 @@ void ecore_main_loop_begin(void) { int original_return; - ORIGINAL_CALL("ecore_main_loop_begin") + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + + ORIGINAL_CALL(ecore_main_loop_begin); + fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app()) _write_unit_file(); (void)original_return; } -Eina_Value* +Eina_Value * efl_loop_begin(Eo *obj) { Eina_Value *original_return; - ORIGINAL_CALL_T(Eina_Value*, "efl_loop_begin", obj); + //fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + + ORIGINAL_CALL_T(Eina_Value*, efl_loop_begin, obj); + fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app()) _write_unit_file(); return original_return; @@ -1141,7 +1159,10 @@ eina_shutdown(void) { int original_return; static Eina_Bool output_written = EINA_FALSE; - ORIGINAL_CALL("eina_shutdown") + fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); + + ORIGINAL_CALL(eina_shutdown); + fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app() &&original_return == 1 && !output_written) { output_written = EINA_TRUE; diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index 053a723e83..bbc6eb9b4c 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -297,15 +297,23 @@ _setup_ee_creation(void) _last_timestamp = ecore_time_get() * 1000; } -#ifdef HAVE_DLSYM +#ifndef _WIN32 +# ifdef HAVE_DLSYM +# define ORIGINAL_CALL_T(t, name, ...) \ + t (*_original_init_cb)(); \ + _original_init_cb = dlsym(RTLD_NEXT, #name); \ + original_return = _original_init_cb(__VA_ARGS__); +# else +# define ORIGINAL_CALL_T(t, name, ...) \ + printf("THIS IS NOT SUPPORTED WITHOUT DLSYM\n"); \ + abort(); +# endif +#else # define ORIGINAL_CALL_T(t, name, ...) \ + fprintf(stderr, " >>> calling " #name "_original() \n"); \ t (*_original_init_cb)(); \ - _original_init_cb = dlsym(RTLD_NEXT, name); \ + _original_init_cb = & name ## _original; \ original_return = _original_init_cb(__VA_ARGS__); -#else -# define ORIGINAL_CALL_T(t, name, ...) \ - printf("THIS IS NOT SUPPORTED ON WINDOWS\n"); \ - abort(); #endif #define ORIGINAL_CALL(name, ...) \ @@ -316,7 +324,7 @@ eina_init(void) { int original_return; - ORIGINAL_CALL("eina_init"); + ORIGINAL_CALL(eina_init); ex_set_original_envvar(); @@ -340,7 +348,7 @@ ecore_evas_init(void) { int original_return; - ORIGINAL_CALL("ecore_evas_init") + ORIGINAL_CALL(ecore_evas_init); if (ex_is_original_app() && original_return == 1) { @@ -356,7 +364,7 @@ int elm_init(int argc, char **argv) { int original_return; - ORIGINAL_CALL("elm_init", argc, argv) + ORIGINAL_CALL(elm_init, argc, argv); if (ex_is_original_app() && original_return == 1) ex_prepare_elm_overlay(); @@ -368,7 +376,7 @@ void ecore_main_loop_begin(void) { int original_return; - ORIGINAL_CALL("ecore_main_loop_begin") + ORIGINAL_CALL(ecore_main_loop_begin); if (ex_is_original_app()) _output_write(); (void)original_return; @@ -378,7 +386,7 @@ Eina_Value* efl_loop_begin(Eo *obj) { Eina_Value *original_return; - ORIGINAL_CALL_T(Eina_Value*, "efl_loop_begin", obj); + ORIGINAL_CALL_T(Eina_Value *, efl_loop_begin, obj); if (ex_is_original_app()) _output_write(); return original_return; @@ -389,7 +397,7 @@ eina_shutdown(void) { int original_return; static Eina_Bool output_written = EINA_FALSE; - ORIGINAL_CALL("eina_shutdown") + ORIGINAL_CALL(eina_shutdown); if (ex_is_original_app() && original_return == 1 && !output_written) { output_written = EINA_TRUE; From 2d9c856fc28aab491d230575994d7fcd659f55ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Fri, 13 Nov 2020 12:54:50 -0300 Subject: [PATCH 20/35] exactness: clean debug messages --- src/bin/exactness/player.c | 22 ---------------------- src/bin/exactness/recorder.c | 10 ---------- src/lib/eina/eina_main.c | 11 ++--------- src/lib/elementary/elm_main.c | 1 - 4 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 2d8a551838..c9bf39be1d 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -1045,7 +1045,6 @@ _write_unit_file(void) # endif #else # define ORIGINAL_CALL_T(t, name, ...) \ - fprintf(stderr, "\n >>>> calling " #name "_original() <<<< \n"); \ t (*_original_init_cb)(); \ _original_init_cb = & name ## _original; \ original_return = _original_init_cb(__VA_ARGS__); @@ -1058,11 +1057,9 @@ int eina_init(void) { int original_return; - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); ORIGINAL_CALL(eina_init); ex_set_original_envvar(); - if (original_return == 1) { const char *dest = getenv("EXACTNESS_DEST"); @@ -1101,10 +1098,8 @@ int ecore_evas_init(void) { int original_return; - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); ORIGINAL_CALL(ecore_evas_init); - fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app() && original_return == 1) { _setup_ee_creation(); @@ -1118,10 +1113,8 @@ int elm_init(int argc, char **argv) { int original_return; - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); ORIGINAL_CALL(elm_init, argc, argv); - fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app() && original_return == 1) ex_prepare_elm_overlay(); @@ -1132,10 +1125,8 @@ void ecore_main_loop_begin(void) { int original_return; - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); ORIGINAL_CALL(ecore_main_loop_begin); - fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app()) _write_unit_file(); (void)original_return; @@ -1145,10 +1136,8 @@ Eina_Value * efl_loop_begin(Eo *obj) { Eina_Value *original_return; - //fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); ORIGINAL_CALL_T(Eina_Value*, efl_loop_begin, obj); - fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app()) _write_unit_file(); return original_return; @@ -1159,10 +1148,8 @@ eina_shutdown(void) { int original_return; static Eina_Bool output_written = EINA_FALSE; - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); ORIGINAL_CALL(eina_shutdown); - fprintf(stderr, " >>> %s:%s: original_return: %d \n", __FILE__, __func__, original_return); if (ex_is_original_app() &&original_return == 1 && !output_written) { output_written = EINA_TRUE; @@ -1176,8 +1163,6 @@ eina_shutdown(void) void exactness_init(void) { - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); - eina_init_redirect = eina_init; eina_shutdown_redirect = eina_shutdown; efl_loop_begin_redirect = efl_loop_begin; @@ -1188,8 +1173,6 @@ void exactness_init(void) void exactness_shutdown(void) { - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); - eina_init_redirect = NULL; eina_shutdown_redirect = NULL; efl_loop_begin_redirect = NULL; @@ -1201,23 +1184,18 @@ void exactness_shutdown(void) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) { - fprintf(stderr, "\n >>> %s:%s <<< \n", __FILE__, __func__); switch (reason) { case DLL_PROCESS_ATTACH: - fprintf(stderr, "\n >>> DLL_PROCESS_ATTACH <<< \n"); exactness_init(); break; case DLL_PROCESS_DETACH: - fprintf(stderr, "\n >>> DLL_PROCESS_DETACH <<< \n"); exactness_shutdown(); break; case DLL_THREAD_ATTACH: - fprintf(stderr, "\n >>> DLL_THREAD_ATTACH <<< \n"); exactness_init(); break; case DLL_THREAD_DETACH: - fprintf(stderr, "\n >>> DLL_THREAD_DETACH <<< \n"); exactness_shutdown(); break; default: diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index bbc6eb9b4c..fd5dbf2c6f 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -310,7 +310,6 @@ _setup_ee_creation(void) # endif #else # define ORIGINAL_CALL_T(t, name, ...) \ - fprintf(stderr, " >>> calling " #name "_original() \n"); \ t (*_original_init_cb)(); \ _original_init_cb = & name ## _original; \ original_return = _original_init_cb(__VA_ARGS__); @@ -411,8 +410,6 @@ eina_shutdown(void) void exactness_init(void) { - fprintf(stderr, " >>> %s:%s \n", __FILE__, __func__); - eina_init_redirect = eina_init; eina_shutdown_redirect = eina_shutdown; efl_loop_begin_redirect = efl_loop_begin; @@ -423,8 +420,6 @@ void exactness_init(void) void exactness_shutdown(void) { - fprintf(stderr, " >>> %s:%s \n", __FILE__, __func__); - eina_init_redirect = NULL; eina_shutdown_redirect = NULL; efl_loop_begin_redirect = NULL; @@ -436,23 +431,18 @@ void exactness_shutdown(void) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) { - fprintf(stderr, " >>> %s:%s \n", __FILE__, __func__); switch (reason) { case DLL_PROCESS_ATTACH: - fprintf(stderr, " >>> DLL_PROCESS_ATTACH \n"); exactness_init(); break; case DLL_PROCESS_DETACH: - fprintf(stderr, " >>> DLL_PROCESS_DETACH \n"); exactness_shutdown(); break; case DLL_THREAD_ATTACH: - fprintf(stderr, "\n >>> DLL_THREAD_ATTACH <<< \n"); exactness_init(); break; case DLL_THREAD_DETACH: - fprintf(stderr, "\n >>> DLL_THREAD_DETACH <<< \n"); exactness_shutdown(); break; default: diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 75731d336f..292122d05b 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -291,7 +291,6 @@ _exactness_preload(void) char *env = getenv("EXACTNESS_PRELOAD_WIN32"); if (env) { - fprintf(stderr, "\n >>> %s:%s: redirected? %s <<< \n", __FILE__, __func__, (eina_init_redirect ? "YES" : "NO")); if (!eina_init_redirect) { static HINSTANCE dll = NULL; @@ -299,26 +298,22 @@ _exactness_preload(void) { if (!strcmp(env, "PLAY")) { - fprintf(stderr, "\n >>> %s:%s: Loadging library exactness_play-1.dll... <<< \n", __FILE__, __func__); dll = LoadLibraryA("C:/Users/joaoantoniocardoso/efl/build/src/bin/exactness/exactness_play-1.dll"); if (!dll) { - fprintf(stderr, "\n >>> Failed loading exactness_play-1.dll <<< \n"); + fprintf(stderr, "Failed loading exactness_play-1.dll\n"); return EINA_FALSE; } - fprintf(stderr, "\n >>> exactness_play-1.dll Loaded! <<< \n"); return EINA_TRUE; } else if (!strcmp(env, "RECORD")) { - fprintf(stderr, "\n >>> %s:%s: Loadging library exactness_record-1.dll... <<< \n", __FILE__, __func__); dll = LoadLibraryA("C:/Users/joaoantoniocardoso/efl/build/src/bin/exactness/exactness_record-1.dll"); if (!dll) { - fprintf(stderr, "\n >>> Failed loading exactness_record-1.dll <<< \n"); + fprintf(stderr, "Failed loading exactness_record-1.dll\n"); return EINA_FALSE; } - fprintf(stderr, "\n >>> exactness_record-1.dll Loaded! <<< \n"); return EINA_TRUE; } } @@ -344,7 +339,6 @@ EINA_API int eina_init(void) #endif { - fprintf(stderr, "\n >>> %s:%s <<< (original) \n", __FILE__, __func__); const struct eina_desc_setup *itr, *itr_end; if (EINA_LIKELY(_eina_main_count > 0)) @@ -433,7 +427,6 @@ EINA_API int eina_shutdown(void) #endif { - fprintf(stderr, "\n >>> %s:%s (original) <<< \n", __FILE__, __func__); if (_eina_main_count <= 0) { ERR("Init count not greater than 0 in shutdown."); diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index afc8c5d1d5..75b1afc87d 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -439,7 +439,6 @@ ELM_API int elm_init(int argc, char **argv) #endif { - fprintf(stderr, "\n >>> %s:%s (original) <<< \n", __FILE__, __func__); _elm_init_count++; if (_elm_init_count > 1) return _elm_init_count; EINA_SAFETY_ON_FALSE_RETURN_VAL(elm_quicklaunch_init(argc, argv ? argv : (char**) bcargv), --_elm_init_count); From 61d3bea0c23c3b4866386537bb7cc99fbc294015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 22 Oct 2020 10:51:39 -0300 Subject: [PATCH 21/35] exactness: call exactness_preload in all necessary _init --- src/lib/eina/eina_main.c | 6 ++---- src/lib/eina/eina_main.h | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 292122d05b..9d3d523d84 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -283,10 +283,8 @@ EINA_API Eina_Version *eina_version = &_version; #ifdef EFL_EXACTNESS_WIN32 EINA_API eina_init_t eina_init_redirect = NULL; -static Eina_Bool _exactness_preload(void); - -static Eina_Bool -_exactness_preload(void) +EINA_API Eina_Bool +exactness_preload(void) { char *env = getenv("EXACTNESS_PRELOAD_WIN32"); if (env) diff --git a/src/lib/eina/eina_main.h b/src/lib/eina/eina_main.h index e0eb79ce4a..5636fa4be1 100644 --- a/src/lib/eina/eina_main.h +++ b/src/lib/eina/eina_main.h @@ -260,6 +260,10 @@ EINA_API Eina_Bool eina_main_loop_is(void); */ EINA_API void eina_main_loop_define(void); +#ifdef EFL_EXACTNESS_WIN32 +EINA_API Eina_Bool exactness_preload(void); +#endif + /** * @} */ From 19afaa31bc8e72aebc271c011e8c0afb610a8170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 27 Oct 2020 17:51:06 -0300 Subject: [PATCH 22/35] exactness_play: Fix atribution of speed env with float value --- src/bin/exactness/exactness_play.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/exactness/exactness_play.in b/src/bin/exactness/exactness_play.in index 80a7f67681..b231bf71aa 100644 --- a/src/bin/exactness/exactness_play.in +++ b/src/bin/exactness/exactness_play.in @@ -73,7 +73,7 @@ if G.tests != None: if G.fontsdir != None: spawn_env["EXACTNESS_FONTS_DIR"] = G.fontsdir if G.speed != 1.0: - spawn_env["EXACTNESS_SPEED"] = G.speed + spawn_env["EXACTNESS_SPEED"] = str(G.speed) if G.scan_objects: spawn_env["EXACTNESS_SCAN_OBJECTS"] = "Yes" if G.disable_screenshots: From 664181e9442b41bf75d3e0ec531b451782412c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Fri, 30 Oct 2020 02:19:29 -0300 Subject: [PATCH 23/35] exactness: fix first value of _last_timestamp The value from gettimeofday() has no consistency when compared to the values from GetMessageTime(), used for event inputs on win32. This patch uses timeGetTime() to get consistent timestamp value with the values from GetMessageTime(). --- src/bin/exactness/meson.build | 8 +++++++- src/bin/exactness/recorder.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build index f2b47edf75..fb93924b27 100644 --- a/src/bin/exactness/meson.build +++ b/src/bin/exactness/meson.build @@ -39,9 +39,15 @@ exactness_play_lib = library('exactness_play', version : meson.project_version() ) +exactness_record_deps = [ elementary, dl] +if sys_windows + winmm = cc.find_library('winmm') + exactness_record_deps += winmm +endif + exactness_record_lib = library('exactness_record', [ 'recorder.c', 'common.c', 'common.h' ], - dependencies: [ elementary, dl], + dependencies: exactness_record_deps, c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, version : meson.project_version() diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index fd5dbf2c6f..2162c202ee 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -13,6 +13,9 @@ #else # include #endif +#ifdef _WIN32 +# include // timeGetTime() +#endif #include #ifdef HAVE_SYS_SYSINFO_H @@ -294,7 +297,11 @@ static void _setup_ee_creation(void) { ecore_evas_callback_new_set(_my_evas_new); +#ifdef _WIN32 + _last_timestamp = timeGetTime(); +#else _last_timestamp = ecore_time_get() * 1000; +#endif } #ifndef _WIN32 From 808e404c742b267b23fe2b8384d1778cabf0de8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Fri, 30 Oct 2020 10:06:18 -0300 Subject: [PATCH 24/35] exactness: run exactness_play from installed path --- src/bin/exactness/exactness.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index 715ad275be..325cd5c4c9 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -229,8 +229,9 @@ _run_command_prepare(const List_Entry *ent, char *buf) sbuf = eina_strbuf_new(); printf("STATUS %s: START\n", ent->name); eina_strbuf_append_printf(sbuf, - "%s exactness_play %s %s%s %s%.*s %s%s%s-t '%s' ", + "%s python %s/exactness_play.py %s %s%s %s%.*s %s%s%s-t '%s' ", _wrap_command ? _wrap_command : "", + PACKAGE_BIN_DIR, _mode == RUN_SIMULATION ? "-s" : "", _fonts_dir ? "-f " : "", _fonts_dir ? _fonts_dir : "", _verbose ? "-" : "", _verbose, "vvvvvvvvvv", From ef11a3621a84ea7da084d53a5bac7343e5b22d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 5 Nov 2020 10:08:05 -0300 Subject: [PATCH 25/35] win32: use only supported engines for windows --- src/lib/ecore_evas/ecore_evas.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index a282bc8cf7..1d924f0af3 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -1026,7 +1026,7 @@ _ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_option /* note: keep sorted by priority, highest first */ static const struct ecore_evas_engine _engines[] = { - /* unix */ +#ifndef _WIN32 {"software_x11", _ecore_evas_constructor_software_x11}, {"opengl_x11", _ecore_evas_constructor_opengl_x11}, {"fb", _ecore_evas_constructor_fb}, @@ -1046,6 +1046,10 @@ static const struct ecore_evas_engine _engines[] = { #ifdef BUILD_ECORE_EVAS_EWS {"ews", _ecore_evas_constructor_ews}, #endif +#endif + {"software_gdi", _ecore_evas_constructor_software_gdi}, + {"software_ddraw", _ecore_evas_constructor_software_ddraw}, + {"buffer", _ecore_evas_constructor_buffer}, {NULL, NULL} }; From d0a5a81536e5e7fb9e87541f3514711f4f703993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 5 Nov 2020 10:12:40 -0300 Subject: [PATCH 26/35] exactness: prevent leading blank space in command string Any leading space will cause ecore_exe_pipe_run() to fail. --- src/bin/exactness/exactness.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index 325cd5c4c9..c2517d3134 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -228,10 +228,13 @@ _run_command_prepare(const List_Entry *ent, char *buf) ok: sbuf = eina_strbuf_new(); printf("STATUS %s: START\n", ent->name); + + if (_wrap_command) + eina_strbuf_append_printf(sbuf, "%s", _wrap_command); + eina_strbuf_append_printf(sbuf, - "%s python %s/exactness_play.py %s %s%s %s%.*s %s%s%s-t '%s' ", - _wrap_command ? _wrap_command : "", - PACKAGE_BIN_DIR, + "python %s/exactness_play.py %s %s%s %s%.*s %s%s%s-t '%s' ", + PACKAGE_BIN_DIR, _mode == RUN_SIMULATION ? "-s" : "", _fonts_dir ? "-f " : "", _fonts_dir ? _fonts_dir : "", _verbose ? "-" : "", _verbose, "vvvvvvvvvv", From 3fc04f895dcba98109ba6196cdc8e433f4411d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 5 Nov 2020 10:15:38 -0300 Subject: [PATCH 27/35] exactness: strings should use double quotes on windows cmd line --- src/bin/exactness/exactness.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index c2517d3134..b90b6e3c15 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -233,7 +233,7 @@ _run_command_prepare(const List_Entry *ent, char *buf) eina_strbuf_append_printf(sbuf, "%s", _wrap_command); eina_strbuf_append_printf(sbuf, - "python %s/exactness_play.py %s %s%s %s%.*s %s%s%s-t '%s' ", + "python %s/exactness_play.py %s %s%s %s%.*s %s%s%s-t \"%s\" ", PACKAGE_BIN_DIR, _mode == RUN_SIMULATION ? "-s" : "", _fonts_dir ? "-f " : "", _fonts_dir ? _fonts_dir : "", @@ -245,9 +245,9 @@ _run_command_prepare(const List_Entry *ent, char *buf) ); if (_mode == RUN_PLAY) - eina_strbuf_append_printf(sbuf, "-o '%s/%s/%s.exu' ", _dest_dir, CURRENT_SUBDIR, ent->name); + eina_strbuf_append_printf(sbuf, "-o \"%s/%s/%s.exu\" ", _dest_dir, CURRENT_SUBDIR, ent->name); if (_mode == RUN_INIT) - eina_strbuf_append_printf(sbuf, "-o '%s' ", scn_path); + eina_strbuf_append_printf(sbuf, "-o \"%s\" ", scn_path); if (ent->command) { From db305fc1ecfd05e502424816b30d6721c255b99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 12 Nov 2020 15:06:12 -0300 Subject: [PATCH 28/35] exactness: resolve base_dirs to absolute path --- src/bin/exactness/exactness.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index b90b6e3c15..5545cf924c 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -10,7 +10,9 @@ #include "common.h" #ifdef _WIN32 -# include /* mkdir */ +# include /* mkdir, dirname */ +#else +# include #endif #define SCHEDULER_CMD_SIZE 1024 @@ -553,6 +555,14 @@ main(int argc, char *argv[]) goto end; } + /* Get absolute path for all parameters */ + EINA_LIST_FOREACH(_base_dirs, itr, base_dir) + { + char resolved_base_dir[PATH_MAX]; + realpath(base_dir, resolved_base_dir); + eina_list_data_set(itr, resolved_base_dir); + } + /* Pre-run summary */ fprintf(stderr, "Running with settings:\n"); fprintf(stderr, "\tConcurrent jobs: %d\n", _max_jobs); From 60b7ad81131f0fd48f0982c0b792a1fd639bab90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 12 Nov 2020 15:06:43 -0300 Subject: [PATCH 29/35] exactness: resolve dest_dir to absolute path --- src/bin/exactness/exactness.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index 5545cf924c..d6da5f0cc7 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -46,6 +46,7 @@ typedef enum static unsigned short _running_jobs = 0, _max_jobs = 1; static Eina_List *_base_dirs = NULL; static char *_dest_dir; +static char dest_dir[PATH_MAX]; static char *_wrap_command = NULL, *_fonts_dir = NULL; static int _verbose = 0; static Eina_Bool _scan_objs = EINA_FALSE, _disable_screenshots = EINA_FALSE, _stabilize_shots = EINA_FALSE; @@ -507,7 +508,7 @@ main(int argc, char *argv[]) return EXIT_FAILURE; _log_domain = eina_log_domain_register("exactness", "red"); - _dest_dir = "./"; + _dest_dir = realpath(".", _dest_dir); _scan_objs = scan_objs; eina_log_abort_on_critical_set(EINA_TRUE); From 281b6423c552359613866033365d7b064a1884ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 10 Nov 2020 12:07:56 -0300 Subject: [PATCH 30/35] exactness: Fix relative path for the commands --- src/bin/exactness/exactness.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index d6da5f0cc7..9349f84ce7 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -352,6 +352,9 @@ _list_file_load(const char *filename) return NULL; } + char *_test_file_dir = realpath(filename, NULL); + _test_file_dir = dirname(_test_file_dir); + while (fgets(buf, BUF_SIZE, file)) { /* Skip comment/empty lines. */ @@ -367,7 +370,9 @@ _list_file_load(const char *filename) if (tmp) { *tmp = '\0'; - cur->command = tmp + 1; + char *command; + asprintf(&command, "%s/%s", _test_file_dir, tmp + 1); + cur->command = command; } else { @@ -387,6 +392,8 @@ _list_file_load(const char *filename) List_Entry); } + free(_test_file_dir); + fclose(file); return ret; } From c96b0b9d51db86bb459f065056bde5d17e0c9279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 10 Nov 2020 12:09:44 -0300 Subject: [PATCH 31/35] exactness: fix relative path for dest_dir --- src/bin/exactness/exactness.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index 9349f84ce7..70b7c6f6b4 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -113,17 +113,17 @@ _file_compare(const char *orig_dir, const char *ent_name) Eina_Bool result = EINA_FALSE; Exactness_Image *img1, *img2, *imgO = NULL; char *filename1 = alloca(strlen(orig_dir) + strlen(ent_name) + 20); - char *filename2 = alloca(strlen(_dest_dir) + strlen(ent_name) + 20); + char *filename2 = alloca(strlen(dest_dir) + strlen(ent_name) + 20); sprintf(filename1, "%s/%s", orig_dir, ent_name); - sprintf(filename2, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ent_name); + sprintf(filename2, "%s/%s/%s", dest_dir, CURRENT_SUBDIR, ent_name); img1 = _image_load(filename1); img2 = _image_load(filename2); if (exactness_image_compare(img1, img2, &imgO)) { - char *buf = alloca(strlen(_dest_dir) + strlen(ent_name)); - sprintf(buf, "%s/%s/comp_%s", _dest_dir, CURRENT_SUBDIR, ent_name); + char *buf = alloca(strlen(dest_dir) + strlen(ent_name)); + sprintf(buf, "%s/%s/comp_%s", dest_dir, CURRENT_SUBDIR, ent_name); if (!_image_save(imgO, buf)) goto cleanup; _compare_errors = eina_list_append(_compare_errors, strdup(ent_name)); @@ -167,7 +167,7 @@ static void _run_test_compare(const List_Entry *ent) { char *path = alloca(PATH_MAX); - char *origdir = alloca(strlen(_dest_dir) + 20); + char *origdir = alloca(strlen(dest_dir) + 20); const char *base_dir; Eina_List *itr; int n = 1, nb_fails = 0; @@ -178,7 +178,7 @@ _run_test_compare(const List_Entry *ent) if (ecore_file_exists(path)) { char *currentdir; - sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR); + sprintf(origdir, "%s/%s/%s", dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR); if (!ecore_file_exists(origdir)) { if (mkdir(origdir, 0744) < 0) @@ -188,9 +188,10 @@ _run_test_compare(const List_Entry *ent) } } _exu_imgs_unpack(path, origdir, ent->name); - sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name); - currentdir = alloca(strlen(_dest_dir) + 20); - sprintf(currentdir, "%s/%s", _dest_dir, CURRENT_SUBDIR); + sprintf(path, "%s/%s/%s.exu", dest_dir, CURRENT_SUBDIR, ent->name); + currentdir = alloca(strlen(dest_dir) + 20); + sprintf(currentdir, "%s/%s", dest_dir, CURRENT_SUBDIR); + _exu_imgs_unpack(path, currentdir, ent->name); goto found; } @@ -248,12 +249,13 @@ _run_command_prepare(const List_Entry *ent, char *buf) ); if (_mode == RUN_PLAY) - eina_strbuf_append_printf(sbuf, "-o \"%s/%s/%s.exu\" ", _dest_dir, CURRENT_SUBDIR, ent->name); + eina_strbuf_append_printf(sbuf, "-o \"%s/%s/%s.exu\" ", dest_dir, CURRENT_SUBDIR, ent->name); if (_mode == RUN_INIT) eina_strbuf_append_printf(sbuf, "-o \"%s\" ", scn_path); if (ent->command) { + eina_strbuf_append(sbuf, "-- "); eina_strbuf_append(sbuf, CONFIG); eina_strbuf_append(sbuf, ent->command); @@ -515,7 +517,7 @@ main(int argc, char *argv[]) return EXIT_FAILURE; _log_domain = eina_log_domain_register("exactness", "red"); - _dest_dir = realpath(".", _dest_dir); + _dest_dir = "."; _scan_objs = scan_objs; eina_log_abort_on_critical_set(EINA_TRUE); @@ -570,6 +572,7 @@ main(int argc, char *argv[]) realpath(base_dir, resolved_base_dir); eina_list_data_set(itr, resolved_base_dir); } + realpath(_dest_dir, dest_dir); /* Pre-run summary */ fprintf(stderr, "Running with settings:\n"); @@ -578,12 +581,12 @@ main(int argc, char *argv[]) fprintf(stderr, "\tBase dirs:\n"); EINA_LIST_FOREACH(_base_dirs, itr, base_dir) fprintf(stderr, "\t\t%s\n", base_dir); - fprintf(stderr, "\tDest dir: %s\n", _dest_dir); + fprintf(stderr, "\tDest dir: %s\n", dest_dir); if (mode_play) { _mode = RUN_PLAY; - if (snprintf(tmp, PATH_MAX, "%s/%s", _dest_dir, CURRENT_SUBDIR) + if (snprintf(tmp, PATH_MAX, "%s/%s", dest_dir, CURRENT_SUBDIR) >= PATH_MAX) { fprintf(stderr, "Path too long: %s", tmp); @@ -603,7 +606,7 @@ main(int argc, char *argv[]) else if (mode_init) { _mode = RUN_INIT; - if (snprintf(tmp, PATH_MAX, "%s/%s", _dest_dir, ORIG_SUBDIR) + if (snprintf(tmp, PATH_MAX, "%s/%s", dest_dir, ORIG_SUBDIR) >= PATH_MAX) { fprintf(stderr, "Path too long: %s", tmp); @@ -659,7 +662,7 @@ main(int argc, char *argv[]) /* Generate the filename. */ snprintf(report_filename, PATH_MAX, "%s/%s/errors.html", - _dest_dir, mode_init ? ORIG_SUBDIR : CURRENT_SUBDIR); + dest_dir, mode_init ? ORIG_SUBDIR : CURRENT_SUBDIR); report_file = fopen(report_filename, "w+"); if (report_file) { @@ -693,7 +696,7 @@ main(int argc, char *argv[]) Eina_Bool is_from_exu; char origpath[PATH_MAX]; snprintf(origpath, PATH_MAX, "%s/%s/orig/%s", - _dest_dir, CURRENT_SUBDIR, test_name); + dest_dir, CURRENT_SUBDIR, test_name); is_from_exu = ecore_file_exists(origpath); printf("\t* %s\n", test_name); From 7a306f8bec1246f104e3421bd73c81674da8f9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 10 Nov 2020 12:12:01 -0300 Subject: [PATCH 32/35] exactness: use underscore prefix for variable name --- src/bin/exactness/exactness.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index 70b7c6f6b4..b59d8c9a3d 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -568,9 +568,9 @@ main(int argc, char *argv[]) /* Get absolute path for all parameters */ EINA_LIST_FOREACH(_base_dirs, itr, base_dir) { - char resolved_base_dir[PATH_MAX]; - realpath(base_dir, resolved_base_dir); - eina_list_data_set(itr, resolved_base_dir); + char _resolved_base_dir[PATH_MAX]; + realpath(base_dir, _resolved_base_dir); + eina_list_data_set(itr, _resolved_base_dir); } realpath(_dest_dir, dest_dir); From 4433f7307a239648ebad8a66b39c8e4fb4c14932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 11 Nov 2020 11:37:24 -0300 Subject: [PATCH 33/35] exactness: fix stdout/stderr to work in realtime --- src/bin/exactness/exactness_play.in | 5 +++-- src/bin/exactness/exactness_record.in | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/exactness/exactness_play.in b/src/bin/exactness/exactness_play.in index b231bf71aa..d63341c11f 100644 --- a/src/bin/exactness/exactness_play.in +++ b/src/bin/exactness/exactness_play.in @@ -101,5 +101,6 @@ for argument in G.app: if passed_all_the_env_vars: app.append(argument) -recorder = subprocess.Popen(app, env=spawn_env) -recorder.wait() +with subprocess.Popen(app, env=spawn_env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) as p: + for line in p.stdout: + print(line, end='') diff --git a/src/bin/exactness/exactness_record.in b/src/bin/exactness/exactness_record.in index 11534dd9ac..84f359d12e 100644 --- a/src/bin/exactness/exactness_record.in +++ b/src/bin/exactness/exactness_record.in @@ -76,5 +76,6 @@ for argument in G.app: if passed_all_the_env_vars: app.append(argument) -recorder = subprocess.Popen(app, env=spawn_env) -recorder.wait() +with subprocess.Popen(app, env=spawn_env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) as p: + for line in p.stdout: + print(line, end='') From 9ce2f3cf845c5819c233902e6676df261bb78159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 11 Nov 2020 13:48:42 -0300 Subject: [PATCH 34/35] exactness: fix when to write to file --- src/bin/exactness/player.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index c9bf39be1d..427052e1bf 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -85,6 +85,7 @@ static Eina_Bool _exit_required = EINA_FALSE; static Eina_Bool _pause_request = EINA_FALSE; static Eina_Bool _playing_status = EINA_FALSE; static Eina_Bool _ready_to_write = EINA_FALSE; +static Eina_Bool _output_written = EINA_FALSE; static Exactness_Image * _snapshot_shot_get(Evas *e) @@ -1015,21 +1016,22 @@ _setup_ee_creation(void) ecore_idler_add(_src_feed, NULL); } -static void +static Eina_Bool _write_unit_file(void) { if (_dest && _dest_unit && _ready_to_write) { Exactness_Unit *tmp = NULL; - EINA_SAFETY_ON_NULL_RETURN(_src_unit); + if (!_src_unit) return EINA_FALSE; if (_src_type == FTYPE_EXU) { tmp = exactness_unit_file_read(_src_filename); _dest_unit->actions = tmp->actions; } - exactness_unit_file_write(_dest_unit, _dest); + return exactness_unit_file_write(_dest_unit, _dest); } + return EINA_FALSE; } #ifndef _WIN32 @@ -1147,13 +1149,11 @@ int eina_shutdown(void) { int original_return; - static Eina_Bool output_written = EINA_FALSE; ORIGINAL_CALL(eina_shutdown); - if (ex_is_original_app() &&original_return == 1 && !output_written) + if (ex_is_original_app() &&original_return == 1 && !_output_written) { - output_written = EINA_TRUE; - _write_unit_file(); + _output_written = _write_unit_file(); } return original_return; @@ -1179,6 +1179,11 @@ void exactness_shutdown(void) elm_init_redirect = NULL; ecore_evas_init_redirect = NULL; ecore_main_loop_begin_redirect = NULL; + + if (!_output_written) + { + _output_written = _write_unit_file(); + } } BOOL WINAPI From 18d8bf24fb9f2e8c6e3a29a3fef5a5f4ede394a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Thu, 12 Nov 2020 12:06:22 -0300 Subject: [PATCH 35/35] exactness: force to use the buffer engine --- src/bin/exactness/exactness.c | 4 ++++ src/bin/exactness/exactness_play.in | 1 + 2 files changed, 5 insertions(+) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index b59d8c9a3d..035a30bc87 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -513,6 +513,10 @@ main(int argc, char *argv[]) ECORE_GETOPT_VALUE_NONE }; + // Force to use the buffer engine + setenv("ELM_DISPLAY", "buffer", 1); + setenv("ECORE_EVAS_ENGINE", "buffer", 1); + if (!ecore_evas_init()) return EXIT_FAILURE; diff --git a/src/bin/exactness/exactness_play.in b/src/bin/exactness/exactness_play.in index d63341c11f..a9fb0fbd2a 100644 --- a/src/bin/exactness/exactness_play.in +++ b/src/bin/exactness/exactness_play.in @@ -84,6 +84,7 @@ if G.verbose: spawn_env["EXACTNESS_VERBOSE"] = "Yes" if G.show_on_screen == False: spawn_env["ELM_DISPLAY"] = "buffer" + spawn_env["ECORE_EVAS_ENGINE"] = "buffer" passed_all_the_env_vars = False app = []