[gimp/gtk3-port: 12/236] libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/



commit 93618a201708140be56bfa496815881830306fe0
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 15 11:37:11 2010 +0200

    libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/

 libgimpwidgets/gimppropwidgets.c |  173 ++++++--------------------------------
 libgimpwidgets/gimppropwidgets.h |    9 +--
 2 files changed, 28 insertions(+), 154 deletions(-)
---
diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c
index a8d2e23..cf5d162 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -1039,12 +1039,12 @@ gimp_prop_spin_button_new (GObject     *config,
                            gdouble      page_increment,
                            gint         digits)
 {
-  GParamSpec *param_spec;
-  GtkWidget  *spinbutton;
-  GtkObject  *adjustment;
-  gdouble     value;
-  gdouble     lower;
-  gdouble     upper;
+  GParamSpec    *param_spec;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adjustment;
+  gdouble        value;
+  gdouble        lower;
+  gdouble        upper;
 
   param_spec = find_param_spec (config, property_name, G_STRFUNC);
   if (! param_spec)
@@ -1097,12 +1097,12 @@ gimp_prop_hscale_new (GObject     *config,
                       gdouble      page_increment,
                       gint         digits)
 {
-  GParamSpec *param_spec;
-  GtkWidget  *scale;
-  GtkObject  *adjustment;
-  gdouble     value;
-  gdouble     lower;
-  gdouble     upper;
+  GParamSpec    *param_spec;
+  GtkWidget     *scale;
+  GtkAdjustment *adjustment;
+  gdouble        value;
+  gdouble        lower;
+  gdouble        upper;
 
   param_spec = find_param_spec (config, property_name, G_STRFUNC);
   if (! param_spec)
@@ -1161,7 +1161,7 @@ gimp_prop_hscale_new (GObject     *config,
  *
  * Since GIMP 2.4
  */
-GtkObject *
+GtkAdjustment *
 gimp_prop_scale_entry_new (GObject     *config,
                            const gchar *property_name,
                            GtkTable    *table,
@@ -1175,12 +1175,12 @@ gimp_prop_scale_entry_new (GObject     *config,
                            gdouble      lower_limit,
                            gdouble      upper_limit)
 {
-  GParamSpec  *param_spec;
-  GtkObject   *adjustment;
-  const gchar *tooltip;
-  gdouble      value;
-  gdouble      lower;
-  gdouble      upper;
+  GParamSpec    *param_spec;
+  GtkAdjustment *adjustment;
+  const gchar   *tooltip;
+  gdouble        value;
+  gdouble        lower;
+  gdouble        upper;
 
   param_spec = find_param_spec (config, property_name, G_STRFUNC);
   if (! param_spec)
@@ -1248,7 +1248,7 @@ gimp_prop_scale_entry_new (GObject     *config,
  *
  * Since GIMP 2.4
  */
-GtkObject *
+GtkAdjustment *
 gimp_prop_opacity_entry_new (GObject     *config,
                              const gchar *property_name,
                              GtkTable    *table,
@@ -1256,12 +1256,12 @@ gimp_prop_opacity_entry_new (GObject     *config,
                              gint         row,
                              const gchar *label)
 {
-  GParamSpec  *param_spec;
-  GtkObject   *adjustment;
-  const gchar *tooltip;
-  gdouble      value;
-  gdouble      lower;
-  gdouble      upper;
+  GParamSpec    *param_spec;
+  GtkAdjustment *adjustment;
+  const gchar   *tooltip;
+  gdouble        value;
+  gdouble        lower;
+  gdouble        upper;
 
   g_return_val_if_fail (G_IS_OBJECT (config), NULL);
   g_return_val_if_fail (property_name != NULL, NULL);
@@ -3509,127 +3509,6 @@ gimp_prop_unit_combo_box_notify (GObject    *config,
 }
 
 
-/***************/
-/*  unit menu  */
-/***************/
-
-static void   gimp_prop_unit_menu_callback (GtkWidget  *menu,
-                                            GObject    *config);
-static void   gimp_prop_unit_menu_notify   (GObject    *config,
-                                            GParamSpec *param_spec,
-                                            GtkWidget  *menu);
-
-/**
- * gimp_prop_unit_menu_new:
- * @config:        Object to which property is attached.
- * @property_name: Name of Unit property.
- * @unit_format:   A printf-like format string which is used to create
- *                 the unit strings.
- *
- * Creates a #GimpUnitMenu to set and display the value of a Unit
- * property.  See gimp_unit_menu_new() for more information.
- *
- * Return value:  A new #GimpUnitMenu widget.
- *
- * Since GIMP 2.4
- */
-GtkWidget *
-gimp_prop_unit_menu_new (GObject     *config,
-                         const gchar *property_name,
-                         const gchar *unit_format)
-{
-  GParamSpec *param_spec;
-  GtkWidget  *menu;
-  GimpUnit    unit;
-  GValue      value = { 0, };
-  gboolean    show_pixels;
-  gboolean    show_percent;
-
-  param_spec = check_param_spec_w (config, property_name,
-                                   GIMP_TYPE_PARAM_UNIT, G_STRFUNC);
-  if (! param_spec)
-    return NULL;
-
-  g_value_init (&value, param_spec->value_type);
-
-  g_value_set_int (&value, GIMP_UNIT_PIXEL);
-  show_pixels = (g_param_value_validate (param_spec, &value) == FALSE);
-
-  g_value_set_int (&value, GIMP_UNIT_PERCENT);
-  show_percent = (g_param_value_validate (param_spec, &value) == FALSE);
-
-  g_value_unset (&value);
-
-  g_object_get (config,
-                property_name, &unit,
-                NULL);
-
-  menu = gimp_unit_menu_new (unit_format,
-                             unit, show_pixels, show_percent, TRUE);
-
-  set_param_spec (G_OBJECT (menu), menu, param_spec);
-
-  g_signal_connect (menu, "unit-changed",
-                    G_CALLBACK (gimp_prop_unit_menu_callback),
-                    config);
-
-  connect_notify (config, property_name,
-                  G_CALLBACK (gimp_prop_unit_menu_notify),
-                  menu);
-
-  return menu;
-}
-
-static void
-gimp_prop_unit_menu_callback (GtkWidget *menu,
-                              GObject   *config)
-{
-  GParamSpec *param_spec;
-  GimpUnit    unit;
-
-  param_spec = get_param_spec (G_OBJECT (menu));
-  if (! param_spec)
-    return;
-
-  gimp_unit_menu_update (menu, &unit);
-
-  g_signal_handlers_block_by_func (config,
-                                   gimp_prop_unit_menu_notify,
-                                   menu);
-
-  g_object_set (config,
-                param_spec->name, unit,
-                NULL);
-
-  g_signal_handlers_unblock_by_func (config,
-                                     gimp_prop_unit_menu_notify,
-                                     menu);
-}
-
-static void
-gimp_prop_unit_menu_notify (GObject    *config,
-                            GParamSpec *param_spec,
-                            GtkWidget  *menu)
-{
-  GimpUnit  unit;
-
-  g_object_get (config,
-                param_spec->name, &unit,
-                NULL);
-
-  g_signal_handlers_block_by_func (menu,
-                                   gimp_prop_unit_menu_callback,
-                                   config);
-
-  gimp_unit_menu_set_unit (GIMP_UNIT_MENU (menu), unit);
-  gimp_unit_menu_update (menu, &unit);
-
-  g_signal_handlers_unblock_by_func (menu,
-                                     gimp_prop_unit_menu_callback,
-                                     config);
-}
-
-
 /*****************/
 /*  stock image  */
 /*****************/
diff --git a/libgimpwidgets/gimppropwidgets.h b/libgimpwidgets/gimppropwidgets.h
index 18b7d30..5656200 100644
--- a/libgimpwidgets/gimppropwidgets.h
+++ b/libgimpwidgets/gimppropwidgets.h
@@ -102,7 +102,7 @@ GtkWidget     * gimp_prop_hscale_new              (GObject      *config,
                                                    gdouble       page_increment,
                                                    gint          digits);
 
-GtkObject     * gimp_prop_scale_entry_new         (GObject      *config,
+GtkAdjustment * gimp_prop_scale_entry_new         (GObject      *config,
                                                    const gchar  *property_name,
                                                    GtkTable     *table,
                                                    gint          column,
@@ -117,7 +117,7 @@ GtkObject     * gimp_prop_scale_entry_new         (GObject      *config,
 
 /*  special form of gimp_prop_scale_entry_new() for GParamDouble  */
 
-GtkObject     * gimp_prop_opacity_entry_new       (GObject       *config,
+GtkAdjustment * gimp_prop_opacity_entry_new       (GObject       *config,
                                                    const gchar   *property_name,
                                                    GtkTable      *table,
                                                    gint           column,
@@ -208,11 +208,6 @@ GtkWidget     * gimp_prop_color_area_new          (GObject       *config,
 
 GtkWidget     * gimp_prop_unit_combo_box_new      (GObject       *config,
                                                    const gchar   *property_name);
-#ifndef GIMP_DISABLE_DEPRECATED
-GtkWidget     * gimp_prop_unit_menu_new           (GObject       *config,
-                                                   const gchar   *property_name,
-                                                   const gchar   *unit_format);
-#endif /* GIMP_DISABLE_DEPRECATED */
 
 
 /*  GParamString (stock_id)  */



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