From 851d2a42c4e840f01d67e6fb8400835e3bb28c37 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Wed, 15 Feb 2012 17:54:45 +0100 Subject: [PATCH] ClutterBindConstraint: Add CLUTTER_BIND_ALL coordinate Add a CLUTTER_BIND_ALL that binds both size and position. --- clutter/clutter-bind-constraint.c | 7 +++++++ clutter/clutter-enums.h | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-bind-constraint.c b/clutter/clutter-bind-constraint.c index fc7690287..51b3e35ef 100644 --- a/clutter/clutter-bind-constraint.c +++ b/clutter/clutter-bind-constraint.c @@ -212,6 +212,13 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint, allocation->y2 = allocation->y1 + source_height + bind->offset; break; + case CLUTTER_BIND_ALL: + allocation->x1 = source_position.x + bind->offset; + allocation->y1 = source_position.y + bind->offset; + allocation->x2 = allocation->x1 + source_width + bind->offset; + allocation->y2 = allocation->y1 + source_height + bind->offset; + break; + default: g_assert_not_reached (); break; diff --git a/clutter/clutter-enums.h b/clutter/clutter-enums.h index 82fcf003a..0261efd62 100644 --- a/clutter/clutter-enums.h +++ b/clutter/clutter-enums.h @@ -486,7 +486,8 @@ typedef enum { * %CLUTTER_BIND_Y * @CLUTTER_BIND_SIZE: Equivalent to %CLUTTER_BIND_WIDTH and * %CLUTTER_BIND_HEIGHT - * + * @CLUTTER_BIND_ALL: Equivalent to %CLUTTER_BIND_POSITION and + * %CLUTTER_BIND_SIZE * Specifies which property should be used in a binding * * Since: 1.4 @@ -497,7 +498,8 @@ typedef enum { /*< prefix=CLUTTER_BIND >*/ CLUTTER_BIND_WIDTH, CLUTTER_BIND_HEIGHT, CLUTTER_BIND_POSITION, - CLUTTER_BIND_SIZE + CLUTTER_BIND_SIZE, + CLUTTER_BIND_ALL } ClutterBindCoordinate; /**