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 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); }
/* AtkComponet interface */ static AtkObject * ecv_ref_accessible_at_point (AtkComponent *component, gint x, gint y, AtkCoordType coord_type) { gint x0, y0, width, height; gint subcell_height, i; GalA11yECell *gaec = GAL_A11Y_E_CELL (component); ECellVboxView *ecvv = (ECellVboxView *) (gaec->cell_view); atk_component_get_extents (component, &x0, &y0, &width, &height, coord_type); x -= x0; y -= y0; if (x < 0 || x > width || y < 0 || y > height) return NULL; for (i = 0; i < ecvv->subcell_view_count; i++) { subcell_height = e_cell_height ( ecvv->subcell_views[i], ecvv->model_cols[i], gaec->view_col, gaec->row); if ( 0 <= y && y <= subcell_height) { return ecv_ref_child ((AtkObject *) component, i); } else y -= subcell_height; } return NULL; }
static void gail_notebook_page_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type) { AtkObject *atk_label; g_return_if_fail (GAIL_IS_NOTEBOOK_PAGE (component)); atk_label = _gail_notebook_page_get_tab_label (GAIL_NOTEBOOK_PAGE (component)); if (!atk_label) { AtkObject *child; *width = 0; *height = 0; child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0); gail_return_if_fail (child); atk_component_get_position (ATK_COMPONENT (child), x, y, coord_type); g_object_unref (child); } else { atk_component_get_extents (ATK_COMPONENT (atk_label), x, y, width, height, coord_type); } return; }
static VALUE rg_get_extents(VALUE self, VALUE coord_type) { gint x, y, width, height; atk_component_get_extents(_SELF(self), &x, &y, &width, &height, RVAL2GENUM(coord_type, ATK_TYPE_COORD_TYPE)); return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(width), INT2NUM(height)); }
static AtkObject* gucharmap_chartable_accessible_ref_accessible_at_point (AtkComponent *component, gint x, gint y, AtkCoordType coord_type) { GtkWidget *widget; GucharmapChartable *chartable; GucharmapChartablePrivate *chartable_priv; gint x_pos, y_pos; gint row, col; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component)); if (widget == NULL) /* State is defunct */ return NULL; chartable = GUCHARMAP_CHARTABLE (widget); chartable_priv = chartable->priv; atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type); /* Find cell at offset x - x_pos, y - y_pos */ x_pos = x - x_pos; y_pos = y - y_pos; for (col = 0; col < chartable_priv->cols; col++) { if (x_pos < _gucharmap_chartable_x_offset (chartable, col)) { col--; break; } } if (col == chartable_priv->cols || col < 0) return NULL; for (row = 0; row < chartable_priv->rows; row++) { if (y_pos < _gucharmap_chartable_y_offset (chartable, row)) { row--; break; } } if (row == chartable_priv->rows || row < 0) return NULL; row += chartable_priv->page_first_cell / chartable_priv->cols; return gucharmap_chartable_accessible_ref_at (ATK_TABLE (component), row, col); }
static void gucharmap_chartable_cell_accessible_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type) { GucharmapChartableCellAccessible *cell; AtkObject *cell_parent; GucharmapChartable *chartable; GucharmapChartablePrivate *chartable_priv; gint real_x, real_y, real_width, real_height; gint row, column; cell = GUCHARMAP_CHARTABLE_CELL_ACCESSIBLE (component); cell_parent = atk_object_get_parent (ATK_OBJECT (cell)); /* * Is the cell visible on the screen */ chartable = GUCHARMAP_CHARTABLE (cell->widget); chartable_priv = chartable->priv; if (cell->index >= chartable_priv->page_first_cell && cell->index < chartable_priv->page_first_cell + chartable_priv->rows * chartable_priv->cols) { atk_component_get_extents (ATK_COMPONENT (cell_parent), &real_x, &real_y, &real_width, &real_height, coord_type); row = (cell->index - chartable_priv->page_first_cell)/ chartable_priv->cols; column = _gucharmap_chartable_cell_column (chartable, cell->index); *x = real_x + _gucharmap_chartable_x_offset (chartable, column); *y = real_y + _gucharmap_chartable_y_offset (chartable, row); *width = _gucharmap_chartable_column_width (chartable, column); *height = _gucharmap_chartable_row_height (chartable, row); } else { *x = G_MININT; *y = G_MININT; } }
static DBusMessage * impl_GetExtents (DBusConnection * bus, DBusMessage * message, void *user_data) { AtkComponent *component = (AtkComponent *) user_data; DBusError error; dbus_uint32_t coord_type; gint ix, iy, iwidth, iheight; g_return_val_if_fail (ATK_IS_COMPONENT (user_data), droute_not_yet_handled_error (message)); dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } atk_component_get_extents (component, &ix, &iy, &iwidth, &iheight, (AtkCoordType) coord_type); return spi_dbus_return_rect (message, ix, iy, iwidth, iheight); }
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; } }
/* 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; }
static AtkObject* gtk_icon_view_accessible_ref_accessible_at_point (AtkComponent *component, gint x, gint y, AtkCoordType coord_type) { GtkWidget *widget; GtkIconView *icon_view; GtkIconViewItem *item; gint x_pos, y_pos; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component)); if (widget == NULL) return NULL; icon_view = GTK_ICON_VIEW (widget); atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type); item = _gtk_icon_view_get_item_at_coords (icon_view, x - x_pos, y - y_pos, TRUE, NULL); if (item) return gtk_icon_view_accessible_ref_child (ATK_OBJECT (component), item->index); return NULL; }