[gtk+/wip/dboles/combobox-cleanup: 35/37] combobox: Remove property cell-area



commit cfae7cba11c72188e0b2a4b532ba6a8d2d5d2fac
Author: Daniel Boles <dboles src gnome org>
Date:   Sat Jan 21 12:54:49 2017 +0000

    combobox: Remove property cell-area
    
    The CellArea is going to become a pure implementation detail & be moved
    to the .ui, instead of letting users mess with it (if anyone ever did).

 docs/reference/gtk/gtk4-sections.txt |    2 -
 gtk/gtkcombobox.c                    |   76 +---------------------------------
 gtk/gtkcombobox.h                    |    4 --
 tests/testtreemenu.c                 |    9 ----
 testsuite/gtk/cellarea.c             |   24 -----------
 5 files changed, 1 insertions(+), 114 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 892980d..0275499 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -633,8 +633,6 @@ gtk_combo_box_new
 gtk_combo_box_new_with_entry
 gtk_combo_box_new_with_model
 gtk_combo_box_new_with_model_and_entry
-gtk_combo_box_new_with_area
-gtk_combo_box_new_with_area_and_entry
 gtk_combo_box_get_wrap_width
 gtk_combo_box_set_wrap_width
 gtk_combo_box_get_row_span_column
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index bb41e5e..229f448 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -215,8 +215,7 @@ enum {
   PROP_ENTRY_TEXT_COLUMN,
   PROP_POPUP_FIXED_WIDTH,
   PROP_ID_COLUMN,
-  PROP_ACTIVE_ID,
-  PROP_CELL_AREA
+  PROP_ACTIVE_ID
 };
 
 static guint combo_box_signals[LAST_SIGNAL] = {0,};
@@ -970,24 +969,6 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
                                                           TRUE,
                                                           GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
 
-   /**
-    * GtkComboBox:cell-area:
-    *
-    * The #GtkCellArea used to layout cell renderers for this combo box.
-    *
-    * If no area is specified when creating the combo box with gtk_combo_box_new_with_area()
-    * a horizontally oriented #GtkCellAreaBox will be used.
-    *
-    * Since: 3.0
-    */
-   g_object_class_install_property (object_class,
-                                    PROP_CELL_AREA,
-                                    g_param_spec_object ("cell-area",
-                                                         P_("Cell Area"),
-                                                         P_("The GtkCellArea used to layout cells"),
-                                                         GTK_TYPE_CELL_AREA,
-                                                         GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
-
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkcombobox.ui");
   gtk_widget_class_bind_template_child_internal_private (widget_class, GtkComboBox, box);
   gtk_widget_class_bind_template_child_internal_private (widget_class, GtkComboBox, button);
@@ -1077,7 +1058,6 @@ gtk_combo_box_set_property (GObject      *object,
 {
   GtkComboBox *combo_box = GTK_COMBO_BOX (object);
   GtkComboBoxPrivate *priv = combo_box->priv;
-  GtkCellArea *area;
 
   switch (prop_id)
     {
@@ -1153,22 +1133,6 @@ gtk_combo_box_set_property (GObject      *object,
       gtk_combo_box_set_active_id (combo_box, g_value_get_string (value));
       break;
 
-    case PROP_CELL_AREA:
-      /* Construct-only, can only be assigned once */
-      area = g_value_get_object (value);
-      if (area)
-        {
-          if (priv->area != NULL)
-            {
-              g_warning ("cell-area has already been set, ignoring construct property");
-              g_object_ref_sink (area);
-              g_object_unref (area);
-            }
-          else
-            priv->area = g_object_ref_sink (area);
-        }
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1242,10 +1206,6 @@ gtk_combo_box_get_property (GObject    *object,
         g_value_set_string (value, gtk_combo_box_get_active_id (combo_box));
         break;
 
-      case PROP_CELL_AREA:
-        g_value_set_object (value, priv->area);
-        break;
-
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
         break;
@@ -2293,40 +2253,6 @@ gtk_combo_box_new (void)
 }
 
 /**
- * gtk_combo_box_new_with_area:
- * @area: the #GtkCellArea to use to layout cell renderers
- *
- * Creates a new empty #GtkComboBox using @area to layout cells.
- *
- * Returns: A new #GtkComboBox.
- */
-GtkWidget *
-gtk_combo_box_new_with_area (GtkCellArea  *area)
-{
-  return g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", area, NULL);
-}
-
-/**
- * gtk_combo_box_new_with_area_and_entry:
- * @area: the #GtkCellArea to use to layout cell renderers
- *
- * Creates a new empty #GtkComboBox with an entry.
- *
- * The new combo box will use @area to layout cells.
- *
- * Returns: A new #GtkComboBox.
- */
-GtkWidget *
-gtk_combo_box_new_with_area_and_entry (GtkCellArea *area)
-{
-  return g_object_new (GTK_TYPE_COMBO_BOX,
-                       "has-entry", TRUE,
-                       "cell-area", area,
-                       NULL);
-}
-
-
-/**
  * gtk_combo_box_new_with_entry:
  *
  * Creates a new empty #GtkComboBox with an entry.
diff --git a/gtk/gtkcombobox.h b/gtk/gtkcombobox.h
index 77130ac..f5172e1 100644
--- a/gtk/gtkcombobox.h
+++ b/gtk/gtkcombobox.h
@@ -80,10 +80,6 @@ GType         gtk_combo_box_get_type                 (void) G_GNUC_CONST;
 GDK_AVAILABLE_IN_ALL
 GtkWidget    *gtk_combo_box_new                      (void);
 GDK_AVAILABLE_IN_ALL
-GtkWidget    *gtk_combo_box_new_with_area            (GtkCellArea  *area);
-GDK_AVAILABLE_IN_ALL
-GtkWidget    *gtk_combo_box_new_with_area_and_entry  (GtkCellArea  *area);
-GDK_AVAILABLE_IN_ALL
 GtkWidget    *gtk_combo_box_new_with_entry           (void);
 GDK_AVAILABLE_IN_ALL
 GtkWidget    *gtk_combo_box_new_with_model           (GtkTreeModel *model);
diff --git a/tests/testtreemenu.c b/tests/testtreemenu.c
index 3d2417b..befb40f 100644
--- a/tests/testtreemenu.c
+++ b/tests/testtreemenu.c
@@ -426,7 +426,6 @@ tree_menu (void)
   GtkWidget *window, *widget;
   GtkWidget *menubar, *vbox;
   GtkCellArea *area;
-  GtkTreeModel *store;
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
@@ -438,7 +437,6 @@ tree_menu (void)
   menubar = gtk_menu_bar_new ();
   gtk_widget_show (menubar);
 
-  store = simple_tree_model ();
   area  = create_cell_area ();
 
 #if _GTK_TREE_MENU_WAS_A_PUBLIC_CLASS_
@@ -461,13 +459,6 @@ tree_menu (void)
   gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE);
 #endif
 
-  /* Add a combo box with the same menu ! */
-  widget = gtk_combo_box_new_with_area (area);
-  gtk_combo_box_set_model (GTK_COMBO_BOX (widget), store);
-  gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
-  gtk_widget_show (widget);
-  gtk_box_pack_end (GTK_BOX (vbox), widget, FALSE, FALSE);
-
   /* Now add some controls */
   widget = gtk_combo_box_text_new ();
   gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
diff --git a/testsuite/gtk/cellarea.c b/testsuite/gtk/cellarea.c
index 5e27bb5..3493848 100644
--- a/testsuite/gtk/cellarea.c
+++ b/testsuite/gtk/cellarea.c
@@ -202,21 +202,6 @@ test_combobox_new (void)
   g_object_unref (view);
 }
 
-/* test that new_with_area() keeps the provided area */
-static void
-test_combobox_new_with_area (void)
-{
-  GtkWidget *view;
-  GtkCellArea *area;
-
-  area = gtk_cell_area_box_new ();
-  view = gtk_combo_box_new_with_area (area);
-  g_assert (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (view)) == area);
-
-  g_object_ref_sink (view);
-  g_object_unref (view);
-}
-
 /* test that g_object_new keeps the provided area */
 static void
 test_combobox_object_new (void)
@@ -832,15 +817,6 @@ main (int argc, char *argv[])
   g_test_add_func ("/tests/iconview-subclass3", test_iconview_subclass3);
   g_test_add_func ("/tests/iconview-subclass3/subprocess", test_iconview_subclass3_subprocess);
 
-  g_test_add_func ("/tests/combobox-new", test_combobox_new);
-  g_test_add_func ("/tests/combobox-new-with-area", test_combobox_new_with_area);
-  g_test_add_func ("/tests/combobox-object-new", test_combobox_object_new);
-  g_test_add_func ("/tests/combobox-subclass0", test_combobox_subclass0);
-  g_test_add_func ("/tests/combobox-subclass1", test_combobox_subclass1);
-  g_test_add_func ("/tests/combobox-subclass2", test_combobox_subclass2);
-  g_test_add_func ("/tests/combobox-subclass3", test_combobox_subclass3);
-  g_test_add_func ("/tests/combobox-subclass3/subprocess", test_combobox_subclass3_subprocess);
-
   g_test_add_func ("/tests/cellview-new", test_cellview_new);
   g_test_add_func ("/tests/cellview-new-with-context", test_cellview_new_with_context);
   g_test_add_func ("/tests/cellview-object-new", test_cellview_object_new);


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