From c5f7672ee1404f899a98770cd01ff9f970690d56 Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Thu, 15 Oct 2026 11:30:51 +0200 Subject: [PATCH] gail, iconview: use atk_component_get_extents() From the warning-cleanups branch. --- gtk/gtkiconview.c | 4 ++-- modules/other/gail/gailbutton.c | 2 +- modules/other/gail/gailimage.c | 2 +- modules/other/gail/gailimagecell.c | 2 +- modules/other/gail/gailnotebookpage.c | 2 +- modules/other/gail/gailpixmap.c | 2 +- modules/other/gail/libgail-util/gailmisc.c | 2 +- modules/other/gail/tests/ferret.c | 6 +++--- modules/other/gail/tests/testcomponent.c | 5 ++++- modules/other/gail/tests/testpaned.c | 2 +- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 78e415478..c6a97d4e5 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -8065,7 +8065,7 @@ gtk_icon_view_item_accessible_image_get_image_position (AtkImage *image, if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT)) return; - atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type); + atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL, coord_type); if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box)) { @@ -8749,7 +8749,7 @@ gtk_icon_view_item_accessible_get_extents (AtkComponent *component, if (gtk_icon_view_item_accessible_is_showing (item)) { parent_obj = gtk_widget_get_accessible (item->widget); - atk_component_get_position (ATK_COMPONENT (parent_obj), &l_x, &l_y, coord_type); + atk_component_get_extents (ATK_COMPONENT (parent_obj), &l_x, &l_y, NULL, NULL, coord_type); *x = l_x + item->item->x; *y = l_y + item->item->y; } diff --git a/modules/other/gail/gailbutton.c b/modules/other/gail/gailbutton.c index 6ecf9cd74..495efce1b 100644 --- a/modules/other/gail/gailbutton.c +++ b/modules/other/gail/gailbutton.c @@ -1021,7 +1021,7 @@ gail_button_get_image_position (AtkImage *image, if (button_image != NULL) { obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); - atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type); + atk_component_get_extents (ATK_COMPONENT (obj), x, y, NULL, NULL, coord_type); } else { diff --git a/modules/other/gail/gailimage.c b/modules/other/gail/gailimage.c index 0a33cd1ec..968b1d464 100644 --- a/modules/other/gail/gailimage.c +++ b/modules/other/gail/gailimage.c @@ -179,7 +179,7 @@ gail_image_get_image_position (AtkImage *image, gint *y, AtkCoordType coord_type) { - atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type); + atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL, coord_type); } static void diff --git a/modules/other/gail/gailimagecell.c b/modules/other/gail/gailimagecell.c index efcded036..5860b723f 100644 --- a/modules/other/gail/gailimagecell.c +++ b/modules/other/gail/gailimagecell.c @@ -150,7 +150,7 @@ gail_image_cell_get_image_position (AtkImage *image, gint *y, AtkCoordType coord_type) { - atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type); + atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL, coord_type); } static void diff --git a/modules/other/gail/gailnotebookpage.c b/modules/other/gail/gailnotebookpage.c index 444ddac0e..cd4e18d7d 100644 --- a/modules/other/gail/gailnotebookpage.c +++ b/modules/other/gail/gailnotebookpage.c @@ -467,7 +467,7 @@ gail_notebook_page_get_extents (AtkComponent *component, 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); + atk_component_get_extents (ATK_COMPONENT (child), x, y, NULL, NULL, coord_type); g_object_unref (child); } else diff --git a/modules/other/gail/gailpixmap.c b/modules/other/gail/gailpixmap.c index b8ab4b3da..4f44f93be 100644 --- a/modules/other/gail/gailpixmap.c +++ b/modules/other/gail/gailpixmap.c @@ -103,7 +103,7 @@ gail_pixmap_get_image_position (AtkImage *obj, gint *y, AtkCoordType coord_type) { - atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type); + atk_component_get_extents (ATK_COMPONENT (obj), x, y, NULL, NULL, coord_type); } static void diff --git a/modules/other/gail/libgail-util/gailmisc.c b/modules/other/gail/libgail-util/gailmisc.c index 9dc143d07..8213c716a 100644 --- a/modules/other/gail/libgail-util/gailmisc.c +++ b/modules/other/gail/libgail-util/gailmisc.c @@ -251,7 +251,7 @@ gail_misc_layout_get_run_attributes (AtkAttributeSet *attrib_set, if ((pango_string = (PangoAttrString*) pango_attr_iterator_get (iter, PANGO_ATTR_FAMILY)) != NULL) { - value = g_strdup_printf("%s", pango_string->value); + value = g_strdup (pango_string->value); attrib_set = gail_misc_add_attribute (attrib_set, ATK_TEXT_ATTR_FAMILY_NAME, value); diff --git a/modules/other/gail/tests/ferret.c b/modules/other/gail/tests/ferret.c index 39eaef441..d3c9170d0 100644 --- a/modules/other/gail/tests/ferret.c +++ b/modules/other/gail/tests/ferret.c @@ -1514,9 +1514,9 @@ _button_watcher (GSignalInvocationHint *ihint, event = (GdkEventButton *) gp; aobject = gtk_widget_get_accessible (widget); aobject_x = aobject_y = 0; - atk_component_get_position (ATK_COMPONENT (aobject), - &aobject_x, &aobject_y, - ATK_XY_WINDOW); + atk_component_get_extents (ATK_COMPONENT (aobject), + &aobject_x, &aobject_y, NULL, NULL, + ATK_XY_WINDOW); x = aobject_x + (gint) event->x; y = aobject_y + (gint) event->y; child = atk_component_ref_accessible_at_point (ATK_COMPONENT (aobject), diff --git a/modules/other/gail/tests/testcomponent.c b/modules/other/gail/tests/testcomponent.c index a28eccebd..5efbb2c87 100644 --- a/modules/other/gail/tests/testcomponent.c +++ b/modules/other/gail/tests/testcomponent.c @@ -16,8 +16,11 @@ static void _check_position (AtkObject *obj) return; atk_component_get_extents (ATK_COMPONENT(obj), &x, &y, &width, &height, ATK_XY_SCREEN); + /* compares the deprecated calls with get_extents on purpose */ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS atk_component_get_position (ATK_COMPONENT(obj), &x1, &y1, ATK_XY_SCREEN ); atk_component_get_size (ATK_COMPONENT(obj), &width1, &height1); + G_GNUC_END_IGNORE_DEPRECATIONS if ((x1 != x) || (y1 != y)) { g_print ("atk_component_get_extents and atk_get_position give different" @@ -29,7 +32,7 @@ static void _check_position (AtkObject *obj) " values: %d,%d %d,%d\n", width, height, width1, height1); } - atk_component_get_position (ATK_COMPONENT(obj), &x1, &y1, ATK_XY_SCREEN); + atk_component_get_extents (ATK_COMPONENT(obj), &x1, &y1, NULL, NULL, ATK_XY_SCREEN); g_print ("Object Type: %s\n", g_type_name (G_OBJECT_TYPE (obj))); g_print ("Object at %d, %d on screen\n", x1, y1); g_print ("Object at %d, %d, size: %d, %d\n", x, y, width, height); diff --git a/modules/other/gail/tests/testpaned.c b/modules/other/gail/tests/testpaned.c index 7e1f27f1c..d680689ee 100644 --- a/modules/other/gail/tests/testpaned.c +++ b/modules/other/gail/tests/testpaned.c @@ -69,7 +69,7 @@ static gint _test_paned (gpointer data) last_position = position; position *= 2; g_value_set_int (value, position); - gail_test_value_set_current_value (ATK_VALUE (obj), value); + (void) gail_test_value_set_current_value (ATK_VALUE (obj), value); times++; } if (times < 4)