[gimp/metadata-browser] libgimpwidgets: add gtk_scale_new() to gimp3migration.[ch]
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] libgimpwidgets: add gtk_scale_new() to gimp3migration.[ch]
- Date: Fri, 2 Dec 2011 02:00:41 +0000 (UTC)
commit 7fd978494b043df3f5ea1f887ddc14146476347d
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 2 14:09:45 2011 +0200
libgimpwidgets: add gtk_scale_new() to gimp3migration.[ch]
and use it all over the place. Also change some GtkObject* variables
to GtkAdjustment*.
app/actions/gradient-editor-commands.c | 12 +++---
app/display/gimpnavigationeditor.c | 3 +-
app/tools/gimpcolorbalancetool.c | 2 +-
app/tools/gimprotatetool.c | 2 +-
libgimpwidgets/gimp3migration.c | 10 +++++
libgimpwidgets/gimp3migration.h | 2 +
libgimpwidgets/gimpscaleentry.c | 3 +-
modules/color-selector-water.c | 16 ++++----
plug-ins/common/file-mng.c | 53 +++++++++++++-----------
plug-ins/common/filter-pack.c | 38 ++++++++++--------
plug-ins/gfig/gfig-dialog.c | 16 ++++----
plug-ins/gimpressionist/brush.c | 45 ++++++++++-----------
plug-ins/gimpressionist/orientmap.c | 69 ++++++++++++++++----------------
plug-ins/gimpressionist/sizemap.c | 40 +++++++++----------
plug-ins/ifs-compose/ifs-compose.c | 26 ++++++------
plug-ins/maze/maze-dialog.c | 20 +++++-----
16 files changed, 185 insertions(+), 172 deletions(-)
---
diff --git a/app/actions/gradient-editor-commands.c b/app/actions/gradient-editor-commands.c
index 66ccdb3..a2a9f60 100644
--- a/app/actions/gradient-editor-commands.c
+++ b/app/actions/gradient-editor-commands.c
@@ -442,7 +442,7 @@ gradient_editor_replicate_cmd_callback (GtkAction *action,
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *scale;
- GtkObject *scale_data;
+ GtkAdjustment *scale_data;
const gchar *title;
const gchar *desc;
@@ -499,9 +499,9 @@ gradient_editor_replicate_cmd_callback (GtkAction *action,
/* Scale */
editor->replicate_times = 2;
- scale_data = gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0);
+ scale_data = GTK_ADJUSTMENT (gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0));
- scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_data);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 4);
@@ -544,7 +544,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *scale;
- GtkObject *scale_data;
+ GtkAdjustment *scale_data;
const gchar *title;
const gchar *desc;
@@ -602,9 +602,9 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
/* Scale */
editor->split_parts = 2;
- scale_data = gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0);
+ scale_data = GTK_ADJUSTMENT (gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0));
- scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_data);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 4);
diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c
index 4172d5f..65f729e 100644
--- a/app/display/gimpnavigationeditor.c
+++ b/app/display/gimpnavigationeditor.c
@@ -426,7 +426,8 @@ gimp_navigation_editor_new_private (GimpMenuFactory *menu_factory,
G_CALLBACK (gimp_navigation_editor_zoom_adj_changed),
editor);
- hscale = gtk_hscale_new (editor->zoom_adjustment);
+ hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL,
+ editor->zoom_adjustment);
gtk_scale_set_draw_value (GTK_SCALE (hscale), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), hscale, TRUE, TRUE, 0);
gtk_widget_show (hscale);
diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c
index e508c8e..8b701f6 100644
--- a/app/tools/gimpcolorbalancetool.c
+++ b/app/tools/gimpcolorbalancetool.c
@@ -229,7 +229,7 @@ create_levels_scale (gdouble value,
value, -100.0, 100.0,
1.0, 10.0, 0.0, 1.0, 0);
- slider = gtk_hscale_new (adj);
+ slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj);
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
gtk_widget_set_size_request (slider, 100, -1);
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, col, col + 1);
diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c
index 18b8e42..a1a7d16 100644
--- a/app/tools/gimprotatetool.c
+++ b/app/tools/gimprotatetool.c
@@ -196,7 +196,7 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
G_CALLBACK (rotate_angle_changed),
tr_tool);
- scale = gtk_hscale_new (rotate->angle_adj);
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, rotate->angle_adj);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
diff --git a/libgimpwidgets/gimp3migration.c b/libgimpwidgets/gimp3migration.c
index 0b9d7ce..3073caf 100644
--- a/libgimpwidgets/gimp3migration.c
+++ b/libgimpwidgets/gimp3migration.c
@@ -48,6 +48,16 @@ gtk_button_box_new (GtkOrientation orientation)
}
GtkWidget *
+gtk_scale_new (GtkOrientation orientation,
+ GtkAdjustment *adjustment)
+{
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ return gtk_hscale_new (adjustment);
+ else
+ return gtk_vscale_new (adjustment);
+}
+
+GtkWidget *
gtk_scrollbar_new (GtkOrientation orientation,
GtkAdjustment *adjustment)
{
diff --git a/libgimpwidgets/gimp3migration.h b/libgimpwidgets/gimp3migration.h
index 273312e..049732f 100644
--- a/libgimpwidgets/gimp3migration.h
+++ b/libgimpwidgets/gimp3migration.h
@@ -36,6 +36,8 @@
GtkWidget * gtk_box_new (GtkOrientation orientation,
gint spacing);
GtkWidget * gtk_button_box_new (GtkOrientation orientation);
+GtkWidget * gtk_scale_new (GtkOrientation orientation,
+ GtkAdjustment *adjustment);
GtkWidget * gtk_scrollbar_new (GtkOrientation orientation,
GtkAdjustment *adjustment);
diff --git a/libgimpwidgets/gimpscaleentry.c b/libgimpwidgets/gimpscaleentry.c
index 7471865..abff2ba 100644
--- a/libgimpwidgets/gimpscaleentry.c
+++ b/libgimpwidgets/gimpscaleentry.c
@@ -208,7 +208,8 @@ gimp_scale_entry_new_internal (gboolean color_scale,
}
else
{
- scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL,
+ GTK_ADJUSTMENT (adjustment));
}
if (scale_width > 0)
diff --git a/modules/color-selector-water.c b/modules/color-selector-water.c
index f9bd694..1d8f024 100644
--- a/modules/color-selector-water.c
+++ b/modules/color-selector-water.c
@@ -127,11 +127,11 @@ colorsel_water_class_finalize (ColorselWaterClass *klass)
static void
colorsel_water_init (ColorselWater *water)
{
- GtkWidget *hbox;
- GtkWidget *area;
- GtkWidget *frame;
- GtkObject *adj;
- GtkWidget *scale;
+ GtkWidget *hbox;
+ GtkWidget *area;
+ GtkWidget *frame;
+ GtkAdjustment *adj;
+ GtkWidget *scale;
water->pressure_adjust = 1.0;
@@ -173,13 +173,13 @@ colorsel_water_init (ColorselWater *water)
gtk_widget_set_extension_events (area, GDK_EXTENSION_EVENTS_ALL);
gtk_widget_grab_focus (area);
- adj = gtk_adjustment_new (200.0 - water->pressure_adjust * 100.0,
- 0.0, 200.0, 1.0, 1.0, 0.0);
+ adj = GTK_ADJUSTMENT (gtk_adjustment_new (200.0 - water->pressure_adjust * 100.0,
+ 0.0, 200.0, 1.0, 1.0, 0.0));
g_signal_connect (adj, "value-changed",
G_CALLBACK (pressure_adjust_update),
water);
- scale = gtk_vscale_new (GTK_ADJUSTMENT (adj));
+ scale = gtk_scale_new (GTK_ORIENTATION_VERTICAL, adj);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gimp_help_set_help_data (scale, _("Pressure"), NULL);
diff --git a/plug-ins/common/file-mng.c b/plug-ins/common/file-mng.c
index 6801a20..6a9a4a7 100644
--- a/plug-ins/common/file-mng.c
+++ b/plug-ins/common/file-mng.c
@@ -1316,21 +1316,21 @@ mng_save_image (const gchar *filename,
static gboolean
mng_save_dialog (gint32 image_id)
{
- GtkWidget *dialog;
- GtkWidget *main_vbox;
- GtkWidget *frame;
- GtkWidget *vbox;
- GtkWidget *table;
- GtkWidget *toggle;
- GtkWidget *hbox;
- GtkWidget *combo;
- GtkWidget *label;
- GtkWidget *scale;
- GtkObject *scale_adj;
- GtkWidget *spinbutton;
- GtkObject *spinbutton_adj;
- gint num_layers;
- gboolean run;
+ GtkWidget *dialog;
+ GtkWidget *main_vbox;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *table;
+ GtkWidget *toggle;
+ GtkWidget *hbox;
+ GtkWidget *combo;
+ GtkWidget *label;
+ GtkWidget *scale;
+ GtkAdjustment *scale_adj;
+ GtkWidget *spinbutton;
+ GtkAdjustment *spinbutton_adj;
+ gint num_layers;
+ gboolean run;
dialog = gimp_export_dialog_new (_("MNG"), PLUG_IN_BINARY, SAVE_PROC);
@@ -1445,10 +1445,11 @@ mng_save_dialog (gint32 image_id)
_("Default frame disposal:"), 0.0, 0.5,
combo, 1, FALSE);
- scale_adj = gtk_adjustment_new (mng_data.compression_level,
- 0.0, 9.0, 1.0, 1.0, 0.0);
+ scale_adj = (GtkAdjustment *)
+ gtk_adjustment_new (mng_data.compression_level,
+ 0.0, 9.0, 1.0, 1.0, 0.0);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_adj));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_adj);
gtk_widget_set_size_request (scale, SCALE_WIDTH, -1);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
@@ -1465,10 +1466,11 @@ mng_save_dialog (gint32 image_id)
"for small file size"),
NULL);
- scale_adj = gtk_adjustment_new (mng_data.quality,
- 0.0, 1.0, 0.01, 0.01, 0.0);
+ scale_adj = (GtkAdjustment *)
+ gtk_adjustment_new (mng_data.quality,
+ 0.0, 1.0, 0.01, 0.01, 0.0);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_adj));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_adj);
gtk_widget_set_size_request (scale, SCALE_WIDTH, -1);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_scale_set_digits (GTK_SCALE (scale), 2);
@@ -1481,10 +1483,11 @@ mng_save_dialog (gint32 image_id)
G_CALLBACK (gimp_int_adjustment_update),
&mng_data.quality);
- scale_adj = gtk_adjustment_new (mng_data.smoothing,
- 0.0, 1.0, 0.01, 0.01, 0.0);
+ scale_adj = (GtkAdjustment *)
+ gtk_adjustment_new (mng_data.smoothing,
+ 0.0, 1.0, 0.01, 0.01, 0.0);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_adj));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_adj);
gtk_widget_set_size_request (scale, SCALE_WIDTH, -1);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_scale_set_digits (GTK_SCALE (scale), 2);
@@ -1524,7 +1527,7 @@ mng_save_dialog (gint32 image_id)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- spinbutton = gimp_spin_button_new (&spinbutton_adj,
+ spinbutton = gimp_spin_button_new ((GtkObject **) &spinbutton_adj,
mng_data.default_delay,
0, 65000, 10, 100, 0, 1, 0);
diff --git a/plug-ins/common/filter-pack.c b/plug-ins/common/filter-pack.c
index c8209da..00fe913 100644
--- a/plug-ins/common/filter-pack.c
+++ b/plug-ins/common/filter-pack.c
@@ -625,8 +625,8 @@ fp_create_circle_palette (GtkWidget *parent)
static GtkWidget *
fp_create_rough (void)
{
- GtkWidget *frame, *vbox, *scale;
- GtkObject *data;
+ GtkWidget *frame, *vbox, *scale;
+ GtkAdjustment *data;
frame = gimp_frame_new (_("Roughness"));
gtk_widget_show (frame);
@@ -635,8 +635,10 @@ fp_create_rough (void)
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
- data = gtk_adjustment_new (fpvals.roughness, 0, 1.0, 0.05, 0.01, 0.0);
- fp_widgets.roughness_scale = scale = gtk_hscale_new (GTK_ADJUSTMENT (data));
+ data = (GtkAdjustment *)
+ gtk_adjustment_new (fpvals.roughness, 0, 1.0, 0.05, 0.01, 0.0);
+ fp_widgets.roughness_scale = scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL,
+ data);
gtk_widget_set_size_request (scale, 60, -1);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
@@ -1291,12 +1293,12 @@ fp_advanced_dialog (GtkWidget *parent)
const gchar *rangeNames[] = { N_("Shadows:"),
N_("Midtones:"),
N_("Highlights:") };
- GtkWidget *frame, *hbox;
- GtkObject *smoothnessData;
- GtkWidget *graphFrame, *scale;
- GtkWidget *vbox, *label, *labelTable, *alignment;
- GtkWidget *inner_vbox, *innermost_vbox;
- gint i;
+ GtkWidget *frame, *hbox;
+ GtkAdjustment *smoothnessData;
+ GtkWidget *graphFrame, *scale;
+ GtkWidget *vbox, *label, *labelTable, *alignment;
+ GtkWidget *inner_vbox, *innermost_vbox;
+ gint i;
AW.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -1397,11 +1399,12 @@ fp_advanced_dialog (GtkWidget *parent)
GTK_EXPAND | GTK_FILL, 0, 0, 0);
}
- smoothnessData = gtk_adjustment_new (fpvals.aliasing,
- 0, 1.0, 0.05, 0.01, 0.0);
+ smoothnessData = (GtkAdjustment *)
+ gtk_adjustment_new (fpvals.aliasing,
+ 0, 1.0, 0.05, 0.01, 0.0);
fp_widgets.aliasing_scale = scale =
- gtk_hscale_new (GTK_ADJUSTMENT (smoothnessData));
+ gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, smoothnessData);
gtk_widget_set_size_request (scale, 200, -1);
gtk_scale_set_digits (GTK_SCALE (scale), 2);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
@@ -1422,12 +1425,13 @@ fp_advanced_dialog (GtkWidget *parent)
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
- smoothnessData = gtk_adjustment_new (fpvals.preview_size,
- 50, MAX_PREVIEW_SIZE,
- 5, 5, 0.0);
+ smoothnessData = (GtkAdjustment *)
+ gtk_adjustment_new (fpvals.preview_size,
+ 50, MAX_PREVIEW_SIZE,
+ 5, 5, 0.0);
fp_widgets.preview_size_scale = scale =
- gtk_hscale_new (GTK_ADJUSTMENT (smoothnessData));
+ gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, smoothnessData);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
gtk_widget_set_size_request (scale, 100, -1);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
diff --git a/plug-ins/gfig/gfig-dialog.c b/plug-ins/gfig/gfig-dialog.c
index 7227353..83b1374 100644
--- a/plug-ins/gfig/gfig-dialog.c
+++ b/plug-ins/gfig/gfig-dialog.c
@@ -1218,12 +1218,12 @@ gfig_prefs_action_callback (GtkAction *widget,
if (!dialog)
{
- GtkWidget *main_vbox;
- GtkWidget *table;
- GtkWidget *toggle;
- GtkObject *size_data;
- GtkWidget *scale;
- GtkObject *scale_data;
+ GtkWidget *main_vbox;
+ GtkWidget *table;
+ GtkWidget *toggle;
+ GtkObject *size_data;
+ GtkWidget *scale;
+ GtkAdjustment *scale_data;
dialog = gimp_dialog_new (_("Options"), "gimp-gfig-options",
GTK_WIDGET (data), 0, NULL, NULL,
@@ -1335,9 +1335,9 @@ gfig_prefs_action_callback (GtkAction *widget,
NULL);
gtk_widget_show (toggle);
- scale_data =
+ scale_data = (GtkAdjustment *)
gtk_adjustment_new (selopt.feather_radius, 0.0, 100.0, 1.0, 1.0, 0.0);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_data);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
g_signal_connect (scale_data, "value-changed",
diff --git a/plug-ins/gimpressionist/brush.c b/plug-ins/gimpressionist/brush.c
index 1cd5e2c..5cf0249 100644
--- a/plug-ins/gimpressionist/brush.c
+++ b/plug-ins/gimpressionist/brush.c
@@ -41,11 +41,11 @@ static void update_brush_preview (const char *fn);
static GtkWidget *brush_preview = NULL;
static GtkListStore *brush_list_store = NULL;
-static GtkWidget *brush_list = NULL;
-static GtkObject *brush_relief_adjust = NULL;
-static GtkObject *brush_aspect_adjust = NULL;
-static GtkObject *brush_gamma_adjust = NULL;
-static gboolean brush_dont_update = FALSE;
+static GtkWidget *brush_list = NULL;
+static GtkAdjustment *brush_relief_adjust = NULL;
+static GtkAdjustment *brush_aspect_adjust = NULL;
+static GtkAdjustment *brush_gamma_adjust = NULL;
+static gboolean brush_dont_update = FALSE;
static gchar *last_selected_brush = NULL;
@@ -57,15 +57,15 @@ void
brush_restore (void)
{
reselect (brush_list, pcvals.selected_brush);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_gamma_adjust), pcvals.brushgamma);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_relief_adjust), pcvals.brush_relief);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_aspect_adjust), pcvals.brush_aspect);
+ gtk_adjustment_set_value (brush_gamma_adjust, pcvals.brushgamma);
+ gtk_adjustment_set_value (brush_relief_adjust, pcvals.brush_relief);
+ gtk_adjustment_set_value (brush_aspect_adjust, pcvals.brush_aspect);
}
void
brush_store (void)
{
- pcvals.brushgamma = gtk_adjustment_get_value (GTK_ADJUSTMENT (brush_gamma_adjust));
+ pcvals.brushgamma = gtk_adjustment_get_value (brush_gamma_adjust);
}
void
@@ -103,8 +103,7 @@ brushdmenuselect (GtkWidget *widget,
guchar *src_row;
guchar *src;
gint id;
- gint alpha, bpp;
- gboolean has_alpha;
+ gint bpp;
gint x, y;
ppm_t *p;
gint x1, y1, x2, y2;
@@ -128,16 +127,14 @@ brushdmenuselect (GtkWidget *widget,
preset_save_button_set_sensitive (FALSE);
}
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_gamma_adjust), 1.0);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_aspect_adjust), 0.0);
+ gtk_adjustment_set_value (brush_gamma_adjust, 1.0);
+ gtk_adjustment_set_value (brush_aspect_adjust, 0.0);
drawable = gimp_drawable_get (id);
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
bpp = gimp_drawable_bpp (drawable->drawable_id);
- has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
- alpha = (has_alpha) ? bpp - 1 : bpp;
ppm_kill (&brushppm);
ppm_new (&brushppm, x2 - x1, y2 - y1);
@@ -363,7 +360,7 @@ update_brush_preview (const gchar *fn)
set_colorbrushes (fn);
- sc = gtk_adjustment_get_value (GTK_ADJUSTMENT (brush_gamma_adjust));
+ sc = gtk_adjustment_get_value (brush_gamma_adjust);
if (sc != 1.0)
for (i = 0; i < 256; i++)
gammatable[i] = pow (i / 255.0, sc) * 255;
@@ -372,7 +369,7 @@ update_brush_preview (const gchar *fn)
gammatable[i] = i;
newheight = p.height *
- pow (10, gtk_adjustment_get_value (GTK_ADJUSTMENT (brush_aspect_adjust)));
+ pow (10, gtk_adjustment_get_value (brush_aspect_adjust));
sc = p.width > newheight ? p.width : newheight;
sc = 100.0 / sc;
@@ -447,8 +444,8 @@ brush_select (GtkTreeSelection *selection, gboolean force)
}
brush_dont_update = TRUE;
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_gamma_adjust), 1.0);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_aspect_adjust), 0.0);
+ gtk_adjustment_set_value (brush_gamma_adjust, 1.0);
+ gtk_adjustment_set_value (brush_aspect_adjust, 0.0);
brush_dont_update = FALSE;
if (brush)
@@ -545,9 +542,9 @@ create_brushpage (GtkNotebook *notebook)
gtk_box_pack_start (GTK_BOX (box3), tmpw, FALSE, FALSE,0);
gtk_widget_show (tmpw);
- brush_gamma_adjust = gtk_adjustment_new (pcvals.brushgamma,
- 0.5, 3.0, 0.1, 0.1, 1.0);
- tmpw = gtk_hscale_new (GTK_ADJUSTMENT (brush_gamma_adjust));
+ brush_gamma_adjust = GTK_ADJUSTMENT (gtk_adjustment_new (pcvals.brushgamma,
+ 0.5, 3.0, 0.1, 0.1, 1.0));
+ tmpw = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, brush_gamma_adjust);
gtk_widget_set_size_request (GTK_WIDGET (tmpw), 100, 30);
gtk_scale_set_draw_value (GTK_SCALE (tmpw), FALSE);
gtk_scale_set_digits (GTK_SCALE (tmpw), 2);
@@ -593,7 +590,7 @@ create_brushpage (GtkNotebook *notebook)
gtk_box_pack_start (GTK_BOX (thispage), table, FALSE, FALSE, 0);
gtk_widget_show (table);
- brush_aspect_adjust =
+ brush_aspect_adjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Aspect ratio:"),
150, -1, pcvals.brush_aspect,
@@ -606,7 +603,7 @@ create_brushpage (GtkNotebook *notebook)
g_signal_connect (brush_aspect_adjust, "value-changed",
G_CALLBACK (brush_asepct_adjust_cb), &pcvals.brush_aspect);
- brush_relief_adjust =
+ brush_relief_adjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Relief:"),
150, -1, pcvals.brush_relief,
diff --git a/plug-ins/gimpressionist/orientmap.c b/plug-ins/gimpressionist/orientmap.c
index 93622ea..1da6b05 100644
--- a/plug-ins/gimpressionist/orientmap.c
+++ b/plug-ins/gimpressionist/orientmap.c
@@ -34,22 +34,22 @@
#define NUMVECTYPES 4
-static GtkWidget *orient_map_window;
-
-static GtkWidget *vector_preview;
-static GtkWidget *orient_map_preview_prev;
-static GtkWidget *prev_button;
-static GtkWidget *next_button;
-static GtkWidget *add_button;
-static GtkWidget *kill_button;
-static GtkObject *vector_preview_brightness_adjust = NULL;
-
-static GtkObject *angle_adjust = NULL;
-static GtkObject *strength_adjust = NULL;
-static GtkObject *orient_map_str_exp_adjust = NULL;
-static GtkObject *angle_offset_adjust = NULL;
-static GtkWidget *vector_types[NUMVECTYPES];
-static GtkWidget *orient_voronoi = NULL;
+static GtkWidget *orient_map_window;
+
+static GtkWidget *vector_preview;
+static GtkWidget *orient_map_preview_prev;
+static GtkWidget *prev_button;
+static GtkWidget *next_button;
+static GtkWidget *add_button;
+static GtkWidget *kill_button;
+static GtkAdjustment *vector_preview_brightness_adjust = NULL;
+
+static GtkAdjustment *angle_adjust = NULL;
+static GtkAdjustment *strength_adjust = NULL;
+static GtkAdjustment *orient_map_str_exp_adjust = NULL;
+static GtkAdjustment *angle_offset_adjust = NULL;
+static GtkWidget *vector_types[NUMVECTYPES];
+static GtkWidget *orient_voronoi = NULL;
#define OMWIDTH 150
#define OMHEIGHT 150
@@ -80,8 +80,8 @@ double get_direction (double x, double y, int from)
{
n = num_vectors;
vec = vector;
- angoff = gtk_adjustment_get_value (GTK_ADJUSTMENT (angle_offset_adjust));
- strexp = gtk_adjustment_get_value (GTK_ADJUSTMENT (orient_map_str_exp_adjust));
+ angoff = gtk_adjustment_get_value (angle_offset_adjust);
+ strexp = gtk_adjustment_get_value (orient_map_str_exp_adjust);
voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (orient_voronoi));
}
else
@@ -225,7 +225,7 @@ update_vector_prev (void)
guchar white[3] = {255, 255, 255};
if (vector_preview_brightness_adjust)
- val = 1.0 - gtk_adjustment_get_value (GTK_ADJUSTMENT (vector_preview_brightness_adjust)) / 100.0;
+ val = 1.0 - gtk_adjustment_get_value (vector_preview_brightness_adjust) / 100.0;
else
val = 0.5;
@@ -286,10 +286,8 @@ update_slides (void)
gint type;
adjignore = TRUE;
- gtk_adjustment_set_value (GTK_ADJUSTMENT (angle_adjust),
- vector[selectedvector].dir);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (strength_adjust),
- vector[selectedvector].str);
+ gtk_adjustment_set_value (angle_adjust, vector[selectedvector].dir);
+ gtk_adjustment_set_value (strength_adjust, vector[selectedvector].str);
type = vector[selectedvector].type;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (vector_types[type]), TRUE);
adjignore = FALSE;
@@ -390,7 +388,7 @@ angle_adjust_move_callback (GtkWidget *w, gpointer data)
{
if (adjignore)
return;
- vector[selectedvector].dir = gtk_adjustment_get_value (GTK_ADJUSTMENT (angle_adjust));
+ vector[selectedvector].dir = gtk_adjustment_get_value (angle_adjust);
vector[selectedvector].dx =
sin (gimp_deg_to_rad (vector[selectedvector].dir));
vector[selectedvector].dy =
@@ -404,7 +402,7 @@ strength_adjust_move_callback (GtkWidget *w, gpointer data)
{
if (adjignore)
return;
- vector[selectedvector].str = gtk_adjustment_get_value (GTK_ADJUSTMENT (strength_adjust));
+ vector[selectedvector].str = gtk_adjustment_get_value (strength_adjust);
update_vector_prev ();
update_orient_map_preview_prev ();
}
@@ -455,8 +453,8 @@ orient_map_response (GtkWidget *widget,
pcvals.orient_vectors[i] = vector[i];
pcvals.num_orient_vectors = num_vectors;
- pcvals.orient_strength_exponent = gtk_adjustment_get_value (GTK_ADJUSTMENT (orient_map_str_exp_adjust));
- pcvals.orient_angle_offset = gtk_adjustment_get_value (GTK_ADJUSTMENT (angle_offset_adjust));
+ pcvals.orient_strength_exponent = gtk_adjustment_get_value (orient_map_str_exp_adjust);
+ pcvals.orient_angle_offset = gtk_adjustment_get_value (angle_offset_adjust);
pcvals.orient_voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (orient_voronoi));
}
};
@@ -492,9 +490,9 @@ update_orientmap_dialog (void)
init_vectors ();
- gtk_adjustment_set_value (GTK_ADJUSTMENT (orient_map_str_exp_adjust),
+ gtk_adjustment_set_value (orient_map_str_exp_adjust,
pcvals.orient_strength_exponent);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (angle_offset_adjust),
+ gtk_adjustment_set_value (angle_offset_adjust,
pcvals.orient_angle_offset);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (orient_voronoi),
pcvals.orient_voronoi);
@@ -578,9 +576,10 @@ create_orientmap_dialog (GtkWidget *parent)
G_CALLBACK (map_click_callback), NULL);
gtk_widget_show (ebox);
- vector_preview_brightness_adjust =
+ vector_preview_brightness_adjust = (GtkAdjustment *)
gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 1.0, 1.0);
- tmpw = gtk_vscale_new (GTK_ADJUSTMENT (vector_preview_brightness_adjust));
+ tmpw = gtk_scale_new (GTK_ORIENTATION_VERTICAL,
+ vector_preview_brightness_adjust);
gtk_scale_set_draw_value (GTK_SCALE (tmpw), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), tmpw, FALSE, FALSE,0);
gtk_widget_show (tmpw);
@@ -667,7 +666,7 @@ create_orientmap_dialog (GtkWidget *parent)
gtk_box_pack_start (GTK_BOX (hbox), table2, TRUE, TRUE, 0);
gtk_widget_show (table2);
- angle_adjust =
+ angle_adjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 0,
_("A_ngle:"),
150, 6, 0.0,
@@ -678,7 +677,7 @@ create_orientmap_dialog (GtkWidget *parent)
g_signal_connect (angle_adjust, "value-changed",
G_CALLBACK (angle_adjust_move_callback), NULL);
- angle_offset_adjust =
+ angle_offset_adjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 1,
_("Ang_le offset:"),
150, 6, 0.0,
@@ -689,7 +688,7 @@ create_orientmap_dialog (GtkWidget *parent)
g_signal_connect (angle_offset_adjust, "value-changed",
G_CALLBACK (angle_offset_adjust_move_callback), NULL);
- strength_adjust =
+ strength_adjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 2,
_("_Strength:"),
150, 6, 1.0,
@@ -700,7 +699,7 @@ create_orientmap_dialog (GtkWidget *parent)
g_signal_connect (strength_adjust, "value-changed",
G_CALLBACK (strength_adjust_move_callback), NULL);
- orient_map_str_exp_adjust =
+ orient_map_str_exp_adjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 3,
_("S_trength exp.:"),
150, 6, 1.0,
diff --git a/plug-ins/gimpressionist/sizemap.c b/plug-ins/gimpressionist/sizemap.c
index a6f47b3..eaf0343 100644
--- a/plug-ins/gimpressionist/sizemap.c
+++ b/plug-ins/gimpressionist/sizemap.c
@@ -44,12 +44,12 @@ static GtkWidget *next_button;
static GtkWidget *add_button;
static GtkWidget *kill_button;
-static GtkObject *smvectprevbrightadjust = NULL;
+static GtkAdjustment *smvectprevbrightadjust = NULL;
-static GtkObject *sizadjust = NULL;
-static GtkObject *smstradjust = NULL;
-static GtkObject *smstrexpadjust = NULL;
-static GtkWidget *size_voronoi = NULL;
+static GtkAdjustment *sizadjust = NULL;
+static GtkAdjustment *smstradjust = NULL;
+static GtkAdjustment *smstrexpadjust = NULL;
+static GtkWidget *size_voronoi = NULL;
#define OMWIDTH 150
#define OMHEIGHT 150
@@ -61,7 +61,7 @@ static double
getsiz_from_gui (double x, double y)
{
return getsiz_proto (x,y, numsmvect, smvector,
- gtk_adjustment_get_value (GTK_ADJUSTMENT (smstrexpadjust)),
+ gtk_adjustment_get_value (smstrexpadjust),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi)));
}
@@ -116,7 +116,7 @@ updatesmvectorprev (void)
guchar white[3] = {255, 255, 255};
if (smvectprevbrightadjust)
- val = 1.0 - gtk_adjustment_get_value (GTK_ADJUSTMENT (smvectprevbrightadjust)) / 100.0;
+ val = 1.0 - gtk_adjustment_get_value (smvectprevbrightadjust) / 100.0;
else
val = 0.5;
@@ -181,10 +181,8 @@ static void
updatesmsliders (void)
{
smadjignore = TRUE;
- gtk_adjustment_set_value (GTK_ADJUSTMENT (sizadjust),
- smvector[selectedsmvector].siz);
- gtk_adjustment_set_value (GTK_ADJUSTMENT (smstradjust),
- smvector[selectedsmvector].str);
+ gtk_adjustment_set_value (sizadjust, smvector[selectedsmvector].siz);
+ gtk_adjustment_set_value (smstradjust, smvector[selectedsmvector].str);
smadjignore = FALSE;
}
@@ -280,7 +278,7 @@ angsmadjmove (GtkWidget *w, gpointer data)
{
if (!smadjignore)
{
- smvector[selectedsmvector].siz = gtk_adjustment_get_value (GTK_ADJUSTMENT (sizadjust));
+ smvector[selectedsmvector].siz = gtk_adjustment_get_value (sizadjust);
updatesmvectorprev ();
updatesmpreviewprev ();
}
@@ -291,7 +289,7 @@ strsmadjmove (GtkWidget *w, gpointer data)
{
if (!smadjignore)
{
- smvector[selectedsmvector].str = gtk_adjustment_get_value (GTK_ADJUSTMENT (smstradjust));
+ smvector[selectedsmvector].str = gtk_adjustment_get_value (smstradjust);
updatesmvectorprev ();
updatesmpreviewprev ();
}
@@ -323,7 +321,7 @@ smresponse (GtkWidget *widget,
pcvals.size_vectors[i] = smvector[i];
pcvals.num_size_vectors = numsmvect;
- pcvals.size_strength_exponent = gtk_adjustment_get_value (GTK_ADJUSTMENT (smstrexpadjust));
+ pcvals.size_strength_exponent = gtk_adjustment_get_value (smstrexpadjust);
pcvals.size_voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi));
}
break;
@@ -367,8 +365,7 @@ update_sizemap_dialog (void)
{
initsmvectors ();
- gtk_adjustment_set_value (GTK_ADJUSTMENT (smstrexpadjust),
- pcvals.size_strength_exponent);
+ gtk_adjustment_set_value (smstrexpadjust, pcvals.size_strength_exponent);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (size_voronoi),
pcvals.size_voronoi);
@@ -449,8 +446,9 @@ create_sizemap_dialog (GtkWidget *parent)
G_CALLBACK (smmapclick), NULL);
gtk_widget_show (tmpw2);
- smvectprevbrightadjust = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 1.0, 1.0);
- tmpw = gtk_vscale_new (GTK_ADJUSTMENT (smvectprevbrightadjust));
+ smvectprevbrightadjust = (GtkAdjustment *)
+ gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 1.0, 1.0);
+ tmpw = gtk_scale_new (GTK_ORIENTATION_VERTICAL, smvectprevbrightadjust);
gtk_scale_set_draw_value (GTK_SCALE (tmpw), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), tmpw,FALSE,FALSE,0);
gtk_widget_show (tmpw);
@@ -507,7 +505,7 @@ create_sizemap_dialog (GtkWidget *parent)
gtk_table_attach_defaults (GTK_TABLE (table1), table2, 0, 2, 2, 3);
gtk_widget_show (table2);
- sizadjust =
+ sizadjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 0,
_("_Size:"),
150, 6, 50.0,
@@ -518,7 +516,7 @@ create_sizemap_dialog (GtkWidget *parent)
g_signal_connect (sizadjust, "value-changed",
G_CALLBACK (angsmadjmove), NULL);
- smstradjust =
+ smstradjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 1,
_("S_trength:"),
150, 6, 1.0,
@@ -529,7 +527,7 @@ create_sizemap_dialog (GtkWidget *parent)
g_signal_connect (smstradjust, "value-changed",
G_CALLBACK (strsmadjmove), NULL);
- smstrexpadjust =
+ smstrexpadjust = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (table2), 0, 2,
_("St_rength exp.:"),
150, 6, 1.0,
diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c
index 0c992b8..8363bd5 100644
--- a/plug-ins/ifs-compose/ifs-compose.c
+++ b/plug-ins/ifs-compose/ifs-compose.c
@@ -72,9 +72,9 @@ typedef enum
typedef struct
{
- GtkObject *adjustment;
- GtkWidget *scale;
- GtkWidget *spin;
+ GtkAdjustment *adjustment;
+ GtkWidget *scale;
+ GtkWidget *spin;
ValuePairType type;
guint timeout_id;
@@ -2123,7 +2123,7 @@ value_pair_create (gpointer data,
value_pair->type = type;
value_pair->timeout_id = 0;
- value_pair->spin = gimp_spin_button_new (&value_pair->adjustment,
+ value_pair->spin = gimp_spin_button_new ((GtkObject **) &value_pair->adjustment,
1.0, lower, upper,
(upper - lower) / 100,
(upper - lower) / 10,
@@ -2136,8 +2136,8 @@ value_pair_create (gpointer data,
if (create_scale)
{
- value_pair->scale =
- gtk_hscale_new (GTK_ADJUSTMENT (value_pair->adjustment));
+ value_pair->scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL,
+ value_pair->adjustment);
if (type == VALUE_PAIR_INT)
gtk_scale_set_digits (GTK_SCALE (value_pair->scale), 0);
@@ -2158,11 +2158,9 @@ static void
value_pair_update (ValuePair *value_pair)
{
if (value_pair->type == VALUE_PAIR_INT)
- gtk_adjustment_set_value (GTK_ADJUSTMENT (value_pair->adjustment),
- *value_pair->data.i);
+ gtk_adjustment_set_value (value_pair->adjustment, *value_pair->data.i);
else
- gtk_adjustment_set_value (GTK_ADJUSTMENT (value_pair->adjustment),
- *value_pair->data.d);
+ gtk_adjustment_set_value (value_pair->adjustment, *value_pair->data.d);
}
@@ -2175,19 +2173,19 @@ value_pair_scale_callback_real (gpointer data)
if (value_pair->type == VALUE_PAIR_DOUBLE)
{
if ((gdouble) *value_pair->data.d !=
- gtk_adjustment_get_value (GTK_ADJUSTMENT (value_pair->adjustment)))
+ gtk_adjustment_get_value (value_pair->adjustment))
{
changed = TRUE;
- *value_pair->data.d = gtk_adjustment_get_value (GTK_ADJUSTMENT (value_pair->adjustment));
+ *value_pair->data.d = gtk_adjustment_get_value (value_pair->adjustment);
}
}
else
{
if (*value_pair->data.i !=
- (gint) gtk_adjustment_get_value (GTK_ADJUSTMENT (value_pair->adjustment)))
+ (gint) gtk_adjustment_get_value (value_pair->adjustment))
{
changed = TRUE;
- *value_pair->data.i = gtk_adjustment_get_value (GTK_ADJUSTMENT (value_pair->adjustment));
+ *value_pair->data.i = gtk_adjustment_get_value (value_pair->adjustment);
}
}
diff --git a/plug-ins/maze/maze-dialog.c b/plug-ins/maze/maze-dialog.c
index 778b9bb..e8e24bc 100644
--- a/plug-ins/maze/maze-dialog.c
+++ b/plug-ins/maze/maze-dialog.c
@@ -56,7 +56,7 @@ typedef void (* EntscaleIntCallback) (gint value,
typedef struct
{
- GtkObject *adjustment;
+ GtkAdjustment *adjustment;
GtkWidget *entry;
gboolean constraint;
EntscaleIntCallback callback;
@@ -562,12 +562,12 @@ entscale_int_new (GtkWidget *table,
gpointer call_data)
{
EntscaleIntData *userdata;
- GtkWidget *hbox;
- GtkWidget *label;
- GtkWidget *entry;
- GtkWidget *scale;
- GtkObject *adjustment;
- gint constraint_val;
+ GtkWidget *hbox;
+ GtkWidget *label;
+ GtkWidget *entry;
+ GtkWidget *scale;
+ GtkAdjustment *adjustment;
+ gint constraint_val;
userdata = g_new (EntscaleIntData, 1);
@@ -588,8 +588,8 @@ entscale_int_new (GtkWidget *table,
constraint_val = ( *intvar < min ? min : *intvar > max ? max : *intvar );
userdata->adjustment = adjustment =
- gtk_adjustment_new (constraint_val, min, max, 1.0, 1.0, 0.0);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
+ GTK_ADJUSTMENT (gtk_adjustment_new (constraint_val, min, max, 1.0, 1.0, 0.0));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_widget_set_size_request (scale, ENTSCALE_INT_SCALE_WIDTH, -1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
@@ -678,7 +678,7 @@ entscale_int_entry_update (GtkWidget *widget,
gint *intvar = data;
userdata = g_object_get_data (G_OBJECT (widget), "userdata");
- adjustment = GTK_ADJUSTMENT (userdata->adjustment);
+ adjustment = userdata->adjustment;
new_val = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
constraint_val = new_val;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]