[gtk/kill-register-surface: 10/10] Remove gdk_surface_set_user_data



commit 45c5b5c26813527d5d30e253919a33eca1634cb8
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 23 18:56:02 2019 -0500

    Remove gdk_surface_set_user_data
    
    GTK is no longer using gdk_surface_get/set_user_data.
    Also remove an unused associated function.

 docs/reference/gdk/gdk4-sections.txt |  3 --
 gdk/gdkinternals.h                   |  2 -
 gdk/gdksurface.c                     | 82 ------------------------------------
 gdk/gdksurface.h                     |  9 ----
 4 files changed, 96 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 80fa982dcd..75824dfef8 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -240,7 +240,6 @@ gdk_surface_thaw_updates
 gdk_surface_get_frame_clock
 
 <SUBSECTION>
-gdk_surface_set_user_data
 gdk_surface_set_accept_focus
 gdk_surface_get_accept_focus
 gdk_surface_set_focus_on_map
@@ -252,7 +251,6 @@ gdk_surface_set_title
 GDK_PARENT_RELATIVE
 gdk_surface_set_cursor
 gdk_surface_get_cursor
-gdk_surface_get_user_data
 gdk_surface_get_geometry
 gdk_surface_set_geometry_hints
 gdk_surface_get_width
@@ -278,7 +276,6 @@ GdkModifierIntent
 gdk_surface_get_parent
 gdk_surface_get_toplevel
 gdk_surface_get_children
-gdk_surface_get_children_with_user_data
 gdk_surface_peek_children
 gdk_surface_set_icon_name
 gdk_surface_set_transient_for
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 30429e931a..7061232c1c 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -145,8 +145,6 @@ struct _GdkSurface
   GdkSurface *parent;
   GdkSurface *transient_for;
 
-  gpointer user_data;
-
   gint x;
   gint y;
 
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 7f9af6fa8f..6eb514c773 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1042,45 +1042,6 @@ gdk_surface_destroy (GdkSurface *surface)
   g_object_unref (surface);
 }
 
-/**
- * gdk_surface_set_user_data:
- * @surface: a #GdkSurface
- * @user_data: (allow-none) (type GObject.Object): user data
- *
- * For most purposes this function is deprecated in favor of
- * g_object_set_data(). However, for historical reasons GTK+ stores
- * the #GtkWidget that owns a #GdkSurface as user data on the
- * #GdkSurface. So, custom widget implementations should use
- * this function for that. If GTK+ receives an event for a #GdkSurface,
- * and the user data for the surface is non-%NULL, GTK+ will assume the
- * user data is a #GtkWidget, and forward the event to that widget.
- *
- **/
-void
-gdk_surface_set_user_data (GdkSurface *surface,
-                           gpointer   user_data)
-{
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-
-  surface->user_data = user_data;
-}
-
-/**
- * gdk_surface_get_user_data:
- * @surface: a #GdkSurface
- * @data: (out): return location for user data
- *
- * Retrieves the user data for @surface, which is normally the widget
- * that @surface belongs to. See gdk_surface_set_user_data().
- *
- **/
-void
-gdk_surface_get_user_data (GdkSurface *surface,
-                           gpointer  *data)
-{
-  *data = surface->user_data;
-}
-
 /**
  * gdk_surface_get_surface_type:
  * @surface: a #GdkSurface
@@ -1265,49 +1226,6 @@ gdk_surface_peek_children (GdkSurface *surface)
   return surface->children;
 }
 
-
-/**
- * gdk_surface_get_children_with_user_data:
- * @surface: a #GdkSurface
- * @user_data: user data to look for
- *
- * Gets the list of children of @surface known to GDK with a
- * particular @user_data set on it.
- *
- * The returned list must be freed, but the elements in the
- * list need not be.
- *
- * The list is returned in (relative) stacking order, i.e. the
- * lowest surface is first.
- *
- * Returns: (transfer container) (element-type GdkSurface):
- *     list of child surfaces inside @surface
- **/
-GList *
-gdk_surface_get_children_with_user_data (GdkSurface *surface,
-                                         gpointer   user_data)
-{
-  GdkSurface *child;
-  GList *res, *l;
-
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-
-  if (GDK_SURFACE_DESTROYED (surface))
-    return NULL;
-
-  res = NULL;
-  for (l = surface->children; l != NULL; l = l->next)
-    {
-      child = l->data;
-
-      if (child->user_data == user_data)
-        res = g_list_prepend (res, child);
-    }
-
-  return res;
-}
-
-
 /**
  * gdk_surface_is_visible:
  * @surface: a #GdkSurface
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 972c8a5fc9..9a87ab0bc4 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -491,9 +491,6 @@ GDK_AVAILABLE_IN_ALL
 void          gdk_surface_focus                 (GdkSurface     *surface,
                                                  guint32        timestamp);
 GDK_AVAILABLE_IN_ALL
-void          gdk_surface_set_user_data         (GdkSurface     *surface,
-                                                 gpointer       user_data);
-GDK_AVAILABLE_IN_ALL
 gboolean      gdk_surface_get_accept_focus      (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_set_accept_focus      (GdkSurface     *surface,
@@ -595,9 +592,6 @@ GDK_AVAILABLE_IN_ALL
 GdkCursor    *gdk_surface_get_device_cursor (GdkSurface     *surface,
                                              GdkDevice     *device);
 GDK_AVAILABLE_IN_ALL
-void          gdk_surface_get_user_data  (GdkSurface      *surface,
-                                          gpointer        *data);
-GDK_AVAILABLE_IN_ALL
 void          gdk_surface_get_geometry   (GdkSurface      *surface,
                                           gint            *x,
                                           gint            *y,
@@ -666,9 +660,6 @@ GDK_AVAILABLE_IN_ALL
 GList *       gdk_surface_get_children   (GdkSurface      *surface);
 GDK_AVAILABLE_IN_ALL
 GList *       gdk_surface_peek_children   (GdkSurface       *surface);
-GDK_AVAILABLE_IN_ALL
-GList *       gdk_surface_get_children_with_user_data (GdkSurface *surface,
-                                                       gpointer   user_data);
 
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_set_icon_list   (GdkSurface       *surface,


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