mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
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.
This commit is contained in:
parent
abda3ee4ce
commit
1b9650da38
@ -713,7 +713,6 @@ struct _ClutterActorPrivate
|
|||||||
gint age;
|
gint age;
|
||||||
|
|
||||||
gchar *name; /* a non-unique name, used for debugging */
|
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 */
|
gint32 pick_id; /* per-stage unique id, used for picking */
|
||||||
|
|
||||||
@ -5825,10 +5824,10 @@ clutter_actor_dispose (GObject *object)
|
|||||||
ClutterActor *self = CLUTTER_ACTOR (object);
|
ClutterActor *self = CLUTTER_ACTOR (object);
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
|
|
||||||
CLUTTER_NOTE (MISC, "Disposing of object (id=%d) of type '%s' (ref_count:%d)",
|
CLUTTER_NOTE (MISC, "Dispose actor (name='%s', ref_count:%d) of type '%s'",
|
||||||
priv->id,
|
_clutter_actor_get_debug_name (self),
|
||||||
g_type_name (G_OBJECT_TYPE (self)),
|
object->ref_count,
|
||||||
object->ref_count);
|
g_type_name (G_OBJECT_TYPE (self)));
|
||||||
|
|
||||||
g_signal_emit (self, actor_signals[DESTROY], 0);
|
g_signal_emit (self, actor_signals[DESTROY], 0);
|
||||||
|
|
||||||
@ -5892,13 +5891,10 @@ clutter_actor_finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = CLUTTER_ACTOR (object)->priv;
|
ClutterActorPrivate *priv = CLUTTER_ACTOR (object)->priv;
|
||||||
|
|
||||||
CLUTTER_NOTE (MISC, "Finalize actor (name='%s', id=%d) of type '%s'",
|
CLUTTER_NOTE (MISC, "Finalize actor (name='%s') of type '%s'",
|
||||||
priv->name != NULL ? priv->name : "<none>",
|
_clutter_actor_get_debug_name ((ClutterActor *) object),
|
||||||
priv->id,
|
|
||||||
g_type_name (G_OBJECT_TYPE (object)));
|
g_type_name (G_OBJECT_TYPE (object)));
|
||||||
|
|
||||||
_clutter_context_release_id (priv->id);
|
|
||||||
|
|
||||||
g_free (priv->name);
|
g_free (priv->name);
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
@ -8415,7 +8411,6 @@ clutter_actor_init (ClutterActor *self)
|
|||||||
|
|
||||||
self->priv = priv = clutter_actor_get_instance_private (self);
|
self->priv = priv = clutter_actor_get_instance_private (self);
|
||||||
|
|
||||||
priv->id = _clutter_context_acquire_id (self);
|
|
||||||
priv->pick_id = -1;
|
priv->pick_id = -1;
|
||||||
|
|
||||||
priv->opacity = 0xff;
|
priv->opacity = 0xff;
|
||||||
@ -11807,14 +11802,15 @@ clutter_actor_get_name (ClutterActor *self)
|
|||||||
*
|
*
|
||||||
* Since: 0.6
|
* 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
|
guint32
|
||||||
clutter_actor_get_gid (ClutterActor *self)
|
clutter_actor_get_gid (ClutterActor *self)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
|
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
|
||||||
|
|
||||||
return self->priv->id;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -567,20 +567,6 @@ clutter_get_motion_events_enabled (void)
|
|||||||
return _clutter_context_get_motion_events_enabled ();
|
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
|
void
|
||||||
_clutter_id_to_color (guint id_,
|
_clutter_id_to_color (guint id_,
|
||||||
ClutterColor *col)
|
ClutterColor *col)
|
||||||
@ -1562,8 +1548,6 @@ pre_parse_hook (GOptionContext *context,
|
|||||||
|
|
||||||
clutter_context = _clutter_context_get_default ();
|
clutter_context = _clutter_context_get_default ();
|
||||||
|
|
||||||
clutter_context->id_pool = _clutter_id_pool_new (256);
|
|
||||||
|
|
||||||
backend = clutter_context->backend;
|
backend = clutter_context->backend;
|
||||||
g_assert (CLUTTER_IS_BACKEND (backend));
|
g_assert (CLUTTER_IS_BACKEND (backend));
|
||||||
|
|
||||||
@ -2693,12 +2677,14 @@ _clutter_process_event (ClutterEvent *event)
|
|||||||
*
|
*
|
||||||
* Since: 0.6
|
* 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 *
|
ClutterActor *
|
||||||
clutter_get_actor_by_gid (guint32 id_)
|
clutter_get_actor_by_gid (guint32 id_)
|
||||||
{
|
{
|
||||||
return _clutter_get_actor_by_id (NULL, id_);
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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
|
void
|
||||||
_clutter_clear_events_queue_for_stage (ClutterStage *stage)
|
_clutter_clear_events_queue_for_stage (ClutterStage *stage)
|
||||||
{
|
{
|
||||||
|
@ -136,9 +136,6 @@ struct _ClutterMainContext
|
|||||||
|
|
||||||
ClutterPickMode pick_mode;
|
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 */
|
/* default FPS; this is only used if we cannot sync to vblank */
|
||||||
guint frame_rate;
|
guint frame_rate;
|
||||||
|
|
||||||
@ -202,8 +199,6 @@ ClutterPickMode _clutter_context_get_pick_mode (void);
|
|||||||
void _clutter_context_push_shader_stack (ClutterActor *actor);
|
void _clutter_context_push_shader_stack (ClutterActor *actor);
|
||||||
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
|
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
|
||||||
ClutterActor * _clutter_context_peek_shader_stack (void);
|
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_motion_events_enabled (void);
|
||||||
gboolean _clutter_context_get_show_fps (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]);
|
guint _clutter_pixel_to_id (guchar pixel[4]);
|
||||||
void _clutter_id_to_color (guint id,
|
void _clutter_id_to_color (guint id,
|
||||||
ClutterColor *col);
|
ClutterColor *col);
|
||||||
ClutterActor * _clutter_get_actor_by_id (ClutterStage *stage,
|
|
||||||
guint32 actor_id);
|
|
||||||
|
|
||||||
void _clutter_set_sync_to_vblank (gboolean sync_to_vblank);
|
void _clutter_set_sync_to_vblank (gboolean sync_to_vblank);
|
||||||
gboolean _clutter_get_sync_to_vblank (void);
|
gboolean _clutter_get_sync_to_vblank (void);
|
||||||
|
@ -1594,7 +1594,7 @@ _clutter_stage_do_pick (ClutterStage *stage,
|
|||||||
{
|
{
|
||||||
guint32 id_ = _clutter_pixel_to_id (pixel);
|
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);
|
CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_timer);
|
||||||
|
Loading…
Reference in New Issue
Block a user