summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukáš Tyrychtr <lukastyrychtr@gmail.com>2022-09-09 17:02:59 +0200
committerEmmanuele Bassi <ebassi@gnome.org>2023-02-03 11:49:17 +0100
commitf88b777fe5bf4b6e3e14c88c7cdd673b66c13745 (patch)
treedd31bfaa9cba2753f7422bd3dfe8d8a82a390a73
parenta80af681b840e123743eaba00ff2a23845301d6c (diff)
downloadgtk+-f88b777fe5bf4b6e3e14c88c7cdd673b66c13745.tar.gz
widget: Implement new GtkAccessible vfuncs
-rw-r--r--gtk/gtkwidget.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 72582aeb6a..c842d1f7a5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8465,11 +8465,35 @@ gtk_widget_accessible_get_platform_state (GtkAccessible *self,
}
}
+static GtkAccessible *
+gtk_widget_accessible_get_parent (GtkAccessible *self)
+{
+ return GTK_ACCESSIBLE (gtk_widget_get_parent (GTK_WIDGET (self)));
+}
+
+static GtkAccessible *
+gtk_widget_accessible_get_child_at_index (GtkAccessible *self, guint index)
+{
+ guint idx = 0;
+ GtkWidget *child;
+ for (child = gtk_widget_get_first_child (GTK_WIDGET (self));
+ child != NULL;
+ child = gtk_widget_get_next_sibling (child))
+ {
+ if (idx == index)
+ return GTK_ACCESSIBLE (child);
+ idx++;
+ }
+ return NULL;
+}
+
static void
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_child_at_index = gtk_widget_accessible_get_child_at_index;
}
static void