Please check this small patch.
Added one miner API.
Thanks.
The Hermet
Index: elm_animator.c
===================================================================
--- elm_animator.c (revision 55099)
+++ elm_animator.c (working copy)
@@ -38,11 +38,11 @@
double duration;
unsigned int repeat_cnt;
unsigned int cur_repeat_cnt;
- double (*curve_op) (double frame);
void (*animator_op) (void *data, Elm_Animator *animator, double frame);
void *animator_arg;
void (*completion_op) (void *data);
void *completion_arg;
+ Elm_Animator_Curve_Style curve_style;
Eina_Bool auto_reverse:1;
Eina_Bool on_animating:1;
};
@@ -111,7 +111,24 @@
animator->cur_time = ecore_loop_time_get();
elapsed_time = animator->cur_time - animator->begin_time;
if (elapsed_time > animator->duration) elapsed_time = animator->duration;
- frame = animator->curve_op(elapsed_time / animator->duration);
+
+ //Compute current frame
+ switch (animator->curve_style)
+ {
+ case ELM_ANIMATOR_CURVE_IN_OUT:
+ frame = _animator_curve_in_out(elapsed_time / animator->duration);
+ break;
+ case ELM_ANIMATOR_CURVE_IN:
+ frame = _animator_curve_in(elapsed_time / animator->duration);
+ break;
+ case ELM_ANIMATOR_CURVE_OUT:
+ frame = _animator_curve_out(elapsed_time / animator->duration);
+ break;
+ default:
+ frame = _animator_curve_linear(elapsed_time / animator->duration);
+ break;
+ }
+
//Reverse?
if (animator->auto_reverse)
{
@@ -178,6 +195,22 @@
}
/**
+ * Set the animation acceleration style.
+ *
+ * @param[in] animator Animator object
+ * @param[in] cs Curve style. Default is ELM_ANIMATOR_CURVE_LINEAR
+ *
+ * @ingroup Animator
+ */
+EAPI Elm_Animator_Curve_Style
+elm_animator_curve_style_get(const Elm_Animator *animator)
+{
+ ELM_ANIMATOR_CHECK_OR_RETURN(animator, ELM_ANIMATOR_CURVE_LINEAR);
+
+ return animator->curve_style;
+}
+
+/**
* Set auto reverse function.
*
* @param[in] animator Animator object
@@ -212,24 +245,8 @@
Elm_Animator_Curve_Style cs)
{
ELM_ANIMATOR_CHECK_OR_RETURN(animator);
- switch (cs)
- {
- case ELM_ANIMATOR_CURVE_LINEAR:
- animator->curve_op = _animator_curve_linear;
- break;
- case ELM_ANIMATOR_CURVE_IN_OUT:
- animator->curve_op = _animator_curve_in_out;
- break;
- case ELM_ANIMATOR_CURVE_IN:
- animator->curve_op = _animator_curve_in;
- break;
- case ELM_ANIMATOR_CURVE_OUT:
- animator->curve_op = _animator_curve_out;
- break;
- default:
- animator->curve_op = _animator_curve_linear;
- break;
- }
+
+ animator->curve_style = cs;
}
/**
Index: Elementary.h.in
===================================================================
--- Elementary.h.in (revision 55099)
+++ Elementary.h.in (working copy)
@@ -2263,21 +2263,22 @@
*/
typedef void (*Elm_Animator_Completion_Cb) (void *data);
- EAPI Elm_Animator* elm_animator_add(Evas_Object *parent);
- EAPI void elm_animator_del(Elm_Animator *animator);
- EAPI void elm_animator_duration_set(Elm_Animator *animator, double
duration);
- EAPI void elm_animator_operation_callback_set(Elm_Animator
*animator, Elm_Animator_Operation_Cb func, void *data);
- EAPI void elm_animator_completion_callback_set(Elm_Animator
*animator, Elm_Animator_Completion_Cb func, void *data);
- EAPI void elm_animator_stop(Elm_Animator *animator);
- EAPI void elm_animator_repeat_set(Elm_Animator *animator, unsigned
int repeat_cnt);
- EAPI void elm_animator_animate(Elm_Animator *animator);
- EAPI void elm_animator_curve_style_set(Elm_Animator *animator,
Elm_Animator_Curve_Style cs);
- EAPI void elm_animator_auto_reverse_set(Elm_Animator *animator,
Eina_Bool reverse);
- EAPI Eina_Bool elm_animator_auto_reverse_get(const Elm_Animator
*animator);
- EAPI Eina_Bool elm_animator_operating_get(const Elm_Animator *animator);
- EAPI unsigned int elm_animator_repeat_get(const Elm_Animator *animator);
- EAPI void elm_animator_pause(Elm_Animator *animator);
- EAPI void elm_animator_resume(Elm_Animator *animator);
+ EAPI Elm_Animator* elm_animator_add(Evas_Object *parent);
+ EAPI void elm_animator_del(Elm_Animator *animator);
+ EAPI void elm_animator_duration_set(Elm_Animator
*animator, double duration);
+ EAPI void
elm_animator_operation_callback_set(Elm_Animator *animator,
Elm_Animator_Operation_Cb func, void *data);
+ EAPI void
elm_animator_completion_callback_set(Elm_Animator *animator,
Elm_Animator_Completion_Cb func, void *data);
+ EAPI void elm_animator_stop(Elm_Animator *animator);
+ EAPI void elm_animator_repeat_set(Elm_Animator
*animator, unsigned int repeat_cnt);
+ EAPI void elm_animator_animate(Elm_Animator *animator);
+ EAPI void elm_animator_curve_style_set(Elm_Animator
*animator, Elm_Animator_Curve_Style cs);
+ EAPI void elm_animator_auto_reverse_set(Elm_Animator
*animator, Eina_Bool reverse);
+ EAPI Elm_Animator_Curve_Style elm_animator_curve_style_get(const
Elm_Animator *animator) EINA_ARG_NONNULL(1);
+ EAPI Eina_Bool elm_animator_auto_reverse_get(const
Elm_Animator *animator) EINA_ARG_NONNULL(1);
+ EAPI Eina_Bool elm_animator_operating_get(const Elm_Animator
*animator) EINA_ARG_NONNULL(1);
+ EAPI unsigned int elm_animator_repeat_get(const Elm_Animator
*animator);
+ EAPI void elm_animator_pause(Elm_Animator *animator);
+ EAPI void elm_animator_resume(Elm_Animator *animator);
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel