* clutter/clutter-container.[ch]: removed find_child_by_id method

from interface (and all implementations of it) since this
functionality is now implemented using a global hash.
* clutter/clutter-box.c: 
* clutter/clutter-group.c:
This commit is contained in:
Øyvind Kolås 2007-11-05 17:12:11 +00:00
parent 8fde26cd81
commit 9047f9d2bc
5 changed files with 8 additions and 122 deletions

View File

@ -1,3 +1,11 @@
2007-11-05 Øyvind Kolås <pippin@o-hand.com>
* clutter/clutter-container.[ch]: removed find_child_by_id method
from interface (and all implementations of it) since this
functionality is now implemented using a global hash.
* clutter/clutter-box.c:
* clutter/clutter-group.c:
2007-11-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script.c: Do not keep ownership of the

View File

@ -128,40 +128,6 @@ clutter_box_foreach (ClutterContainer *container,
}
}
static ClutterActor *
clutter_box_find_child_by_id (ClutterContainer *container,
guint child_id)
{
ClutterBox *self = CLUTTER_BOX (container);
ClutterActor *actor = NULL;
GList *l;
if (clutter_actor_get_id (CLUTTER_ACTOR (self)) == child_id)
return CLUTTER_ACTOR (self);
for (l = self->children; l; l = l->next)
{
ClutterBoxChild *child = l->data;
if (clutter_actor_get_id (child->actor) == child_id)
{
actor = child->actor;
break;
}
if (CLUTTER_IS_CONTAINER (child->actor))
{
ClutterContainer *c = CLUTTER_CONTAINER (child->actor);
actor = clutter_container_find_child_by_id (c, child_id);
if (actor)
break;
}
}
return actor;
}
static void
clutter_box_raise (ClutterContainer *container,
ClutterActor *actor,
@ -307,7 +273,6 @@ clutter_container_iface_init (ClutterContainerIface *iface)
iface->add = clutter_box_add;
iface->remove = clutter_box_remove;
iface->foreach = clutter_box_foreach;
iface->find_child_by_id = clutter_box_find_child_by_id;
iface->raise = clutter_box_raise;
iface->lower = clutter_box_lower;
iface->sort_depth_order = clutter_box_sort_depth_order;

View File

@ -379,29 +379,6 @@ clutter_container_foreach (ClutterContainer *container,
CLUTTER_CONTAINER_GET_IFACE (container)->foreach (container, callback, user_data);
}
/**
* clutter_container_find_child_by_id:
* @container: a #ClutterContainer
* @child_id: the unique id of an actor
*
* Finds a child actor of a container by its unique ID. Search recurses
* into any child container.
*
* Return value: The child actor with the requested id, or %NULL if no
* actor with that id was found
*
* Since: 0.6
*/
ClutterActor *
clutter_container_find_child_by_id (ClutterContainer *container,
guint child_id)
{
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
return CLUTTER_CONTAINER_GET_IFACE (container)->find_child_by_id (container,
child_id);
}
/**
* clutter_container_raise_child:
* @container: a #ClutterContainer

View File

@ -46,9 +46,6 @@ typedef struct _ClutterContainerIface ClutterContainerIface;
* @add: virtual function for adding an actor to the container
* @remove: virtual function for removing an actor from the container
* @foreach: virtual function for iterating over the container's children
* @find_child_by_id: virtual function for searching a container children
* using its unique id. Should recurse through its children. This function
* is used when "picking" actors (e.g. by clutter_stage_get_actor_at_pos())
* @raise: virtual function for raising a child
* @lower: virtual function for lowering a child
* @sort_depth_order: virtual function for sorting the children of a
@ -73,8 +70,6 @@ struct _ClutterContainerIface
void (* foreach) (ClutterContainer *container,
ClutterCallback callback,
gpointer user_data);
ClutterActor *(* find_child_by_id) (ClutterContainer *container,
guint child_id);
void (* raise) (ClutterContainer *container,
ClutterActor *actor,
ClutterActor *sibling);
@ -112,8 +107,6 @@ GList * clutter_container_get_children (ClutterContainer *container);
void clutter_container_foreach (ClutterContainer *container,
ClutterCallback callback,
gpointer user_data);
ClutterActor *clutter_container_find_child_by_id (ClutterContainer *container,
guint child_id);
ClutterActor *clutter_container_find_child_by_name(ClutterContainer *container,
const gchar *child_name);
void clutter_container_raise_child (ClutterContainer *container,

View File

@ -285,41 +285,6 @@ clutter_group_real_foreach (ClutterContainer *container,
(* callback) (CLUTTER_ACTOR (l->data), user_data);
}
static ClutterActor *
clutter_group_real_find_child_by_id (ClutterContainer *container,
guint child_id)
{
ClutterGroup *self = CLUTTER_GROUP (container);
ClutterGroupPrivate *priv = self->priv;
ClutterActor *actor = NULL;
GList *l;
if (clutter_actor_get_id (CLUTTER_ACTOR (self)) == child_id)
return CLUTTER_ACTOR (self);
for (l = priv->children; l; l = l->next)
{
ClutterActor *child = l->data;
if (clutter_actor_get_id (child) == child_id)
{
actor = child;
break;
}
if (CLUTTER_IS_CONTAINER (child))
{
ClutterContainer *c = CLUTTER_CONTAINER (child);
actor = clutter_container_find_child_by_id (c, child_id);
if (actor)
break;
}
}
return actor;
}
static void
clutter_group_real_raise (ClutterContainer *container,
ClutterActor *actor,
@ -440,7 +405,6 @@ clutter_container_iface_init (ClutterContainerIface *iface)
iface->add = clutter_group_real_add;
iface->remove = clutter_group_real_remove;
iface->foreach = clutter_group_real_foreach;
iface->find_child_by_id = clutter_group_real_find_child_by_id;
iface->raise = clutter_group_real_raise;
iface->lower = clutter_group_real_lower;
iface->sort_depth_order = clutter_group_real_sort_depth_order;
@ -681,27 +645,6 @@ clutter_group_get_nth_child (ClutterGroup *self,
return g_list_nth_data (self->priv->children, index_);
}
/**
* clutter_group_find_child_by_id:
* @self: A #ClutterGroup
* @id: A unique #Clutteractor ID
*
* Finds a child actor of a group by its unique ID. Search recurses
* into any child groups.
*
* Returns: the #ClutterActor if found, or NULL.
*
* Deprecated: 0.6: Use clutter_container_find_child_by_id() instead.
*/
ClutterActor *
clutter_group_find_child_by_id (ClutterGroup *self,
guint id)
{
g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL);
return clutter_container_find_child_by_id (CLUTTER_CONTAINER (self), id);
}
/**
* clutter_group_raise:
* @self: a #ClutterGroup