[gimp/gtk3-port: 17/246] 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: 17/246] libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/
- Date: Sun, 27 Feb 2011 15:46:10 +0000 (UTC)
commit ac0aa485b6a941bd1c2021110e86609a375857a2
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 cfdff79..abfd857 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -1036,12 +1036,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)
@@ -1094,12 +1094,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)
@@ -1158,7 +1158,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,
@@ -1172,12 +1172,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)
@@ -1245,7 +1245,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,
@@ -1253,12 +1253,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);
@@ -3506,127 +3506,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 50cfd75..44b4303 100644
--- a/libgimpwidgets/gimppropwidgets.h
+++ b/libgimpwidgets/gimppropwidgets.h
@@ -98,7 +98,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,
@@ -113,7 +113,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,
@@ -204,11 +204,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]