static AtkObject *
eti_ref_accessible_at_point (AtkComponent *component,
                             gint x,
                             gint y,
                             AtkCoordType coord_type)
{
	gint row = -1;
	gint col = -1;
	gint x_origin, y_origin;
	ETableItem *item;
	GtkWidget *tableOrTree;

	item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (component)));
	if (!item)
		return NULL;

	atk_component_get_extents (
		component,
		&x_origin,
		&y_origin,
		NULL,
		NULL,
		coord_type);
	x -= x_origin;
	y -= y_origin;

	tableOrTree = gtk_widget_get_parent (GTK_WIDGET (item->parent.canvas));

	if (E_IS_TREE (tableOrTree))
		e_tree_get_cell_at (E_TREE (tableOrTree), x, y, &row, &col);
	else
		e_table_get_cell_at (E_TABLE (tableOrTree), x, y, &row, &col);

	if (row != -1 && col != -1) {
		return eti_ref_at (ATK_TABLE (component), row, col);
	} else {
		return NULL;
	}
}
Example #2
0
/* Component IFace */
static void
gal_a11y_e_cell_get_extents (AtkComponent *component,
                             gint *x,
                             gint *y,
                             gint *width,
                             gint *height,
                             AtkCoordType coord_type)
{
	GalA11yECell *a11y = GAL_A11Y_E_CELL (component);
	GtkWidget *tableOrTree;
	gint row;
	gint col;
	gint xval;
	gint yval;

	row = a11y->row;
	col = a11y->view_col;

	tableOrTree = gtk_widget_get_parent (GTK_WIDGET (a11y->item->parent.canvas));
	if (E_IS_TREE (tableOrTree)) {
		e_tree_get_cell_geometry (
			E_TREE (tableOrTree),
			row, col, &xval, &yval,
			width, height);
	} else {
		e_table_get_cell_geometry (
			E_TABLE (tableOrTree),
			row, col, &xval, &yval,
			width, height);
	}

	atk_component_get_extents (
		ATK_COMPONENT (a11y->parent),
		x, y, NULL, NULL, coord_type);
	if (x && *x != G_MININT)
		*x += xval;
	if (y && *y != G_MININT)
		*y += yval;
}