diff --git a/ChangeLog b/ChangeLog index 051102acc..2dbfe8606 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2006-11-17 Emmanuele Bassi + + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-path.c: Add a "knot-reached" signal, + which is emitted when the path reaches a node in the nodes list; + flesh out the documentation a bit; sync the parameters names + so that gtk-doc doesn't complain about missing stuff. + + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour.c: Add the alpha value to the + ClutterBehaviour::alpha_notify vfunc, so you don't have to + get the value from the alpha inside the behaviour implementations; + add more documentation. + + * clutter/clutter-alpha.c: Flesh out the description. + + * clutter/clutter-actor.h: Update the header. + + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-scale.c: Update docs. + 2006-11-17 Matthew Allum * clutter/clutter-alpha.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index b27d9930e..c071471e8 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -934,8 +934,8 @@ clutter_actor_set_size (ClutterActor *self, /* * clutter_actor_get_size * @self: A #ClutterActor - * @x: Location to store width if non NULL. - * @y: Location to store height if non NULL. + * @width: Location to store width if non NULL. + * @height: Location to store height if non NULL. * * Gets the size of an actor ignoring any scaling factors * diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index 8ef61b508..f507453cc 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -211,42 +211,28 @@ void clutter_actor_lower_bottom (ClutterActor *sel void clutter_actor_set_depth (ClutterActor *self, gint depth); gint clutter_actor_get_depth (ClutterActor *self); - -void -clutter_actor_set_scalex (ClutterActor *self, - ClutterFixed scale_x, - ClutterFixed scale_y); - -void -clutter_actor_set_scale (ClutterActor *self, - double scale_x, - double scale_y); - -void -clutter_actor_get_scalex (ClutterActor *self, - ClutterFixed *scale_x, - ClutterFixed *scale_y); - -void -clutter_actor_get_scale (ClutterActor *self, - double *scale_x, - double *scale_y); - -void -clutter_actor_get_abs_size (ClutterActor *self, - guint *width, - guint *height); - -void -clutter_actor_get_size (ClutterActor *self, - guint *width, - guint *height); - -void -clutter_actor_move_by (ClutterActor *self, - gint dx, - gint dy); +void clutter_actor_set_scalex (ClutterActor *self, + ClutterFixed scale_x, + ClutterFixed scale_y); +void clutter_actor_set_scale (ClutterActor *self, + gdouble scale_x, + gdouble scale_y); +void clutter_actor_get_scalex (ClutterActor *self, + ClutterFixed *scale_x, + ClutterFixed *scale_y); +void clutter_actor_get_scale (ClutterActor *self, + gdouble *scale_x, + gdouble *scale_y); +void clutter_actor_get_abs_size (ClutterActor *self, + guint *width, + guint *height); +void clutter_actor_get_size (ClutterActor *self, + guint *width, + guint *height); +void clutter_actor_move_by (ClutterActor *self, + gint dx, + gint dy); G_END_DECLS -#endif +#endif /* _HAVE_CLUTTER_ACTOR_H */ diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c index 8f5338f65..8204627f2 100644 --- a/clutter/clutter-alpha.c +++ b/clutter/clutter-alpha.c @@ -30,8 +30,17 @@ * @short_description: A class for calculating an alpha value as a function * of time. * - * #ClutterAlpha is a class for calculating an integer value between - * 0 and CLUTTER_ALPHA_MAX_ALPHA as a function of time. + * #ClutterAlpha is a class for calculating an integer value between + * 0 and %CLUTTER_ALPHA_MAX_ALPHA as a function of time. You should + * provide a #ClutterTimeline and bind it to the #ClutterAlpha object; + * you should also provide a function returning the alpha value depending + * on the position inside the timeline; this function will be executed + * each time a new frame in the #ClutterTimeline is reached. Since the + * alpha function is controlled by the timeline instance, you can pause + * or stop the #ClutterAlpha from calling the alpha function by controlling + * the #ClutterTimeline object. + * + * #ClutterAlpha is used to "drive" a #ClutterBehaviour instance. */ #ifdef HAVE_CONFIG_H @@ -142,6 +151,10 @@ clutter_alpha_finalize (GObject *object) if (priv->destroy) { priv->destroy (priv->data); + + priv->destroy = NULL; + priv->data = NULL; + priv->func = NULL; } G_OBJECT_CLASS (clutter_alpha_parent_class)->finalize (object); @@ -300,7 +313,9 @@ clutter_alpha_set_timeline (ClutterAlpha *alpha, * clutter_alpha_get_timeline: * @alpha: A #ClutterAlpha * - * Return value: The #ClutterTimeline + * Gets the #ClutterTimeline bound to @alpha. + * + * Return value: a #ClutterTimeline instance */ ClutterTimeline * clutter_alpha_get_timeline (ClutterAlpha *alpha) @@ -336,10 +351,10 @@ clutter_alpha_new (void) * @data: data to be passed to the alpha function * @destroy: notify to be called when removing the alpha function * - * Create a new #ClutterAlpha instance and sets the timeline + * Creates a new #ClutterAlpha instance and sets the timeline * and alpha function. * - * Return Value: a new #ClutterAlpha + * Return Value: the newly created #ClutterAlpha */ ClutterAlpha * clutter_alpha_new_full (ClutterTimeline *timeline, @@ -360,6 +375,16 @@ clutter_alpha_new_full (ClutterTimeline *timeline, return retval; } +/** + * clutter_ramp_inc_func: + * @alpha: a #ClutterAlpha + * @dummy: unused argument + * + * Convenience alpha function for a monotonic increasing ramp. You + * can use this function as the alpha function for clutter_alpha_set_func(). + * + * Return value: an alpha value. + */ guint32 clutter_ramp_inc_func (ClutterAlpha *alpha, gpointer dummy) @@ -375,6 +400,16 @@ clutter_ramp_inc_func (ClutterAlpha *alpha, return (current_frame_num * CLUTTER_ALPHA_MAX_ALPHA) / n_frames; } +/** + * clutter_ramp_dec_func: + * @alpha: a #ClutterAlpha + * @dummy: unused argument + * + * Convenience alpha function for a monotonic decreasing ramp. You + * can use this function as the alpha function for clutter_alpha_set_func(). + * + * Return value: an alpha value. + */ guint32 clutter_ramp_dec_func (ClutterAlpha *alpha, gpointer dummy) @@ -392,6 +427,17 @@ clutter_ramp_dec_func (ClutterAlpha *alpha, / n_frames; } +/** + * clutter_ramp_func: + * @alpha: a #ClutterAlpha + * @dummy: unused argument + * + * Convenience alpha function for a full ramp function (increase for + * half the time, decrease for the remaining half). You can use this + * function as the alpha function for clutter_alpha_set_func(). + * + * Return value: an alpha value. + */ guint32 clutter_ramp_func (ClutterAlpha *alpha, gpointer dummy) @@ -418,6 +464,16 @@ clutter_ramp_func (ClutterAlpha *alpha, } } +/** + * clutter_sine_func: + * @alpha: a #ClutterAlpha + * @dummy: unused argument + * + * Convenience alpha function for a sine wave. You can use this + * function as the alpha function for clutter_alpha_set_func(). + * + * Return value: an alpha value. + */ guint32 clutter_sine_func (ClutterAlpha *alpha, gpointer dummy) @@ -438,5 +494,5 @@ clutter_sine_func (ClutterAlpha *alpha, CLUTTER_DBG ("%2f\n", ((sin (x - (M_PI / 2.0f)) + 1.0f) * 0.5f)); return (guint32) (((sin (x - (M_PI / 2.0f)) + 1.0f) * 0.5f) - * (gdouble) CLUTTER_ALPHA_MAX_ALPHA); + * (gdouble) CLUTTER_ALPHA_MAX_ALPHA); } diff --git a/clutter/clutter-behaviour-opacity.c b/clutter/clutter-behaviour-opacity.c index 9efe438ad..25e923b90 100644 --- a/clutter/clutter-behaviour-opacity.c +++ b/clutter/clutter-behaviour-opacity.c @@ -44,6 +44,13 @@ #include +/** + * SECTION:clutter-behaviour-opacity + * @short_description: Behaviour controlling the opacity + * + * #ClutterBehaviourOpacity controls the opacity of a set of actors. + */ + G_DEFINE_TYPE (ClutterBehaviourOpacity, clutter_behaviour_opacity, CLUTTER_TYPE_BEHAVIOUR); @@ -60,8 +67,8 @@ struct _ClutterBehaviourOpacityPrivate ClutterBehaviourOpacityPrivate)) static void -clutter_behaviour_opacity_frame_foreach (ClutterActor *actor, - ClutterBehaviourOpacity *behave) +opacity_frame_foreach (ClutterActor *actor, + ClutterBehaviourOpacity *behave) { guint32 alpha; guint8 opacity; @@ -84,10 +91,11 @@ clutter_behaviour_opacity_frame_foreach (ClutterActor *actor, } static void -clutter_behaviour_alpha_notify (ClutterBehaviour *behave) +clutter_behaviour_alpha_notify (ClutterBehaviour *behave, + guint32 alpha_value) { clutter_behaviour_actors_foreach (behave, - (GFunc)clutter_behaviour_opacity_frame_foreach, + (GFunc) opacity_frame_foreach, CLUTTER_BEHAVIOUR_OPACITY (behave)); } @@ -117,18 +125,18 @@ clutter_behaviour_opacity_init (ClutterBehaviourOpacity *self) } /** - * clutter_behaviour_opacity_new : - * @alpha: a #ClutterAlpha - * @scale_begin: initial opacity value - * @scale_end: final opacity value + * clutter_behaviour_opacity_new: + * @alpha: a #ClutterAlpha instance, or %NULL + * @opacity_start: minimum level of opacity + * @opacity_end: maximum level of opacity * - * Creates a new #ClutterBehaviourOpacity instance. + * Creates a new #ClutterBehaviourOpacity object, driven by @alpha + * which controls the opacity property of every actor, making it + * change in the interval between @opacity_start and @opacity_end. * * Return value: the newly created #ClutterBehaviourOpacity - * - * Since: 0.2 */ -ClutterBehaviour* +ClutterBehaviour * clutter_behaviour_opacity_new (ClutterAlpha *alpha, guint8 opacity_start, guint8 opacity_end) diff --git a/clutter/clutter-behaviour-path.c b/clutter/clutter-behaviour-path.c index 982b96481..45a076796 100644 --- a/clutter/clutter-behaviour-path.c +++ b/clutter/clutter-behaviour-path.c @@ -39,12 +39,25 @@ #include "clutter-actor.h" #include "clutter-behaviour.h" +#include "clutter-marshal.h" #include "clutter-enum-types.h" #include "clutter-main.h" #include "clutter-behaviour-path.h" #include +/** + * SECTION:clutter-behaviour-path + * @short_description: Behaviour for walking on a path + * + * #ClutterBehaviourPath makes all the actors driven by it walk on a path. + * A path is a set of #ClutterKnots object given when creating a new + * #ClutterBehaviourPath instance. Knots can be also added to the path + * using clutter_behaviour_path_append_knot(). The whole path can be + * cleared using clutter_behaviour_path_clear(). Each time the behaviour + * reaches a knot in the path, the "knot-reached" signal is emitted. + */ + static ClutterKnot * clutter_knot_copy (const ClutterKnot *knot) { @@ -80,8 +93,8 @@ clutter_knot_get_type (void) } -G_DEFINE_TYPE (ClutterBehaviourPath, \ - clutter_behaviour_path, \ +G_DEFINE_TYPE (ClutterBehaviourPath, + clutter_behaviour_path, CLUTTER_TYPE_BEHAVIOUR); struct _ClutterBehaviourPathPrivate @@ -94,6 +107,15 @@ struct _ClutterBehaviourPathPrivate CLUTTER_TYPE_BEHAVIOUR_PATH, \ ClutterBehaviourPathPrivate)) +enum +{ + KNOT_REACHED, + + LAST_SIGNAL +}; + +static guint path_signals[LAST_SIGNAL] = { 0, }; + static void clutter_behaviour_path_finalize (GObject *object) { @@ -105,7 +127,7 @@ clutter_behaviour_path_finalize (GObject *object) G_OBJECT_CLASS (clutter_behaviour_path_parent_class)->finalize (object); } -static void +static inline void interpolate (const ClutterKnot *begin, const ClutterKnot *end, ClutterKnot *out, @@ -117,7 +139,8 @@ interpolate (const ClutterKnot *begin, } static gint -node_distance (const ClutterKnot *begin, const ClutterKnot *end) +node_distance (const ClutterKnot *begin, + const ClutterKnot *end) { g_return_val_if_fail (begin != NULL, 0); g_return_val_if_fail (end != NULL, 0); @@ -141,18 +164,18 @@ path_total_length (ClutterBehaviourPath *behave) } static void -actor_apply_knot_foreach (ClutterActor *actor, - ClutterKnot *knot) +actor_apply_knot_foreach (ClutterActor *actor, + ClutterKnot *knot) { clutter_actor_set_position (actor, knot->x, knot->y); } static void -path_alpha_to_position (ClutterBehaviourPath *behave) +path_alpha_to_position (ClutterBehaviourPath *behave, + guint32 alpha) { ClutterBehaviourPathPrivate *priv = behave->priv; ClutterBehaviour *behaviour = CLUTTER_BEHAVIOUR (behave); - guint32 alpha; GSList *l; gint total_len, offset, dist_to_next, dist = 0; @@ -168,8 +191,6 @@ path_alpha_to_position (ClutterBehaviourPath *behave) * o Apply to actors. */ - alpha = clutter_alpha_get_alpha (clutter_behaviour_get_alpha (behaviour)); - total_len = path_total_length (behave); offset = (alpha * total_len) / CLUTTER_ALPHA_MAX_ALPHA; @@ -178,6 +199,9 @@ path_alpha_to_position (ClutterBehaviourPath *behave) clutter_behaviour_actors_foreach (behaviour, (GFunc) actor_apply_knot_foreach, priv->knots->data); + + g_signal_emit (behave, path_signals[KNOT_REACHED], 0, + priv->knots->data); return; } @@ -197,11 +221,15 @@ path_alpha_to_position (ClutterBehaviourPath *behave) /* FIXME: Use fixed */ t = (double) (offset - dist) / dist_to_next; + interpolate (knot, next, &new, t); clutter_behaviour_actors_foreach (behaviour, (GFunc)actor_apply_knot_foreach, &new); + + g_signal_emit (behave, path_signals[KNOT_REACHED], 0, &new); + return; } } @@ -211,25 +239,41 @@ path_alpha_to_position (ClutterBehaviourPath *behave) } static void -clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave) +clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave, + guint32 alpha_value) { - path_alpha_to_position (CLUTTER_BEHAVIOUR_PATH(behave)); + path_alpha_to_position (CLUTTER_BEHAVIOUR_PATH (behave), alpha_value); } static void clutter_behaviour_path_class_init (ClutterBehaviourPathClass *klass) { - GObjectClass *object_class; - ClutterBehaviourClass *behave_class; + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); - object_class = (GObjectClass*) klass; - behave_class = (ClutterBehaviourClass*) klass; + gobject_class->finalize = clutter_behaviour_path_finalize; - object_class->finalize = clutter_behaviour_path_finalize; + /** + * ClutterBehaviourPath::knot-reached: + * @pathb: the object which received the signal + * @knot: the #ClutterKnot reached + * + * This signal is emitted each time a node defined inside the path + * is reached. + */ + path_signals[KNOT_REACHED] = + g_signal_new ("knot-reached", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterBehaviourPathClass, knot_reached), + NULL, NULL, + clutter_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + CLUTTER_TYPE_KNOT); behave_class->alpha_notify = clutter_behaviour_path_alpha_notify; - - g_type_class_add_private (object_class, sizeof (ClutterBehaviourPathPrivate)); + + g_type_class_add_private (klass, sizeof (ClutterBehaviourPathPrivate)); } static void @@ -242,23 +286,24 @@ clutter_behaviour_path_init (ClutterBehaviourPath *self) /** * clutter_behaviour_path_new: - * @alpha: a #ClutterAlpha - * @knots: a list of #ClutterKnots - * @n_knots: the number of nodes in the path + * @alpha: a #ClutterAlpha, or %NULL + * @knots: a list of #ClutterKnots, or %NULL for an empty path + * @n_knots: the number of nodes in the path * - * Creates a new #ClutterBehaviourPath instance for supplied knots. + * Creates a new path behaviour. You can use this behaviour to drive + * actors along the nodes of a path, described by the @knots. * * Return value: a #ClutterBehaviour * * Since: 0.2 */ ClutterBehaviour * -clutter_behaviour_path_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots) +clutter_behaviour_path_new (ClutterAlpha *alpha, + const ClutterKnot *knots, + guint n_knots) { ClutterBehaviourPath *behave; - gint i; + gint i; behave = g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, "alpha", alpha, @@ -276,23 +321,23 @@ clutter_behaviour_path_new (ClutterAlpha *alpha, /** * clutter_behaviour_path_get_knots: - * @behave: a #ClutterBehvaiourPath + * @pathb: a #ClutterBehvaiourPath * - * Returns a copy of the list of knots contained by the #ClutterBehvaiourPath + * Returns a copy of the list of knots contained by @pathb * * Return value: a #GSList of the paths knots. * * Since: 0.2 */ GSList * -clutter_behaviour_path_get_knots (ClutterBehaviourPath *behave) +clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb) { GSList *retval, *l; - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (behave), NULL); + g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb), NULL); retval = NULL; - for (l = behave->priv->knots; l != NULL; l = l->next) + for (l = pathb->priv->knots; l != NULL; l = l->next) retval = g_slist_prepend (retval, l->data); return g_slist_reverse (retval); diff --git a/clutter/clutter-behaviour-path.h b/clutter/clutter-behaviour-path.h index 09100c200..179b55380 100644 --- a/clutter/clutter-behaviour-path.h +++ b/clutter/clutter-behaviour-path.h @@ -80,6 +80,14 @@ struct _ClutterBehaviourPath struct _ClutterBehaviourPathClass { ClutterBehaviourClass parent_class; + + void (*knot_reached) (ClutterBehaviourPath *pathb, + const ClutterKnot *knot); + + void (*_clutter_path_1) (void); + void (*_clutter_path_2) (void); + void (*_clutter_path_3) (void); + void (*_clutter_path_4) (void); }; GType clutter_behaviour_path_get_type (void) G_GNUC_CONST; @@ -87,20 +95,19 @@ GType clutter_behaviour_path_get_type (void) G_GNUC_CONST; ClutterBehaviour *clutter_behaviour_path_new (ClutterAlpha *alpha, const ClutterKnot *knots, guint n_knots); -GSList * clutter_behaviour_path_get_knots (ClutterBehaviourPath *behave); -void clutter_behaviour_path_append_knot (ClutterBehaviourPath *behave, +GSList * clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb); +void clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, const ClutterKnot *knot); void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, const ClutterKnot *first_knot, ...) G_GNUC_NULL_TERMINATED; +void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, + guint offset, + const ClutterKnot *knot); +void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, + guint offset); -void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, - guint offset, - const ClutterKnot *knot); -void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, - guint offset); - -void clutter_behaviour_path_clear (ClutterBehaviourPath *path); +void clutter_behaviour_path_clear (ClutterBehaviourPath *path); G_END_DECLS diff --git a/clutter/clutter-behaviour-scale.c b/clutter/clutter-behaviour-scale.c index 4cf62cea7..afc52f31d 100644 --- a/clutter/clutter-behaviour-scale.c +++ b/clutter/clutter-behaviour-scale.c @@ -45,6 +45,13 @@ #include +/** + * SECTION:clutter-behaviour-scale + * @short_description: Behaviour controlling the scale of a set of actors + * + * FIXME + */ + G_DEFINE_TYPE (ClutterBehaviourScale, clutter_behaviour_scale, CLUTTER_TYPE_BEHAVIOUR); @@ -63,8 +70,8 @@ struct _ClutterBehaviourScalePrivate ClutterBehaviourScalePrivate)) static void -clutter_behaviour_scale_frame_foreach (ClutterActor *actor, - ClutterBehaviourScale *behave) +scale_frame_foreach (ClutterActor *actor, + ClutterBehaviourScale *behave) { ClutterFixed scale, factor; guint32 alpha; @@ -122,10 +129,11 @@ clutter_behaviour_scale_frame_foreach (ClutterActor *actor, } static void -clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave) +clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave, + guint32 alpha_value) { clutter_behaviour_actors_foreach (behave, - (GFunc)clutter_behaviour_scale_frame_foreach, + (GFunc) scale_frame_foreach, CLUTTER_BEHAVIOUR_SCALE (behave)); } @@ -154,6 +162,7 @@ clutter_behaviour_scale_init (ClutterBehaviourScale *self) * @alpha: a #ClutterAlpha * @scale_begin: initial scale factor * @scale_end: final scale factor + * @gravity: FIXME * * Creates a new #ClutterBehaviourScale instance. * diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index a0f6c9ede..8d12c6426 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -27,6 +27,26 @@ * SECTION:clutter-behaviour * @short_description: Class for providing behaviours to actors * + * #ClutterBehaviour is the base class for implementing behaviours. A + * behaviour is a controller object for #ClutterActors; you can + * use a behaviour to control one or more properties of an actor (such + * as its opacity, or its position). A #ClutterBehaviour is driven by + * an "alpha function" stored inside a #ClutterAlpha object; an alpha + * function is a function depending solely on time. The alpha function + * computes a value which is then applied to the properties of the + * actors driven by a behaviour. + * + * Clutter provides some pre-defined behaviours, like #ClutterBehaviourPath, + * which controls the position of a set of actors making them "walk" along + * a set of nodes; #ClutterBehaviourOpacity, which controls the opacity + * of a set of actors; #ClutterBehaviourScale, which controls the width + * and height of a set of actors. + * + * In order to implement a new behaviour you should subclass #ClutterBehaviour + * and override the "alpha_notify" virtual function; inside the overridden + * function you should obtain the alpha value from the #ClutterAlpha + * instance bound to the behaviour and apply it to the desiderd property + * (or properties) of every actor controlled by the behaviour. */ #include "config.h" @@ -214,12 +234,18 @@ notify_cb (GObject *object, GParamSpec *param_spec, ClutterBehaviour *behave) { - ClutterBehaviourClass *class; + ClutterBehaviourClass *klass; - class = CLUTTER_BEHAVIOUR_GET_CLASS(behave); + klass = CLUTTER_BEHAVIOUR_GET_CLASS (behave); - if (class->alpha_notify) - class->alpha_notify (behave); + if (klass->alpha_notify) + { + guint32 alpha_value; + + alpha_value = clutter_alpha_get_alpha (behave->priv->alpha); + + klass->alpha_notify (behave, alpha_value); + } } void diff --git a/clutter/clutter-behaviour.h b/clutter/clutter-behaviour.h index 26f32fd9c..238f069a3 100644 --- a/clutter/clutter-behaviour.h +++ b/clutter/clutter-behaviour.h @@ -70,8 +70,11 @@ struct _ClutterBehaviourClass { GObjectClass parent_class; - void (*alpha_notify) (ClutterBehaviour *behave); + /* vfunc, not signal */ + void (*alpha_notify) (ClutterBehaviour *behave, + guint32 alpha_value); + /* padding, for future expansion */ void (*_clutter_behaviour1) (void); void (*_clutter_behaviour2) (void); void (*_clutter_behaviour3) (void); diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog index 59b02e69d..a408e41b5 100644 --- a/doc/reference/ChangeLog +++ b/doc/reference/ChangeLog @@ -1,3 +1,26 @@ +2006-11-17 Emmanuele Bassi + + * clutter-sections.txt: Move stuff around: get_type and Private + stuff go in the Private subsection; remove private symbols like + pango stuff and the enum gtype signatures; remove cruft. + + * Makefile.am: Add more private files. + + * tmpl/clutter-fixed.sgml: + * tmpl/clutter-feature.sgml: + * tmpl/clutter-actor.sgml: + * tmpl/clutter-media.sgml: + * tmpl/clutter-behaviour-opacity.sgml: + * tmpl/clutter-behaviour-path.sgml: + * tmpl/clutter-behaviour-scale.sgml: + * tmpl/clutter-behaviour.sgml: + * tmpl/clutter-alpha.sgml: Add templates. + + * tmpl/clutter-0.0-unused.sgml: + * tmpl/clutter.sgml: + * tmpl/clutter-enum-types.sgml: + * tmpl/clutter-element.sgml: Remove old templates. + 2006-11-15 Emmanuele Bassi * clutter-sections.txt: diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am index dcd805ffb..d3fd96f61 100644 --- a/doc/reference/Makefile.am +++ b/doc/reference/Makefile.am @@ -51,7 +51,9 @@ IGNORE_HFILES=\ clutter-private.h \ clutter-marshal.h \ clutter-keysyms.h \ - stamp-clutter-enum-types.h + clutter-enum-types.h \ + stamp-clutter-enum-types.h \ + pango # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index a483dac03..a5eb372a6 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -19,6 +19,7 @@ clutter_media_set_filename CLUTTER_MEDIA CLUTTER_IS_MEDIA CLUTTER_TYPE_MEDIA + clutter_media_get_type @@ -99,12 +100,12 @@ clutter_alpha_get_timeline CLUTTER_ALPHA CLUTTER_IS_ALPHA CLUTTER_TYPE_ALPHA -clutter_alpha_get_type CLUTTER_ALPHA_CLASS CLUTTER_IS_ALPHA_CLASS CLUTTER_ALPHA_GET_CLASS ClutterAlphaPrivate +clutter_alpha_get_type
@@ -186,16 +187,13 @@ CLUTTER_ACTOR_IS_MAPPED CLUTTER_ACTOR_IS_REALIZED CLUTTER_ACTOR_IS_VISIBLE ClutterActorBox -ClutterActorPrivate -ClutterGeometry -ClutterCallback -CLUTTER_CALLBACK ClutterActorFlags -clutter_actor_box_get_type +ClutterGeometry +CLUTTER_CALLBACK +ClutterCallback ClutterActor ClutterActor ClutterActorClass -clutter_actor_get_type clutter_actor_show clutter_actor_hide clutter_actor_realize @@ -245,10 +243,14 @@ clutter_actor_get_abs_size CLUTTER_ACTOR CLUTTER_IS_ACTOR CLUTTER_TYPE_ACTOR -clutter_geometry_get_type CLUTTER_ACTOR_CLASS CLUTTER_IS_ACTOR_CLASS CLUTTER_ACTOR_GET_CLASS + +ClutterActorPrivate +clutter_actor_get_type +clutter_actor_box_get_type +clutter_geometry_get_type
@@ -399,58 +401,11 @@ ClutterBehaviourScalePrivate clutter_behaviour_scale_get_type
-
-pangoclutter-private -PANGO_SCALE_26_6 -PANGO_PIXELS_26_6 -PANGO_UNITS_26_6 -PANGO_CLUTTER_FONT -PangoClutterFont -PangoClutterGlyphInfo -pango_clutter_get_unknown_glyph -pango_clutter_font_get_face -PangoClutterRenderer -PANGO_TYPE_CLUTTER_RENDERER -PANGO_CLUTTER_RENDERER -PANGO_IS_CLUTTER_RENDERER -pango_clutter_renderer_get_type -pango_fc_font_get_raw_extents - -PANGO_TYPE_CLUTTER_FONT -PANGO_CLUTTER_IS_FONT -pango_clutter_font_get_type -
- -
-pangoclutter -PANGO_ENABLE_BACKEND -G_DISABLE_CAST_CHECKS -PANGO_CLUTTER_FONT_MAP -PangoClutterFontMap -PangoClutterFontMapClass -PangoClutterSubstituteFunc -pango_clutter_font_map_new -pango_clutter_font_map_set_default_substitute -pango_clutter_font_map_substitute_changed -pango_clutter_font_map_create_context -FLAG_INVERSE -FLAG_OUTLINE -pango_clutter_render_layout_subpixel -pango_clutter_render_layout -pango_clutter_render_layout_line -pango_clutter_render_clear_caches - -PANGO_TYPE_CLUTTER_FONT_MAP -PANGO_CLUTTER_IS_FONT_MAP -pango_clutter_font_map_get_type -
-
clutter-util clutter_util_trap_x_errors clutter_util_untrap_x_errors clutter_util_next_p2 -clutter_util_can_create_texture
@@ -539,22 +494,3 @@ clutter_want_debug clutter_threads_enter clutter_threads_leave
- -
-clutter -
- -
-clutter-enum-types -CLUTTER_TYPE_EVENT_TYPE -clutter_event_type_get_type -CLUTTER_TYPE_FEATURE_FLAGS -clutter_feature_flags_get_type -CLUTTER_TYPE_ACTOR_FLAGS -clutter_actor_flags_get_type -CLUTTER_TYPE_RAMP_TYPE -clutter_ramp_type_get_type -CLUTTER_TYPE_INIT_ERROR -clutter_init_error_get_type -
- diff --git a/doc/reference/tmpl/clutter-0.0-unused.sgml b/doc/reference/tmpl/clutter-0.0-unused.sgml deleted file mode 100644 index 2c7507c1d..000000000 --- a/doc/reference/tmpl/clutter-0.0-unused.sgml +++ /dev/null @@ -1,488 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -ClutterElement - - - - - - - -@e: - - - - - - -@e: - - - - - - -@e: - - - - - - -@e: -@f: - - - - - - -@e: -@f: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@parent: -@flags: - - - - - - -@x1: -@y1: -@x2: -@y2: - - - - - - -@CLUTTER_ELEMENT_MAPPED: -@CLUTTER_ELEMENT_REALIZED: - - - - - - - - - - - - -@CLUTTER_ELEMENT_MIRROR_X: -@CLUTTER_ELEMENT_MIRROR_Y: - - - - - - -@self: -@box: - - - - - - -@Returns: - - - - - - -@Returns: - - - - - - -@self: -@x: -@y: - - - - - - -@self: -@x1: -@y1: -@x2: -@y2: - - - - - - -@self: -@geom: - - - - - - -@self: -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@self: -@Returns: - - - - - - -@self: - - - - - - -@self: -@above: - - - - - - -@self: - - - - - - -@self: - - - - - - -@self: - - - - - - -@self: -@below: - - - - - - -@self: - - - - - - -@self: - - - - - - -@self: - - - - - - -@self: -@box: - - - - - - -@self: -@angle: -@y: -@z: - - - - - - -@self: -@angle: -@x: -@z: - - - - - - -@self: -@angle: -@x: -@y: - - - - - - -@self: -@xoff: -@yoff: -@width: -@height: - - - - - - -@self: -@geom: - - - - - - -@self: -@id: - - - - - - -@self: -@opacity: - - - - - - -@self: -@parent: - - - - - - -@self: -@x: -@y: - - - - - - -@self: -@width: -@height: - - - - - - -@self: - - - - - - -@Returns: - - - - - - -@self: - - - - - - -@Returns: - - - - - - -@Returns: - - - - - - -@stage: -@x: -@y: -@Returns: - - - - - - -@Returns: - - - - - - -@Returns: - - - - - - -@Returns: - diff --git a/doc/reference/tmpl/clutter-actor.sgml b/doc/reference/tmpl/clutter-actor.sgml new file mode 100644 index 000000000..f491d26c0 --- /dev/null +++ b/doc/reference/tmpl/clutter-actor.sgml @@ -0,0 +1,629 @@ + +ClutterActor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@e: +@f: + + + + + + + +@e: +@f: + + + + + + + +@e: + + + + + + + +@e: + + + + + + + +@e: + + + + + + + +@x1: +@y1: +@x2: +@y2: + + + + + + +@CLUTTER_ACTOR_MAPPED: +@CLUTTER_ACTOR_REALIZED: + + + + + + +@x: +@y: +@width: +@height: + + + + + + +@f: + + + + + + + +@actor: +@data: + + + + + + + +@parent_instance: +@flags: + + + + + + +@clutteractor: the object which received the signal. + + + + + + +@clutteractor: the object which received the signal. + + + + + + +@clutteractor: the object which received the signal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: +@show: +@hide: +@realize: +@unrealize: +@paint: +@request_coords: +@allocate_coords: +@set_depth: +@get_depth: +@destroy: +@show_all: +@hide_all: +@queue_redraw: +@_clutter_actor_1: +@_clutter_actor_2: +@_clutter_actor_3: +@_clutter_actor_4: +@_clutter_actor_5: +@_clutter_actor_6: + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: +@box: + + + + + + + +@self: +@box: + + + + + + + +@self: +@geometry: + + + + + + + +@self: +@geometry: + + + + + + + +@self: +@x1: +@y1: +@x2: +@y2: + + + + + + + +@self: +@width: +@height: + + + + + + + +@self: +@x: +@y: + + + + + + + +@self: +@x: +@y: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@angle: +@y: +@z: + + + + + + + +@self: +@angle: +@x: +@z: + + + + + + + +@self: +@angle: +@x: +@y: + + + + + + + +@self: +@opacity: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@name: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@xoff: +@yoff: +@width: +@height: + + + + + + + +@self: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@parent: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@new_parent: + + + + + + + +@self: + + + + + + + +@self: +@below: + + + + + + + +@self: +@above: + + + + + + + +@self: + + + + + + + +@self: + + + + + + + +@self: +@depth: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@scale_x: +@scale_y: + + + + + + + +@self: +@scale_x: +@scale_y: + + + + + + + +@self: +@scale_x: +@scale_y: + + + + + + + +@self: +@scale_x: +@scale_y: + + + + + + + +@self: +@width: +@height: + + diff --git a/doc/reference/tmpl/clutter-alpha.sgml b/doc/reference/tmpl/clutter-alpha.sgml new file mode 100644 index 000000000..ce7cbb77b --- /dev/null +++ b/doc/reference/tmpl/clutter-alpha.sgml @@ -0,0 +1,123 @@ + +ClutterAlpha + + + + + + + + + + + +#ClutterBehaviour, #ClutterTimeline + + + + + + + +The #ClutterAlpha structure contains only private data and should not be +accessed directly. + + + + + + + + + + + + + + + + + + +@parent_class: +@_clutter_alpha_1: +@_clutter_alpha_2: +@_clutter_alpha_3: +@_clutter_alpha_4: +@_clutter_alpha_5: + + + + + + +@Returns: + + + + + + + +@timeline: +@func: +@data: +@destroy: +@Returns: + + + + + + + +@alpha: +@Returns: + + + + + + + + + + + + + + +@alpha: +@user_data: +@Returns: + + + + + + + +@alpha: +@func: +@data: +@destroy: + + + + + + + +@alpha: +@timeline: + + + + + + + +@alpha: +@Returns: + + diff --git a/doc/reference/tmpl/clutter-behaviour-opacity.sgml b/doc/reference/tmpl/clutter-behaviour-opacity.sgml new file mode 100644 index 000000000..1bce93f46 --- /dev/null +++ b/doc/reference/tmpl/clutter-behaviour-opacity.sgml @@ -0,0 +1,43 @@ + +ClutterBehaviourOpacity + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: + + + + + + +@alpha: +@opacity_start: +@opacity_end: +@Returns: + + diff --git a/doc/reference/tmpl/clutter-behaviour-path.sgml b/doc/reference/tmpl/clutter-behaviour-path.sgml new file mode 100644 index 000000000..292fc2f65 --- /dev/null +++ b/doc/reference/tmpl/clutter-behaviour-path.sgml @@ -0,0 +1,107 @@ + +ClutterBehaviourPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@x: +@y: + + + + + + + + + + + + +@clutterbehaviourpath: the object which received the signal. +@arg1: + + + + + + +@parent_class: +@knot_reached: +@_clutter_path_1: +@_clutter_path_2: +@_clutter_path_3: +@_clutter_path_4: + + + + + + +@alpha: +@knots: +@n_knots: +@Returns: + + + + + + + +@pathb: +@Returns: + + + + + + + +@pathb: +@knot: + + + + + + + +@pathb: +@first_knot: +@Varargs: + + + + + + + +@path: + + diff --git a/doc/reference/tmpl/clutter-behaviour-scale.sgml b/doc/reference/tmpl/clutter-behaviour-scale.sgml new file mode 100644 index 000000000..910fe75d2 --- /dev/null +++ b/doc/reference/tmpl/clutter-behaviour-scale.sgml @@ -0,0 +1,44 @@ + +ClutterBehaviourScale + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: + + + + + + +@alpha: +@scale_begin: +@scale_end: +@gravity: +@Returns: + + diff --git a/doc/reference/tmpl/clutter-behaviour.sgml b/doc/reference/tmpl/clutter-behaviour.sgml new file mode 100644 index 000000000..07f96a1b7 --- /dev/null +++ b/doc/reference/tmpl/clutter-behaviour.sgml @@ -0,0 +1,90 @@ + +ClutterBehaviour + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent_class: +@alpha_notify: +@_clutter_behaviour1: +@_clutter_behaviour2: +@_clutter_behaviour3: +@_clutter_behaviour4: +@_clutter_behaviour5: +@_clutter_behaviour6: + + + + + + +@behave: +@actor: + + + + + + + +@behave: +@actor: + + + + + + + +@behave: +@func: +@data: + + + + + + + +@behave: +@Returns: + + + + + + + +@behave: +@alpha: + + diff --git a/doc/reference/tmpl/clutter-element.sgml b/doc/reference/tmpl/clutter-element.sgml deleted file mode 100644 index ed9d5462a..000000000 --- a/doc/reference/tmpl/clutter-element.sgml +++ /dev/null @@ -1,462 +0,0 @@ - -ClutterElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@e: -@f: - - - - - - - -@e: -@f: - - - - - - - -@e: - - - - - - - -@e: - - - - - - - -@e: - - - - - - - -@x1: -@y1: -@x2: -@y2: - - - - - - - - - - - - -@x: -@y: -@width: -@height: - - - - - - -@element: -@data: - - - - - - - -@CLUTTER_ELEMENT_MIRROR_X: -@CLUTTER_ELEMENT_MIRROR_Y: - - - - - - -@CLUTTER_ELEMENT_MAPPED: -@CLUTTER_ELEMENT_REALIZED: - - - - - - -@Returns: - - - - - - - -@parent: -@flags: - - - - - - -@Returns: - - - - - - - -@self: - - - - - - - -@self: - - - - - - - -@self: - - - - - - - -@self: - - - - - - - -@self: - - - - - - - -@self: - - - - - - - -@self: -@box: - - - - - - - -@self: -@box: - - - - - - - -@self: -@geom: - - - - - - - -@self: -@geom: - - - - - - - -@self: -@x1: -@y1: -@x2: -@y2: - - - - - - - -@self: -@x: -@y: - - - - - - - -@self: -@width: -@height: - - - - - - - -@self: -@x: -@y: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@angle: -@x: -@y: - - - - - - - -@self: -@angle: -@y: -@z: - - - - - - - -@self: -@angle: -@x: -@z: - - - - - - - -@self: -@opacity: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@id: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@xoff: -@yoff: -@width: -@height: - - - - - - - -@self: - - - - - - - -@self: -@parent: - - - - - - - -@self: -@Returns: - - - - - - - -@self: -@below: - - - - - - - -@self: -@above: - - - - - - - -@self: - - - - - - - -@self: - - diff --git a/doc/reference/tmpl/clutter-enum-types.sgml b/doc/reference/tmpl/clutter-enum-types.sgml deleted file mode 100644 index 456682004..000000000 --- a/doc/reference/tmpl/clutter-enum-types.sgml +++ /dev/null @@ -1,79 +0,0 @@ - -clutter-enum-types - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@Returns: - - - - - - - - - - - - - - -@Returns: - - - - - - - - - - - - - - -@Returns: - - - - - - - - - - - - - - -@Returns: - - diff --git a/doc/reference/tmpl/clutter-feature.sgml b/doc/reference/tmpl/clutter-feature.sgml new file mode 100644 index 000000000..4f5949b27 --- /dev/null +++ b/doc/reference/tmpl/clutter-feature.sgml @@ -0,0 +1,44 @@ + +clutter-feature + + + + + + + + + + + + + + + + + + + + + + +@CLUTTER_FEATURE_TEXTURE_RECTANGLE: +@CLUTTER_FEATURE_SYNC_TO_VBLANK: + + + + + + +@flags: +@Returns: + + + + + + + +@Returns: + + diff --git a/doc/reference/tmpl/clutter-fixed.sgml b/doc/reference/tmpl/clutter-fixed.sgml new file mode 100644 index 000000000..297c52da7 --- /dev/null +++ b/doc/reference/tmpl/clutter-fixed.sgml @@ -0,0 +1,135 @@ + +clutter-fixed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: +@y: + + + + + + + +@x: +@y: + + diff --git a/doc/reference/tmpl/clutter-main.sgml b/doc/reference/tmpl/clutter-main.sgml index 7cb71b098..440500df2 100644 --- a/doc/reference/tmpl/clutter-main.sgml +++ b/doc/reference/tmpl/clutter-main.sgml @@ -38,6 +38,21 @@ clutter-main @a...: @a...: @a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: +@a...: @a...: diff --git a/doc/reference/tmpl/clutter-media.sgml b/doc/reference/tmpl/clutter-media.sgml new file mode 100644 index 000000000..8097a52a8 --- /dev/null +++ b/doc/reference/tmpl/clutter-media.sgml @@ -0,0 +1,196 @@ + +clutter-media + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@base_iface: +@set_uri: +@get_uri: +@set_playing: +@get_playing: +@set_position: +@get_position: +@set_volume: +@get_volume: +@can_seek: +@get_buffer_percent: +@get_duration: +@eos: +@error: + + + + + + +@media: +@uri: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@playing: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@position: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@volume: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@Returns: + + + + + + + +@media: +@filename: + + diff --git a/doc/reference/tmpl/clutter.sgml b/doc/reference/tmpl/clutter.sgml deleted file mode 100644 index b93d9132c..000000000 --- a/doc/reference/tmpl/clutter.sgml +++ /dev/null @@ -1,19 +0,0 @@ - -clutter - - - - - - - - - - - - - - - - -