[gtk+] textdisplay: Remove widgets parameter from gtk_text_layout_draw



commit 4a03e86d4fb05a0cc2d70d03aa02b799dab03af6
Author: Timm Bäder <mail baedert org>
Date:   Sun Oct 8 10:49:28 2017 +0200

    textdisplay: Remove widgets parameter from gtk_text_layout_draw
    
    All calls in gtk+ were passing NULL anyway.

 gtk/gtktextdisplay.c |   18 +++---------------
 gtk/gtktextdisplay.h |    4 +---
 gtk/gtktextutil.c    |    2 +-
 gtk/gtktextview.c    |    3 +--
 4 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index c6e28e4..8c10096 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -504,11 +504,10 @@ text_renderer_begin (GtkTextRenderer *text_renderer,
 
 /* Returns a GSList of (referenced) widgets encountered while drawing.
  */
-static GList *
+static void
 text_renderer_end (GtkTextRenderer *text_renderer)
 {
   GtkStyleContext *context;
-  GList *widgets = text_renderer->widgets;
 
   cairo_restore (text_renderer->cr);
 
@@ -519,15 +518,11 @@ text_renderer_end (GtkTextRenderer *text_renderer)
   text_renderer->widget = NULL;
   text_renderer->cr = NULL;
 
-  text_renderer->widgets = NULL;
-
   if (text_renderer->error_color)
     {
       gdk_rgba_free (text_renderer->error_color);
       text_renderer->error_color = NULL;
     }
-
-  return widgets;
 }
 
 static cairo_region_t *
@@ -818,8 +813,7 @@ get_text_renderer (void)
 void
 gtk_text_layout_draw (GtkTextLayout *layout,
                       GtkWidget *widget,
-                      cairo_t *cr,
-                      GList **widgets)
+                      cairo_t *cr)
 {
   GtkStyleContext *context;
   gint offset_y;
@@ -828,7 +822,6 @@ gtk_text_layout_draw (GtkTextLayout *layout,
   gboolean have_selection;
   GSList *line_list;
   GSList *tmp_list;
-  GList *tmp_widgets;
   GdkRectangle clip;
 
   g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
@@ -932,12 +925,7 @@ gtk_text_layout_draw (GtkTextLayout *layout,
     }
 
   gtk_text_layout_wrap_loop_end (layout);
-
-  tmp_widgets = text_renderer_end (text_renderer);
-  if (widgets)
-    *widgets = tmp_widgets;
-  else
-    g_list_free_full (tmp_widgets, g_object_unref);
+  text_renderer_end (text_renderer);
 
   g_slist_free (line_list);
 }
diff --git a/gtk/gtktextdisplay.h b/gtk/gtktextdisplay.h
index 63c0897..93296e5 100644
--- a/gtk/gtktextdisplay.h
+++ b/gtk/gtktextdisplay.h
@@ -88,13 +88,11 @@ G_BEGIN_DECLS
  * widget            - Widget to grab some style info from
  * cr                - Context to render to, matrix set so that (0, 0)
  *                     is the top left of the layout
- * widgets           - list of widgets that need exposing
  */
 GDK_AVAILABLE_IN_ALL
 void gtk_text_layout_draw (GtkTextLayout        *layout,
                            GtkWidget            *widget,
-                           cairo_t              *cr,
-                           GList               **widgets);
+                           cairo_t              *cr);
 
 
 G_END_DECLS
diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c
index e4452db..c10c2ef 100644
--- a/gtk/gtktextutil.c
+++ b/gtk/gtktextutil.c
@@ -350,7 +350,7 @@ _gtk_text_util_create_rich_drag_icon (GtkWidget     *widget,
 
   cr = cairo_create (surface);
 
-  gtk_text_layout_draw (layout, widget, cr, NULL);
+  gtk_text_layout_draw (layout, widget, cr);
 
   cairo_destroy (cr);
   g_object_unref (layout);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 023e5e5..64c4cfd 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5804,8 +5804,7 @@ gtk_text_view_paint (GtkWidget      *widget,
 
   gtk_text_layout_draw (priv->layout,
                         widget,
-                        cr,
-                        NULL);
+                        cr);
 
   cairo_restore (cr);
 }


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