Commit 1b9650da authored by Emmanuele Bassi's avatar Emmanuele Bassi

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.
parent abda3ee4
......@@ -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
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment