After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660471 - ClutterActor: Add clutter_actor_has_effects
ClutterActor: Add clutter_actor_has_effects
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-29 13:32 UTC by drago01
Modified: 2011-09-29 17:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ClutterActor: Add clutter_actor_has_effects (1.67 KB, patch)
2011-09-29 13:32 UTC, drago01
needs-work Details | Review
ClutterActor: Add clutter_actor_has_effects (3.57 KB, patch)
2011-09-29 16:35 UTC, drago01
needs-work Details | Review
ClutterActor: Add clutter_actor_has_contraints (1.83 KB, patch)
2011-09-29 16:36 UTC, drago01
committed Details | Review
ClutterActor: Add clutter_actor_has_actions (1.71 KB, patch)
2011-09-29 16:36 UTC, drago01
committed Details | Review
ClutterActor: Add clutter_actor_has_effects (3.58 KB, patch)
2011-09-29 16:43 UTC, drago01
committed Details | Review

Description drago01 2011-09-29 13:32:17 UTC
See patch.
Comment 1 drago01 2011-09-29 13:32:19 UTC
Created attachment 197767 [details] [review]
ClutterActor: Add clutter_actor_has_effects

Adds an efficent way to query whether an actor has any
applied effects.
Comment 2 Emmanuele Bassi (:ebassi) 2011-09-29 15:06:02 UTC
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.
Comment 3 drago01 2011-09-29 16:35:46 UTC
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.
Comment 4 drago01 2011-09-29 16:36:01 UTC
Created attachment 197779 [details] [review]
ClutterActor: Add clutter_actor_has_contraints

Adds an efficent way to query whether an actor has any
applied constraints.
Comment 5 drago01 2011-09-29 16:36:09 UTC
Created attachment 197780 [details] [review]
ClutterActor: Add clutter_actor_has_actions

Adds an efficent way to query whether an actor has any
applied actions.
Comment 6 Emmanuele Bassi (:ebassi) 2011-09-29 16:38:58 UTC
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
Comment 7 Emmanuele Bassi (:ebassi) 2011-09-29 16:40:19 UTC
Review of attachment 197779 [details] [review]:

looks good to me
Comment 8 Emmanuele Bassi (:ebassi) 2011-09-29 16:40:39 UTC
Review of attachment 197780 [details] [review]:

looks good to me.
Comment 9 drago01 2011-09-29 16:43:34 UTC
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
Comment 10 Emmanuele Bassi (:ebassi) 2011-09-29 17:28:33 UTC
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.
Comment 11 drago01 2011-09-29 17:34:42 UTC
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.