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



commit f6ab70c72fc7b14e254dced1eaccf50449a3eede
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 |  151 ++++----------------------------------
 libgimpwidgets/gimppropwidgets.h |    8 +--
 2 files changed, 17 insertions(+), 142 deletions(-)
---
diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c
index 722af62..e34b66d 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -1265,12 +1265,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)
@@ -1335,7 +1335,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,
@@ -1349,12 +1349,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)
@@ -1481,7 +1481,7 @@ gimp_prop_widget_set_factor (GtkWidget     *widget,
  *
  * Since GIMP 2.4
  */
-GtkObject *
+GtkAdjustment *
 gimp_prop_opacity_entry_new (GObject     *config,
                              const gchar *property_name,
                              GtkTable    *table,
@@ -1489,7 +1489,7 @@ gimp_prop_opacity_entry_new (GObject     *config,
                              gint         row,
                              const gchar *label)
 {
-  GtkObject *adjustment;
+  GtkAdjustment *adjustment;
 
   g_return_val_if_fail (G_IS_OBJECT (config), NULL);
   g_return_val_if_fail (property_name != NULL, NULL);
@@ -3757,127 +3757,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 = G_VALUE_INIT;
-  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);
-}
-
-
-/***************/
 /*  icon name  */
 /***************/
 
diff --git a/libgimpwidgets/gimppropwidgets.h b/libgimpwidgets/gimppropwidgets.h
index 19dca84..142e094 100644
--- a/libgimpwidgets/gimppropwidgets.h
+++ b/libgimpwidgets/gimppropwidgets.h
@@ -115,7 +115,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,
@@ -130,7 +130,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,
@@ -221,10 +221,6 @@ GtkWidget     * gimp_prop_color_area_new          (GObject       *config,
 
 GtkWidget     * gimp_prop_unit_combo_box_new      (GObject       *config,
                                                    const gchar   *property_name);
-GIMP_DEPRECATED_FOR(gimp_prop_unit_combo_box_new)
-GtkWidget     * gimp_prop_unit_menu_new           (GObject       *config,
-                                                   const gchar   *property_name,
-                                                   const gchar   *unit_format);
 
 
 /*  GParamString (icon name)  */


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