[gtk+] API: container: Remove GtkContainer::child property



commit 1d4f23da8ed86dce0d0beecac39cb94ffe4652b8
Author: Benjamin Otte <otte redhat com>
Date:   Sun Oct 9 03:22:56 2016 +0200

    API: container: Remove GtkContainer::child property

 gtk/gtkcontainer.c     |   64 ------------------------------------------------
 tests/testgtk.c        |   17 ++++++------
 testsuite/gtk/object.c |    1 -
 3 files changed, 9 insertions(+), 73 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index f5396bd..59c3e72 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -294,14 +294,6 @@ enum {
   LAST_SIGNAL
 };
 
-enum {
-  PROP_0,
-  PROP_CHILD,
-  LAST_PROP
-};
-
-static GParamSpec *container_props[LAST_PROP];
-
 #define PARAM_SPEC_PARAM_ID(pspec)              ((pspec)->param_id)
 #define PARAM_SPEC_SET_PARAM_ID(pspec, id)      ((pspec)->param_id = (id))
 
@@ -312,14 +304,6 @@ static void     gtk_container_base_class_finalize  (GtkContainerClass *klass);
 static void     gtk_container_class_init           (GtkContainerClass *klass);
 static void     gtk_container_init                 (GtkContainer      *container);
 static void     gtk_container_destroy              (GtkWidget         *widget);
-static void     gtk_container_set_property         (GObject         *object,
-                                                    guint            prop_id,
-                                                    const GValue    *value,
-                                                    GParamSpec      *pspec);
-static void     gtk_container_get_property         (GObject         *object,
-                                                    guint            prop_id,
-                                                    GValue          *value,
-                                                    GParamSpec      *pspec);
 static void     gtk_container_add_unimplemented    (GtkContainer      *container,
                                                     GtkWidget         *widget);
 static void     gtk_container_remove_unimplemented (GtkContainer      *container,
@@ -478,9 +462,6 @@ gtk_container_class_init (GtkContainerClass *class)
   hadjustment_key_id = g_quark_from_static_string ("gtk-hadjustment");
   quark_focus_chain = g_quark_from_static_string ("gtk-container-focus-chain");
 
-  gobject_class->set_property = gtk_container_set_property;
-  gobject_class->get_property = gtk_container_get_property;
-
   widget_class->destroy = gtk_container_destroy;
   widget_class->compute_expand = gtk_container_compute_expand;
   widget_class->show_all = gtk_container_show_all;
@@ -499,15 +480,6 @@ gtk_container_class_init (GtkContainerClass *class)
   class->composite_name = gtk_container_child_default_composite_name;
   class->get_path_for_child = gtk_container_real_get_path_for_child;
 
-  container_props[PROP_CHILD] =
-      g_param_spec_object ("child",
-                           P_("Child"),
-                           P_("Can be used to add a new child to the container"),
-                           GTK_TYPE_WIDGET,
-                           GTK_PARAM_WRITABLE);
-
-  g_object_class_install_properties (gobject_class, LAST_PROP, container_props);
-
   container_signals[ADD] =
     g_signal_new (I_("add"),
                   G_OBJECT_CLASS_TYPE (gobject_class),
@@ -1656,42 +1628,6 @@ gtk_container_destroy (GtkWidget *widget)
   GTK_WIDGET_CLASS (parent_class)->destroy (widget);
 }
 
-static void
-gtk_container_set_property (GObject         *object,
-                            guint            prop_id,
-                            const GValue    *value,
-                            GParamSpec      *pspec)
-{
-  GtkContainer *container = GTK_CONTAINER (object);
-
-  switch (prop_id)
-    {
-    case PROP_CHILD:
-      gtk_container_add (container, GTK_WIDGET (g_value_get_object (value)));
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-gtk_container_get_property (GObject         *object,
-                            guint            prop_id,
-                            GValue          *value,
-                            GParamSpec      *pspec)
-{
-  //GtkContainer *container = GTK_CONTAINER (object);
-  //GtkContainerPrivate *priv = container->priv;
-
-  switch (prop_id)
-    {
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
 /**
  * gtk_container_add:
  * @container: a #GtkContainer
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 3a2dcfb..ab0b5b4 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2108,6 +2108,13 @@ create_saved_position (GtkWidget *widget)
       main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
       gtk_container_add (GTK_CONTAINER (window), main_vbox);
 
+      button = g_object_new (GTK_TYPE_TOGGLE_BUTTON,
+                             "label", "Stop Events",
+                             "active", FALSE,
+                             "visible", TRUE,
+                             NULL);
+      g_signal_connect (button, "clicked", G_CALLBACK (uposition_stop_configure), window);
+
       vbox =
        g_object_new (GTK_TYPE_BOX,
                       "orientation", GTK_ORIENTATION_VERTICAL,
@@ -2115,14 +2122,8 @@ create_saved_position (GtkWidget *widget)
                        "GtkBox::spacing", 5,
                        "GtkWidget::parent", main_vbox,
                        "GtkWidget::visible", TRUE,
-                       "child", g_object_connect (g_object_new (GTK_TYPE_TOGGLE_BUTTON,
-                                                                  "label", "Stop Events",
-                                                                  "active", FALSE,
-                                                                  "visible", TRUE,
-                                                                  NULL),
-                                                  "signal::clicked", uposition_stop_configure, window,
-                                                  NULL),
                        NULL);
+      gtk_container_add (GTK_CONTAINER (vbox), button);
 
       hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
       gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE);
@@ -2325,8 +2326,8 @@ create_tooltips (GtkWidget *widget)
                              "label_xalign", (double) 0.5,
                              "visible", TRUE,
                              "parent", box2,
-                             "child", box3,
                              NULL);
+      gtk_container_add (GTK_CONTAINER (frame), box3);
       gtk_box_set_child_packing (GTK_BOX (box2), frame, TRUE, TRUE, GTK_PACK_START);
 
       separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c
index 2e90b74..9a923e7 100644
--- a/testsuite/gtk/object.c
+++ b/testsuite/gtk/object.c
@@ -53,7 +53,6 @@ list_ignore_properties (gboolean buglist)
 {
   /* currently untestable properties */
   static const IgnoreProperty ignore_properties[] = {
-    { "GtkContainer",           "child",                NULL, },                        /* needs working 
child widget */
     { "GtkRadioMenuItem",       "group",                NULL, },                        /* needs working 
sibling */
     { "GtkWidget",              "parent",               NULL, },                        /* needs working 
parent widget */
     { "GtkCList",               "selection-mode",       (void*) GTK_SELECTION_NONE, },


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