widget: Remove gtk_widget_get_path()
authorBenjamin Otte <otte@redhat.com>
Tue, 21 Jan 2020 02:05:38 +0000 (03:05 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 21 Jan 2020 11:47:16 +0000 (12:47 +0100)
docs/reference/gtk/gtk4-sections.txt
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwidgetprivate.h

index c36a4a2b549d5a1403f3797ea402ebe2ea7a3580..7e5cf044217c117888b3ff0a1bb0a4b2897457cc 100644 (file)
@@ -4411,7 +4411,6 @@ gtk_widget_get_layout_manager
 gtk_widget_should_layout
 
 <SUBSECTION>
-gtk_widget_get_path
 gtk_widget_get_style_context
 gtk_widget_reset_style
 gtk_widget_class_get_css_name
index 9f37c854f27f470eda85ba1bdd99a23aac6412d6..fb3cbec94a8ec2c1f96180a28469b45b29b3c21f 100644 (file)
@@ -592,7 +592,6 @@ static void gtk_widget_get_property          (GObject           *object,
                                                  guint              prop_id,
                                                  GValue            *value,
                                                  GParamSpec        *pspec);
-static void    gtk_widget_constructed           (GObject           *object);
 static void    gtk_widget_dispose               (GObject           *object);
 static void    gtk_widget_real_destroy          (GtkWidget         *object);
 static void    gtk_widget_finalize              (GObject           *object);
@@ -718,7 +717,6 @@ static GQuark               quark_mnemonic_labels = 0;
 static GQuark          quark_tooltip_markup = 0;
 static GQuark           quark_size_groups = 0;
 static GQuark           quark_auto_children = 0;
-static GQuark           quark_widget_path = 0;
 static GQuark           quark_action_muxer = 0;
 static GQuark           quark_font_options = 0;
 static GQuark           quark_font_map = 0;
@@ -876,12 +874,10 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   quark_tooltip_markup = g_quark_from_static_string ("gtk-tooltip-markup");
   quark_size_groups = g_quark_from_static_string ("gtk-widget-size-groups");
   quark_auto_children = g_quark_from_static_string ("gtk-widget-auto-children");
-  quark_widget_path = g_quark_from_static_string ("gtk-widget-path");
   quark_action_muxer = g_quark_from_static_string ("gtk-widget-action-muxer");
   quark_font_options = g_quark_from_static_string ("gtk-widget-font-options");
   quark_font_map = g_quark_from_static_string ("gtk-widget-font-map");
 
-  gobject_class->constructed = gtk_widget_constructed;
   gobject_class->dispose = gtk_widget_dispose;
   gobject_class->finalize = gtk_widget_finalize;
   gobject_class->set_property = gtk_widget_set_property;
@@ -7461,24 +7457,6 @@ gtk_widget_get_default_direction (void)
   return gtk_default_direction;
 }
 
-static void
-gtk_widget_constructed (GObject *object)
-{
-  GtkWidget *widget = GTK_WIDGET (object);
-  GtkWidgetPath *path;
-
-  /* As strange as it may seem, this may happen on object construction.
-   * init() implementations of parent types may eventually call this function,
-   * each with its corresponding GType, which could leave a child
-   * implementation with a wrong widget type in the widget path
-   */
-  path = (GtkWidgetPath*)g_object_get_qdata (object, quark_widget_path);
-  if (path && G_OBJECT_TYPE (widget) != gtk_widget_path_get_object_type (path))
-    g_object_set_qdata (object, quark_widget_path, NULL);
-
-  G_OBJECT_CLASS (gtk_widget_parent_class)->constructed (object);
-}
-
 static void
 gtk_widget_dispose (GObject *object)
 {
@@ -7700,8 +7678,6 @@ gtk_widget_finalize (GObject *object)
   g_clear_pointer (&priv->transform, gsk_transform_unref);
   g_clear_pointer (&priv->allocated_transform, gsk_transform_unref);
 
-  gtk_widget_clear_path (widget);
-
   gtk_css_widget_node_widget_destroyed (GTK_CSS_WIDGET_NODE (priv->cssnode));
   g_object_unref (priv->cssnode);
 
@@ -11242,77 +11218,6 @@ gtk_widget_path_append_for_widget (GtkWidgetPath *path,
   return pos;
 }
 
-GtkWidgetPath *
-_gtk_widget_create_path (GtkWidget *widget)
-{
-  GtkWidget *parent = _gtk_widget_get_parent (widget);
-
-  if (parent)
-    {
-      GtkWidgetPath *path = _gtk_widget_create_path (parent);
-      gtk_widget_path_append_for_widget (path, widget);
-      return path;
-    }
-  else
-    {
-      /* Widget is either toplevel or unparented, treat both
-       * as toplevels style wise, since there are situations
-       * where style properties might be retrieved on that
-       * situation.
-       */
-      GtkWidget *attach_widget = NULL;
-      GtkWidgetPath *result;
-
-      if (GTK_IS_WINDOW (widget))
-        attach_widget = gtk_window_get_attached_to (GTK_WINDOW (widget));
-
-      if (attach_widget != NULL)
-        result = gtk_widget_path_copy (gtk_widget_get_path (attach_widget));
-      else
-        result = gtk_widget_path_new ();
-
-      gtk_widget_path_append_for_widget (result, widget);
-
-      return result;
-    }
-}
-
-/**
- * gtk_widget_get_path:
- * @widget: a #GtkWidget
- *
- * Returns the #GtkWidgetPath representing @widget, if the widget
- * is not connected to a toplevel widget, a partial path will be
- * created.
- *
- * Returns: (transfer none): The #GtkWidgetPath representing @widget
- **/
-GtkWidgetPath *
-gtk_widget_get_path (GtkWidget *widget)
-{
-  GtkWidgetPath *path;
-
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
-  path = (GtkWidgetPath*)g_object_get_qdata (G_OBJECT (widget), quark_widget_path);
-  if (!path)
-    {
-      path = _gtk_widget_create_path (widget);
-      g_object_set_qdata_full (G_OBJECT (widget),
-                               quark_widget_path,
-                               path,
-                               (GDestroyNotify)gtk_widget_path_free);
-    }
-
-  return path;
-}
-
-void
-gtk_widget_clear_path (GtkWidget *widget)
-{
-  g_object_set_qdata (G_OBJECT (widget), quark_widget_path, NULL);
-}
-
 /**
  * gtk_widget_class_set_css_name:
  * @widget_class: class to set the name on
index fc1221fc81167c857635b3a1f816b2954ee1024c..1719f59487bd0019ebafc019d4a032e34db83637 100644 (file)
@@ -764,9 +764,6 @@ gboolean     gtk_widget_in_destruction (GtkWidget *widget);
 GDK_AVAILABLE_IN_ALL
 GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
 
-GDK_AVAILABLE_IN_ALL
-GtkWidgetPath *   gtk_widget_get_path (GtkWidget *widget);
-
 GDK_AVAILABLE_IN_ALL
 void              gtk_widget_class_set_css_name (GtkWidgetClass *widget_class,
                                                  const char     *name);
index a9c22331699cb09a2b6128983a0ec9791af51044..415b75e7f59ff29e401f197ad6dd03fce43df7db 100644 (file)
@@ -278,8 +278,6 @@ GtkStyleContext * _gtk_widget_peek_style_context           (GtkWidget *widget);
 gboolean          _gtk_widget_captured_event               (GtkWidget *widget,
                                                             GdkEvent  *event);
 
-GtkWidgetPath *   _gtk_widget_create_path                  (GtkWidget    *widget);
-void              gtk_widget_clear_path                    (GtkWidget    *widget);
 void              _gtk_widget_style_context_invalidated    (GtkWidget    *widget);
 
 void              _gtk_widget_update_parent_muxer          (GtkWidget    *widget);