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

* clutter/clutter-private.h: Add our own READABLE,
	WRITABLE and READWRITE paramspec flags, declaring the
	string components of the properties GParamSpec as static;
	this should shave off some bytes in the memory footprint
	and avoid relocations.

	* clutter/clutter-actor.c:
	* clutter/clutter-behaviour.c:
	* clutter/clutter-behaviour-opacity.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-behavuour-scale.c:
	* clutter/clutter-clone-texture.c:
	* clutter/clutter-label.c:
	* clutter/clutter-rectangle.c:
	* clutter/clutter-stage.c:
	* clutter/clutter-texture.c:
	* clutter/clutter-timeline.c: Use the CLUTTER_PARAM_*
	macros we just added.

	* clutter/clutter-behaviour-scale.c: Add properties for
	the scale begin, scale end and gravity parameters.

	* clutter/clutter-behaviour-path.h: Mark the ClutterKnot
	memory management functions as public (for the bindings),
	since we use the slice allocator for copying knots around;
	add a clutter_knot_equal() function.

	* clutter/clutter-behaviour-path.c:
	(node_distance): Use clutter_knot_equal() as a fast path
	to avoid the sqrt() in case the nodes we are using are
	at the same position.
	(path_total_length): Additional check on the existence
	of the next node.

	* examples/behave.c: Do not leak the ClutterBehaviour
	objects around.
This commit is contained in:
Emmanuele Bassi
2006-12-04 16:26:35 +00:00
parent 28d83d3c1a
commit f83ffa3520
16 changed files with 249 additions and 62 deletions

View File

@ -5,7 +5,7 @@ main (int argc, char *argv[])
{
ClutterTimeline *timeline;
ClutterAlpha *alpha;
ClutterBehaviour *behave;
ClutterBehaviour *o_behave, *p_behave;
ClutterActor *stage;
ClutterActor *group, *rect, *hand;
ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff };
@ -64,14 +64,14 @@ main (int argc, char *argv[])
NULL, NULL);
/* Create a behaviour for that alpha */
behave = clutter_behaviour_opacity_new (alpha, 0X33, 0xff);
o_behave = clutter_behaviour_opacity_new (alpha, 0X33, 0xff);
/* Apply it to our actor */
clutter_behaviour_apply (behave, group);
clutter_behaviour_apply (o_behave, group);
/* Make a path behaviour and apply that too */
behave = clutter_behaviour_path_new (alpha, knots, 5);
clutter_behaviour_apply (behave, group);
p_behave = clutter_behaviour_path_new (alpha, knots, 5);
clutter_behaviour_apply (p_behave, group);
/* start the timeline and thus the animations */
clutter_timeline_start (timeline);
@ -80,5 +80,8 @@ main (int argc, char *argv[])
clutter_main();
g_object_unref (o_behave);
g_object_unref (p_behave);
return 0;
}