From d5b52ae3b1c0422b652609ecd364f6af5f6aec2c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 11 Nov 2011 02:19:28 +0100 Subject: [PATCH] a11y: Implement get_child_index in treeviewaccessible --- gtk/a11y/gtktreeviewaccessible.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index b6faa75377..deb1f175de 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -1526,12 +1526,26 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent, return FALSE; } +static int +gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent, + GtkCellAccessible *cell) +{ + GtkTreeViewAccessibleCellInfo *cell_info; + + cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell, TRUE); + if (!cell_info || !cell_info->cell_col_ref || !cell_info->cell_row_ref) + return -1; + + return cell_info_get_index (tree_view, info); +} + static void gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface) { iface->get_cell_extents = gtk_tree_view_accessible_get_cell_extents; iface->get_cell_area = gtk_tree_view_accessible_get_cell_area; iface->grab_focus = gtk_tree_view_accessible_grab_cell_focus; + iface->get_child_index = gtk_tree_view_accessible_get_child_index; } /* signal handling */