From 52065e88bc36ab14d2aabeeacc65e4563d66749e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 10 Oct 2007 16:02:54 +0000 Subject: [PATCH] 2007-10-10 Emmanuele Bassi * clutter/glx/clutter-backend-glx.c: Fix documentation of the filter function API. * clutter/clutter-score.c: * clutter/clutter-effect.c: * clutter/clutter-actor.c: Documentation fixes. * clutter/clutter-actor.h: Automatically typecast to ClutterActor when setting/checking flags. --- ChangeLog | 12 +++++++++++ clutter/clutter-actor.c | 30 ++++++++++++++++++++++++-- clutter/clutter-actor.h | 10 ++++----- clutter/clutter-effect.c | 18 ++++++++++++---- clutter/clutter-score.c | 4 ++-- clutter/glx/clutter-backend-glx.c | 35 ++++++++++++++++++------------- 6 files changed, 82 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7911905b..056676663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-10-10 Emmanuele Bassi + + * clutter/glx/clutter-backend-glx.c: Fix documentation of the + filter function API. + + * clutter/clutter-score.c: + * clutter/clutter-effect.c: + * clutter/clutter-actor.c: Documentation fixes. + + * clutter/clutter-actor.h: Automatically typecast to ClutterActor + when setting/checking flags. + 2007-10-10 Emmanuele Bassi * clutter/clutter-actor.c: Beautify the ClutterActor documentation. diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 32483e6d3..da128f61a 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -2808,7 +2808,7 @@ clutter_actor_unparent (ClutterActor *self) g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent); g_hash_table_remove (clutter_context->actor_hash, - (gconstpointer)clutter_actor_get_id(self)); + GUINT_TO_POINTER (clutter_actor_get_id(self))); g_object_unref (self); } @@ -3069,6 +3069,14 @@ out: return retval; } +/** + * clutter_actor_set_reactive: + * @actor: a #ClutterActor + * + * Sets @actor as reactive. Reactive actors will receive events. + * + * Since: 0.6 + */ void clutter_actor_set_reactive (ClutterActor *actor) { @@ -3077,6 +3085,14 @@ clutter_actor_set_reactive (ClutterActor *actor) CLUTTER_ACTOR_SET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE); } +/** + * clutter_actor_unset_reactive: + * @actor: a #ClutterActor + * + * Sets @actor as not reactive. + * + * Since: 0.6 + */ void clutter_actor_unset_reactive (ClutterActor *actor) { @@ -3085,12 +3101,22 @@ clutter_actor_unset_reactive (ClutterActor *actor) CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE); } +/** + * clutter_actor_is_reactive: + * @actor: a #ClutterActor + * + * Checks whether @actor is marked as reactive. + * + * Return value: %TRUE if the actor is reactive + * + * Since: 0.6 + */ gboolean clutter_actor_is_reactive (ClutterActor *actor) { g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE); - return CLUTTER_ACTOR_IS_REACTIVE(actor); + return CLUTTER_ACTOR_IS_REACTIVE (actor); } /* diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index fc36c3844..d83d27260 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -51,14 +51,14 @@ G_BEGIN_DECLS #define CLUTTER_ACTOR_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ACTOR, ClutterActorClass)) -#define CLUTTER_ACTOR_SET_FLAGS(e,f) ((e)->flags |= (f)) -#define CLUTTER_ACTOR_UNSET_FLAGS(e,f) ((e)->flags &= ~(f)) +#define CLUTTER_ACTOR_SET_FLAGS(e,f) (((ClutterActor*)(e))->flags |= (f)) +#define CLUTTER_ACTOR_UNSET_FLAGS(e,f) (((ClutterActor*)(e))->flags &= ~(f)) -#define CLUTTER_ACTOR_IS_MAPPED(e) ((e)->flags & CLUTTER_ACTOR_MAPPED) -#define CLUTTER_ACTOR_IS_REALIZED(e) ((e)->flags & CLUTTER_ACTOR_REALIZED) +#define CLUTTER_ACTOR_IS_MAPPED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED) +#define CLUTTER_ACTOR_IS_REALIZED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED) #define CLUTTER_ACTOR_IS_VISIBLE(e) (CLUTTER_ACTOR_IS_MAPPED (e) && \ CLUTTER_ACTOR_IS_REALIZED (e)) -#define CLUTTER_ACTOR_IS_REACTIVE(e) (((e)->flags & CLUTTER_ACTOR_REACTIVE)) +#define CLUTTER_ACTOR_IS_REACTIVE(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE) /* && CLUTTER_ACTOR_IS_VISIBLE(e)) */ diff --git a/clutter/clutter-effect.c b/clutter/clutter-effect.c index 67afb1657..cc3a36340 100644 --- a/clutter/clutter-effect.c +++ b/clutter/clutter-effect.c @@ -299,22 +299,32 @@ void clutter_effect_template_set_timeline_clone (ClutterEffectTemplate *template_, gboolean setting) { - template_->priv->do_clone = setting; + g_return_if_fail (CLUTTER_IS_EFFECT_TEMPLATE (template_)); + + if (template_->priv->do_clone != setting) + { + template_->priv->do_clone = setting; + + g_object_notify (G_OBJECT (template_), "clone"); + } } /** * clutter_effect_template_get_timeline_clone: - * @template: A #ClutterEffectTemplate + * @template_: A #ClutterEffectTemplate * - * + * Gets whether timelines should be cloned when creating a new + * effect or just referenced. * - * Return value: TRUE if the templates timeline is to be cloned. + * Return value: %TRUE if the templates timeline is to be cloned. * * Since: 0.6 */ gboolean clutter_effect_template_get_timeline_clone (ClutterEffectTemplate *template_) { + g_return_val_if_fail (CLUTTER_IS_EFFECT_TEMPLATE (template_), FALSE); + return template_->priv->do_clone; } diff --git a/clutter/clutter-score.c b/clutter/clutter-score.c index af1b65aa5..b12134730 100644 --- a/clutter/clutter-score.c +++ b/clutter/clutter-score.c @@ -44,8 +44,8 @@ */ /** - * SECTION:clutter-score @short_description: A class for sequencing - * multiple #ClutterTimelines in order + * SECTION:clutter-score + * @short_description: Sequencing multiple #ClutterTimelines in order * * #ClutterScore is a base class for sequencing multiple timelines in order. */ diff --git a/clutter/glx/clutter-backend-glx.c b/clutter/glx/clutter-backend-glx.c index 084844022..fbf62005c 100644 --- a/clutter/glx/clutter-backend-glx.c +++ b/clutter/glx/clutter-backend-glx.c @@ -680,9 +680,9 @@ clutter_glx_get_default_display (void) /** * clutter_glx_get_default_screen: * - * Gets the pointer to the default X Screen object. + * Gets the number of the default X Screen object. * - * Return value: FIXME + * Return value: the number of the default Screen object. * * Since: 0.4 */ @@ -721,15 +721,21 @@ clutter_glx_get_root_window (void) /** * clutter_glx_add_filter: - * - * FIXME + * @func: an event filter function + * @data: user data to pass to the function, or %NULL * - * Return value: FIXME + * Adds @func to the list of event filters. Filter functions + * receive the raw events and must return %CLUTTER_GLX_FILTER_CONTINUE + * if the event should be processed by Clutter, %CLUTTER_GLX_FILTER_TRANSLATE + * if the event has been translated by the function and it's ready + * to be sent to the stage, or %CLUTTER_GLX_FILTER_REMOVE if the event should + * not be sent to the stage. * * Since: 0.4 */ void -clutter_glx_add_filter (ClutterGLXFilterFunc func, gpointer data) +clutter_glx_add_filter (ClutterGLXFilterFunc func, + gpointer data) { ClutterGLXEventFilter *filter; @@ -745,23 +751,24 @@ clutter_glx_add_filter (ClutterGLXFilterFunc func, gpointer data) filter->func = func; filter->data = data; - backend_singleton->event_filters - = g_slist_append (backend_singleton->event_filters, filter); + backend_singleton->event_filters = + g_slist_append (backend_singleton->event_filters, filter); return; } /** * clutter_glx_remove_filter: + * @func: the filter function to remove + * @data: user data of the filter function, or %NULL * - * FIXME - * - * Return value: FIXME + * Removes @func from the list of filter functions installed * * Since: 0.4 */ void -clutter_glx_remove_filter (ClutterGLXFilterFunc func, gpointer data) +clutter_glx_remove_filter (ClutterGLXFilterFunc func, + gpointer data) { GSList *tmp_list, *this; ClutterGLXEventFilter *filter; @@ -778,8 +785,8 @@ clutter_glx_remove_filter (ClutterGLXFilterFunc func, gpointer data) if (filter->func == func && filter->data == data) { - backend_singleton->event_filters - = g_slist_remove_link (backend_singleton->event_filters, this); + backend_singleton->event_filters = + g_slist_remove_link (backend_singleton->event_filters, this); g_slist_free_1 (this); g_free (filter);