summaryrefslogtreecommitdiff
path: root/clutter/clutter-constraint.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2014-12-14 14:20:53 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2014-12-16 00:37:06 +0000
commit82fffaedb632bd7bf6a147d0fee41b8133cc6ad8 (patch)
tree5a53dfa612e7cc25bc8f01a18ddf7750b385adca /clutter/clutter-constraint.c
parent768b5b89e2ced13c1fbaf54406868f7e39bc613e (diff)
downloadclutter-82fffaedb632bd7bf6a147d0fee41b8133cc6ad8.tar.gz
constraint: Add a private header
And move the only private ClutterConstraint method to it. This commit also sneaks in a change that makes sense for the debugging of the update_allocation() method, which checks if the allocation was effectively changed.
Diffstat (limited to 'clutter/clutter-constraint.c')
-rw-r--r--clutter/clutter-constraint.c56
1 files changed, 48 insertions, 8 deletions
diff --git a/clutter/clutter-constraint.c b/clutter/clutter-constraint.c
index 8749ed962..be6dae8bc 100644
--- a/clutter/clutter-constraint.c
+++ b/clutter/clutter-constraint.c
@@ -1,3 +1,27 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2010 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author:
+ * Emmanuele Bassi <ebassi@linux.intel.com>
+ */
+
/**
* SECTION:clutter-constraint
* @Title: ClutterConstraint
@@ -110,7 +134,7 @@
#include <string.h>
-#include "clutter-constraint.h"
+#include "clutter-constraint-private.h"
#include "clutter-actor.h"
#include "clutter-actor-meta-private.h"
@@ -159,16 +183,32 @@ clutter_constraint_init (ClutterConstraint *self)
{
}
-void
-_clutter_constraint_update_allocation (ClutterConstraint *constraint,
- ClutterActor *actor,
- ClutterActorBox *allocation)
+/*< private >
+ * clutter_constraint_update_allocation:
+ * @constraint: a #ClutterConstraint
+ * @actor: a #ClutterActor
+ * @allocation: (inout): the allocation to modify
+ *
+ * Asks the @constraint to update the @allocation of a #ClutterActor.
+ *
+ * Returns: %TRUE if the allocation was updated
+ */
+gboolean
+clutter_constraint_update_allocation (ClutterConstraint *constraint,
+ ClutterActor *actor,
+ ClutterActorBox *allocation)
{
- g_return_if_fail (CLUTTER_IS_CONSTRAINT (constraint));
- g_return_if_fail (CLUTTER_IS_ACTOR (actor));
- g_return_if_fail (allocation != NULL);
+ ClutterActorBox old_alloc;
+
+ g_return_val_if_fail (CLUTTER_IS_CONSTRAINT (constraint), FALSE);
+ g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
+ g_return_val_if_fail (allocation != NULL, FALSE);
+
+ old_alloc = *allocation;
CLUTTER_CONSTRAINT_GET_CLASS (constraint)->update_allocation (constraint,
actor,
allocation);
+
+ return clutter_actor_box_equal (allocation, &old_alloc);
}