clutter: add clutter_actor_has_accessible()

This new virtual function allows querying if an actor has an accessible
without force creating the accessible. Doing so allows actors to more
carefully avoid creating accessibles during removal of actors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1044
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1083
This commit is contained in:
Christian Hergert 2020-02-23 14:07:24 -08:00 committed by Christian Hergert
parent be269d0992
commit 629a4b4c21
2 changed files with 15 additions and 1 deletions

View File

@ -21192,3 +21192,14 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
return node;
}
gboolean
clutter_actor_has_accessible (ClutterActor *actor)
{
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
if (CLUTTER_ACTOR_GET_CLASS (actor)->has_accessible)
return CLUTTER_ACTOR_GET_CLASS (actor)->has_accessible (actor);
return TRUE;
}

View File

@ -299,10 +299,11 @@ struct _ClutterActorClass
gboolean (* touch_event) (ClutterActor *self,
ClutterTouchEvent *event);
gboolean (* has_accessible) (ClutterActor *self);
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[26];
gpointer _padding_dummy[25];
};
/**
@ -380,6 +381,8 @@ CLUTTER_EXPORT
const gchar * clutter_actor_get_name (ClutterActor *self);
CLUTTER_EXPORT
AtkObject * clutter_actor_get_accessible (ClutterActor *self);
CLUTTER_EXPORT
gboolean clutter_actor_has_accessible (ClutterActor *self);
CLUTTER_EXPORT
gboolean clutter_actor_is_visible (ClutterActor *self);