[clutter/wip/apocalypses/apocalypse-1: 35/43] group: Proxy last few methods to Actor
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/apocalypses/apocalypse-1: 35/43] group: Proxy last few methods to Actor
- Date: Wed, 7 Dec 2011 18:16:18 +0000 (UTC)
commit d91022f263fc695b258e66f0c797cf6f6f0c58fb
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Tue Dec 6 16:00:49 2011 +0000
group: Proxy last few methods to Actor
At this point, ClutterGroup is basically just a shim layer on top of
ClutterActor.
clutter/clutter-group.c | 24 +++++-------------------
1 files changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c
index b703aa5..5436cd5 100644
--- a/clutter/clutter-group.c
+++ b/clutter/clutter-group.c
@@ -246,17 +246,9 @@ clutter_group_remove_all (ClutterGroup *self)
gint
clutter_group_get_n_children (ClutterGroup *self)
{
- GList *children;
- gint retval;
-
g_return_val_if_fail (CLUTTER_IS_GROUP (self), 0);
- children = clutter_actor_get_children (CLUTTER_ACTOR (self));
- retval = g_list_length (children);
-
- g_list_free (children);
-
- return retval;
+ return clutter_actor_get_n_children (CLUTTER_ACTOR (self));
}
/**
@@ -275,18 +267,12 @@ ClutterActor *
clutter_group_get_nth_child (ClutterGroup *self,
gint index_)
{
- ClutterActor *retval;
- GList *children;
+ ClutterActor *actor;
g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL);
- children = clutter_actor_get_children (CLUTTER_ACTOR (self));
- if (children == NULL)
- return NULL;
-
- retval = g_list_nth_data (children, index_);
-
- g_list_free (children);
+ actor = CLUTTER_ACTOR (self);
+ g_return_val_if_fail (index_ > clutter_actor_get_n_children (actor), NULL);
- return retval;
+ return clutter_actor_get_child_at_index (actor, index_);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]