mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
Allow updating the next accessible sibling for a GtkAccessible
This commit is contained in:
parent
d566771262
commit
f507dd4962
@ -49,7 +49,7 @@
|
|||||||
* and it has children, whose implementation you don't control,
|
* and it has children, whose implementation you don't control,
|
||||||
* it is necessary to ensure the correct shape of the a11y tree
|
* it is necessary to ensure the correct shape of the a11y tree
|
||||||
* by calling gtk_accessible_set_accessible_parent() and
|
* 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"
|
#include "config.h"
|
||||||
@ -159,6 +159,38 @@ gtk_accessible_set_accessible_parent (GtkAccessible *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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:
|
* gtk_accessible_get_first_accessible_child:
|
||||||
* @self: an accessible object
|
* @self: an accessible object
|
||||||
|
@ -174,6 +174,10 @@ GtkAccessible * gtk_accessible_get_first_accessible_child (GtkAccessible *self);
|
|||||||
|
|
||||||
GDK_AVAILABLE_IN_4_10
|
GDK_AVAILABLE_IN_4_10
|
||||||
GtkAccessible * gtk_accessible_get_next_accessible_sibling (GtkAccessible *self);
|
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
|
GDK_AVAILABLE_IN_4_10
|
||||||
gboolean gtk_accessible_get_bounds (GtkAccessible *self,
|
gboolean gtk_accessible_get_bounds (GtkAccessible *self,
|
||||||
|
Loading…
Reference in New Issue
Block a user