Пример #1
0
static void
cell_destroyed (gpointer data)
{
	GalA11yECell * cell;

	g_return_if_fail (GAL_A11Y_IS_E_CELL (data));
	cell = GAL_A11Y_E_CELL (data);

	g_return_if_fail (cell->item && G_IS_OBJECT (cell->item));

	if (cell->item) {
		g_object_unref (cell->item);
		cell->item = NULL;
	}

}
Пример #2
0
static void
subcell_destroyed (gpointer data)
{
	GalA11yECell *cell;
	AtkObject *parent;
	GalA11yECellVbox *gaev;

	g_return_if_fail (GAL_A11Y_IS_E_CELL (data));
	cell = GAL_A11Y_E_CELL (data);

	parent = atk_object_get_parent (ATK_OBJECT (cell));
	g_return_if_fail (GAL_A11Y_IS_E_CELL_VBOX (parent));
	gaev = GAL_A11Y_E_CELL_VBOX (parent);

	if (cell->view_col < gaev->a11y_subcell_count)
		gaev->a11y_subcells[cell->view_col] = NULL;
}
Пример #3
0
static void
eti_a11y_reset_focus_object (GalA11yETableItem *a11y,
                             ETableItem *item,
                             gboolean notify)
{
	ESelectionModel * esm;
	gint cursor_row, cursor_col, view_row, view_col;
	AtkObject *cell, *old_cell;

	esm = item->selection;
	g_return_if_fail (esm);

	cursor_row = e_selection_model_cursor_row (esm);
	cursor_col = e_selection_model_cursor_col (esm);

	view_row = model_to_view_row (item, cursor_row);
	view_col = model_to_view_col (item, cursor_col);

	if (view_row == -1)
		view_row = 0;
	if (view_col == -1)
		view_col = 0;

	old_cell = (AtkObject *) g_object_get_data (G_OBJECT (a11y), "gail-focus-object");
	if (old_cell && GAL_A11Y_IS_E_CELL (old_cell))
		gal_a11y_e_cell_remove_state (
			GAL_A11Y_E_CELL (old_cell), ATK_STATE_FOCUSED, FALSE);
	if (old_cell)
		g_object_unref (old_cell);

	cell = eti_ref_at (ATK_TABLE (a11y), view_row, view_col);

	if (cell != NULL) {
		g_object_set_data (G_OBJECT (a11y), "gail-focus-object", cell);
		gal_a11y_e_cell_add_state (
			GAL_A11Y_E_CELL (cell), ATK_STATE_FOCUSED, FALSE);
	} else
		g_object_set_data (G_OBJECT (a11y), "gail-focus-object", NULL);

	if (notify && cell)
		g_signal_emit_by_name (a11y, "active-descendant-changed", cell);
}