From 45c85c4213c85d0dbbbe0e7eb8f93e290d5ffff2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 1 Jul 2009 15:15:52 +0100 Subject: [PATCH] [actor] Remove the unused get_allocation_coords() The clutter_actor_get_allocation_coords() is not used, and since the switch to floats in the Actor's API, it returns exactly what the get_allocation_box() returns. --- clutter/clutter-actor.c | 62 ++++++------------------------------ clutter/clutter-actor.h | 5 --- clutter/clutter-deprecated.h | 2 ++ 3 files changed, 12 insertions(+), 57 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 9b4d36008..032f64b94 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -4604,51 +4604,6 @@ clutter_actor_get_preferred_height (ClutterActor *self, *natural_height_p = priv->request_natural_height; } -/** - * clutter_actor_get_allocation_coords: - * @self: A #ClutterActor - * @x_1: (out): x1 coordinate - * @y_1: (out): y1 coordinate - * @x_2: (out): x2 coordinate - * @y_2: (out): y2 coordinate - * - * Gets the layout box an actor has been assigned. The allocation can - * only be assumed valid inside a paint() method; anywhere else, it - * may be out-of-date. - * - * An allocation does not incorporate the actor's scale or anchor point; - * those transformations do not affect layout, only rendering. - * - * The returned coordinates are in pixels. - * - * Since: 0.8 - */ -void -clutter_actor_get_allocation_coords (ClutterActor *self, - gint *x_1, - gint *y_1, - gint *x_2, - gint *y_2) -{ - ClutterActorBox allocation = { 0, }; - - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - - clutter_actor_get_allocation_box (self, &allocation); - - if (x_1) - *x_1 = allocation.x1; - - if (y_1) - *y_1 = allocation.y1; - - if (x_2) - *x_2 = allocation.x2; - - if (y_2) - *y_2 = allocation.y2; -} - /** * clutter_actor_get_allocation_box: * @self: A #ClutterActor @@ -4721,14 +4676,17 @@ void clutter_actor_get_allocation_geometry (ClutterActor *self, ClutterGeometry *geom) { - gint x2, y2; + ClutterActorBox box; g_return_if_fail (CLUTTER_IS_ACTOR (self)); + g_return_if_fail (geom != NULL); - clutter_actor_get_allocation_coords (self, &geom->x, &geom->y, &x2, &y2); + clutter_actor_get_allocation_box (self, &box); - geom->width = x2 - geom->x; - geom->height = y2 - geom->y; + geom->x = clutter_actor_box_get_x (&box); + geom->y = clutter_actor_box_get_y (&box); + geom->width = clutter_actor_box_get_width (&box); + geom->height = clutter_actor_box_get_height (&box); } /** @@ -5257,7 +5215,7 @@ clutter_actor_set_size (ClutterActor *self, * * If you care whether you get the request vs. the allocation, you * should probably call a different function like - * clutter_actor_get_allocation_coords() or + * clutter_actor_get_allocation_box() or * clutter_actor_get_preferred_width(). * * Since: 0.2 @@ -5440,7 +5398,7 @@ clutter_actor_get_transformed_size (ClutterActor *self, * * If you care whether you get the preferred width or the width that * has been assigned to the actor, you should probably call a different - * function like clutter_actor_get_allocation_coords() to retrieve the + * function like clutter_actor_get_allocation_box() to retrieve the * allocated size or clutter_actor_get_preferred_width() to retrieve the * preferred width. * @@ -5496,7 +5454,7 @@ clutter_actor_get_width (ClutterActor *self) * * If you care whether you get the preferred height or the height that * has been assigned to the actor, you should probably call a different - * function like clutter_actor_get_allocation_coords() to retrieve the + * function like clutter_actor_get_allocation_box() to retrieve the * allocated size or clutter_actor_get_preferred_height() to retrieve the * preferred height. * diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index 080d25781..72f7893da 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -322,11 +322,6 @@ void clutter_actor_allocate_available_size (ClutterActor gfloat available_width, gfloat available_height, ClutterAllocationFlags flags); -void clutter_actor_get_allocation_coords (ClutterActor *self, - gint *x_1, - gint *y_1, - gint *x_2, - gint *y_2); void clutter_actor_get_allocation_box (ClutterActor *self, ClutterActorBox *box); void clutter_actor_get_allocation_geometry (ClutterActor *self, diff --git a/clutter/clutter-deprecated.h b/clutter/clutter-deprecated.h index c817b4581..0c6f54bdd 100644 --- a/clutter/clutter-deprecated.h +++ b/clutter/clutter-deprecated.h @@ -200,4 +200,6 @@ #define clutter_actor_pick clutter_actor_pick_DEPRECATED_BY_clutter_actor_paint +#define clutter_actor_get_allocation_coords clutter_actor_get_allocation_coords_DEPRECATED_BY_clutter_actor_get_allocation_box + #endif /* CLUTTER_DEPRECATED_H */