2007-10-10 Emmanuele Bassi <ebassi@openedhand.com>

* 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.
This commit is contained in:
Emmanuele Bassi 2007-10-10 16:02:54 +00:00
parent 676dd6a1b8
commit 52065e88bc
6 changed files with 82 additions and 27 deletions

View File

@ -1,3 +1,15 @@
2007-10-10 Emmanuele Bassi <ebassi@openedhand.com>
* 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 <ebassi@openedhand.com> 2007-10-10 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Beautify the ClutterActor documentation. * clutter/clutter-actor.c: Beautify the ClutterActor documentation.

View File

@ -2808,7 +2808,7 @@ clutter_actor_unparent (ClutterActor *self)
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent); g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
g_hash_table_remove (clutter_context->actor_hash, 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); g_object_unref (self);
} }
@ -3069,6 +3069,14 @@ out:
return retval; return retval;
} }
/**
* clutter_actor_set_reactive:
* @actor: a #ClutterActor
*
* Sets @actor as reactive. Reactive actors will receive events.
*
* Since: 0.6
*/
void void
clutter_actor_set_reactive (ClutterActor *actor) 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_SET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
} }
/**
* clutter_actor_unset_reactive:
* @actor: a #ClutterActor
*
* Sets @actor as not reactive.
*
* Since: 0.6
*/
void void
clutter_actor_unset_reactive (ClutterActor *actor) 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_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 gboolean
clutter_actor_is_reactive (ClutterActor *actor) clutter_actor_is_reactive (ClutterActor *actor)
{ {
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE); g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
return CLUTTER_ACTOR_IS_REACTIVE(actor); return CLUTTER_ACTOR_IS_REACTIVE (actor);
} }
/* /*

View File

@ -51,14 +51,14 @@ G_BEGIN_DECLS
#define CLUTTER_ACTOR_GET_CLASS(obj) \ #define CLUTTER_ACTOR_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ACTOR, ClutterActorClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ACTOR, ClutterActorClass))
#define CLUTTER_ACTOR_SET_FLAGS(e,f) ((e)->flags |= (f)) #define CLUTTER_ACTOR_SET_FLAGS(e,f) (((ClutterActor*)(e))->flags |= (f))
#define CLUTTER_ACTOR_UNSET_FLAGS(e,f) ((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_MAPPED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED)
#define CLUTTER_ACTOR_IS_REALIZED(e) ((e)->flags & CLUTTER_ACTOR_REALIZED) #define CLUTTER_ACTOR_IS_REALIZED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED)
#define CLUTTER_ACTOR_IS_VISIBLE(e) (CLUTTER_ACTOR_IS_MAPPED (e) && \ #define CLUTTER_ACTOR_IS_VISIBLE(e) (CLUTTER_ACTOR_IS_MAPPED (e) && \
CLUTTER_ACTOR_IS_REALIZED (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)) */ /* && CLUTTER_ACTOR_IS_VISIBLE(e)) */

View File

@ -299,22 +299,32 @@ void
clutter_effect_template_set_timeline_clone (ClutterEffectTemplate *template_, clutter_effect_template_set_timeline_clone (ClutterEffectTemplate *template_,
gboolean setting) 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: * 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 * Since: 0.6
*/ */
gboolean gboolean
clutter_effect_template_get_timeline_clone (ClutterEffectTemplate *template_) clutter_effect_template_get_timeline_clone (ClutterEffectTemplate *template_)
{ {
g_return_val_if_fail (CLUTTER_IS_EFFECT_TEMPLATE (template_), FALSE);
return template_->priv->do_clone; return template_->priv->do_clone;
} }

View File

@ -44,8 +44,8 @@
*/ */
/** /**
* SECTION:clutter-score @short_description: A class for sequencing * SECTION:clutter-score
* multiple #ClutterTimelines in order * @short_description: Sequencing multiple #ClutterTimelines in order
* *
* #ClutterScore is a base class for sequencing multiple timelines in order. * #ClutterScore is a base class for sequencing multiple timelines in order.
*/ */

View File

@ -680,9 +680,9 @@ clutter_glx_get_default_display (void)
/** /**
* clutter_glx_get_default_screen: * 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 * Since: 0.4
*/ */
@ -721,15 +721,21 @@ clutter_glx_get_root_window (void)
/** /**
* clutter_glx_add_filter: * clutter_glx_add_filter:
* @func: an event filter function
* @data: user data to pass to the function, or %NULL
* *
* FIXME * Adds @func to the list of event filters. Filter functions
* * receive the raw events and must return %CLUTTER_GLX_FILTER_CONTINUE
* Return value: FIXME * 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 * Since: 0.4
*/ */
void void
clutter_glx_add_filter (ClutterGLXFilterFunc func, gpointer data) clutter_glx_add_filter (ClutterGLXFilterFunc func,
gpointer data)
{ {
ClutterGLXEventFilter *filter; ClutterGLXEventFilter *filter;
@ -745,23 +751,24 @@ clutter_glx_add_filter (ClutterGLXFilterFunc func, gpointer data)
filter->func = func; filter->func = func;
filter->data = data; filter->data = data;
backend_singleton->event_filters backend_singleton->event_filters =
= g_slist_append (backend_singleton->event_filters, filter); g_slist_append (backend_singleton->event_filters, filter);
return; return;
} }
/** /**
* clutter_glx_remove_filter: * clutter_glx_remove_filter:
* @func: the filter function to remove
* @data: user data of the filter function, or %NULL
* *
* FIXME * Removes @func from the list of filter functions installed
*
* Return value: FIXME
* *
* Since: 0.4 * Since: 0.4
*/ */
void void
clutter_glx_remove_filter (ClutterGLXFilterFunc func, gpointer data) clutter_glx_remove_filter (ClutterGLXFilterFunc func,
gpointer data)
{ {
GSList *tmp_list, *this; GSList *tmp_list, *this;
ClutterGLXEventFilter *filter; ClutterGLXEventFilter *filter;
@ -778,8 +785,8 @@ clutter_glx_remove_filter (ClutterGLXFilterFunc func, gpointer data)
if (filter->func == func && filter->data == data) if (filter->func == func && filter->data == data)
{ {
backend_singleton->event_filters backend_singleton->event_filters =
= g_slist_remove_link (backend_singleton->event_filters, this); g_slist_remove_link (backend_singleton->event_filters, this);
g_slist_free_1 (this); g_slist_free_1 (this);
g_free (filter); g_free (filter);