2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>

* clutter/clutter-alpha.h:
	* clutter/clutter-alpha.c:
	(clutter_alpha_set_mode): Use a lookup table to find the alpha
	function given the animation mode.

	(clutter_exp_in_func),
	(clutter_exp_out_func),
	(clutter_exp_in_out_func): Add new exponential functions.

	* clutter/clutter-script.c: Update the lookup table with the
	new animation modes; match "linear" to the ramp-inc alpha
	function.

	* clutter/clutter-types.h: Add new AnimationMode values.

	* tests/interactive/test-easing.c: Update the easing functions
	test.
This commit is contained in:
Emmanuele Bassi
2008-11-18 12:42:05 +00:00
parent 33a67bc299
commit 34cc7fe21c
6 changed files with 153 additions and 75 deletions

View File

@ -518,7 +518,8 @@ construct_timeline (ClutterScript *script,
}
/* ugh. if g_module_open() fails (*cough* python *cough*) we need a fallback
* for finding at least our own functions.
* for finding at least our own functions. keep the nick in sync with the
* ClutterAnimationMode enumeration
*/
static const struct
{
@ -542,9 +543,14 @@ static const struct
ALPHA_FUNC (clutter_smoothstep_dec_func, "smoothstep-dec"),
ALPHA_FUNC (clutter_exp_inc_func, "exp-inc"),
ALPHA_FUNC (clutter_exp_dec_func, "exp-dec"),
ALPHA_FUNC (clutter_ramp_inc_func, "linear"),
ALPHA_FUNC (clutter_ease_in_func, "ease-in"),
ALPHA_FUNC (clutter_ease_out_func, "ease-out"),
ALPHA_FUNC (clutter_ease_in_out_func, "ease-in-out")
ALPHA_FUNC (clutter_ease_in_out_func, "ease-in-out"),
ALPHA_FUNC (clutter_exp_in_func, "exp-in"),
ALPHA_FUNC (clutter_exp_out_func, "exp-out"),
ALPHA_FUNC (clutter_exp_in_out_func, "exp-in-out"),
ALPHA_FUNC (clutter_smoothstep_inc_func, "smooth-in-out")
#undef ALPHA_FUNC
};