* and it has children, whose implementation you don't control,
* it is necessary to ensure the correct shape of the a11y tree
* by calling gtk_accessible_set_accessible_parent() and
- * gtk_accessible_set_next_accessible_sibling() as appropriate.
+ * updating the sibling by gtk_accessible_update_next_accessible_sibling().
*/
#include "config.h"
}
}
+/**
+ * gtk_accessible_update_next_accessible_sibling:
+ * @self: a `GtkAccessible`
+ * @new_sibling: (nullable): the new next accessible sibling to set
+ *
+ * Updates the next accessible sibling of @self.
+ * That might be useful when a new child of a custom `GtkAccessible`
+ * is created, and it needs to be linked to a previous child.
+ *
+ * Since: 4.10
+ */
+void
+gtk_accessible_update_next_accessible_sibling (GtkAccessible *self,
+ GtkAccessible *new_sibling)
+{
+ GtkATContext *context;
+
+ g_return_if_fail (GTK_IS_ACCESSIBLE (self));
+
+ context = gtk_accessible_get_at_context (self);
+ if (!context)
+ return;
+
+ if (gtk_at_context_get_accessible_parent (context) == NULL)
+ {
+ g_critical ("Failed to update next accessible sibling: no parent accessible set for this accessible");
+ return;
+ }
+
+ gtk_at_context_set_next_accessible_sibling (context, new_sibling);
+}
+
/**
* gtk_accessible_get_first_accessible_child:
* @self: an accessible object
GDK_AVAILABLE_IN_4_10
GtkAccessible * gtk_accessible_get_next_accessible_sibling (GtkAccessible *self);
+GDK_AVAILABLE_IN_4_10
+void gtk_accessible_update_next_accessible_sibling (GtkAccessible *self,
+ GtkAccessible *new_sibling);
+
GDK_AVAILABLE_IN_4_10
gboolean gtk_accessible_get_bounds (GtkAccessible *self,