[gtk/otte/for-master: 36/39] cssnode: Remove ability to set GType as fallback name



commit ff677c3054df209e824909d7e06a544ff8662ba5
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jan 23 02:22:30 2020 +0100

    cssnode: Remove ability to set GType as fallback name

 gtk/gtkcssnode.c        | 31 -------------------------------
 gtk/gtkcssnodeprivate.h |  3 ---
 gtk/gtkwidget.c         |  1 -
 3 files changed, 35 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 9c0c20c9c9..1b45366f38 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -110,7 +110,6 @@ enum {
   PROP_NAME,
   PROP_STATE,
   PROP_VISIBLE,
-  PROP_WIDGET_TYPE,
   NUM_PROPERTIES
 };
 
@@ -187,10 +186,6 @@ gtk_css_node_get_property (GObject    *object,
       g_value_set_boolean (value, gtk_css_node_get_visible (cssnode));
       break;
 
-    case PROP_WIDGET_TYPE:
-      g_value_set_gtype (value, gtk_css_node_get_widget_type (cssnode));
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -226,10 +221,6 @@ gtk_css_node_set_property (GObject      *object,
       gtk_css_node_set_visible (cssnode, g_value_get_boolean (value));
       break;
 
-    case PROP_WIDGET_TYPE:
-      gtk_css_node_set_widget_type (cssnode, g_value_get_gtype (value));
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -655,11 +646,6 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
                           TRUE,
                           G_PARAM_READWRITE
                           | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
-  cssnode_properties[PROP_WIDGET_TYPE] =
-    g_param_spec_gtype ("widget-type", P_("Widget type"), P_("GType of the widget"),
-                        G_TYPE_NONE,
-                        G_PARAM_READWRITE
-                        | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
 
   g_object_class_install_properties (object_class, NUM_PROPERTIES, cssnode_properties);
 
@@ -1121,23 +1107,6 @@ gtk_css_node_get_name (GtkCssNode *cssnode)
   return gtk_css_node_declaration_get_name (cssnode->decl);
 }
 
-void
-gtk_css_node_set_widget_type (GtkCssNode *cssnode,
-                              GType       widget_type)
-{
-  if (gtk_css_node_declaration_set_type (&cssnode->decl, widget_type))
-    {
-      gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_NAME);
-      g_object_notify_by_pspec (G_OBJECT (cssnode), cssnode_properties[PROP_WIDGET_TYPE]);
-    }
-}
-
-GType
-gtk_css_node_get_widget_type (GtkCssNode *cssnode)
-{
-  return gtk_css_node_declaration_get_type (cssnode->decl);
-}
-
 void
 gtk_css_node_set_id (GtkCssNode                *cssnode,
                      /* interned */ const char *id)
diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h
index 680189813f..ae8597c796 100644
--- a/gtk/gtkcssnodeprivate.h
+++ b/gtk/gtkcssnodeprivate.h
@@ -118,9 +118,6 @@ gboolean                gtk_css_node_get_visible        (GtkCssNode            *
 void                    gtk_css_node_set_name           (GtkCssNode            *cssnode,
                                                          /*interned*/const char*name);
 /*interned*/const char *gtk_css_node_get_name           (GtkCssNode            *cssnode) G_GNUC_PURE;
-void                    gtk_css_node_set_widget_type    (GtkCssNode            *cssnode,
-                                                         GType                  widget_type);
-GType                   gtk_css_node_get_widget_type    (GtkCssNode            *cssnode) G_GNUC_PURE;
 void                    gtk_css_node_set_id             (GtkCssNode            *cssnode,
                                                          /*interned*/const char*id);
 /*interned*/const char *gtk_css_node_get_id             (GtkCssNode            *cssnode) G_GNUC_PURE;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e1a3fe1a8e..44e70c3945 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2441,7 +2441,6 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
   gtk_css_node_set_visible (priv->cssnode, priv->visible);
   /* need to set correct name here, and only class has the correct type here */
   gtk_css_node_set_name (priv->cssnode, GTK_WIDGET_CLASS (g_class)->priv->css_name);
-  gtk_css_node_set_widget_type (priv->cssnode, G_TYPE_FROM_CLASS (g_class));
 
   if (g_type_is_a (G_TYPE_FROM_CLASS (g_class), GTK_TYPE_ROOT))
     priv->root = (GtkRoot *) widget;


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