From 8ac07474b90e2a4128e762e1d469d5ebe917a240 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 16 Feb 2024 20:14:15 +0900 Subject: [PATCH] tizen-core: Modify ecore_main_loop_begin implementation The ecore_main_loop_begin() uses the tizen_core_task_run() to run the main loop. Change-Id: I7a418ed80511d35a72169a3a49ac6be32ad6c01f Signed-off-by: Hwankyu Jhun --- src/lib/ecore/ecore_main.c | 29 ++++++++++++++++++++--------- src/lib/ecore/tizen-core/tcore.cc | 8 ++++++++ src/lib/ecore/tizen-core/tcore.h | 4 ++++ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index abb5e35..1bc596d 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -1328,15 +1328,24 @@ _ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd) if (!_dl_uv_run) { #endif +#ifdef USE_TIZEN_CORE + if (tcore_ready()) + { + tcore_run(); + } + else +#endif // USE_TIZEN_CORE #ifndef USE_G_MAIN_LOOP - in_main_loop++; - pd->in_loop = in_main_loop; - _update_loop_time(pd); - while (!pd->do_quit) - _ecore_main_loop_iterate_internal(obj, pd, 0); - pd->do_quit = 0; - in_main_loop--; - pd->in_loop = in_main_loop; + { + in_main_loop++; + pd->in_loop = in_main_loop; + _update_loop_time(pd); + while (!pd->do_quit) + _ecore_main_loop_iterate_internal(obj, pd, 0); + pd->do_quit = 0; + in_main_loop--; + pd->in_loop = in_main_loop; + } #else if (!pd->do_quit) { @@ -1403,7 +1412,9 @@ _ecore_main_loop_quit(Eo *obj, Efl_Loop_Data *pd) if (!pd->loop_active) return; pd->do_quit = 1; if (obj != ML_OBJ) return; -#ifdef USE_G_MAIN_LOOP +#ifdef USE_TIZEN_CORE + if (tcore_ready()) tcore_quit(); +#elif defined(USE_G_MAIN_LOOP) if (ecore_main_loop) g_main_loop_quit(ecore_main_loop); #elif defined(HAVE_LIBUV) if (_dl_uv_run) _dl_uv_stop(_dl_uv_default_loop()); diff --git a/src/lib/ecore/tizen-core/tcore.cc b/src/lib/ecore/tizen-core/tcore.cc index 6de233a..bc97aff 100644 --- a/src/lib/ecore/tizen-core/tcore.cc +++ b/src/lib/ecore/tizen-core/tcore.cc @@ -52,6 +52,10 @@ class TCore { tizen_core_h GetCore() const { return tizen_core_; } + void Run() { tizen_core_task_run(tizen_core_task_); } + + void Quit() { tizen_core_task_quit(tizen_core_task_); } + private: bool disposed_ = true; bool ready_ = false; @@ -72,3 +76,7 @@ bool tcore_ready(void) { return core.IsReady(); } int tcore_init(void) { return core.Init(); } void tcore_shutdown(void) { core.Dispose(); } + +void tcore_run(void) { core.Run(); } + +void tcore_quit(void) { core.Quit(); } diff --git a/src/lib/ecore/tizen-core/tcore.h b/src/lib/ecore/tizen-core/tcore.h index a1fc6e7..e6d9a0a 100644 --- a/src/lib/ecore/tizen-core/tcore.h +++ b/src/lib/ecore/tizen-core/tcore.h @@ -18,6 +18,10 @@ int tcore_init(void); void tcore_shutdown(void); +void tcore_run(void); + +void tcore_quit(void); + #ifdef __cplusplus } #endif -- 2.7.4