[clutter] ClutterActor: Add clutter_actor_has_contraints
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] ClutterActor: Add clutter_actor_has_contraints
- Date: Thu, 29 Sep 2011 17:34:26 +0000 (UTC)
commit e81800607cdde8522fde33e0df14686e9b972541
Author: Adel Gadllah <adel gadllah gmail com>
Date: Thu Sep 29 18:29:40 2011 +0200
ClutterActor: Add clutter_actor_has_contraints
Adds an efficent way to query whether an actor has any
applied constraints.
https://bugzilla.gnome.org/show_bug.cgi?id=660471
clutter/clutter-actor.c | 19 +++++++++++++++++++
clutter/clutter-constraint.h | 2 ++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 76882f9..4af467c 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -12474,6 +12474,25 @@ clutter_actor_has_effects (ClutterActor *self)
return _clutter_meta_group_has_metas_no_internal (self->priv->effects);
}
+/**
+ * clutter_actor_has_constraints:
+ * @self: A #ClutterActor
+ *
+ * Returns whether the actor has any constraints applied.
+ *
+ * Return value: %TRUE if the actor has any constraints,
+ * %FALSE otherwise
+ *
+ * Since: 1.10
+ */
+gboolean
+clutter_actor_has_constraints (ClutterActor *self)
+{
+ g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE);
+
+ return self->priv->constraints != NULL;
+}
+
gint
_clutter_actor_get_n_children (ClutterActor *self)
{
diff --git a/clutter/clutter-constraint.h b/clutter/clutter-constraint.h
index 6d2eabd..777df55 100644
--- a/clutter/clutter-constraint.h
+++ b/clutter/clutter-constraint.h
@@ -101,6 +101,8 @@ ClutterConstraint *clutter_actor_get_constraint (ClutterActor *s
const gchar *name);
void clutter_actor_clear_constraints (ClutterActor *self);
+gboolean clutter_actor_has_constraints (ClutterActor *self);
+
G_END_DECLS
#endif /* __CLUTTER_CONSTRAINT_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]