a11y: Add _gtk_tree_view_accessible_add_state()

... and _gtk_tree_view_accessible_remove_state(). They should be called
by gtktreeview.c to notify about changes of state for a row.
This commit is contained in:
Benjamin Otte 2011-12-12 10:25:27 +01:00
parent 3badf48d2e
commit d9b71702dc
2 changed files with 67 additions and 0 deletions

View File

@ -3084,3 +3084,61 @@ _gtk_tree_view_accessible_toggle_visibility (GtkTreeView *treeview,
column,
id);
}
void
_gtk_tree_view_accessible_add_state (GtkTreeView *treeview,
GtkRBTree *tree,
GtkRBNode *node,
GtkCellRendererState state)
{
GtkTreeViewAccessible *accessible;
AtkObject *obj;
guint i;
obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
if (obj == NULL)
return;
accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
{
GtkCellAccessible *cell = peek_cell (accessible,
tree, node,
gtk_tree_view_get_column (treeview, i));
if (cell == NULL)
continue;
_gtk_cell_accessible_state_changed (cell, state, 0);
}
}
void
_gtk_tree_view_accessible_remove_state (GtkTreeView *treeview,
GtkRBTree *tree,
GtkRBNode *node,
GtkCellRendererState state)
{
GtkTreeViewAccessible *accessible;
AtkObject *obj;
guint i;
obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
if (obj == NULL)
return;
accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
{
GtkCellAccessible *cell = peek_cell (accessible,
tree, node,
gtk_tree_view_get_column (treeview, i));
if (cell == NULL)
continue;
_gtk_cell_accessible_state_changed (cell, 0, state);
}
}

View File

@ -72,6 +72,15 @@ void _gtk_tree_view_accessible_toggle_visibility
(GtkTreeView *treeview,
GtkTreeViewColumn *column);
void _gtk_tree_view_accessible_add_state (GtkTreeView *treeview,
GtkRBTree *tree,
GtkRBNode *node,
GtkCellRendererState state);
void _gtk_tree_view_accessible_remove_state (GtkTreeView *treeview,
GtkRBTree *tree,
GtkRBNode *node,
GtkCellRendererState state);
G_END_DECLS
#endif /* __GTK_TREE_VIEW_ACCESSIBLE_H__ */