[gimp/gtk3-port: 11/227] libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/
- From: Clayton Walker <claytonw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 11/227] libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/
- Date: Mon, 21 Oct 2013 21:19:20 +0000 (UTC)
commit 28a7dc1595af0fe07544e83da01e56136f8c6f19
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 | 163 +++++---------------------------------
libgimpwidgets/gimppropwidgets.h | 8 +--
2 files changed, 23 insertions(+), 148 deletions(-)
---
diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c
index 9684de7..1c2957d 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -1040,12 +1040,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)
@@ -1098,12 +1098,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)
@@ -1162,7 +1162,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,
@@ -1176,12 +1176,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)
@@ -1298,7 +1298,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,
@@ -1306,7 +1306,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);
@@ -3524,127 +3524,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 afff4b5..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,10 +208,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 (stock_id) */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]