[mutter/wip/chergert/has-accessible: 2/3] clutter: add clutter_actor_has_accessible()



commit 2d7eea0656321be64acddde1a57886a64ee05b23
Author: Christian Hergert <chergert redhat com>
Date:   Sun Feb 23 14:07:24 2020 -0800

    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/mutter/-/merge_requests/1083

 clutter/clutter/clutter-actor.c | 11 +++++++++++
 clutter/clutter/clutter-actor.h |  5 ++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 6624ae406..8780a0758 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -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;
+}
diff --git a/clutter/clutter/clutter-actor.h b/clutter/clutter/clutter-actor.h
index bb968ddd0..e4f25d985 100644
--- a/clutter/clutter/clutter-actor.h
+++ b/clutter/clutter/clutter-actor.h
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]