[clutter/clutter-1.22] Remove global "actor id"
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.22] Remove global "actor id"
- Date: Thu, 1 Jan 2015 15:39:43 +0000 (UTC)
commit 1b9650da38d0566fadfc8723598e601ddf6c3441
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Jan 1 15:10:54 2015 +0000
Remove global "actor id"
It's absolutely, positively pointless. Every surviving call has long
since been deprecated, and should have not been public in the first
place.
clutter/clutter-actor.c | 22 +++++++++-------------
clutter/clutter-main.c | 38 ++++----------------------------------
clutter/clutter-private.h | 7 -------
clutter/clutter-stage.c | 2 +-
4 files changed, 14 insertions(+), 55 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 45e1ac4..5735edf 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -713,7 +713,6 @@ struct _ClutterActorPrivate
gint age;
gchar *name; /* a non-unique name, used for debugging */
- guint32 id; /* unique id, used for backward compatibility */
gint32 pick_id; /* per-stage unique id, used for picking */
@@ -5825,10 +5824,10 @@ clutter_actor_dispose (GObject *object)
ClutterActor *self = CLUTTER_ACTOR (object);
ClutterActorPrivate *priv = self->priv;
- CLUTTER_NOTE (MISC, "Disposing of object (id=%d) of type '%s' (ref_count:%d)",
- priv->id,
- g_type_name (G_OBJECT_TYPE (self)),
- object->ref_count);
+ CLUTTER_NOTE (MISC, "Dispose actor (name='%s', ref_count:%d) of type '%s'",
+ _clutter_actor_get_debug_name (self),
+ object->ref_count,
+ g_type_name (G_OBJECT_TYPE (self)));
g_signal_emit (self, actor_signals[DESTROY], 0);
@@ -5892,13 +5891,10 @@ clutter_actor_finalize (GObject *object)
{
ClutterActorPrivate *priv = CLUTTER_ACTOR (object)->priv;
- CLUTTER_NOTE (MISC, "Finalize actor (name='%s', id=%d) of type '%s'",
- priv->name != NULL ? priv->name : "<none>",
- priv->id,
+ CLUTTER_NOTE (MISC, "Finalize actor (name='%s') of type '%s'",
+ _clutter_actor_get_debug_name ((ClutterActor *) object),
g_type_name (G_OBJECT_TYPE (object)));
- _clutter_context_release_id (priv->id);
-
g_free (priv->name);
#ifdef CLUTTER_ENABLE_DEBUG
@@ -8415,7 +8411,6 @@ clutter_actor_init (ClutterActor *self)
self->priv = priv = clutter_actor_get_instance_private (self);
- priv->id = _clutter_context_acquire_id (self);
priv->pick_id = -1;
priv->opacity = 0xff;
@@ -11807,14 +11802,15 @@ clutter_actor_get_name (ClutterActor *self)
*
* Since: 0.6
*
- * Deprecated: 1.8: The id is not used any longer.
+ * Deprecated: 1.8: The id is not used any longer, and this function
+ * always returns 0.
*/
guint32
clutter_actor_get_gid (ClutterActor *self)
{
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
- return self->priv->id;
+ return 0;
}
static inline void
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index 5593ba6..c21f897 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -567,20 +567,6 @@ clutter_get_motion_events_enabled (void)
return _clutter_context_get_motion_events_enabled ();
}
-ClutterActor *
-_clutter_get_actor_by_id (ClutterStage *stage,
- guint32 actor_id)
-{
- if (stage == NULL)
- {
- ClutterMainContext *context = _clutter_context_get_default ();
-
- return _clutter_id_pool_lookup (context->id_pool, actor_id);
- }
-
- return _clutter_stage_get_actor_by_pick_id (stage, actor_id);
-}
-
void
_clutter_id_to_color (guint id_,
ClutterColor *col)
@@ -1562,8 +1548,6 @@ pre_parse_hook (GOptionContext *context,
clutter_context = _clutter_context_get_default ();
- clutter_context->id_pool = _clutter_id_pool_new (256);
-
backend = clutter_context->backend;
g_assert (CLUTTER_IS_BACKEND (backend));
@@ -2693,12 +2677,14 @@ _clutter_process_event (ClutterEvent *event)
*
* Since: 0.6
*
- * Deprecated: 1.8: The id is not used any longer.
+ * Deprecated: 1.8: The id is deprecated, and this function always returns
+ * %NULL. Use the proper scene graph API in #ClutterActor to find a child
+ * of the stage.
*/
ClutterActor *
clutter_get_actor_by_gid (guint32 id_)
{
- return _clutter_get_actor_by_id (NULL, id_);
+ return NULL;
}
void
@@ -3657,22 +3643,6 @@ _clutter_clear_events_queue (void)
}
}
-guint32
-_clutter_context_acquire_id (gpointer key)
-{
- ClutterMainContext *context = _clutter_context_get_default ();
-
- return _clutter_id_pool_add (context->id_pool, key);
-}
-
-void
-_clutter_context_release_id (guint32 id_)
-{
- ClutterMainContext *context = _clutter_context_get_default ();
-
- _clutter_id_pool_remove (context->id_pool, id_);
-}
-
void
_clutter_clear_events_queue_for_stage (ClutterStage *stage)
{
diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h
index 4c8bb40..deffe8f 100644
--- a/clutter/clutter-private.h
+++ b/clutter/clutter-private.h
@@ -136,9 +136,6 @@ struct _ClutterMainContext
ClutterPickMode pick_mode;
- /* mapping between reused integer ids and actors */
- ClutterIDPool *id_pool;
-
/* default FPS; this is only used if we cannot sync to vblank */
guint frame_rate;
@@ -202,8 +199,6 @@ ClutterPickMode _clutter_context_get_pick_mode (void);
void _clutter_context_push_shader_stack (ClutterActor *actor);
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
ClutterActor * _clutter_context_peek_shader_stack (void);
-guint32 _clutter_context_acquire_id (gpointer key);
-void _clutter_context_release_id (guint32 id_);
gboolean _clutter_context_get_motion_events_enabled (void);
gboolean _clutter_context_get_show_fps (void);
@@ -219,8 +214,6 @@ void _clutter_diagnostic_message (const char *fmt, ...);
guint _clutter_pixel_to_id (guchar pixel[4]);
void _clutter_id_to_color (guint id,
ClutterColor *col);
-ClutterActor * _clutter_get_actor_by_id (ClutterStage *stage,
- guint32 actor_id);
void _clutter_set_sync_to_vblank (gboolean sync_to_vblank);
gboolean _clutter_get_sync_to_vblank (void);
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 55b8984..d1ec7b4 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -1594,7 +1594,7 @@ _clutter_stage_do_pick (ClutterStage *stage,
{
guint32 id_ = _clutter_pixel_to_id (pixel);
- retval = _clutter_get_actor_by_id (stage, id_);
+ retval = _clutter_stage_get_actor_by_pick_id (stage, id_);
}
CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_timer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]