[gtk/wip/chergert/textview-widgets: 23/23] textview: revert renaming of buffer_to_surface_coords()



commit daa29881b0af38e981765de54685bea85038964e
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 26 11:45:58 2019 -0700

    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.

 gtk/a11y/gtktextviewaccessible.c |  2 +-
 gtk/gtktextview.c                | 28 ++++++++++++++--------------
 gtk/gtktextview.h                | 12 ++++++------
 3 files changed, 21 insertions(+), 21 deletions(-)
---
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 94175c0fc7..5cc9931ebe 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -2010,7 +2010,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
@@ -2113,7 +2113,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
@@ -2138,7 +2138,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,
@@ -2788,7 +2788,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,
@@ -4896,7 +4896,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 *
@@ -8923,12 +8923,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);
         }
@@ -9364,7 +9364,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
@@ -9379,7 +9379,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,
@@ -10046,7 +10046,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 9fe349b9a2..5684f94c76 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]