2006-12-08 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-behaviour.h: Add a function prototype
	for the foreach function: we need something more specific
	than GFunc; add clutter_behaviour_get_actors(), used to
	get a list of the actors.

	* clutter/clutter-behaviour.c: Add debugging notes; add
	a warning for behaviour implementations missing the
	alpha_notify vfunc; add api documentation

	* clutter/clutter-behaviour-opacity.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-behaviour-scale.c: Reimplement the
	alpha_notify functions using the new foreach function
	and, where possible, by directly iterating on the
	actors: this shaves off the number of recalculations
	of the property/alpha values, and the number of
	functions.
This commit is contained in:
Emmanuele Bassi
2006-12-08 16:12:52 +00:00
parent a56ea84dd5
commit aa623df78f
9 changed files with 242 additions and 71 deletions

View File

@ -184,9 +184,12 @@ path_total_length (ClutterBehaviourPath *behave)
}
static void
actor_apply_knot_foreach (ClutterActor *actor,
ClutterKnot *knot)
actor_apply_knot_foreach (ClutterBehaviour *behaviour,
ClutterActor *actor,
gpointer data)
{
ClutterKnot *knot = data;
clutter_actor_set_position (actor, knot->x, knot->y);
}
@ -217,7 +220,7 @@ path_alpha_to_position (ClutterBehaviourPath *behave,
if (offset == 0)
{
clutter_behaviour_actors_foreach (behaviour,
(GFunc) actor_apply_knot_foreach,
actor_apply_knot_foreach,
priv->knots->data);
g_signal_emit (behave, path_signals[KNOT_REACHED], 0,
@ -245,7 +248,7 @@ path_alpha_to_position (ClutterBehaviourPath *behave,
interpolate (knot, next, &new, t);
clutter_behaviour_actors_foreach (behaviour,
(GFunc)actor_apply_knot_foreach,
actor_apply_knot_foreach,
&new);
g_signal_emit (behave, path_signals[KNOT_REACHED], 0, &new);