mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
Miscellaneous formatting and documentation fixes
This commit is contained in:
parent
f507dd4962
commit
5717b95cad
@ -48,8 +48,8 @@
|
|||||||
* Also note that when an accessible object does not correspond to a widget,
|
* Also note that when an accessible object does not correspond to a widget,
|
||||||
* 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 [method@Gtk.Accessible.set_accessible_parent] and
|
||||||
* updating the sibling by gtk_accessible_update_next_accessible_sibling().
|
* updating the sibling by [method@Gtk.Accessible.update_next_accessible_sibling].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -135,11 +135,19 @@ gtk_accessible_get_accessible_parent (GtkAccessible *self)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_accessible_set_accessible_parent:
|
* gtk_accessible_set_accessible_parent:
|
||||||
* @self: a `GtkAccessible`
|
* @self: an accessible object
|
||||||
* @parent: the parent `GtkAccessible`
|
* @parent: (nullable): the parent accessible object
|
||||||
* @next_sibling: the next accessible sibling of this `GtkAccessible`
|
* @next_sibling: (nullable): the sibling accessible object
|
||||||
*
|
*
|
||||||
* Sets the parent and next sibling accessible of an accessible object
|
* Sets the parent and sibling of an accessible object.
|
||||||
|
*
|
||||||
|
* This function is meant to be used by accessible implementations that are
|
||||||
|
* not part of the widget hierarchy, and but act as a logical bridge between
|
||||||
|
* widgets. For instance, if a widget creates an object that holds metadata
|
||||||
|
* for each child, and you want that object to implement the `GtkAccessible`
|
||||||
|
* interface, you will use this function to ensure that the parent of each
|
||||||
|
* child widget is the metadata object, and the parent of each metadata
|
||||||
|
* object is the container widget.
|
||||||
*
|
*
|
||||||
* Since: 4.10
|
* Since: 4.10
|
||||||
*/
|
*/
|
||||||
@ -149,14 +157,16 @@ gtk_accessible_set_accessible_parent (GtkAccessible *self,
|
|||||||
GtkAccessible *next_sibling)
|
GtkAccessible *next_sibling)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_ACCESSIBLE (self));
|
g_return_if_fail (GTK_IS_ACCESSIBLE (self));
|
||||||
|
g_return_if_fail (parent == NULL || GTK_IS_ACCESSIBLE (parent));
|
||||||
|
g_return_if_fail (next_sibling == NULL || GTK_IS_ACCESSIBLE (parent));
|
||||||
GtkATContext *context;
|
GtkATContext *context;
|
||||||
|
|
||||||
context = gtk_accessible_get_at_context (self);
|
context = gtk_accessible_get_at_context (self);
|
||||||
if (context != NULL)
|
if (context != NULL)
|
||||||
{
|
{
|
||||||
gtk_at_context_set_accessible_parent (context, parent);
|
gtk_at_context_set_accessible_parent (context, parent);
|
||||||
gtk_at_context_set_next_accessible_sibling (context, next_sibling);
|
gtk_at_context_set_next_accessible_sibling (context, next_sibling);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -476,12 +476,7 @@ gtk_at_context_set_accessible_parent (GtkATContext *self,
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_AT_CONTEXT (self));
|
g_return_if_fail (GTK_IS_AT_CONTEXT (self));
|
||||||
|
|
||||||
if (self->accessible_parent != parent)
|
g_set_object (&self->accessible_parent, parent);
|
||||||
{
|
|
||||||
if (self->accessible_parent != NULL)
|
|
||||||
g_object_unref (self->accessible_parent);
|
|
||||||
self->accessible_parent = g_object_ref (parent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
@ -513,12 +508,7 @@ gtk_at_context_set_next_accessible_sibling (GtkATContext *self,
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_AT_CONTEXT (self));
|
g_return_if_fail (GTK_IS_AT_CONTEXT (self));
|
||||||
|
|
||||||
if (self->next_accessible_sibling != sibling)
|
g_set_object (&self->next_accessible_sibling, sibling);
|
||||||
{
|
|
||||||
if (self->next_accessible_sibling != NULL)
|
|
||||||
g_object_unref (self->next_accessible_sibling);
|
|
||||||
self->next_accessible_sibling = g_object_ref (sibling);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
|
@ -411,9 +411,9 @@ gtk_stack_page_set_property (GObject *object,
|
|||||||
case CHILD_PROP_CHILD:
|
case CHILD_PROP_CHILD:
|
||||||
g_set_object (&info->widget, g_value_get_object (value));
|
g_set_object (&info->widget, g_value_get_object (value));
|
||||||
gtk_accessible_set_accessible_parent (
|
gtk_accessible_set_accessible_parent (
|
||||||
GTK_ACCESSIBLE (info->widget),
|
gtk_accessible_set_accessible_parent (GTK_ACCESSIBLE (info->widget),
|
||||||
GTK_ACCESSIBLE (info),
|
GTK_ACCESSIBLE (info),
|
||||||
NULL);
|
NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHILD_PROP_NAME:
|
case CHILD_PROP_NAME:
|
||||||
|
Loading…
Reference in New Issue
Block a user