[clutter/wip/apocalypses/apocalypse-1: 9/46] actor: Provide Container::raise/lower implementations
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/apocalypses/apocalypse-1: 9/46] actor: Provide Container::raise/lower implementations
- Date: Thu, 8 Dec 2011 12:09:37 +0000 (UTC)
commit 2aba78065a681c07aa6ef97fb92dfe95ed879916
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Nov 21 14:53:14 2011 +0000
actor: Provide Container::raise/lower implementations
clutter/clutter-actor.c | 67 ++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 57 insertions(+), 10 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 3a387cc..57800be 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -9203,8 +9203,8 @@ clutter_actor_set_anchor_point_from_gravity (ClutterActor *self,
}
static void
-actor_add_actor (ClutterContainer *container,
- ClutterActor *actor)
+container_add_actor (ClutterContainer *container,
+ ClutterActor *actor)
{
clutter_actor_add_child (CLUTTER_ACTOR (container), actor);
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
@@ -9213,8 +9213,8 @@ actor_add_actor (ClutterContainer *container,
}
static void
-actor_remove_actor (ClutterContainer *container,
- ClutterActor *actor)
+container_remove_actor (ClutterContainer *container,
+ ClutterActor *actor)
{
g_object_ref (actor);
@@ -9243,9 +9243,9 @@ foreach_cb (ClutterActor *actor,
}
static void
-actor_foreach (ClutterContainer *container,
- ClutterCallback callback,
- gpointer user_data)
+container_foreach (ClutterContainer *container,
+ ClutterCallback callback,
+ gpointer user_data)
{
ForeachClosure clos;
@@ -9258,11 +9258,58 @@ actor_foreach (ClutterContainer *container,
}
static void
+container_raise (ClutterContainer *container,
+ ClutterActor *child,
+ ClutterActor *sibling)
+{
+ ClutterActor *self = CLUTTER_ACTOR (container);
+ ClutterActorPrivate *priv = self->priv;
+
+ priv->children = g_list_remove (priv->children, child);
+
+ if (sibling == NULL)
+ priv->children = g_list_append (priv->children, child);
+ else
+ {
+ gint index_ = g_list_index (priv->children, sibling) + 1;
+
+ priv->children = g_list_insert (priv->children, child, index_);
+ }
+
+ clutter_actor_queue_relayout (self);
+}
+
+static void
+container_lower (ClutterContainer *container,
+ ClutterActor *child,
+ ClutterActor *sibling)
+{
+ ClutterActor *self = CLUTTER_ACTOR (container);
+ ClutterActorPrivate *priv = self->priv;
+
+ priv->children = g_list_remove (priv->children, child);
+
+ if (sibling == NULL)
+ priv->children = g_list_prepend (priv->children, child);
+ else
+ {
+ gint index_ = g_list_index (priv->children, sibling);
+
+ priv->children = g_list_insert (priv->children, child, index_);
+ }
+
+ clutter_actor_queue_relayout (self);
+}
+
+static void
clutter_container_iface_init (ClutterContainerIface *iface)
{
- iface->add = actor_add_actor;
- iface->remove = actor_remove_actor;
- iface->foreach = actor_foreach;
+ iface->add = container_add_actor;
+ iface->remove = container_remove_actor;
+ iface->foreach = container_foreach;
+
+ iface->raise = container_raise;
+ iface->lower = container_lower;
}
typedef enum
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]