summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-08 15:05:51 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-09 14:48:07 +0900
commitcc1ff312768c3915516e1d8c36e6d4c382de830a (patch)
treeb21ba8c7f6cbf27e42dabbbc78596ba9b1d669c0 /src/lib/ecore
parentde7b7f381c6ec35e6c39947cebf775ed8caad488 (diff)
ecore loop + animator - add call to get if an animator cb has run this iter
this adds a simple call and infra to get if an animator has run this iteration. it's simple and not really useful other than internally to efl.
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/Ecore_Common.h1
-rw-r--r--src/lib/ecore/ecore_anim.c14
-rw-r--r--src/lib/ecore/ecore_main.c23
-rw-r--r--src/lib/ecore/ecore_private.h2
4 files changed, 39 insertions, 1 deletions
diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h
index 39feead947..2fad5c1988 100644
--- a/src/lib/ecore/Ecore_Common.h
+++ b/src/lib/ecore/Ecore_Common.h
@@ -73,6 +73,7 @@ EAPI void ecore_main_loop_glib_always_integrate_disable(void);
73 73
74EAPI void ecore_main_loop_begin(void); 74EAPI void ecore_main_loop_begin(void);
75EAPI void ecore_main_loop_quit(void); 75EAPI void ecore_main_loop_quit(void);
76EAPI Eina_Bool ecore_main_loop_animator_ticked_get(void);
76 77
77/** 78/**
78 * @typedef Ecore_Cb Ecore_Cb 79 * @typedef Ecore_Cb Ecore_Cb
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index dd76dafcbf..2bdd8d1b83 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -53,6 +53,7 @@ static Ecore_Cb begin_tick_cb = NULL;
53static const void *begin_tick_data = NULL; 53static const void *begin_tick_data = NULL;
54static Ecore_Cb end_tick_cb = NULL; 54static Ecore_Cb end_tick_cb = NULL;
55static const void *end_tick_data = NULL; 55static const void *end_tick_data = NULL;
56static Eina_Bool animator_ran = EINA_FALSE;
56 57
57static void 58static void
58_begin_tick(void) 59_begin_tick(void)
@@ -114,6 +115,7 @@ _do_tick(void)
114 (!animator->suspended) && 115 (!animator->suspended) &&
115 (!animator->just_added)) 116 (!animator->just_added))
116 { 117 {
118 animator_ran = EINA_TRUE;
117 if (!_ecore_call_task_cb(animator->func, animator->data)) 119 if (!_ecore_call_task_cb(animator->func, animator->data))
118 { 120 {
119 animator->delete_me = EINA_TRUE; 121 animator->delete_me = EINA_TRUE;
@@ -657,6 +659,18 @@ _ecore_animator_shutdown(void)
657 } 659 }
658} 660}
659 661
662void
663_ecore_animator_run_reset(void)
664{
665 animator_ran = EINA_FALSE;
666}
667
668Eina_Bool
669_ecore_animator_run_get(void)
670{
671 return animator_ran;
672}
673
660static Eina_Bool 674static Eina_Bool
661_ecore_animator_run(void *data) 675_ecore_animator_run(void *data)
662{ 676{
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 045ccb10a2..44fb957f51 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -707,6 +707,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED,
707 707
708 if (ecore_idling && events_ready) 708 if (ecore_idling && events_ready)
709 { 709 {
710 _ecore_animator_run_reset();
710 _ecore_idle_exiter_call(); 711 _ecore_idle_exiter_call();
711 ecore_idling = 0; 712 ecore_idling = 0;
712 } 713 }
@@ -723,6 +724,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED,
723 724
724 if (ecore_fds_ready || events_ready || timers_ready) 725 if (ecore_fds_ready || events_ready || timers_ready)
725 { 726 {
727 _ecore_animator_run_reset();
726 _ecore_idle_exiter_call(); 728 _ecore_idle_exiter_call();
727 ecore_idling = 0; 729 ecore_idling = 0;
728 } 730 }
@@ -1067,6 +1069,21 @@ ecore_main_loop_quit(void)
1067} 1069}
1068 1070
1069/** 1071/**
1072 * Returns if an animator has ticked off during this loop iteration
1073 *
1074 * @return EINA_TRUE if an animator has been called, EINA_FALSE otherwise.
1075 *
1076 * There should be little need for anyone to use this - ever.
1077 *
1078 * @since 1.9
1079 */
1080EAPI Eina_Bool
1081ecore_main_loop_animator_ticked_get(void)
1082{
1083 return _ecore_animator_run_get();
1084}
1085
1086/**
1070 * Sets the function to use when monitoring multiple file descriptors, 1087 * Sets the function to use when monitoring multiple file descriptors,
1071 * and waiting until one of more of the file descriptors before ready 1088 * and waiting until one of more of the file descriptors before ready
1072 * for some class of I/O operation. 1089 * for some class of I/O operation.
@@ -2002,7 +2019,11 @@ start_loop: /***************************************************************/
2002process_all: /***********************************************************/ 2019process_all: /***********************************************************/
2003 2020
2004 /* we came out of our "wait state" so idle has exited */ 2021 /* we came out of our "wait state" so idle has exited */
2005 if (!once_only) _ecore_idle_exiter_call(); 2022 if (!once_only)
2023 {
2024 _ecore_animator_run_reset();
2025 _ecore_idle_exiter_call();
2026 }
2006 /* call the fd handler per fd that became alive... */ 2027 /* call the fd handler per fd that became alive... */
2007 /* this should read or write any data to the monitored fd and then */ 2028 /* this should read or write any data to the monitored fd and then */
2008 /* post events onto the ecore event pipe if necessary */ 2029 /* post events onto the ecore event pipe if necessary */
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index 1c7f53e5a4..f6a2d5553a 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -219,6 +219,8 @@ void _ecore_exe_event_del_free(void *data,
219#endif 219#endif
220 220
221void _ecore_animator_shutdown(void); 221void _ecore_animator_shutdown(void);
222void _ecore_animator_run_reset(void);
223Eina_Bool _ecore_animator_run_get(void);
222 224
223void _ecore_poller_shutdown(void); 225void _ecore_poller_shutdown(void);
224 226