static const gchar *
table_interface_get_column_description (AtkTable *table,
                                        gint in_col)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
	const gchar *description;
	EaCellTable *cell_data;

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return NULL;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	if (in_col < 0 || in_col >= e_day_view_get_days_shown (day_view))
		return NULL;
	cell_data = ea_day_view_main_item_get_cell_data (ea_main_item);
	if (!cell_data)
		return NULL;

	description = ea_cell_table_get_column_label (cell_data, in_col);
	if (!description) {
		gchar buffer[128];
		e_day_view_top_item_get_day_label (day_view, in_col, buffer, 128);
		ea_cell_table_set_column_label (cell_data, in_col, buffer);
		description = ea_cell_table_get_column_label (cell_data, in_col);
	}
	return description;
}
static void
eti_rows_deleted (ETableModel *model,
                  gint row,
                  gint count,
                  AtkObject *table_item)
{
	gint i,j, n_rows, n_cols, old_nrows;
	ETableItem *item = E_TABLE_ITEM (
		atk_gobject_accessible_get_object (
		ATK_GOBJECT_ACCESSIBLE (table_item)));

	n_rows = atk_table_get_n_rows (ATK_TABLE (table_item));
	n_cols = atk_table_get_n_columns (ATK_TABLE (table_item));

	old_nrows = GET_PRIVATE (table_item)->rows;

	g_return_if_fail (row + count <= old_nrows);
	g_return_if_fail (old_nrows == n_rows + count);
	GET_PRIVATE (table_item)->rows = n_rows;

	g_signal_emit_by_name (
		table_item, "row-deleted", row,
		count, NULL);

	for (i = row; i < (row + count); i++) {
		for (j = 0; j < n_cols; j++) {
			g_signal_emit_by_name (
				table_item,
				"children_changed::remove",
				(((i + 1) * n_cols) + j), NULL, NULL);
		}
	}
	g_signal_emit_by_name (table_item, "visible-data-changed");
	eti_a11y_reset_focus_object ((GalA11yETableItem *) table_item, item, TRUE);
}
Exemple #3
0
static AtkObject *
goo_canvas_widget_accessible_ref_child (AtkObject *accessible,
					gint       child_num)
{
  GooCanvasWidget *witem;
  AtkObject *atk_object;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_WIDGET_ACCESSIBLE (accessible), NULL);

  if (child_num != 0)
    return NULL;

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
  if (object == NULL)
    return NULL;

  g_return_val_if_fail (GOO_IS_CANVAS_WIDGET (object), NULL);

  witem = GOO_CANVAS_WIDGET (object);

  if (!witem->widget)
    return NULL;

  atk_object = gtk_widget_get_accessible (witem->widget);
  g_object_ref (atk_object);

  return atk_object;
}
Exemple #4
0
static AtkObject*
goo_canvas_item_accessible_ref_child (AtkObject *accessible,
				      gint       child_num)
{
  GooCanvasItem *item, *child;
  AtkObject *atk_object;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL);

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
  if (object == NULL)
    return NULL;

  item = GOO_CANVAS_ITEM (object);

  child = goo_canvas_item_get_child (item, child_num);
  if (!child)
    return NULL;

  atk_object = atk_gobject_accessible_for_object (G_OBJECT (child));
  g_object_ref (atk_object);

  return atk_object;
}
static gboolean
table_interface_is_row_selected (AtkTable *table,
                                 gint row)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return FALSE;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	if (day_view->selection_start_day == -1)
		/* no selection */
		return FALSE;
	if (day_view->selection_start_day != day_view->selection_end_day)
		/* all row is selected */
		return TRUE;
	if (row >= day_view->selection_start_row &&
	    row <= day_view->selection_end_row)
		return TRUE;
	return FALSE;
}
Exemple #6
0
static AtkObject*
goo_canvas_item_accessible_get_parent (AtkObject *accessible)
{
  GooCanvasItem *item, *parent;
  GooCanvas *canvas;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL);

  if (accessible->accessible_parent)
    return accessible->accessible_parent;

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
  if (object == NULL)
    return NULL;

  item = GOO_CANVAS_ITEM (object);
  parent = goo_canvas_item_get_parent (item);

  if (parent)
    return atk_gobject_accessible_for_object (G_OBJECT (parent));

  canvas = goo_canvas_item_get_canvas (item);
  if (canvas)
    return gtk_widget_get_accessible (GTK_WIDGET (canvas));

  return NULL;
}
static gint
table_interface_get_selected_columns (AtkTable *table,
                                      gint **columns_selected)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
	gint start_column = -1, n_columns = 0;

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return -1;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	if (day_view->selection_start_day == -1)
		return 0;

	start_column = day_view->selection_start_day;
	n_columns = day_view->selection_end_day - start_column + 1;
	if (n_columns > 0 && start_column != -1 && columns_selected) {
		gint index;

		*columns_selected = (gint *) g_malloc (n_columns * sizeof (gint));
		for (index = 0; index < n_columns; ++index)
			(*columns_selected)[index] = start_column + index;
	}
	return n_columns;
}
Exemple #8
0
static gboolean
goo_canvas_item_accessible_grab_focus (AtkComponent    *component)
{
  GooCanvasItem *item;
  GooCanvas *canvas;
  GtkWidget *toplevel;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), FALSE);

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component));
  if (!object)
    return FALSE;

  item = GOO_CANVAS_ITEM (object);

  canvas = goo_canvas_item_get_canvas (item);
  if (!canvas)
    return FALSE;

  goo_canvas_grab_focus (canvas, item);

  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas));
  if (GTK_WIDGET_TOPLEVEL (toplevel))
    gtk_window_present (GTK_WINDOW (toplevel));

  return TRUE;
}
static void
eti_get_extents (AtkComponent *component,
                 gint *x,
                 gint *y,
                 gint *width,
                 gint *height,
                 AtkCoordType coord_type)
{
	ETableItem *item;
	AtkObject *parent;

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

	parent = ATK_OBJECT (component)->accessible_parent;
	if (parent && ATK_IS_COMPONENT (parent))
		atk_component_get_extents (
			ATK_COMPONENT (parent),
			x, y,
			width, height,
			coord_type);

	if (parent && GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (parent)) {
		ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (
			atk_gobject_accessible_get_object (
			ATK_GOBJECT_ACCESSIBLE (parent)));
		if (etcta) {
			*width = etcta->width;
			*height = etcta->height;
		}
	}
}
static gboolean
idle_do_action (gpointer data)
{
	GtkLayout *layout;
	GdkEventButton event;
	ETableClickToAdd * etcta;
	gint finished;

	g_return_val_if_fail (data!= NULL, FALSE);

	etcta = E_TABLE_CLICK_TO_ADD (
		atk_gobject_accessible_get_object (
		ATK_GOBJECT_ACCESSIBLE (data)));
	g_return_val_if_fail (etcta, FALSE);

	layout = GTK_LAYOUT (GNOME_CANVAS_ITEM (etcta)->canvas);

	event.x = 0;
	event.y = 0;
	event.type = GDK_BUTTON_PRESS;
	event.window = gtk_layout_get_bin_window (layout);
	event.button = 1;
	event.send_event = TRUE;
	event.time = GDK_CURRENT_TIME;
	event.axes = NULL;

	g_signal_emit_by_name (etcta, "event", &event, &finished);

	return FALSE;
}
static gint
ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item,
                                          gint row,
                                          gint column)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;

	g_return_val_if_fail (ea_main_item, -1);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return -1;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	if (row >= 0 && row < day_view->rows &&
	    column >= 0 && column < e_day_view_get_days_shown (day_view))
		return column * day_view->rows + row;
	return -1;
}
static void
component_interface_get_extents (AtkComponent *component,
                                 gint *x,
                                 gint *y,
                                 gint *width,
                                 gint *height,
                                 AtkCoordType coord_type)
{
	GObject *g_obj;
	AtkObject *ea_canvas;
	EDayViewMainItem *main_item;
	EDayView *day_view;

	*x = *y = *width = *height = 0;

	g_return_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (component));

	g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component));
	if (!g_obj)
		/* defunct object*/
		return;
	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	ea_canvas = gtk_widget_get_accessible (day_view->main_canvas);
	atk_component_get_extents (
		ATK_COMPONENT (ea_canvas), x, y,
		width, height, coord_type);
}
static gint
ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item,
                                           gint index)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	gint n_children;

	g_return_val_if_fail (ea_main_item, -1);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return -1;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	n_children = ea_day_view_main_item_get_n_children (ATK_OBJECT (ea_main_item));
	if (index >= 0 && index < n_children)
		return index / day_view->rows;
	return -1;
}
static gboolean
selection_interface_is_child_selected (AtkSelection *selection,
                                       gint i)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
	gint column, row;

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return FALSE;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	row = ea_day_view_main_item_get_row_at_index (ea_main_item, i);
	column = ea_day_view_main_item_get_column_at_index (ea_main_item, i);

	if (column < day_view->selection_start_day ||
	    column > day_view->selection_end_day)
		return FALSE;

	if ((column == day_view->selection_start_day ||
	     column == day_view->selection_end_day) &&
	    (row < day_view->selection_start_row ||
	     row > day_view->selection_end_row))
		return FALSE;

	/* if comes here, the cell is selected */
	return TRUE;
}
static const gchar *
table_interface_get_row_description (AtkTable *table,
                                     gint row)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
	const gchar *description;
	EaCellTable *cell_data;

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return NULL;

	if (row < 0 || row >= 12 * 24)
		return NULL;
	cell_data = ea_day_view_main_item_get_cell_data (ea_main_item);
	if (!cell_data)
		return NULL;

	description = ea_cell_table_get_row_label (cell_data, row);
	if (!description) {
		gchar buffer[128];
		ea_day_view_main_item_get_row_label (
			ea_main_item, row, buffer, sizeof (buffer));
		ea_cell_table_set_row_label (cell_data, row, buffer);
		description = ea_cell_table_get_row_label (cell_data, row);
	}
	return description;
}
static AtkObject *
selection_interface_ref_selection (AtkSelection *selection,
                                   gint i)
{
	gint count;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
	gint start_index;

	count = selection_interface_get_selection_count (selection);
	if (i < 0 || i >=count)
		return NULL;

	g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (ea_main_item));

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	start_index = ea_day_view_main_item_get_child_index_at (
		ea_main_item,
		day_view->selection_start_row,
		day_view->selection_start_day);

	return ea_day_view_main_item_ref_child (ATK_OBJECT (selection), start_index + i);
}
static gint
selection_interface_get_selection_count (AtkSelection *selection)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
	gint start_index, end_index;

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return 0;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	if (day_view->selection_start_day == -1 ||
	    day_view->selection_start_row == -1)
		return 0;
	start_index = ea_day_view_main_item_get_child_index_at (
		ea_main_item,
		day_view->selection_start_row,
		day_view->selection_start_day);
	end_index = ea_day_view_main_item_get_child_index_at (
		ea_main_item,
		day_view->selection_end_row,
		day_view->selection_end_day);

	return end_index - start_index + 1;
}
static gboolean
selection_interface_clear_selection (AtkSelection *selection)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return FALSE;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	day_view->selection_start_row = -1;
	day_view->selection_start_day = -1;
	day_view->selection_end_row = -1;
	day_view->selection_end_day = -1;

	e_day_view_update_calendar_selection_time (day_view);
	gtk_widget_queue_draw (day_view->main_canvas);

	return TRUE;
}
static AtkObject *
etcta_ref_child (AtkObject *accessible,
                 gint i)
{
	AtkObject * atk_obj = NULL;
	ETableClickToAdd * etcta;

	if (i != 0)
		return NULL;

	etcta = E_TABLE_CLICK_TO_ADD (
		atk_gobject_accessible_get_object (
		ATK_GOBJECT_ACCESSIBLE (accessible)));

	g_return_val_if_fail (etcta, NULL);

	if (etcta->rect) {
		atk_obj = atk_gobject_accessible_for_object (
			G_OBJECT (etcta->rect));
	} else if (etcta->row) {
		atk_obj = atk_gobject_accessible_for_object (
			G_OBJECT (etcta->row));
	}

	g_object_ref (atk_obj);

	return atk_obj;
}
static EaCellTable *
ea_day_view_main_item_get_cell_data (EaDayViewMainItem *ea_main_item)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaCellTable *cell_data;

	g_return_val_if_fail (ea_main_item, NULL);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return NULL;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	cell_data = g_object_get_data (
		G_OBJECT (ea_main_item),
		"ea-day-view-cell-table");
	if (!cell_data) {
		cell_data = ea_cell_table_create (
			day_view->rows,
			e_day_view_get_days_shown (day_view), TRUE);
		g_object_set_data (
			G_OBJECT (ea_main_item),
			"ea-day-view-cell-table", cell_data);
	}
	return cell_data;
}
static gboolean
table_interface_add_column_selection (AtkTable *table,
                                      gint column)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;
	EDayViewMainItem *main_item;
	EDayView *day_view;
	EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return FALSE;

	main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
	day_view = e_day_view_main_item_get_day_view (main_item);

	/* FIXME: we need multi-selection */

	day_view->selection_start_day = column;
	day_view->selection_end_day = column;
	day_view->selection_start_row = 0;
	day_view->selection_end_row = day_view->rows;

	e_day_view_update_calendar_selection_time (day_view);
	gtk_widget_queue_draw (day_view->main_canvas);
	return TRUE;
}
Exemple #22
0
static AtkObject*
get_accessible_for_widget (GtkWidget *widget,
                           gboolean  *transient)
{
  AtkObject *obj = NULL;

  *transient = FALSE;
  if (!widget)
    return NULL;

  if (GTK_IS_ENTRY (widget))
    ;
  else if (GTK_IS_NOTEBOOK (widget)) 
    {
      GtkNotebook *notebook;
      gint page_num = -1;

      notebook = GTK_NOTEBOOK (widget);
      page_num = gtk_notebook_get_current_page (notebook);
      if (page_num != -1)
        {
          obj = gtk_widget_get_accessible (widget);
          obj = atk_object_ref_accessible_child (obj, page_num);
          g_object_unref (obj);
        }
    }
  else if (GTK_IS_TOGGLE_BUTTON (widget))
    {
      GtkWidget *other_widget = gtk_widget_get_parent (widget);
      if (GTK_IS_COMBO_BOX (other_widget))
        {
          gail_set_focus_widget (other_widget, widget);
          widget = other_widget;
        }
    }
  if (obj == NULL)
    {
      AtkObject *focus_object;

      obj = gtk_widget_get_accessible (widget);
      focus_object = g_object_get_qdata (G_OBJECT (obj), quark_focus_object);
      /*
       * We check whether the object for this focus_object has been deleted.
       * This can happen when navigating to an empty directory in nautilus. 
       * See bug #141907.
       */
      if (ATK_IS_GOBJECT_ACCESSIBLE (focus_object))
        {
          if (!atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (focus_object)))
            focus_object = NULL;
        }
      if (focus_object)
        obj = focus_object;
    }

  return obj;
}
static void
wnck_workspace_accessible_get_extents (AtkComponent *component,
                                       int          *x,
                                       int          *y,
                                       int          *width,
                                       int          *height,
                                       AtkCoordType  coords)
{
  AtkGObjectAccessible *atk_gobj;
  WnckPager *pager;
  GdkRectangle rect;
  GtkWidget *widget;
  AtkObject *parent;
  GObject *g_obj;
  int px, py;

  g_return_if_fail (WNCK_IS_WORKSPACE_ACCESSIBLE (component));

  atk_gobj = ATK_GOBJECT_ACCESSIBLE (component);
  g_obj = atk_gobject_accessible_get_object (atk_gobj);
  if (g_obj == NULL)
    return;

  g_return_if_fail (WNCK_IS_WORKSPACE (g_obj));

  parent = atk_object_get_parent (ATK_OBJECT(component));
#if GTK_CHECK_VERSION(2,21,0)
  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
#else
  widget = GTK_ACCESSIBLE (parent)->widget;
#endif

  if (widget == NULL)
    {
      /*
       *State is defunct
       */
      return;
    }

  g_return_if_fail (WNCK_IS_PAGER (widget));
  pager = WNCK_PAGER (widget);

  g_return_if_fail (WNCK_IS_PAGER (pager));

  atk_component_get_position (ATK_COMPONENT (parent), &px,&py, coords);

  _wnck_pager_get_workspace_rect (pager, WNCK_WORKSPACE_ACCESSIBLE (component)->index, &rect);

  *x = rect.x + px;
  *y = rect.y + py;
  *height = rect.height;
  *width = rect.width;
}
static gint
etcta_get_n_children (AtkObject *accessible)
{
	ETableClickToAdd * etcta;

	etcta = E_TABLE_CLICK_TO_ADD (
		atk_gobject_accessible_get_object (
		ATK_GOBJECT_ACCESSIBLE (accessible)));

	return (etcta->rect || etcta->row) ? 1 : 0;
}
Exemple #25
0
static void
goo_canvas_item_accessible_get_extents (AtkComponent *component,
					gint         *x,
					gint         *y,
					gint         *width,
					gint         *height,
					AtkCoordType  coord_type)
{
  GooCanvasItem *item;
  GooCanvas *canvas;
  GObject *object;
  gint window_x, window_y;
  gint toplevel_x, toplevel_y;
  GdkRectangle rect;
  GdkWindow *window;

  g_return_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component));

  *x = *y = G_MININT;

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component));
  if (!object)
    return;

  item = GOO_CANVAS_ITEM (object);

  canvas = goo_canvas_item_get_canvas (item);
  if (!canvas || !GTK_WIDGET (canvas)->window)
    return;

  goo_canvas_item_accessible_get_item_extents (item, &rect);
  *width = rect.width;
  *height = rect.height;

  if (!goo_canvas_item_accessible_is_item_in_window (item, &rect))
    return;

  gdk_window_get_origin (GTK_WIDGET (canvas)->window,
			 &window_x, &window_y);
  *x = rect.x + window_x;
  *y = rect.y + window_y;

  if (coord_type == ATK_XY_WINDOW)
    {
      window = gdk_window_get_toplevel (GTK_WIDGET (canvas)->window);
      gdk_window_get_origin (window, &toplevel_x, &toplevel_y);
      *x -= toplevel_x;
      *y -= toplevel_y;
    }
}
static const gchar *
etcta_get_name (AtkObject *obj)
{
	ETableClickToAdd * etcta;

	g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (obj), NULL);

	etcta = E_TABLE_CLICK_TO_ADD (
		atk_gobject_accessible_get_object (
		ATK_GOBJECT_ACCESSIBLE (obj)));
	if (etcta && etcta->message != NULL)
		return etcta->message;

	return _("click to add");
}
Exemple #27
0
static gint
goo_canvas_item_accessible_get_n_children (AtkObject *accessible)
{
  GooCanvasItem *item;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), 0);

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
  if (object == NULL)
    return 0;

  item = GOO_CANVAS_ITEM (object);

  return goo_canvas_item_get_n_children (item);
}
Exemple #28
0
static gint 
goo_canvas_widget_accessible_get_n_children (AtkObject *accessible)
{
  GooCanvasWidget *witem;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_WIDGET_ACCESSIBLE (accessible), 0);

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
  if (object == NULL)
    return 0;

  witem = GOO_CANVAS_WIDGET (object);

  return witem->widget ? 1 : 0;
}
Exemple #29
0
static void
atk_gobject_accessible_dispose (gpointer  data)
{
  GObject *object;

  g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (data));

  object = atk_gobject_accessible_get_object (data);
  if (object)
      g_object_set_qdata (object, quark_accessible_object, NULL);

  g_object_set_qdata (G_OBJECT (data), quark_object, NULL);
  atk_object_notify_state_change (ATK_OBJECT (data), ATK_STATE_DEFUNCT,
                                  TRUE); 
  g_object_unref (data);
}
static gint
ea_day_view_main_item_get_index_in_parent (AtkObject *accessible)
{
	AtkGObjectAccessible *atk_gobj;
	GObject *g_obj;

	g_return_val_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (accessible), -1);

	atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
	g_obj = atk_gobject_accessible_get_object (atk_gobj);
	if (!g_obj)
		return -1;

	/* always the first child of ea-day-view */
	return 0;
}