mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
2007-09-28 Øyvind Kolås <pippin@openedhand.com>
* clutter/clutter-container.[ch]: added clutter_container_find_child_by_name.
This commit is contained in:
parent
99c97b3337
commit
d93230d1bf
@ -1,3 +1,8 @@
|
||||
2007-09-28 Øyvind Kolås <pippin@openedhand.com>
|
||||
|
||||
* clutter/clutter-container.[ch]: added
|
||||
clutter_container_find_child_by_name.
|
||||
|
||||
2007-09-28 Øyvind Kolås <pippin@openedhand.com>
|
||||
|
||||
* clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize):
|
||||
|
@ -504,3 +504,55 @@ clutter_container_sort_depth_order (ClutterContainer *container)
|
||||
|
||||
CLUTTER_CONTAINER_GET_IFACE (container)->sort_depth_order (container);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_container_find_child_by_name:
|
||||
* @container: a #ClutterContainer
|
||||
* @child_name: the name of the requested child.
|
||||
*
|
||||
* Finds a child actor of a container by its name. Search recurses
|
||||
* into any child container.
|
||||
*
|
||||
* Return value: The child actor with the requested name, or %NULL if no
|
||||
* actor with that name was found.
|
||||
*
|
||||
* Since: 0.6
|
||||
*/
|
||||
ClutterActor *
|
||||
clutter_container_find_child_by_name (ClutterContainer *container,
|
||||
const gchar *child_name)
|
||||
{
|
||||
GList *children;
|
||||
GList *iter;
|
||||
ClutterActor *actor = NULL;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL);
|
||||
|
||||
children = clutter_container_get_children (container);
|
||||
|
||||
for (iter=children; iter; iter = g_list_next (iter))
|
||||
{
|
||||
ClutterActor *a;
|
||||
const gchar *iter_name;
|
||||
|
||||
a = CLUTTER_ACTOR (iter->data);
|
||||
iter_name = clutter_actor_get_name (a);
|
||||
|
||||
if (iter_name && !strcmp (iter_name, child_name))
|
||||
{
|
||||
actor = a;
|
||||
break;
|
||||
}
|
||||
|
||||
if (CLUTTER_IS_CONTAINER (a))
|
||||
{
|
||||
ClutterContainer *c = CLUTTER_CONTAINER (a);
|
||||
|
||||
actor = clutter_container_find_child_by_name (c, child_name);
|
||||
if (actor)
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_list_free (children);
|
||||
return actor;
|
||||
}
|
||||
|
@ -114,6 +114,8 @@ void clutter_container_foreach (ClutterContainer *container,
|
||||
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,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling);
|
||||
|
Loading…
Reference in New Issue
Block a user