a11y: Add API to update relationsets of cells to their parents

This commit is contained in:
Benjamin Otte 2014-03-24 15:51:38 +01:00
parent fef14e0e87
commit 8374a58623
3 changed files with 47 additions and 0 deletions

View File

@ -70,6 +70,27 @@ gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
return gtk_cell_accessible_parent_get_child_index (GTK_CELL_ACCESSIBLE_PARENT (cell->priv->parent), cell);
}
static AtkRelationSet *
gtk_cell_accessible_ref_relation_set (AtkObject *object)
{
GtkCellAccessible *cell;
AtkRelationSet *relationset;
AtkObject *parent;
relationset = ATK_OBJECT_CLASS (gtk_cell_accessible_parent_class)->ref_relation_set (object);
if (relationset == NULL)
relationset = atk_relation_set_new ();
cell = GTK_CELL_ACCESSIBLE (object);
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
gtk_cell_accessible_parent_update_relationset (GTK_CELL_ACCESSIBLE_PARENT (parent),
cell,
relationset);
return relationset;
}
static AtkStateSet *
gtk_cell_accessible_ref_state_set (AtkObject *accessible)
{
@ -130,6 +151,7 @@ gtk_cell_accessible_class_init (GtkCellAccessibleClass *klass)
class->get_index_in_parent = gtk_cell_accessible_get_index_in_parent;
class->ref_state_set = gtk_cell_accessible_ref_state_set;
class->ref_relation_set = gtk_cell_accessible_ref_relation_set;
class->get_parent = gtk_cell_accessible_get_parent;
}

View File

@ -170,3 +170,20 @@ gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
if (iface->edit)
(iface->edit) (parent, cell);
}
void
gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
AtkRelationSet *relationset)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
g_return_if_fail (ATK_IS_RELATION_SET (relationset));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->update_relationset)
(iface->update_relationset) (parent, cell, relationset);
}

View File

@ -71,6 +71,10 @@ struct _GtkCellAccessibleParentIface
GtkCellAccessible *cell);
void ( *edit) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
/* end of actions */
void ( *update_relationset) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
AtkRelationSet *relationset);
};
GDK_AVAILABLE_IN_ALL
@ -107,6 +111,10 @@ void gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *p
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GDK_AVAILABLE_IN_3_12
void gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
AtkRelationSet *relationset);
G_END_DECLS