From 4d7dfb08c9a25d5c82fb1d55af2b689f437b0215 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Wed, 13 Dec 2023 12:46:19 +0100 Subject: [PATCH] cally: Remove useless cally_actor_get_top_level_origin Does nothing... Part-of: --- clutter/clutter/cally/cally-actor-private.h | 4 --- clutter/clutter/cally/cally-actor.c | 36 --------------------- clutter/clutter/cally/cally-text.c | 19 ++--------- 3 files changed, 2 insertions(+), 57 deletions(-) diff --git a/clutter/clutter/cally/cally-actor-private.h b/clutter/clutter/cally/cally-actor-private.h index bd6c85a59..0de920e33 100644 --- a/clutter/clutter/cally/cally-actor-private.h +++ b/clutter/clutter/cally/cally-actor-private.h @@ -33,7 +33,3 @@ */ #define CALLY_GET_CLUTTER_ACTOR(cally_object) \ (CLUTTER_ACTOR (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (cally_object)))) - -void _cally_actor_get_top_level_origin (ClutterActor *actor, - gint *x, - gint *y); diff --git a/clutter/clutter/cally/cally-actor.c b/clutter/clutter/cally/cally-actor.c index 6b37ae90e..735268333 100644 --- a/clutter/clutter/cally/cally-actor.c +++ b/clutter/clutter/cally/cally-actor.c @@ -647,7 +647,6 @@ cally_actor_get_extents (AtkComponent *component, { CallyActor *cally_actor = NULL; ClutterActor *actor = NULL; - gint top_level_x, top_level_y; gfloat f_width, f_height; graphene_point3d_t verts[4]; ClutterActor *stage = NULL; @@ -673,22 +672,6 @@ cally_actor_get_extents (AtkComponent *component, *y = verts[0].y; *width = ceilf (f_width); *height = ceilf (f_height); - - /* In the ATK_XY_WINDOW case, we consider the stage as the - * "top-level-window" - * - * http://library.gnome.org/devel/atk/stable/AtkUtil.html#AtkCoordType - */ - - if (coord_type == ATK_XY_SCREEN) - { - _cally_actor_get_top_level_origin (actor, &top_level_x, &top_level_y); - - *x += top_level_x; - *y += top_level_y; - } - - return; } static gint @@ -725,25 +708,6 @@ cally_actor_grab_focus (AtkComponent *component) return TRUE; } -/* - * - * This gets the top level origin, it is, the position of the stage in - * the global screen. You can see it as the absolute display position - * of the stage. This is 0,0 for a compositor. - */ -void -_cally_actor_get_top_level_origin (ClutterActor *actor, - gint *xp, - gint *yp) -{ - /* default values */ - if (xp) - *xp = 0; - - if (yp) - *yp = 0; -} - /* AtkAction implementation */ static void cally_actor_action_interface_init (AtkActionIface *iface) diff --git a/clutter/clutter/cally/cally-text.c b/clutter/clutter/cally/cally-text.c index 57775f111..1edb86c05 100644 --- a/clutter/clutter/cally/cally-text.c +++ b/clutter/clutter/cally/cally-text.c @@ -1423,7 +1423,7 @@ static void cally_text_get_character_extents (AtkText *text, ClutterActor *actor = NULL; ClutterText *clutter_text = NULL; gint x = 0, y = 0, width = 0, height = 0; - gint index, x_window, y_window, x_toplevel, y_toplevel; + gint index, x_window, y_window; gint x_layout, y_layout; PangoLayout *layout; PangoRectangle extents; @@ -1460,13 +1460,6 @@ static void cally_text_get_character_extents (AtkText *text, width = extents.width / PANGO_SCALE; height = extents.height / PANGO_SCALE; - if (coords == ATK_XY_SCREEN) - { - _cally_actor_get_top_level_origin (actor, &x_toplevel, &y_toplevel); - x += x_toplevel; - y += y_toplevel; - } - done: if (widthp) *widthp = width; @@ -2281,7 +2274,7 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text, gint y, AtkCoordType coords) { - gint index, x_window, y_window, x_toplevel, y_toplevel; + gint index, x_window, y_window; gint x_temp, y_temp; gboolean ret; graphene_point3d_t verts[4]; @@ -2297,14 +2290,6 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text, x_temp = x - x_layout - x_window; y_temp = y - y_layout - y_window; - if (coords == ATK_XY_SCREEN) - { - _cally_actor_get_top_level_origin (CLUTTER_ACTOR (clutter_text), &x_toplevel, - &y_toplevel); - x_temp -= x_toplevel; - y_temp -= y_toplevel; - } - layout = clutter_text_get_layout (clutter_text); ret = pango_layout_xy_to_index (layout, x_temp * PANGO_SCALE,