From 8373cc6c471f478dbf48fad7f5532e27f286c150 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 23 Sep 2019 16:08:53 -0700 Subject: [PATCH] textview: revert renaming of buffer_to_surface_coords() The renaming of this function doesn't make much since because the window is the GtkTextWindowType, not GdkWindow specifically. So we can keep the old name which is closer to the proper meaning and less code for consumers to change when porting to 4.x. --- docs/reference/gtk/gtk4-sections.txt | 2 +- gtk/a11y/gtktextviewaccessible.c | 2 +- gtk/gtktextview.c | 28 ++++++++++++++-------------- gtk/gtktextview.h | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index b454df5ca1..cfd069216b 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -3070,7 +3070,7 @@ gtk_text_view_get_line_at_y gtk_text_view_get_line_yrange gtk_text_view_get_iter_at_location gtk_text_view_get_iter_at_position -gtk_text_view_buffer_to_surface_coords +gtk_text_view_buffer_to_window_coords gtk_text_view_window_to_buffer_coords gtk_text_view_set_border_window_size gtk_text_view_get_border_window_size diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c index 67dce5bd0f..ba15122db0 100644 --- a/gtk/a11y/gtktextviewaccessible.c +++ b/gtk/a11y/gtktextviewaccessible.c @@ -513,7 +513,7 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, *height = rectangle.height; *width = rectangle.width; - gtk_text_view_buffer_to_surface_coords (view, GTK_TEXT_WINDOW_WIDGET, + gtk_text_view_buffer_to_window_coords (view, GTK_TEXT_WINDOW_WIDGET, rectangle.x, rectangle.y, x, y); if (coords != ATK_XY_WINDOW) { diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 7811fd79af..38e7e10356 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -2008,7 +2008,7 @@ gtk_text_view_get_buffer (GtkTextView *text_view) * cursor’s offset within the preedit sequence. * * The rectangle position is in buffer coordinates; use - * gtk_text_view_buffer_to_surface_coords() to convert these + * gtk_text_view_buffer_to_window_coords() to convert these * coordinates to coordinates for one of the windows in the text view. **/ void @@ -2111,7 +2111,7 @@ gtk_text_view_get_iter_at_position (GtkTextView *text_view, * * Gets a rectangle which roughly contains the character at @iter. * The rectangle position is in buffer coordinates; use - * gtk_text_view_buffer_to_surface_coords() to convert these + * gtk_text_view_buffer_to_window_coords() to convert these * coordinates to coordinates for one of the windows in the text view. **/ void @@ -2136,7 +2136,7 @@ gtk_text_view_get_iter_location (GtkTextView *text_view, * * Gets the y coordinate of the top of the line containing @iter, * and the height of the line. The coordinate is a buffer coordinate; - * convert to window coordinates with gtk_text_view_buffer_to_surface_coords(). + * convert to window coordinates with gtk_text_view_buffer_to_window_coords(). **/ void gtk_text_view_get_line_yrange (GtkTextView *text_view, @@ -2786,7 +2786,7 @@ gtk_text_view_move_mark_onscreen (GtkTextView *text_view, * * Fills @visible_rect with the currently-visible * region of the buffer, in buffer coordinates. Convert to window coordinates - * with gtk_text_view_buffer_to_surface_coords(). + * with gtk_text_view_buffer_to_window_coords(). **/ void gtk_text_view_get_visible_rect (GtkTextView *text_view, @@ -4764,7 +4764,7 @@ gtk_text_view_show_magnifier (GtkTextView *text_view, gtk_text_view_get_iter_location (text_view, iter, (GdkRectangle *) &rect); rect.x = x + priv->xoffset; - gtk_text_view_buffer_to_surface_coords (text_view, GTK_TEXT_WINDOW_TEXT, + gtk_text_view_buffer_to_window_coords (text_view, GTK_TEXT_WINDOW_TEXT, rect.x, rect.y, &rect.x, &rect.y); _text_window_to_widget_coords (text_view, &rect.x, &rect.y); req.height = rect.height * N_LINES * @@ -8791,12 +8791,12 @@ gtk_text_view_do_popup (GtkTextView *text_view, if (is_visible) { - gtk_text_view_buffer_to_surface_coords (text_view, - GTK_TEXT_WINDOW_WIDGET, - iter_location.x, - iter_location.y, - &iter_location.x, - &iter_location.y); + gtk_text_view_buffer_to_window_coords (text_view, + GTK_TEXT_WINDOW_WIDGET, + iter_location.x, + iter_location.y, + &iter_location.x, + &iter_location.y); gtk_popover_set_pointing_to (GTK_POPOVER (priv->popup_menu), &iter_location); } @@ -9213,7 +9213,7 @@ gtk_text_view_get_css_node (GtkTextView *text_view, } /** - * gtk_text_view_buffer_to_surface_coords: + * gtk_text_view_buffer_to_window_coords: * @text_view: a #GtkTextView * @win: a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE * @buffer_x: buffer x coordinate @@ -9228,7 +9228,7 @@ gtk_text_view_get_css_node (GtkTextView *text_view, * gtk_text_view_set_border_window_size()). **/ void -gtk_text_view_buffer_to_surface_coords (GtkTextView *text_view, +gtk_text_view_buffer_to_window_coords (GtkTextView *text_view, GtkTextWindowType win, gint buffer_x, gint buffer_y, @@ -10023,7 +10023,7 @@ gtk_text_view_insert_emoji (GtkTextView *text_view) gtk_text_buffer_get_insert (buffer)); gtk_text_view_get_iter_location (text_view, &iter, (GdkRectangle *) &rect); - gtk_text_view_buffer_to_surface_coords (text_view, GTK_TEXT_WINDOW_TEXT, + gtk_text_view_buffer_to_window_coords (text_view, GTK_TEXT_WINDOW_TEXT, rect.x, rect.y, &rect.x, &rect.y); _text_window_to_widget_coords (text_view, &rect.x, &rect.y); diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h index bf666f7b81..489b5ebf1f 100644 --- a/gtk/gtktextview.h +++ b/gtk/gtktextview.h @@ -266,12 +266,12 @@ void gtk_text_view_get_line_at_y (GtkTextView *text_view gint *line_top); GDK_AVAILABLE_IN_ALL -void gtk_text_view_buffer_to_surface_coords (GtkTextView *text_view, - GtkTextWindowType win, - gint buffer_x, - gint buffer_y, - gint *window_x, - gint *window_y); +void gtk_text_view_buffer_to_window_coords (GtkTextView *text_view, + GtkTextWindowType win, + gint buffer_x, + gint buffer_y, + gint *window_x, + gint *window_y); GDK_AVAILABLE_IN_ALL void gtk_text_view_window_to_buffer_coords (GtkTextView *text_view, GtkTextWindowType win, -- 2.30.2