GNOME Bugzilla – Bug 660471
ClutterActor: Add clutter_actor_has_effects
Last modified: 2011-09-29 17:34:50 UTC
See patch.
Created attachment 197767 [details] [review] ClutterActor: Add clutter_actor_has_effects Adds an efficent way to query whether an actor has any applied effects.
Review of attachment 197767 [details] [review]: we should also have has_actions() and has_constraints(). ::: clutter/clutter-actor.c @@ +12469,3 @@ + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE); + + * %FALSE otherwise this is not enough. we might have the flattener effect (which is internal), and if the last effect has been removed, the MetaGroup will still be set. I'd do: if (self->priv->effects == NULL) return FALSE; return _clutter_meta_group_peek_metas_no_internal (self->priv->effects) != NULL; with _clutter_meta_group_peek_metas_no_internal() as a new private ClutterMetaGroup method. ::: clutter/clutter-actor.h @@ +619,3 @@ gboolean clutter_actor_has_overlaps (ClutterActor *self); +gboolean clutter_actor_has_effects (ClutterActor *self); somewhat confusingly, but to avoid polluting the clutter-actor.h header, the ClutterActor action/constraint/effect API is declared in the clutter-action/constraint/effect.h header. in this case, clutter_actor_has_effects() should go into clutter-effect.h.
Created attachment 197778 [details] [review] ClutterActor: Add clutter_actor_has_effects Adds an efficent way to query whether an actor has any applied effects. --- Check the internal metas too.
Created attachment 197779 [details] [review] ClutterActor: Add clutter_actor_has_contraints Adds an efficent way to query whether an actor has any applied constraints.
Created attachment 197780 [details] [review] ClutterActor: Add clutter_actor_has_actions Adds an efficent way to query whether an actor has any applied actions.
Review of attachment 197778 [details] [review]: ::: clutter/clutter-actor.c @@ +12469,3 @@ + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE); + + * %FALSE otherwise missing newline
Review of attachment 197779 [details] [review]: looks good to me
Review of attachment 197780 [details] [review]: looks good to me.
Created attachment 197784 [details] [review] ClutterActor: Add clutter_actor_has_effects Adds an efficent way to query whether an actor has any applied effects. --- Added missing linebreak
Review of attachment 197784 [details] [review]: looks good to go, with one minor nitpick. ::: clutter/clutter-actor-meta.c @@ +567,3 @@ + GList *l; + + * %FALSE otherwise the comment doesn't match the code.
Attachment 197779 [details] pushed as e818006 - ClutterActor: Add clutter_actor_has_contraints Attachment 197780 [details] pushed as e8ec7eb - ClutterActor: Add clutter_actor_has_actions Attachment 197784 [details] pushed as bed2d9e - ClutterActor: Add clutter_actor_has_effects Pushed with the wrongly copied comment removed.