{
EINA_INLIST;
ECORE_MAGIC;
- unsigned char delete_me : 1;
+
int (*func) (void *data);
void *data;
+
+ Eina_Bool delete_me : 1;
+ Eina_Bool suspended : 1;
};
double t_loop = ecore_loop_time_get();
double sync_0 = 0.0;
double d = -fmod(t_loop - sync_0, animators_frametime);
-
+
timer = ecore_timer_loop_add(animators_frametime, _ecore_animator, NULL);
ecore_timer_delay(timer, d);
}
return NULL;
}
if (animator->delete_me) return animator->data;
- animator->delete_me = 1;
+ animator->delete_me = EINA_TRUE;
animators_delete_me++;
return animator->data;
}
return animators_frametime;
}
+/**
+ * Suspend the specified animator.
+ * @param animator The animator to delete
+ * @ingroup Ecore_Animator_Group
+ *
+ * The specified @p animator will be temporarly removed from the set of animators
+ * that are executed during main loop execution.
+ */
+EAPI void
+ecore_animator_freeze(Ecore_Animator *animator)
+{
+ if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
+ {
+ ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
+ "ecore_animator_del");
+ return NULL;
+ }
+ if (animator->delete_me) return;
+ animator->suspended = EINA_TRUE;
+}
+
+/**
+ * Restore execution of the specified animator.
+ * @param animator The animator to delete
+ * @ingroup Ecore_Animator_Group
+ *
+ * The specified @p animator will be put back in the set of animators
+ * that are executed during main loop execution.
+ */
+EAPI void
+ecore_animator_thaw(Ecore_Animator *animator)
+{
+ if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
+ {
+ ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
+ "ecore_animator_del");
+ return NULL;
+ }
+ if (animator->delete_me) return;
+ animator->suspended = EINA_FALSE;
+}
+
void
_ecore_animator_shutdown(void)
{
EINA_INLIST_FOREACH(animators, animator)
{
- if (!animator->delete_me)
+ if (!animator->delete_me && !animator->suspended)
{
if (!animator->func(animator->data))
{
- animator->delete_me = 1;
+ animator->delete_me = EINA_TRUE;
animators_delete_me++;
}
}