Move Tweener.slowDownFactor into St

It has probably crossed the line to evil by a mile or so, but here
it is: a Tweener.slowDownFactor replacement used by all animations
without exception.
While at it, update Tweener to use the new setTimeScale() upstream
function instead of adjusting the timeline directly.

https://bugzilla.gnome.org/show_bug.cgi?id=622249
This commit is contained in:
Florian Müllner
2010-06-20 04:16:06 +02:00
parent 4b1fea2fa4
commit 35764fa09e
7 changed files with 53 additions and 21 deletions

View File

@ -105,6 +105,8 @@ enum
static guint signals[LAST_SIGNAL] = { 0, };
gfloat st_slow_down_factor = 1.0;
G_DEFINE_ABSTRACT_TYPE (StWidget, st_widget, CLUTTER_TYPE_ACTOR);
#define ST_WIDGET_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_WIDGET, StWidgetPrivate))
@ -1704,3 +1706,27 @@ st_describe_actor (ClutterActor *actor)
return g_string_free (desc, FALSE);
}
/**
* st_set_slow_down_factor:
*
* @factor: new slow-down factor
*
* Set a global factor applied to all animation durations
*/
void
st_set_slow_down_factor (gfloat factor)
{
st_slow_down_factor = factor;
}
/**
* st_get_slow_down_factor:
*
* Returns: the global factor applied to all animation durations
*/
gfloat
st_get_slow_down_factor ()
{
return st_slow_down_factor;
}