a11y: Rename GtkAccessible.get_parent
authorLukáš Tyrychtr <lukastyrychtr@gmail.com>
Tue, 22 Nov 2022 14:17:30 +0000 (15:17 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Fri, 3 Feb 2023 10:49:17 +0000 (11:49 +0100)
Avoid a collision when the type implementing the GtkAccessible interface
already has a `get_parent()` method—like GtkWidget.

gtk/a11y/gtkatspicontext.c
gtk/gtkaccessible.c
gtk/gtkaccessible.h
gtk/gtkstack.c
gtk/gtkwidget.c

index e2988252dee07e1126a732dda7b6448a1de08bd8..82f88627faede489a52e9ed9f28d0e7093d590e3 100644 (file)
@@ -366,7 +366,7 @@ get_index_in (GtkAccessible *parent,
 static int
 get_index_in_parent (GtkAccessible *accessible)
 {
-  GtkAccessible *parent = gtk_accessible_get_parent (accessible);
+  GtkAccessible *parent = gtk_accessible_get_accessible_parent (accessible);
   return get_index_in(parent, accessible);
 }
 
@@ -402,7 +402,7 @@ get_parent_context_ref (GtkAccessible *accessible)
 {
   GVariant *res = NULL;
 
-  GtkAccessible *parent = gtk_accessible_get_parent (accessible);
+  GtkAccessible *parent = gtk_accessible_get_accessible_parent (accessible);
 
   if (parent == NULL)
     {
@@ -873,7 +873,7 @@ gtk_at_spi_context_state_change (GtkATContext                *ctx,
         }
       else
         {
-          parent = gtk_accessible_get_parent (accessible);
+          parent = gtk_accessible_get_accessible_parent (accessible);
 
           context = gtk_accessible_get_at_context (parent);
           gtk_at_context_child_changed (context, change, accessible);
@@ -1123,7 +1123,7 @@ gtk_at_spi_context_child_change (GtkATContext             *ctx,
   if (child_context == NULL)
     return;
 
-  if (gtk_accessible_get_parent (child) != accessible)
+  if (gtk_accessible_get_accessible_parent (child) != accessible)
     {
       idx = 0;
     }
index 848d9a0bd9bd77cbd405c06dee5cc7dee1f26f36..b9101a79d3909adc6c00aea6d63324775915182a 100644 (file)
@@ -40,7 +40,7 @@
  *
  * Every accessible implementation is part of a tree of accessible objects.
  * Normally, this tree corresponds to the widget tree, but can be customized
- * by reimplementing the [vfunc@Gtk.Accessible.get_parent]
+ * by reimplementing the [vfunc@Gtk.Accessible.get_accessible_parent]
  * and [vfunc@Gtk.Accessible.get_child_at_index] virtual functions.
  * Note that you can not create a top-level accessible object as of now,
  * which means that you must always have a parent accessible object.
@@ -98,7 +98,7 @@ gtk_accessible_get_at_context (GtkAccessible *self)
 }
 
 /*
- * gtk_accessible_get_parent:
+ * gtk_accessible_get_accessible_parent:
  * @self: a `GtkAccessible`
  *
  * Retrieves the parent `GtkAccessible` for the given `GtkAccessible`.
@@ -106,11 +106,11 @@ gtk_accessible_get_at_context (GtkAccessible *self)
  * Returns: (transfer none): the parent `GtkAccessible`, which can not be %NULL
  */
 GtkAccessible *
-gtk_accessible_get_parent (GtkAccessible *self)
+gtk_accessible_get_accessible_parent (GtkAccessible *self)
 {
   g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), NULL);
 
-  return GTK_ACCESSIBLE_GET_IFACE (self)->get_parent (self);
+  return GTK_ACCESSIBLE_GET_IFACE (self)->get_accessible_parent (self);
 }
 
 
@@ -755,7 +755,7 @@ gtk_accessible_platform_changed (GtkAccessible               *self,
 
   /* propagate changes up from ignored widgets */
   if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE)
-    context = gtk_accessible_get_at_context (gtk_accessible_get_parent (self));
+    context = gtk_accessible_get_at_context (gtk_accessible_get_accessible_parent (self));
 
   if (context == NULL)
     return;
@@ -900,7 +900,7 @@ gtk_accessible_update_children (GtkAccessible           *self,
 
   /* propagate changes up from ignored widgets */
   if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE)
-    context = gtk_accessible_get_at_context (gtk_accessible_get_parent (self));
+    context = gtk_accessible_get_at_context (gtk_accessible_get_accessible_parent (self));
 
   if (context == NULL)
     return;
index 6b30107c063c167e49a6115b3e8b087636ed9331..a557d49fec326ed9807d53859f90f2b334b56108 100644 (file)
@@ -96,14 +96,14 @@ struct _GtkAccessibleInterface
                                                  GtkAccessiblePlatformState  state);
 
   /**
-   * GtkAccessibleInterface::get_parent:
+   * GtkAccessibleInterface::get_accessible_parent:
    * @self: a `GtkAccessible`
    * 
    * Returns the parent `GtkAccessible` of @self.
    * Be sure not to return %NULL, as a top-level `GtkAccessible` which is not a
    * top-level window is not supported.
    */
-  GtkAccessible *       (* get_parent)  (GtkAccessible *self);
+  GtkAccessible *       (* get_accessible_parent)  (GtkAccessible *self);
   
   /**
    * GtkaccessibleInterface::get_child_at_index:
@@ -139,7 +139,7 @@ gboolean        gtk_accessible_get_platform_state (GtkAccessible              *s
                                                    GtkAccessiblePlatformState  state);
 
 GDK_AVAILABLE_IN_4_10
-GtkAccessible * gtk_accessible_get_parent(GtkAccessible *self);
+GtkAccessible * gtk_accessible_get_accessible_parent(GtkAccessible *self);
 
 GDK_AVAILABLE_IN_4_10
 GtkAccessible * gtk_accessible_get_child_at_index(GtkAccessible *self, guint idx);
index 3e99575d29a7c311b3272dcd98d4eb524c809ef2..fa47587b1bc20e0a0c988da827be319003141eda 100644 (file)
@@ -257,7 +257,7 @@ gtk_stack_page_accessible_get_platform_state (GtkAccessible              *self,
 }
 
 static GtkAccessible *
-gtk_stack_page_accessible_get_parent (GtkAccessible *accessible)
+gtk_stack_page_accessible_get_accessible_parent (GtkAccessible *accessible)
 {
   GtkStackPage *page = GTK_STACK_PAGE (accessible);
 
@@ -298,7 +298,7 @@ gtk_stack_page_accessible_init (GtkAccessibleInterface *iface)
 {
   iface->get_at_context = gtk_stack_page_accessible_get_at_context;
   iface->get_platform_state = gtk_stack_page_accessible_get_platform_state;
-  iface->get_parent = gtk_stack_page_accessible_get_parent;
+  iface->get_accessible_parent = gtk_stack_page_accessible_get_accessible_parent;
   iface->get_child_at_index = gtk_stack_page_accessible_get_child_at_index;
   iface->get_bounds = gtk_stack_page_accessible_get_bounds;
 }
index 5694974a3564289b8d12df7c801826691b579e4b..ed56005039f15b1b768310c26571a7a952e613ff 100644 (file)
@@ -8466,7 +8466,7 @@ gtk_widget_accessible_get_platform_state (GtkAccessible              *self,
 }
 
 static GtkAccessible *
-gtk_widget_accessible_get_parent (GtkAccessible *self)
+gtk_widget_accessible_get_accessible_parent (GtkAccessible *self)
 {
   return GTK_ACCESSIBLE (gtk_widget_get_parent (GTK_WIDGET (self)));
 }
@@ -8525,7 +8525,7 @@ gtk_widget_accessible_interface_init (GtkAccessibleInterface *iface)
 {
   iface->get_at_context = gtk_widget_accessible_get_at_context;
   iface->get_platform_state = gtk_widget_accessible_get_platform_state;
-  iface->get_parent = gtk_widget_accessible_get_parent;
+  iface->get_accessible_parent = gtk_widget_accessible_get_accessible_parent;
   iface->get_child_at_index = gtk_widget_accessible_get_child_at_index;
   iface->get_bounds = gtk_widget_accessible_get_bounds;
 }