[gimp/gtk3-port: 12/230] libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 12/230] libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/
- Date: Mon, 9 Jun 2014 22:35:22 +0000 (UTC)
commit 23f053a357757303acff2f2e6789e45b36396c87
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 53977eb..75ce4c0 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -1071,12 +1071,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)
@@ -1129,12 +1129,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)
@@ -1196,7 +1196,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,
@@ -1210,12 +1210,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)
@@ -1339,7 +1339,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,
@@ -1347,7 +1347,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);
@@ -3566,127 +3566,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);
-}
-
-
-/***************/
/* icon name */
/***************/
diff --git a/libgimpwidgets/gimppropwidgets.h b/libgimpwidgets/gimppropwidgets.h
index 469e667..db95fdf 100644
--- a/libgimpwidgets/gimppropwidgets.h
+++ b/libgimpwidgets/gimppropwidgets.h
@@ -110,7 +110,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,
@@ -125,7 +125,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,
@@ -216,10 +216,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]