[gtksourceview/wip/gutter: 8/9] Deprecate gtk_source_gutter_get_window()



commit ee0b1385733dd86aa2f326e9224443ea724b54f9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Sep 4 15:28:42 2013 +0200

    Deprecate gtk_source_gutter_get_window()
    
    It's a small convenience function, used nowhere in gedit or
    gedit-plugins. All the information is available from the outside for
    reimplementing the function.

 gtksourceview/gtksourcegutter.c |   19 ++++++++++++-------
 gtksourceview/gtksourcegutter.h |    1 +
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index c247993..ae39797 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -638,6 +638,13 @@ gtk_source_gutter_new (GtkSourceView     *view,
                             NULL);
 }
 
+static GdkWindow *
+get_window (GtkSourceGutter *gutter)
+{
+       return gtk_text_view_get_window (GTK_TEXT_VIEW (gutter->priv->view),
+                                        gutter->priv->window_type);
+}
+
 /* Public API */
 
 /**
@@ -651,17 +658,15 @@ gtk_source_gutter_new (GtkSourceView     *view,
  * if the gutter has no window.
  *
  * Since: 2.8
+ * Deprecated: 3.12: Use gtk_text_view_get_window() instead.
  */
-/* Note: this function should maybe be private. It is not really useful, and it
- * is used nowhere in gedit. */
 GdkWindow *
 gtk_source_gutter_get_window (GtkSourceGutter *gutter)
 {
        g_return_val_if_fail (GTK_SOURCE_IS_GUTTER (gutter), NULL);
        g_return_val_if_fail (gutter->priv->view != NULL, NULL);
 
-       return gtk_text_view_get_window (GTK_TEXT_VIEW (gutter->priv->view),
-                                        gutter->priv->window_type);
+       return get_window (gutter);
 }
 
 /**
@@ -949,7 +954,7 @@ on_view_draw (GtkSourceView   *view,
        GdkDeviceManager *device_manager;
        GdkDevice *pointer;
 
-       window = gtk_source_gutter_get_window (gutter);
+       window = get_window (gutter);
 
        if (window == NULL || !gtk_cairo_should_draw_window (cr, window))
        {
@@ -1383,7 +1388,7 @@ redraw_for_window (GtkSourceGutter *gutter,
        gboolean redraw;
        gint start;
 
-       if (event->window != gtk_source_gutter_get_window (gutter) && act_on_window)
+       if (event->window != get_window (gutter) && act_on_window)
        {
                return FALSE;
        }
@@ -1484,7 +1489,7 @@ on_view_button_press_event (GtkSourceView    *view,
        gint start = -1;
        GdkRectangle rect;
 
-       if (event->window != gtk_source_gutter_get_window (gutter))
+       if (event->window != get_window (gutter))
        {
                return FALSE;
        }
diff --git a/gtksourceview/gtksourcegutter.h b/gtksourceview/gtksourcegutter.h
index 9a183a4..b057b5f 100644
--- a/gtksourceview/gtksourcegutter.h
+++ b/gtksourceview/gtksourcegutter.h
@@ -52,6 +52,7 @@ struct _GtkSourceGutterClass
 
 GType gtk_source_gutter_get_type               (void) G_GNUC_CONST;
 
+G_DEPRECATED_FOR (gtk_text_view_get_window)
 GdkWindow *gtk_source_gutter_get_window        (GtkSourceGutter         *gutter);
 
 gboolean gtk_source_gutter_insert               (GtkSourceGutter         *gutter,


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