From 80997a86466213e1e329ace487863218ef8c3647 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 24 Jun 2018 18:15:16 +0200 Subject: [PATCH] Remove most GTK_ADJUSTMENT() and (GtkAdjutment *) casts they are obsolete in GTK+ 3.x because GtkAdjustment cannot be passed around as GtkObject any longer, GtkObject is gone. --- app/actions/gradient-editor-commands.c | 4 +- app/dialogs/channel-options-dialog.c | 3 +- app/dialogs/convert-indexed-dialog.c | 3 +- app/dialogs/layer-options-dialog.c | 10 ++--- app/dialogs/offset-dialog.c | 3 +- app/dialogs/print-size-dialog.c | 8 ++-- app/dialogs/resize-dialog.c | 2 +- app/display/gimpdisplayshell.c | 8 ++-- app/display/gimpnavigationeditor.c | 4 +- app/tools/gimprectangleoptions.c | 2 +- app/widgets/gimpbrushfactoryview.c | 5 +-- app/widgets/gimpbrushselect.c | 6 +-- app/widgets/gimpgradienteditor.c | 8 ++-- app/widgets/gimplayertreeview.c | 5 +-- app/widgets/gimppropwidgets.c | 5 +-- app/widgets/gimptemplateeditor.c | 8 ++-- app/widgets/gimptextstyleeditor.c | 8 ++-- libgimpwidgets/gimpcolorscales.c | 2 +- libgimpwidgets/gimpmemsizeentry.c | 14 +++---- libgimpwidgets/gimppropwidgets.c | 12 +++--- libgimpwidgets/gimpquerybox.c | 6 +-- libgimpwidgets/gimpscaleentry.c | 2 +- libgimpwidgets/gimpscrolledpreview.c | 6 +-- libgimpwidgets/gimpsizeentry.c | 16 ++++---- libgimpwidgets/gimpwidgets.c | 5 +-- modules/color-selector-cmyk.c | 29 +++++++-------- plug-ins/common/file-gbr.c | 2 +- plug-ins/common/file-gih.c | 4 +- plug-ins/common/file-html-table.c | 9 ++--- plug-ins/common/file-pdf-load.c | 17 ++++----- plug-ins/common/file-ps.c | 42 ++++++++++----------- plug-ins/common/file-svg.c | 20 +++++----- plug-ins/common/file-wmf.c | 20 +++++----- plug-ins/common/file-xbm.c | 14 +++---- plug-ins/common/film.c | 8 ++-- plug-ins/common/sample-colorize.c | 10 ++--- plug-ins/common/smooth-palette.c | 3 +- plug-ins/common/tile-small.c | 11 +++--- plug-ins/common/unit-editor.c | 16 ++++---- plug-ins/common/warp.c | 2 +- plug-ins/common/web-page.c | 3 +- plug-ins/file-fli/fli-gimp.c | 8 ++-- plug-ins/file-jpeg/jpeg-save.c | 13 +++---- plug-ins/file-webp/file-webp-dialog.c | 6 +-- plug-ins/gimpressionist/brush.c | 15 ++++---- plug-ins/gimpressionist/color.c | 2 +- plug-ins/gimpressionist/general.c | 20 +++++----- plug-ins/gimpressionist/orientation.c | 20 ++++------ plug-ins/gimpressionist/orientmap.c | 10 ++--- plug-ins/gimpressionist/paper.c | 4 +- plug-ins/gimpressionist/placement.c | 2 +- plug-ins/gimpressionist/size.c | 6 +-- plug-ins/gimpressionist/sizemap.c | 8 ++-- plug-ins/gimpressionist/utils.c | 2 +- plug-ins/ifs-compose/ifs-compose.c | 9 ++--- plug-ins/imagemap/imap_ui_grid.c | 2 +- plug-ins/lighting/lighting-ui.c | 8 ++-- plug-ins/map-object/map-object-ui.c | 47 +++++++++--------------- plug-ins/print/print-page-layout.c | 12 +++--- plug-ins/screenshot/screenshot.c | 10 ++--- plug-ins/script-fu/script-fu-interface.c | 4 +- 61 files changed, 254 insertions(+), 319 deletions(-) diff --git a/app/actions/gradient-editor-commands.c b/app/actions/gradient-editor-commands.c index 316de325c4..80ed39b548 100644 --- a/app/actions/gradient-editor-commands.c +++ b/app/actions/gradient-editor-commands.c @@ -430,7 +430,7 @@ gradient_editor_replicate_cmd_callback (GtkAction *action, gtk_widget_show (label); /* Scale */ - scale_data = GTK_ADJUSTMENT (gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0)); + scale_data = gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0); scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_data); gtk_scale_set_digits (GTK_SCALE (scale), 0); @@ -540,7 +540,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action, gtk_widget_show (label); /* Scale */ - scale_data = GTK_ADJUSTMENT (gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0)); + scale_data = gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0); scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, scale_data); gtk_scale_set_digits (GTK_SCALE (scale), 0); diff --git a/app/dialogs/channel-options-dialog.c b/app/dialogs/channel-options-dialog.c index eda81b6dc7..f9437a5288 100644 --- a/app/dialogs/channel-options-dialog.c +++ b/app/dialogs/channel-options-dialog.c @@ -139,8 +139,7 @@ channel_options_dialog_new (GimpImage *image, g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) channel_options_dialog_free, private); - opacity_adj = (GtkAdjustment *) - gtk_adjustment_new (channel_color->a * 100.0, + opacity_adj = gtk_adjustment_new (channel_color->a * 100.0, 0.0, 100.0, 1.0, 10.0, 0); scale = gimp_spin_scale_new (opacity_adj, NULL, 1); gtk_widget_set_size_request (scale, 200, -1); diff --git a/app/dialogs/convert-indexed-dialog.c b/app/dialogs/convert-indexed-dialog.c index b521025120..139ab7cb6f 100644 --- a/app/dialogs/convert-indexed-dialog.c +++ b/app/dialogs/convert-indexed-dialog.c @@ -198,8 +198,7 @@ convert_indexed_dialog_new (GimpImage *image, if (private->max_colors == 256 && gimp_image_has_alpha (image)) private->max_colors = 255; - adjustment = (GtkAdjustment *) - gtk_adjustment_new (private->max_colors, 2, 256, 1, 8, 0); + adjustment = gtk_adjustment_new (private->max_colors, 2, 256, 1, 8, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton); diff --git a/app/dialogs/layer-options-dialog.c b/app/dialogs/layer-options-dialog.c index dea850cae1..a9216a080d 100644 --- a/app/dialogs/layer-options-dialog.c +++ b/app/dialogs/layer-options-dialog.c @@ -233,8 +233,8 @@ layer_options_dialog_new (GimpImage *image, /* set the sensitivity of above 3 menus */ layer_options_dialog_update_mode_sensitivity (private); - adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (private->opacity, 0.0, 100.0, - 1.0, 10.0, 0.0)); + adjustment = gtk_adjustment_new (private->opacity, 0.0, 100.0, + 1.0, 10.0, 0.0); scale = gimp_spin_scale_new (adjustment, NULL, 1); item_options_dialog_add_widget (dialog, _("_Opacity:"), scale); @@ -260,8 +260,7 @@ layer_options_dialog_new (GimpImage *image, gtk_widget_show (label); /* The size sizeentry */ - adjustment = (GtkAdjustment *) - gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); @@ -318,8 +317,7 @@ layer_options_dialog_new (GimpImage *image, gtk_widget_show (label); /* The offset sizeentry */ - adjustment = (GtkAdjustment *) - gtk_adjustment_new (0, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (0, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); diff --git a/app/dialogs/offset-dialog.c b/app/dialogs/offset-dialog.c index 97a3e161d3..e27485a988 100644 --- a/app/dialogs/offset-dialog.c +++ b/app/dialogs/offset-dialog.c @@ -168,8 +168,7 @@ offset_dialog_new (GimpDrawable *drawable, gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); - adjustment = (GtkAdjustment *) - gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); diff --git a/app/dialogs/print-size-dialog.c b/app/dialogs/print-size-dialog.c index ccdcb0f4f8..2871bf92da 100644 --- a/app/dialogs/print-size-dialog.c +++ b/app/dialogs/print-size-dialog.c @@ -154,12 +154,12 @@ print_size_dialog_new (GimpImage *image, /* the print size entry */ - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); width = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH); - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); height = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH); @@ -215,12 +215,12 @@ print_size_dialog_new (GimpImage *image, /* the resolution entry */ - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); width = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH); - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); height = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH); diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 4656652c2d..23665fe409 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -235,7 +235,7 @@ resize_dialog_new (GimpViewable *viewable, gtk_widget_show (vbox); /* the offset sizeentry */ - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), SB_WIDTH); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index ae8cac003d..35085d0510 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -434,14 +434,14 @@ gimp_display_shell_constructed (GObject *object) gtk_widget_show (grid); /* the horizontal scrollbar */ - shell->hsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_width, - 1, 1, image_width)); + shell->hsbdata = gtk_adjustment_new (0, 0, image_width, + 1, 1, image_width); shell->hsb = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, shell->hsbdata); gtk_widget_set_can_focus (shell->hsb, FALSE); /* the vertical scrollbar */ - shell->vsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_height, - 1, 1, image_height)); + shell->vsbdata = gtk_adjustment_new (0, 0, image_height, + 1, 1, image_height); shell->vsb = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, shell->vsbdata); gtk_widget_set_can_focus (shell->vsb, FALSE); diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c index 479a6e5a54..1b38dfa6be 100644 --- a/app/display/gimpnavigationeditor.c +++ b/app/display/gimpnavigationeditor.c @@ -430,8 +430,8 @@ gimp_navigation_editor_new_private (GimpMenuFactory *menu_factory, gtk_box_pack_end (GTK_BOX (editor), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - editor->zoom_adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -8.0, 8.0, 0.5, 1.0, 0.0)); + editor->zoom_adjustment = gtk_adjustment_new (0.0, -8.0, 8.0, + 0.5, 1.0, 0.0); g_signal_connect (editor->zoom_adjustment, "value-changed", G_CALLBACK (gimp_navigation_editor_zoom_adj_changed), diff --git a/app/tools/gimprectangleoptions.c b/app/tools/gimprectangleoptions.c index 9328d58e43..c2f66cc2a0 100644 --- a/app/tools/gimprectangleoptions.c +++ b/app/tools/gimprectangleoptions.c @@ -792,7 +792,7 @@ gimp_rectangle_options_prop_dimension_frame_new (GObject *config, gtk_container_add (GTK_CONTAINER (frame), hbox); gtk_widget_show (hbox); - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), SB_WIDTH); diff --git a/app/widgets/gimpbrushfactoryview.c b/app/widgets/gimpbrushfactoryview.c index 97d88add79..ec63d69c0a 100644 --- a/app/widgets/gimpbrushfactoryview.c +++ b/app/widgets/gimpbrushfactoryview.c @@ -73,9 +73,8 @@ gimp_brush_factory_view_class_init (GimpBrushFactoryViewClass *klass) static void gimp_brush_factory_view_init (GimpBrushFactoryView *view) { - view->spacing_adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 5000.0, - 1.0, 10.0, 0.0)); + view->spacing_adjustment = gtk_adjustment_new (0.0, 1.0, 5000.0, + 1.0, 10.0, 0.0); view->spacing_scale = gimp_spin_scale_new (view->spacing_adjustment, _("Spacing"), 1); diff --git a/app/widgets/gimpbrushselect.c b/app/widgets/gimpbrushselect.c index e15168ff00..f7e954a4db 100644 --- a/app/widgets/gimpbrushselect.c +++ b/app/widgets/gimpbrushselect.c @@ -167,9 +167,9 @@ gimp_brush_select_constructed (GObject *object) /* Create the opacity scale widget */ select->opacity_data = - GTK_ADJUSTMENT (gtk_adjustment_new (gimp_context_get_opacity (dialog->context) * 100.0, - 0.0, 100.0, - 1.0, 10.0, 0.0)); + gtk_adjustment_new (gimp_context_get_opacity (dialog->context) * 100.0, + 0.0, 100.0, + 1.0, 10.0, 0.0); scale = gimp_spin_scale_new (select->opacity_data, _("Opacity"), 1); diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index a2476eb238..a3e7b42d12 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -365,10 +365,10 @@ gimp_gradient_editor_init (GimpGradientEditor *editor) /* Scrollbar */ editor->zoom_factor = 1; - editor->scroll_data = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1.0, - GRAD_SCROLLBAR_STEP_SIZE, - GRAD_SCROLLBAR_PAGE_SIZE, - 1.0)); + editor->scroll_data = gtk_adjustment_new (0.0, 0.0, 1.0, + GRAD_SCROLLBAR_STEP_SIZE, + GRAD_SCROLLBAR_PAGE_SIZE, + 1.0); g_signal_connect (editor->scroll_data, "value-changed", G_CALLBACK (gradient_editor_scrollbar_update), diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c index bf5c482989..47c33cd3b4 100644 --- a/app/widgets/gimplayertreeview.c +++ b/app/widgets/gimplayertreeview.c @@ -284,9 +284,8 @@ gimp_layer_tree_view_init (GimpLayerTreeView *view) /* Opacity scale */ - view->priv->opacity_adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (100.0, 0.0, 100.0, - 1.0, 10.0, 0.0)); + view->priv->opacity_adjustment = gtk_adjustment_new (100.0, 0.0, 100.0, + 1.0, 10.0, 0.0); scale = gimp_spin_scale_new (view->priv->opacity_adjustment, _("Opacity"), 1); gimp_help_set_help_data (scale, NULL, GIMP_HELP_LAYER_DIALOG_OPACITY_SCALE); diff --git a/app/widgets/gimppropwidgets.c b/app/widgets/gimppropwidgets.c index 51eedde41d..ce536293a3 100644 --- a/app/widgets/gimppropwidgets.c +++ b/app/widgets/gimppropwidgets.c @@ -503,9 +503,8 @@ gimp_prop_spin_scale_new (GObject *config, if (! G_IS_PARAM_SPEC_DOUBLE (param_spec)) digits = 0; - adjustment = (GtkAdjustment *) - gtk_adjustment_new (value, lower, upper, - step_increment, page_increment, 0.0); + adjustment = gtk_adjustment_new (value, lower, upper, + step_increment, page_increment, 0.0); scale = gimp_spin_scale_new (adjustment, label, digits); diff --git a/app/widgets/gimptemplateeditor.c b/app/widgets/gimptemplateeditor.c index fcf7d2a2f3..60c687b35b 100644 --- a/app/widgets/gimptemplateeditor.c +++ b/app/widgets/gimptemplateeditor.c @@ -183,12 +183,12 @@ gimp_template_editor_constructed (GObject *object) gtk_container_add (GTK_CONTAINER (frame), grid); gtk_widget_show (grid); - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); width = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH); - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); height = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH); @@ -306,12 +306,12 @@ gimp_template_editor_constructed (GObject *object) gtk_container_add (GTK_CONTAINER (frame), grid); gtk_widget_show (grid); - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); xres = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (xres), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (xres), SB_WIDTH); - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 0); yres = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (yres), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (yres), SB_WIDTH); diff --git a/app/widgets/gimptextstyleeditor.c b/app/widgets/gimptextstyleeditor.c index 56c1d374e6..d94aa1efaf 100644 --- a/app/widgets/gimptextstyleeditor.c +++ b/app/widgets/gimptextstyleeditor.c @@ -263,8 +263,8 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor) G_CALLBACK (gimp_text_style_editor_color_changed), editor); - editor->kerning_adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -1000.0, 1000.0, 1.0, 10.0, 0.0)); + editor->kerning_adjustment = gtk_adjustment_new (0.0, -1000.0, 1000.0, + 1.0, 10.0, 0.0); editor->kerning_spinbutton = gtk_spin_button_new (editor->kerning_adjustment, 1.0, 1); gtk_entry_set_width_chars (GTK_ENTRY (editor->kerning_spinbutton), 5); @@ -279,8 +279,8 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor) G_CALLBACK (gimp_text_style_editor_kerning_changed), editor); - editor->baseline_adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -1000.0, 1000.0, 1.0, 10.0, 0.0)); + editor->baseline_adjustment = gtk_adjustment_new (0.0, -1000.0, 1000.0, + 1.0, 10.0, 0.0); editor->baseline_spinbutton = gtk_spin_button_new (editor->baseline_adjustment, 1.0, 1); gtk_entry_set_width_chars (GTK_ENTRY (editor->baseline_spinbutton), 5); diff --git a/libgimpwidgets/gimpcolorscales.c b/libgimpwidgets/gimpcolorscales.c index 8fd8bc1b9b..4af95bfb25 100644 --- a/libgimpwidgets/gimpcolorscales.c +++ b/libgimpwidgets/gimpcolorscales.c @@ -308,7 +308,7 @@ create_group (GimpColorScales *scales, gtk_size_group_add_widget (size_group0, scales->toggles[i]); - scales->adjustments[i] = (GtkAdjustment *) + scales->adjustments[i] = gimp_color_scale_entry_new (GTK_GRID (grid), 1, row, gettext (enum_desc->value_desc), -1, -1, diff --git a/libgimpwidgets/gimpmemsizeentry.c b/libgimpwidgets/gimpmemsizeentry.c index 123c331baa..c548da65a5 100644 --- a/libgimpwidgets/gimpmemsizeentry.c +++ b/libgimpwidgets/gimpmemsizeentry.c @@ -188,7 +188,6 @@ gimp_memsize_entry_new (guint64 value, { GimpMemsizeEntry *entry; GimpMemsizeEntryPrivate *private; - GtkAdjustment *adj; guint shift; #if _MSC_VER < 1300 @@ -215,19 +214,16 @@ gimp_memsize_entry_new (guint64 value, private->upper = upper; private->shift = shift; - adj = gtk_adjustment_new (CAST (value >> shift), - CAST (lower >> shift), - CAST (upper >> shift), - 1, 8, 0); + private->adjustment = gtk_adjustment_new (CAST (value >> shift), + CAST (lower >> shift), + CAST (upper >> shift), + 1, 8, 0); - private->spinbutton = gtk_spin_button_new (adj, 1.0, 0); + private->spinbutton = gtk_spin_button_new (private->adjustment, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (private->spinbutton), TRUE); #undef CAST - private->adjustment = GTK_ADJUSTMENT (adj); - g_object_ref_sink (private->adjustment); - gtk_entry_set_width_chars (GTK_ENTRY (private->spinbutton), 7); gtk_box_pack_start (GTK_BOX (entry), private->spinbutton, FALSE, FALSE, 0); gtk_widget_show (private->spinbutton); diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c index ae0a11b370..74453d3df9 100644 --- a/libgimpwidgets/gimppropwidgets.c +++ b/libgimpwidgets/gimppropwidgets.c @@ -1229,9 +1229,8 @@ gimp_prop_spin_button_new (GObject *config, if (! G_IS_PARAM_SPEC_DOUBLE (param_spec)) digits = 0; - adjustment = (GtkAdjustment *) - gtk_adjustment_new (value, lower, upper, - step_increment, page_increment, 0); + adjustment = gtk_adjustment_new (value, lower, upper, + step_increment, page_increment, 0); spinbutton = gtk_spin_button_new (adjustment, step_increment, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -1289,9 +1288,8 @@ gimp_prop_hscale_new (GObject *config, if (! G_IS_PARAM_SPEC_DOUBLE (param_spec)) digits = 0; - adjustment = (GtkAdjustment *) - gtk_adjustment_new (value, lower, upper, - step_increment, page_increment, 0.0); + adjustment = gtk_adjustment_new (value, lower, upper, + step_increment, page_increment, 0.0); scale = g_object_new (GTK_TYPE_SCALE, "orientation", GTK_ORIENTATION_HORIZONTAL, @@ -1509,7 +1507,7 @@ gimp_prop_opacity_entry_new (GObject *config, if (adjustment) { gimp_prop_widget_set_factor (GIMP_SCALE_ENTRY_SPINBUTTON (adjustment), - GTK_ADJUSTMENT (adjustment), + adjustment, 100.0, 0.0, 0.0, 1); } diff --git a/libgimpwidgets/gimpquerybox.c b/libgimpwidgets/gimpquerybox.c index 514d6201d4..77ed500b42 100644 --- a/libgimpwidgets/gimpquerybox.c +++ b/libgimpwidgets/gimpquerybox.c @@ -337,8 +337,7 @@ gimp_query_int_box (const gchar *title, if (! query_box) return NULL; - adjustment = (GtkAdjustment *) - gtk_adjustment_new (initial, lower, upper, 1, 10, 0); + adjustment = gtk_adjustment_new (initial, lower, upper, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_activates_default (GTK_ENTRY (spinbutton), TRUE); @@ -401,8 +400,7 @@ gimp_query_double_box (const gchar *title, if (! query_box) return NULL; - adjustment = (GtkAdjustment *) - gtk_adjustment_new (initial, lower, upper, 1, 10, 0); + adjustment = gtk_adjustment_new (initial, lower, upper, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_activates_default (GTK_ENTRY (spinbutton), TRUE); diff --git a/libgimpwidgets/gimpscaleentry.c b/libgimpwidgets/gimpscaleentry.c index 95d07f1f01..8fd907192d 100644 --- a/libgimpwidgets/gimpscaleentry.c +++ b/libgimpwidgets/gimpscaleentry.c @@ -341,7 +341,7 @@ gimp_scale_entry_set_logarithmic (GtkAdjustment *adjustment, g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); - spin_adj = GTK_ADJUSTMENT (adjustment); + spin_adj = adjustment; scale_adj = GIMP_SCALE_ENTRY_SCALE_ADJ (adjustment); binding = g_object_get_data (G_OBJECT (adjustment), "binding"); diff --git a/libgimpwidgets/gimpscrolledpreview.c b/libgimpwidgets/gimpscrolledpreview.c index da9f648269..1edf7e5d6c 100644 --- a/libgimpwidgets/gimpscrolledpreview.c +++ b/libgimpwidgets/gimpscrolledpreview.c @@ -149,8 +149,7 @@ gimp_scrolled_preview_init (GimpScrolledPreview *preview) gimp_preview_get_size (GIMP_PREVIEW (preview), &width, &height); /* scrollbars */ - adj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, width - 1, 1.0, - width, width)); + adj = gtk_adjustment_new (0, 0, width - 1, 1.0, width, width); g_signal_connect (adj, "value-changed", G_CALLBACK (gimp_scrolled_preview_h_scroll), @@ -160,8 +159,7 @@ gimp_scrolled_preview_init (GimpScrolledPreview *preview) gtk_widget_set_hexpand (priv->hscr, TRUE); gtk_grid_attach (GTK_GRID (grid), priv->hscr, 0, 1, 1, 1); - adj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, height - 1, 1.0, - height, height)); + adj = gtk_adjustment_new (0, 0, height - 1, 1.0, height, height); g_signal_connect (adj, "value-changed", G_CALLBACK (gimp_scrolled_preview_v_scroll), diff --git a/libgimpwidgets/gimpsizeentry.c b/libgimpwidgets/gimpsizeentry.c index e964cb153c..8374d352c1 100644 --- a/libgimpwidgets/gimpsizeentry.c +++ b/libgimpwidgets/gimpsizeentry.c @@ -123,11 +123,11 @@ struct _GimpSizeEntryPrivate static void gimp_size_entry_finalize (GObject *object); static void gimp_size_entry_update_value (GimpSizeEntryField *gsef, gdouble value); -static void gimp_size_entry_value_callback (GtkWidget *widget, +static void gimp_size_entry_value_callback (GtkAdjustment *adjustment, gpointer data); static void gimp_size_entry_update_refval (GimpSizeEntryField *gsef, gdouble refval); -static void gimp_size_entry_refval_callback (GtkWidget *widget, +static void gimp_size_entry_refval_callback (GtkAdjustment *adjustment, gpointer data); static void gimp_size_entry_update_unit (GimpSizeEntry *gse, GimpUnit unit); @@ -935,15 +935,15 @@ gimp_size_entry_set_value (GimpSizeEntry *gse, static void -gimp_size_entry_value_callback (GtkWidget *widget, - gpointer data) +gimp_size_entry_value_callback (GtkAdjustment *adjustment, + gpointer data) { GimpSizeEntryField *gsef; gdouble new_value; gsef = (GimpSizeEntryField *) data; - new_value = gtk_adjustment_get_value (GTK_ADJUSTMENT (widget)); + new_value = gtk_adjustment_get_value (adjustment); if (gsef->value != new_value) gimp_size_entry_update_value (gsef, new_value); @@ -1217,15 +1217,15 @@ gimp_size_entry_set_refval (GimpSizeEntry *gse, } static void -gimp_size_entry_refval_callback (GtkWidget *widget, - gpointer data) +gimp_size_entry_refval_callback (GtkAdjustment *adjustment, + gpointer data) { GimpSizeEntryField *gsef; gdouble new_refval; gsef = (GimpSizeEntryField *) data; - new_refval = gtk_adjustment_get_value (GTK_ADJUSTMENT (widget)); + new_refval = gtk_adjustment_get_value (adjustment); if (gsef->refval != new_refval) gimp_size_entry_update_refval (gsef, new_refval); diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index a722902c08..102a152527 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -457,8 +457,7 @@ gimp_random_seed_new (guint *seed, if (*random_seed) *seed = g_random_int (); - adj = (GtkAdjustment *) - gtk_adjustment_new (*seed, 0, (guint32) -1, 1, 10, 0); + adj = gtk_adjustment_new (*seed, 0, (guint32) -1, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0); @@ -694,7 +693,7 @@ gimp_coordinates_new (GimpUnit unit, GtkWidget *sizeentry; GtkWidget *chainbutton; - adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 0, 1, 1, 10, 0); + adjustment = gtk_adjustment_new (1, 0, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/modules/color-selector-cmyk.c b/modules/color-selector-cmyk.c index 249bccaeba..8d7ac1a39d 100644 --- a/modules/color-selector-cmyk.c +++ b/modules/color-selector-cmyk.c @@ -130,9 +130,8 @@ colorsel_cmyk_class_finalize (ColorselCmykClass *klass) static void colorsel_cmyk_init (ColorselCmyk *module) { - GtkWidget *grid; - GtkAdjustment *adj; - gint i; + GtkWidget *grid; + gint i; static const gchar * const cmyk_labels[] = { @@ -169,22 +168,20 @@ colorsel_cmyk_init (ColorselCmyk *module) for (i = 0; i < 4; i++) { - adj = gimp_scale_entry_new (GTK_GRID (grid), 1, i, - gettext (cmyk_labels[i]), - -1, -1, - 0.0, - 0.0, 100.0, - 1.0, 10.0, - 0, - TRUE, 0.0, 0.0, - gettext (cmyk_tips[i]), - NULL); + module->adj[i] = gimp_scale_entry_new (GTK_GRID (grid), 1, i, + gettext (cmyk_labels[i]), + -1, -1, + 0.0, + 0.0, 100.0, + 1.0, 10.0, + 0, + TRUE, 0.0, 0.0, + gettext (cmyk_tips[i]), + NULL); - g_signal_connect (adj, "value-changed", + g_signal_connect (module->adj[i], "value-changed", G_CALLBACK (colorsel_cmyk_adj_update), module); - - module->adj[i] = GTK_ADJUSTMENT (adj); } module->name_label = gtk_label_new (NULL); diff --git a/plug-ins/common/file-gbr.c b/plug-ins/common/file-gbr.c index d5ce848ba9..05fcadae87 100644 --- a/plug-ins/common/file-gbr.c +++ b/plug-ins/common/file-gbr.c @@ -820,7 +820,7 @@ save_dialog (void) G_CALLBACK (entry_callback), info.description); - adj = (GtkAdjustment *) gtk_adjustment_new (info.spacing, 1, 1000, 1, 10, 0); + adj = gtk_adjustment_new (info.spacing, 1, 1000, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_activates_default (GTK_ENTRY (spinbutton), TRUE); diff --git a/plug-ins/common/file-gih.c b/plug-ins/common/file-gih.c index 4110f6e5e0..757469a658 100644 --- a/plug-ins/common/file-gih.c +++ b/plug-ins/common/file-gih.c @@ -800,7 +800,7 @@ gih_load_image (GFile *file, /* save routines */ static void -size_adjustment_callback (GtkWidget *widget, +size_adjustment_callback (GtkAdjustment *adjustment, SizeAdjustmentData *adj) { gint i; @@ -815,7 +815,7 @@ size_adjustment_callback (GtkWidget *widget, adj->guides = NULL; gimp_displays_flush (); - *(adj->value) = gtk_adjustment_get_value (GTK_ADJUSTMENT (widget)); + *(adj->value) = gtk_adjustment_get_value (adjustment); if (adj->orientation == GIMP_ORIENTATION_VERTICAL) { diff --git a/plug-ins/common/file-html-table.c b/plug-ins/common/file-html-table.c index f8215af6f8..b568030ff1 100644 --- a/plug-ins/common/file-html-table.c +++ b/plug-ins/common/file-html-table.c @@ -617,8 +617,7 @@ save_dialog (gint32 image_ID) gtk_grid_set_column_spacing (GTK_GRID (grid), 6); gtk_container_add (GTK_CONTAINER (frame), grid); - adj = (GtkAdjustment *) gtk_adjustment_new (gtmvals.border, - 0, 1000, 1, 10, 0); + adj = gtk_adjustment_new (gtmvals.border, 0, 1000, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, @@ -665,8 +664,7 @@ save_dialog (gint32 image_ID) G_CALLBACK (entry_changed_callback), gtmvals.clheight); - adj = (GtkAdjustment *) gtk_adjustment_new (gtmvals.cellpadding, - 0, 1000, 1, 10, 0); + adj = gtk_adjustment_new (gtmvals.cellpadding, 0, 1000, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 3, @@ -680,8 +678,7 @@ save_dialog (gint32 image_ID) G_CALLBACK (gimp_int_adjustment_update), >mvals.cellpadding); - adj = (GtkAdjustment *) gtk_adjustment_new (gtmvals.cellspacing, - 0, 1000, 1, 10, 0); + adj = gtk_adjustment_new (gtmvals.cellspacing, 0, 1000, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 4, diff --git a/plug-ins/common/file-pdf-load.c b/plug-ins/common/file-pdf-load.c index 74970f25fd..faf732e803 100644 --- a/plug-ins/common/file-pdf-load.c +++ b/plug-ins/common/file-pdf-load.c @@ -228,7 +228,7 @@ static void gimp_resolution_entry_init (GimpResolutionEntry *g static void gimp_resolution_entry_update_value (GimpResolutionEntryField *gref, gdouble value); -static void gimp_resolution_entry_value_callback (GtkWidget *widget, +static void gimp_resolution_entry_value_callback (GtkAdjustment *adjustment, gpointer data); static void gimp_resolution_entry_update_unit (GimpResolutionEntry *gre, GimpUnit unit); @@ -1560,11 +1560,10 @@ gimp_resolution_entry_field_init (GimpResolutionEntry *gre, digits = size ? 0 : MIN (gimp_unit_get_digits (initial_unit), 5) + 1; - gref->adjustment = (GtkAdjustment *) - gtk_adjustment_new (gref->value, - gref->min_value, - gref->max_value, - 1.0, 10.0, 0.0); + gref->adjustment = gtk_adjustment_new (gref->value, + gref->min_value, + gref->max_value, + 1.0, 10.0, 0.0); gref->spinbutton = gtk_spin_button_new (gref->adjustment, 1.0, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (gref->spinbutton), TRUE); @@ -1825,13 +1824,13 @@ gimp_resolution_entry_update_value (GimpResolutionEntryField *gref, } static void -gimp_resolution_entry_value_callback (GtkWidget *widget, - gpointer data) +gimp_resolution_entry_value_callback (GtkAdjustment *adjustment, + gpointer data) { GimpResolutionEntryField *gref = (GimpResolutionEntryField *) data; gdouble new_value; - new_value = gtk_adjustment_get_value (GTK_ADJUSTMENT (widget)); + new_value = gtk_adjustment_get_value (adjustment); if (gref->value != new_value) gimp_resolution_entry_update_value (gref, new_value); diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c index ad34b7683e..d3c7c4a186 100644 --- a/plug-ins/common/file-ps.c +++ b/plug-ins/common/file-ps.c @@ -3442,9 +3442,9 @@ load_dialog (const gchar *filename) gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0); gtk_widget_show (grid); - adj = (GtkAdjustment *) gtk_adjustment_new (plvals.resolution, - MIN_RESOLUTION, MAX_RESOLUTION, - 1, 10, 0); + adj = gtk_adjustment_new (plvals.resolution, + MIN_RESOLUTION, MAX_RESOLUTION, + 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, @@ -3458,9 +3458,9 @@ load_dialog (const gchar *filename) G_CALLBACK (gimp_int_adjustment_update), &plvals.resolution); - adj = (GtkAdjustment *) gtk_adjustment_new (plvals.width, - 1, GIMP_MAX_IMAGE_SIZE, - 1, 10, 0); + adj = gtk_adjustment_new (plvals.width, + 1, GIMP_MAX_IMAGE_SIZE, + 1, 10, 0); ps_width_spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1, @@ -3471,9 +3471,9 @@ load_dialog (const gchar *filename) G_CALLBACK (gimp_int_adjustment_update), &plvals.width); - adj = (GtkAdjustment *) gtk_adjustment_new (plvals.height, - 1, GIMP_MAX_IMAGE_SIZE, - 1, 10, 0); + adj = gtk_adjustment_new (plvals.height, + 1, GIMP_MAX_IMAGE_SIZE, + 1, 10, 0); ps_height_spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 2, @@ -3663,9 +3663,8 @@ save_dialog (void) gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0); gtk_widget_show (grid); - vals->adjustment[0] = (GtkAdjustment *) - gtk_adjustment_new (psvals.width, - 1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); + vals->adjustment[0] = gtk_adjustment_new (psvals.width, + 1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); spinbutton = gtk_spin_button_new (vals->adjustment[0], 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, @@ -3675,9 +3674,8 @@ save_dialog (void) G_CALLBACK (gimp_double_adjustment_update), &psvals.width); - vals->adjustment[1] = (GtkAdjustment *) - gtk_adjustment_new (psvals.height, - 1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); + vals->adjustment[1] = gtk_adjustment_new (psvals.height, + 1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); spinbutton = gtk_spin_button_new (vals->adjustment[1], 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1, @@ -3687,9 +3685,8 @@ save_dialog (void) G_CALLBACK (gimp_double_adjustment_update), &psvals.height); - vals->adjustment[2] = (GtkAdjustment *) - gtk_adjustment_new (psvals.x_offset, - 0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); + vals->adjustment[2] = gtk_adjustment_new (psvals.x_offset, + 0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); spinbutton = gtk_spin_button_new (vals->adjustment[2], 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 2, @@ -3699,9 +3696,8 @@ save_dialog (void) G_CALLBACK (gimp_double_adjustment_update), &psvals.x_offset); - vals->adjustment[3] = (GtkAdjustment *) - gtk_adjustment_new (psvals.y_offset, - 0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); + vals->adjustment[3] = gtk_adjustment_new (psvals.y_offset, + 0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0); spinbutton = gtk_spin_button_new (vals->adjustment[3], 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 3, @@ -3801,8 +3797,8 @@ save_dialog (void) grid, "sensitive", G_BINDING_SYNC_CREATE); - adj = (GtkAdjustment *) gtk_adjustment_new (psvals.preview_size, - 0, 1024, 1, 10, 0); + adj = gtk_adjustment_new (psvals.preview_size, + 0, 1024, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c index 5da4caa7f9..c3addf2d0d 100644 --- a/plug-ins/common/file-svg.c +++ b/plug-ins/common/file-svg.c @@ -799,7 +799,7 @@ load_dialog (const gchar *filename, // GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (hbox); - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); @@ -846,11 +846,10 @@ load_dialog (const gchar *filename, grid2 = gtk_grid_new (); gtk_box_pack_start (GTK_BOX (hbox), grid2, FALSE, FALSE, 0); - xadj = (GtkAdjustment *) - gtk_adjustment_new (ratio_x, - (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_width, - (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_width, - 0.01, 0.1, 0); + xadj = gtk_adjustment_new (ratio_x, + (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_width, + (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_width, + 0.01, 0.1, 0); spinbutton = gtk_spin_button_new (xadj, 0.01, 4); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); @@ -868,11 +867,10 @@ load_dialog (const gchar *filename, // GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); - yadj = (GtkAdjustment *) - gtk_adjustment_new (ratio_y, - (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_height, - (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_height, - 0.01, 0.1, 0); + yadj = gtk_adjustment_new (ratio_y, + (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_height, + (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_height, + 0.01, 0.1, 0); spinbutton = gtk_spin_button_new (yadj, 0.01, 4); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); diff --git a/plug-ins/common/file-wmf.c b/plug-ins/common/file-wmf.c index ab45fcc28c..a5c7091355 100644 --- a/plug-ins/common/file-wmf.c +++ b/plug-ins/common/file-wmf.c @@ -580,7 +580,7 @@ load_dialog (const gchar *filename) gtk_grid_attach (GTK_GRID (grid), hbox, 1, 0, 1, 1); gtk_widget_show (hbox); - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); @@ -625,11 +625,10 @@ load_dialog (const gchar *filename) grid2 = gtk_grid_new (); gtk_box_pack_start (GTK_BOX (hbox), grid2, FALSE, FALSE, 0); - xadj = (GtkAdjustment *) - gtk_adjustment_new (ratio_x, - (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) wmf_width, - (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) wmf_width, - 0.01, 0.1, 0); + xadj = gtk_adjustment_new (ratio_x, + (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) wmf_width, + (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) wmf_width, + 0.01, 0.1, 0); spinbutton = gtk_spin_button_new (xadj, 0.01, 4); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); @@ -646,11 +645,10 @@ load_dialog (const gchar *filename) gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1); gtk_widget_show (label); - yadj = (GtkAdjustment *) - gtk_adjustment_new (ratio_y, - (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) wmf_height, - (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) wmf_height, - 0.01, 0.1, 0); + yadj = gtk_adjustment_new (ratio_y, + (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) wmf_height, + (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) wmf_height, + 0.01, 0.1, 0); spinbutton = gtk_spin_button_new (yadj, 0.01, 4); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10); diff --git a/plug-ins/common/file-xbm.c b/plug-ins/common/file-xbm.c index 823be812f9..2ed637c855 100644 --- a/plug-ins/common/file-xbm.c +++ b/plug-ins/common/file-xbm.c @@ -1309,10 +1309,9 @@ save_dialog (gint32 drawable_ID) grid, "sensitive", G_BINDING_SYNC_CREATE); - adj = (GtkAdjustment *) - gtk_adjustment_new (xsvals.x_hot, 0, - gimp_drawable_width (drawable_ID) - 1, - 1, 10, 0); + adj = gtk_adjustment_new (xsvals.x_hot, 0, + gimp_drawable_width (drawable_ID) - 1, + 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, @@ -1323,10 +1322,9 @@ save_dialog (gint32 drawable_ID) G_CALLBACK (gimp_int_adjustment_update), &xsvals.x_hot); - adj = (GtkAdjustment *) - gtk_adjustment_new (xsvals.y_hot, 0, - gimp_drawable_height (drawable_ID) - 1, - 1, 10, 0); + adj = gtk_adjustment_new (xsvals.y_hot, 0, + gimp_drawable_height (drawable_ID) - 1, + 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1, diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c index 551dc9519e..45686fc1bd 100644 --- a/plug-ins/common/film.c +++ b/plug-ins/common/film.c @@ -1000,8 +1000,8 @@ create_selection_tab (GtkWidget *notebook, gtk_widget_show (grid); /* Film height */ - adj = GTK_ADJUSTMENT (gtk_adjustment_new (filmvals.film_height, 10, - GIMP_MAX_IMAGE_SIZE, 1, 10, 0)); + adj = gtk_adjustment_new (filmvals.film_height, 10, + GIMP_MAX_IMAGE_SIZE, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -1059,8 +1059,8 @@ create_selection_tab (GtkWidget *notebook, gtk_widget_show (grid); /* Startindex */ - adj = GTK_ADJUSTMENT (gtk_adjustment_new (filmvals.number_start, 0, - GIMP_MAX_IMAGE_SIZE, 1, 10, 0)); + adj = gtk_adjustment_new (filmvals.number_start, 0, + GIMP_MAX_IMAGE_SIZE, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/plug-ins/common/sample-colorize.c b/plug-ins/common/sample-colorize.c index f619ed04d6..05ff46f44f 100644 --- a/plug-ins/common/sample-colorize.c +++ b/plug-ins/common/sample-colorize.c @@ -1567,7 +1567,7 @@ smp_dialog (void) /* min input spinbutton */ data = gtk_adjustment_new ((gfloat)g_values.lvl_in_min, 0.0, 254.0, 1, 10, 0); - g_di.adj_lvl_in_min = GTK_ADJUSTMENT (data); + g_di.adj_lvl_in_min = data; spinbutton = gtk_spin_button_new (g_di.adj_lvl_in_min, 0.5, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -1580,7 +1580,7 @@ smp_dialog (void) /* input gamma spinbutton */ data = gtk_adjustment_new ((gfloat)g_values.lvl_in_gamma, 0.1, 10.0, 0.02, 0.2, 0); - g_di.adj_lvl_in_gamma = GTK_ADJUSTMENT (data); + g_di.adj_lvl_in_gamma = data; spinbutton = gtk_spin_button_new (g_di.adj_lvl_in_gamma, 0.5, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -1593,7 +1593,7 @@ smp_dialog (void) /* high input spinbutton */ data = gtk_adjustment_new ((gfloat)g_values.lvl_in_max, 1.0, 255.0, 1, 10, 0); - g_di.adj_lvl_in_max = GTK_ADJUSTMENT (data); + g_di.adj_lvl_in_max = data; spinbutton = gtk_spin_button_new (g_di.adj_lvl_in_max, 0.5, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -1617,7 +1617,7 @@ smp_dialog (void) /* min output spinbutton */ data = gtk_adjustment_new ((gfloat)g_values.lvl_out_min, 0.0, 254.0, 1, 10, 0); - g_di.adj_lvl_out_min = GTK_ADJUSTMENT (data); + g_di.adj_lvl_out_min = data; spinbutton = gtk_spin_button_new (g_di.adj_lvl_out_min, 0.5, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -1630,7 +1630,7 @@ smp_dialog (void) /* high output spinbutton */ data = gtk_adjustment_new ((gfloat)g_values.lvl_out_max, 0.0, 255.0, 1, 10, 0); - g_di.adj_lvl_out_max = GTK_ADJUSTMENT (data); + g_di.adj_lvl_out_max = data; spinbutton = gtk_spin_button_new (g_di.adj_lvl_out_max, 0.5, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/plug-ins/common/smooth-palette.c b/plug-ins/common/smooth-palette.c index 17aba9caa2..b8a20cc103 100644 --- a/plug-ins/common/smooth-palette.c +++ b/plug-ins/common/smooth-palette.c @@ -469,8 +469,7 @@ dialog (gint32 drawable_id) sizeentry, FALSE, FALSE, 0); gtk_widget_show (sizeentry); - adj = GTK_ADJUSTMENT (gtk_adjustment_new (config.ntries, - 1, 1024, 1, 10, 0)); + adj = gtk_adjustment_new (config.ntries, 1, 1024, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/plug-ins/common/tile-small.c b/plug-ins/common/tile-small.c index 38eaaaa370..4dd87f293e 100644 --- a/plug-ins/common/tile-small.c +++ b/plug-ins/common/tile-small.c @@ -359,8 +359,7 @@ spin_button_new (GtkAdjustment **adjustment, /* return value */ *adjustment = gtk_adjustment_new (value, lower, upper, step_increment, page_increment, 0); - spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment), - climb_rate, digits); + spinbutton = gtk_spin_button_new (*adjustment, climb_rate, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -715,8 +714,8 @@ exp_need_update (gint nx, tileit_exp_update_f, &exp_call); - gtk_adjustment_set_value (GTK_ADJUSTMENT (exp_call.c_adj), nx); - gtk_adjustment_set_value (GTK_ADJUSTMENT (exp_call.r_adj), ny); + gtk_adjustment_set_value (exp_call.c_adj, nx); + gtk_adjustment_set_value (exp_call.r_adj, ny); g_signal_handlers_unblock_by_func (exp_call.c_adj, tileit_exp_update_f, @@ -773,12 +772,12 @@ explicit_update (gboolean settile) gint x,y; /* Make sure bounds are OK */ - y = ROUND (gtk_adjustment_get_value (GTK_ADJUSTMENT (exp_call.r_adj))); + y = ROUND (gtk_adjustment_get_value (exp_call.r_adj)); if (y > itvals.numtiles || y <= 0) { y = itvals.numtiles; } - x = ROUND (gtk_adjustment_get_value (GTK_ADJUSTMENT (exp_call.c_adj))); + x = ROUND (gtk_adjustment_get_value (exp_call.c_adj)); if (x > itvals.numtiles || x <= 0) { x = itvals.numtiles; diff --git a/plug-ins/common/unit-editor.c b/plug-ins/common/unit-editor.c index f3a640d288..c9d03ce93a 100644 --- a/plug-ins/common/unit-editor.c +++ b/plug-ins/common/unit-editor.c @@ -236,11 +236,10 @@ new_unit_dialog (GtkWidget *main_dialog, gimp_help_set_help_data (entry, gettext (columns[IDENTIFIER].help), NULL); - factor_adj = (GtkAdjustment *) - gtk_adjustment_new ((template != GIMP_UNIT_PIXEL) ? - gimp_unit_get_factor (template) : 1.0, - GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, - 0.01, 0.1, 0.0); + factor_adj = gtk_adjustment_new ((template != GIMP_UNIT_PIXEL) ? + gimp_unit_get_factor (template) : 1.0, + GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, + 0.01, 0.1, 0.0); spinbutton = gtk_spin_button_new (factor_adj, 0.01, 5); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1, @@ -249,10 +248,9 @@ new_unit_dialog (GtkWidget *main_dialog, gimp_help_set_help_data (spinbutton, gettext (columns[FACTOR].help), NULL); - digits_adj = (GtkAdjustment *) - gtk_adjustment_new ((template != GIMP_UNIT_PIXEL) ? - gimp_unit_get_digits (template) : 2.0, - 0, 5, 1, 1, 0); + digits_adj = gtk_adjustment_new ((template != GIMP_UNIT_PIXEL) ? + gimp_unit_get_digits (template) : 2.0, + 0, 5, 1, 1, 0); spinbutton = gtk_spin_button_new (digits_adj, 0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 2, diff --git a/plug-ins/common/warp.c b/plug-ins/common/warp.c index 12b84974ad..59e2e42d97 100644 --- a/plug-ins/common/warp.c +++ b/plug-ins/common/warp.c @@ -367,7 +367,7 @@ spin_button_new (GtkAdjustment **adjustment, /* return value */ *adjustment = gtk_adjustment_new (value, lower, upper, step_increment, page_increment, 0); - spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment), + spinbutton = gtk_spin_button_new (*adjustment, climb_rate, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/plug-ins/common/web-page.c b/plug-ins/common/web-page.c index f96c0f1dd4..43a192d7ed 100644 --- a/plug-ins/common/web-page.c +++ b/plug-ins/common/web-page.c @@ -344,8 +344,7 @@ webpage_dialog (void) g_free (webpagevals.url); webpagevals.url = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); - webpagevals.width = (gint) gtk_adjustment_get_value - (GTK_ADJUSTMENT (adjustment)); + webpagevals.width = (gint) gtk_adjustment_get_value (adjustment); gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &webpagevals.font_size); diff --git a/plug-ins/file-fli/fli-gimp.c b/plug-ins/file-fli/fli-gimp.c index d1ada9caab..10e8bf57dd 100644 --- a/plug-ins/file-fli/fli-gimp.c +++ b/plug-ins/file-fli/fli-gimp.c @@ -889,7 +889,7 @@ load_dialog (const gchar *filename) * Maybe I add on-the-fly RGB conversion, to keep palettechanges... * But for now you can set a start- and a end-frame: */ - adj = (GtkAdjustment *) gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0); + adj = gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, @@ -899,7 +899,7 @@ load_dialog (const gchar *filename) G_CALLBACK (gimp_int_adjustment_update), &from_frame); - adj = (GtkAdjustment *) gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0); + adj = gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1, @@ -947,7 +947,7 @@ save_dialog (gint32 image_id) * Maybe I add on-the-fly RGB conversion, to keep palettechanges... * But for now you can set a start- and a end-frame: */ - adj = (GtkAdjustment *) gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0); + adj = gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0, @@ -957,7 +957,7 @@ save_dialog (gint32 image_id) G_CALLBACK (gimp_int_adjustment_update), &from_frame); - adj = (GtkAdjustment *) gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0); + adj = gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0); spinbutton = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1, diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c index 92841e3023..c15c7f4318 100644 --- a/plug-ins/file-jpeg/jpeg-save.c +++ b/plug-ins/file-jpeg/jpeg-save.c @@ -770,8 +770,7 @@ save_dialog (void) gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0); gtk_widget_show (grid); - pg.quality = entry = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + pg.quality = entry = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("_Quality:"), SCALE_WIDTH, 0, jsvals.quality, 0.0, 100.0, 1.0, 10.0, 0, @@ -837,8 +836,7 @@ save_dialog (void) gtk_grid_attach (GTK_GRID (grid), grid2, 2, 0, 4, 1); gtk_widget_show (grid2); - pg.smoothing = entry = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid2), 0, 0, + pg.smoothing = entry = gimp_scale_entry_new (GTK_GRID (grid2), 0, 0, _("S_moothing:"), 100, 0, jsvals.smoothing, 0.0, 1.0, 0.01, 0.1, 2, @@ -857,10 +855,9 @@ save_dialog (void) gtk_grid_attach (GTK_GRID (grid), restart_markers_label, 4, 1, 1, 1); gtk_widget_show (restart_markers_label); - pg.scale_data = (GtkAdjustment *) - gtk_adjustment_new (((jsvals.restart == 0) ? - DEFAULT_RESTART_MCU_ROWS : jsvals.restart), - 1.0, 64.0, 1.0, 1.0, 0); + pg.scale_data = gtk_adjustment_new (((jsvals.restart == 0) ? + DEFAULT_RESTART_MCU_ROWS : jsvals.restart), + 1.0, 64.0, 1.0, 1.0, 0); pg.restart = restart_markers_scale = spinbutton = gtk_spin_button_new (pg.scale_data, 1.0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/plug-ins/file-webp/file-webp-dialog.c b/plug-ins/file-webp/file-webp-dialog.c index 46ee817618..b9e496d47d 100644 --- a/plug-ins/file-webp/file-webp-dialog.c +++ b/plug-ins/file-webp/file-webp-dialog.c @@ -274,9 +274,9 @@ save_dialog (WebPSaveParams *params, gtk_widget_show (label_kf); /* key-frame distance entry */ - adj_kf = (GtkAdjustment *) gtk_adjustment_new (params->kf_distance, - 0.0, 10000.0, - 1.0, 10.0, 0.0); + adj_kf = gtk_adjustment_new (params->kf_distance, + 0.0, 10000.0, + 1.0, 10.0, 0.0); kf_distance = gtk_spin_button_new (adj_kf, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (kf_distance), TRUE); gtk_box_pack_start (GTK_BOX (hbox_kf), kf_distance, FALSE, FALSE, 0); diff --git a/plug-ins/gimpressionist/brush.c b/plug-ins/gimpressionist/brush.c index a9ebb932c3..7daec615a9 100644 --- a/plug-ins/gimpressionist/brush.c +++ b/plug-ins/gimpressionist/brush.c @@ -483,9 +483,9 @@ brush_preview_size_allocate (GtkWidget *preview) } static void -brush_asepct_adjust_cb (GtkWidget *w, gpointer data) +brush_asepct_adjust_cb (GtkAdjustment *a, gpointer data) { - gimp_double_adjustment_update (GTK_ADJUSTMENT (w), data); + gimp_double_adjustment_update (a, data); update_brush_preview (pcvals.selected_brush); } @@ -543,8 +543,8 @@ create_brushpage (GtkNotebook *notebook) gtk_box_pack_start (GTK_BOX (box3), tmpw, FALSE, FALSE,0); gtk_widget_show (tmpw); - brush_gamma_adjust = GTK_ADJUSTMENT (gtk_adjustment_new (pcvals.brushgamma, - 0.5, 3.0, 0.1, 0.1, 1.0)); + brush_gamma_adjust = 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); @@ -591,7 +591,7 @@ create_brushpage (GtkNotebook *notebook) gtk_box_pack_start (GTK_BOX (thispage), grid, FALSE, FALSE, 0); gtk_widget_show (grid); - brush_aspect_adjust = (GtkAdjustment *) + brush_aspect_adjust = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("Aspect ratio:"), 150, -1, pcvals.brush_aspect, @@ -602,9 +602,10 @@ create_brushpage (GtkNotebook *notebook) gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (brush_aspect_adjust)); g_signal_connect (brush_aspect_adjust, "value-changed", - G_CALLBACK (brush_asepct_adjust_cb), &pcvals.brush_aspect); + G_CALLBACK (brush_asepct_adjust_cb), + &pcvals.brush_aspect); - brush_relief_adjust = (GtkAdjustment *) + brush_relief_adjust = gimp_scale_entry_new (GTK_GRID (grid), 0, 1, _("Relief:"), 150, -1, pcvals.brush_relief, diff --git a/plug-ins/gimpressionist/color.c b/plug-ins/gimpressionist/color.c index 49fd3759f6..1b2c1db024 100644 --- a/plug-ins/gimpressionist/color.c +++ b/plug-ins/gimpressionist/color.c @@ -39,7 +39,7 @@ color_restore (void) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (colorradio[pcvals.color_type]), TRUE); - gtk_adjustment_set_value (GTK_ADJUSTMENT (colornoiseadjust), + gtk_adjustment_set_value (colornoiseadjust, pcvals.color_noise); } diff --git a/plug-ins/gimpressionist/general.c b/plug-ins/gimpressionist/general.c index 07c43ce9d6..0bcd94632c 100644 --- a/plug-ins/gimpressionist/general.c +++ b/plug-ins/gimpressionist/general.c @@ -62,13 +62,13 @@ void general_store (void) { pcvals.general_paint_edges = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_paint_edges)); - pcvals.general_dark_edge = gtk_adjustment_get_value (GTK_ADJUSTMENT (general_dark_edge_adjust)); + pcvals.general_dark_edge = gtk_adjustment_get_value (general_dark_edge_adjust); pcvals.general_tileable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_tileable)); pcvals.general_drop_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_drop_shadow)); - pcvals.general_shadow_darkness = gtk_adjustment_get_value (GTK_ADJUSTMENT (general_shadow_adjust)); - pcvals.general_shadow_depth = gtk_adjustment_get_value (GTK_ADJUSTMENT (general_shadow_depth)); - pcvals.general_shadow_blur = gtk_adjustment_get_value (GTK_ADJUSTMENT (general_shadow_blur)); - pcvals.devthresh = gtk_adjustment_get_value (GTK_ADJUSTMENT (dev_thresh_adjust)); + pcvals.general_shadow_darkness = gtk_adjustment_get_value (general_shadow_adjust); + pcvals.general_shadow_depth = gtk_adjustment_get_value (general_shadow_depth); + pcvals.general_shadow_blur = gtk_adjustment_get_value (general_shadow_blur); + pcvals.devthresh = gtk_adjustment_get_value (dev_thresh_adjust); } int @@ -86,21 +86,21 @@ general_restore (void) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_paint_edges), pcvals.general_paint_edges); - gtk_adjustment_set_value (GTK_ADJUSTMENT (general_dark_edge_adjust), + gtk_adjustment_set_value (general_dark_edge_adjust, pcvals.general_dark_edge); - gtk_adjustment_set_value (GTK_ADJUSTMENT (general_shadow_adjust), + gtk_adjustment_set_value (general_shadow_adjust, pcvals.general_shadow_darkness); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_drop_shadow), pcvals.general_drop_shadow); - gtk_adjustment_set_value (GTK_ADJUSTMENT (general_shadow_depth), + gtk_adjustment_set_value (general_shadow_depth, pcvals.general_shadow_depth); - gtk_adjustment_set_value (GTK_ADJUSTMENT (general_shadow_blur), + gtk_adjustment_set_value (general_shadow_blur, pcvals.general_shadow_blur); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_tileable), pcvals.general_tileable); gimp_color_button_set_color (GIMP_COLOR_BUTTON (general_color_button), &pcvals.color); - gtk_adjustment_set_value (GTK_ADJUSTMENT (dev_thresh_adjust), + gtk_adjustment_set_value (dev_thresh_adjust, pcvals.devthresh); } diff --git a/plug-ins/gimpressionist/orientation.c b/plug-ins/gimpressionist/orientation.c index 8cb137fe1d..dd1e06da2e 100644 --- a/plug-ins/gimpressionist/orientation.c +++ b/plug-ins/gimpressionist/orientation.c @@ -47,18 +47,14 @@ int orientation_type_input (int in) void orientation_restore (void) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (orient_radio[pcvals.orient_type]), - TRUE); - gtk_adjustment_set_value ( - GTK_ADJUSTMENT (orient_num_adjust), - pcvals.orient_num); - gtk_adjustment_set_value ( - GTK_ADJUSTMENT (orient_first_adjust), - pcvals.orient_first); - gtk_adjustment_set_value ( - GTK_ADJUSTMENT (orient_last_adjust), - pcvals.orient_last); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (orient_radio[pcvals.orient_type]), + TRUE); + gtk_adjustment_set_value (orient_num_adjust, + pcvals.orient_num); + gtk_adjustment_set_value (orient_first_adjust, + pcvals.orient_first); + gtk_adjustment_set_value (orient_last_adjust, + pcvals.orient_last); } static void diff --git a/plug-ins/gimpressionist/orientmap.c b/plug-ins/gimpressionist/orientmap.c index 507527cd68..0d264000b1 100644 --- a/plug-ins/gimpressionist/orientmap.c +++ b/plug-ins/gimpressionist/orientmap.c @@ -575,7 +575,7 @@ create_orientmap_dialog (GtkWidget *parent) G_CALLBACK (map_click_callback), NULL); gtk_widget_show (ebox); - vector_preview_brightness_adjust = (GtkAdjustment *) + vector_preview_brightness_adjust = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 1.0, 1.0); tmpw = gtk_scale_new (GTK_ORIENTATION_VERTICAL, vector_preview_brightness_adjust); @@ -664,7 +664,7 @@ create_orientmap_dialog (GtkWidget *parent) gtk_box_pack_start (GTK_BOX (hbox), grid2, TRUE, TRUE, 0); gtk_widget_show (grid2); - angle_adjust = (GtkAdjustment *) + angle_adjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 0, _("A_ngle:"), 150, 6, 0.0, @@ -675,7 +675,7 @@ create_orientmap_dialog (GtkWidget *parent) g_signal_connect (angle_adjust, "value-changed", G_CALLBACK (angle_adjust_move_callback), NULL); - angle_offset_adjust = (GtkAdjustment *) + angle_offset_adjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 1, _("Ang_le offset:"), 150, 6, 0.0, @@ -686,7 +686,7 @@ create_orientmap_dialog (GtkWidget *parent) g_signal_connect (angle_offset_adjust, "value-changed", G_CALLBACK (angle_offset_adjust_move_callback), NULL); - strength_adjust = (GtkAdjustment *) + strength_adjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 2, _("_Strength:"), 150, 6, 1.0, @@ -697,7 +697,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 = (GtkAdjustment *) + orient_map_str_exp_adjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 3, _("S_trength exp.:"), 150, 6, 1.0, diff --git a/plug-ins/gimpressionist/paper.c b/plug-ins/gimpressionist/paper.c index 5f2e86e61c..3adb0a2a07 100644 --- a/plug-ins/gimpressionist/paper.c +++ b/plug-ins/gimpressionist/paper.c @@ -109,8 +109,8 @@ void paper_restore (void) { reselect (paper_list, pcvals.selected_paper); - gtk_adjustment_set_value (GTK_ADJUSTMENT (paper_relief_adjust), pcvals.paper_relief); - gtk_adjustment_set_value (GTK_ADJUSTMENT (paper_scale_adjust), pcvals.paper_scale); + gtk_adjustment_set_value (paper_relief_adjust, pcvals.paper_relief); + gtk_adjustment_set_value (paper_scale_adjust, pcvals.paper_scale); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (paper_invert), pcvals.paper_invert); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (paper_overlay), pcvals.paper_overlay); } diff --git a/plug-ins/gimpressionist/placement.c b/plug-ins/gimpressionist/placement.c index 92a78dd57b..2b87788259 100644 --- a/plug-ins/gimpressionist/placement.c +++ b/plug-ins/gimpressionist/placement.c @@ -41,7 +41,7 @@ place_restore (void) (GTK_TOGGLE_BUTTON (placement_radio[pcvals.place_type]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (placement_center), pcvals.placement_center); - gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_density_adjust), + gtk_adjustment_set_value (brush_density_adjust, pcvals.brush_density); } diff --git a/plug-ins/gimpressionist/size.c b/plug-ins/gimpressionist/size.c index 0d57688e2c..11bb0a5ee8 100644 --- a/plug-ins/gimpressionist/size.c +++ b/plug-ins/gimpressionist/size.c @@ -58,11 +58,11 @@ void size_restore (void) { size_type_restore (); - gtk_adjustment_set_value (GTK_ADJUSTMENT (sizenumadjust), + gtk_adjustment_set_value (sizenumadjust, pcvals.size_num); - gtk_adjustment_set_value (GTK_ADJUSTMENT (sizefirstadjust), + gtk_adjustment_set_value (sizefirstadjust, pcvals.size_first); - gtk_adjustment_set_value (GTK_ADJUSTMENT (sizelastadjust), + gtk_adjustment_set_value (sizelastadjust, pcvals.size_last); } diff --git a/plug-ins/gimpressionist/sizemap.c b/plug-ins/gimpressionist/sizemap.c index f5fea7e249..9beee8c4b6 100644 --- a/plug-ins/gimpressionist/sizemap.c +++ b/plug-ins/gimpressionist/sizemap.c @@ -445,7 +445,7 @@ create_sizemap_dialog (GtkWidget *parent) G_CALLBACK (smmapclick), NULL); gtk_widget_show (tmpw2); - smvectprevbrightadjust = (GtkAdjustment *) + smvectprevbrightadjust = 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); @@ -504,7 +504,7 @@ create_sizemap_dialog (GtkWidget *parent) gtk_grid_attach (GTK_GRID (grid1), grid2, 0, 2, 2, 1); gtk_widget_show (grid2); - sizadjust = (GtkAdjustment *) + sizadjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 0, _("_Size:"), 150, 6, 50.0, @@ -515,7 +515,7 @@ create_sizemap_dialog (GtkWidget *parent) g_signal_connect (sizadjust, "value-changed", G_CALLBACK (angsmadjmove), NULL); - smstradjust = (GtkAdjustment *) + smstradjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 1, _("S_trength:"), 150, 6, 1.0, @@ -526,7 +526,7 @@ create_sizemap_dialog (GtkWidget *parent) g_signal_connect (smstradjust, "value-changed", G_CALLBACK (strsmadjmove), NULL); - smstrexpadjust = (GtkAdjustment *) + smstrexpadjust = gimp_scale_entry_new (GTK_GRID (grid2), 0, 2, _("St_rength exp.:"), 150, 6, 1.0, diff --git a/plug-ins/gimpressionist/utils.c b/plug-ins/gimpressionist/utils.c index 18a61aa913..be3cefb089 100644 --- a/plug-ins/gimpressionist/utils.c +++ b/plug-ins/gimpressionist/utils.c @@ -57,7 +57,7 @@ getsiz_proto (double x, double y, int n, smvector_t *vec, { n = numsmvect; vec = smvector; - smstrexp = gtk_adjustment_get_value (GTK_ADJUSTMENT (smstrexpadjust)); + smstrexp = gtk_adjustment_get_value (smstrexpadjust); voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi)); } else diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c index 49186397ed..ede828b0ac 100644 --- a/plug-ins/ifs-compose/ifs-compose.c +++ b/plug-ins/ifs-compose/ifs-compose.c @@ -2087,11 +2087,10 @@ value_pair_create (gpointer data, value_pair->type = type; value_pair->timeout_id = 0; - value_pair->adjustment = (GtkAdjustment *) - gtk_adjustment_new (1.0, lower, upper, - (upper - lower) / 100, - (upper - lower) / 10, - 0.0); + value_pair->adjustment = gtk_adjustment_new (1.0, lower, upper, + (upper - lower) / 100, + (upper - lower) / 10, + 0.0); value_pair->spin = gtk_spin_button_new (value_pair->adjustment, 1.0, 3); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (value_pair->spin), TRUE); gtk_widget_set_size_request (value_pair->spin, 72, -1); diff --git a/plug-ins/imagemap/imap_ui_grid.c b/plug-ins/imagemap/imap_ui_grid.c index 32de07adfd..b751c40ea8 100644 --- a/plug-ins/imagemap/imap_ui_grid.c +++ b/plug-ins/imagemap/imap_ui_grid.c @@ -48,7 +48,7 @@ create_spin_button_in_grid (GtkWidget *grid, gint max) { GtkAdjustment *adj = gtk_adjustment_new (value, min, max, 1, 1, 1); - GtkWidget *button = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + GtkWidget *button = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (button), TRUE); if (label) diff --git a/plug-ins/lighting/lighting-ui.c b/plug-ins/lighting/lighting-ui.c index 77a3684b24..94dcb9b90b 100644 --- a/plug-ins/lighting/lighting-ui.c +++ b/plug-ins/lighting/lighting-ui.c @@ -352,8 +352,7 @@ create_options_page (void) gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 12); gtk_widget_show (grid); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("Distance:"), 100, 6, mapvals.viewpoint.z, 0.0, 2.0, 0.01, 0.05, @@ -1546,11 +1545,10 @@ spin_button_new (GtkAdjustment **adjustment, /* return value */ { GtkWidget *spinbutton; - *adjustment = (GtkAdjustment *) - gtk_adjustment_new (value, lower, upper, + *adjustment = gtk_adjustment_new (value, lower, upper, step_increment, page_increment, 0); - spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment), + spinbutton = gtk_spin_button_new (*adjustment, climb_rate, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); diff --git a/plug-ins/map-object/map-object-ui.c b/plug-ins/map-object/map-object-ui.c index 7ff765a4a7..b858b2d75f 100644 --- a/plug-ins/map-object/map-object-ui.c +++ b/plug-ins/map-object/map-object-ui.c @@ -91,7 +91,7 @@ update_light_pos_entries (void) g_signal_handlers_block_by_func (xadj, double_adjustment_update, &mapvals.lightsource.position.x); - gtk_adjustment_set_value (GTK_ADJUSTMENT (xadj), + gtk_adjustment_set_value (xadj, mapvals.lightsource.position.x); g_signal_handlers_unblock_by_func (xadj, double_adjustment_update, @@ -100,7 +100,7 @@ update_light_pos_entries (void) g_signal_handlers_block_by_func (yadj, double_adjustment_update, &mapvals.lightsource.position.y); - gtk_adjustment_set_value (GTK_ADJUSTMENT (yadj), + gtk_adjustment_set_value (yadj, mapvals.lightsource.position.y); g_signal_handlers_unblock_by_func (yadj, double_adjustment_update, @@ -109,7 +109,7 @@ update_light_pos_entries (void) g_signal_handlers_block_by_func (zadj, double_adjustment_update, &mapvals.lightsource.position.z); - gtk_adjustment_set_value (GTK_ADJUSTMENT (zadj), + gtk_adjustment_set_value (zadj, mapvals.lightsource.position.z); g_signal_handlers_unblock_by_func (zadj, double_adjustment_update, @@ -400,11 +400,10 @@ spin_button_new (GtkAdjustment **adjustment, /* return value */ { GtkWidget *spinbutton; - *adjustment = (GtkAdjustment *) - gtk_adjustment_new (value, lower, upper, + *adjustment = gtk_adjustment_new (value, lower, upper, step_increment, page_increment, 0); - spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment), + spinbutton = gtk_spin_button_new (*adjustment, climb_rate, digits); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE); @@ -549,8 +548,7 @@ create_options_page (void) grid, "sensitive", G_BINDING_SYNC_CREATE); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("_Depth:"), 0, 0, mapvals.maxdepth, 1.0, 5.0, 0.1, 1.0, 1, TRUE, 0, 0, @@ -967,8 +965,7 @@ create_orientation_page (void) gtk_container_add (GTK_CONTAINER (frame), grid); gtk_widget_show (grid); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("X:"), 0, 0, mapvals.position.x, -1.0, 2.0, 0.01, 0.1, 5, TRUE, 0, 0, @@ -981,8 +978,7 @@ create_orientation_page (void) G_CALLBACK (double_adjustment_update), &mapvals.position.x); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 1, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 1, _("Y:"), 0, 0, mapvals.position.y, -1.0, 2.0, 0.01, 0.1, 5, TRUE, 0, 0, @@ -995,8 +991,7 @@ create_orientation_page (void) G_CALLBACK (double_adjustment_update), &mapvals.position.y); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 2, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 2, _("Z:"), 0, 0, mapvals.position.z, -1.0, 2.0, 0.01, 0.1, 5, TRUE, 0, 0, @@ -1019,8 +1014,7 @@ create_orientation_page (void) gtk_container_add (GTK_CONTAINER (frame), grid); gtk_widget_show (grid); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("X:"), 0, 0, mapvals.alpha, -180.0, 180.0, 1.0, 15.0, 1, TRUE, 0, 0, @@ -1031,8 +1025,7 @@ create_orientation_page (void) G_CALLBACK (double_adjustment_update), &mapvals.alpha); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 1, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 1, _("Y:"), 0, 0, mapvals.beta, -180.0, 180.0, 1.0, 15.0, 1, TRUE, 0, 0, @@ -1043,8 +1036,7 @@ create_orientation_page (void) G_CALLBACK (double_adjustment_update), &mapvals.beta); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 2, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 2, _("Z:"), 0, 0, mapvals.gamma, -180.0, 180.0, 1.0, 15.0, 1, TRUE, 0, 0, @@ -1119,8 +1111,7 @@ create_box_page (void) gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0); gtk_widget_show (grid); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("Scale X:"), 0, 0, mapvals.scale.x, 0.0, 5.0, 0.01, 0.1, 2, TRUE, 0, 0, @@ -1132,8 +1123,7 @@ create_box_page (void) G_CALLBACK (double_adjustment_update), &mapvals.scale.x); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 1, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 1, _("Y:"), 0, 0, mapvals.scale.y, 0.0, 5.0, 0.01, 0.1, 2, TRUE, 0, 0, @@ -1145,8 +1135,7 @@ create_box_page (void) G_CALLBACK (double_adjustment_update), &mapvals.scale.y); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 2, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 2, _("Z:"), 0, 0, mapvals.scale.z, 0.0, 5.0, 0.01, 0.1, 2, TRUE, 0, 0, @@ -1217,8 +1206,7 @@ create_cylinder_page (void) gtk_container_add (GTK_CONTAINER (frame), grid); gtk_widget_show (grid); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 0, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 0, _("R_adius:"), 0, 0, mapvals.cylinder_radius, 0.0, 2.0, 0.01, 0.1, 2, @@ -1232,8 +1220,7 @@ create_cylinder_page (void) G_CALLBACK (double_adjustment_update), &mapvals.cylinder_radius); - adj = (GtkAdjustment *) - gimp_scale_entry_new (GTK_GRID (grid), 0, 1, + adj = gimp_scale_entry_new (GTK_GRID (grid), 0, 1, _("L_ength:"), 0, 0, mapvals.cylinder_length, 0.0, 2.0, 0.01, 0.1, 2, diff --git a/plug-ins/print/print-page-layout.c b/plug-ins/print/print-page-layout.c index 05b12a9593..a82f148351 100644 --- a/plug-ins/print/print-page-layout.c +++ b/plug-ins/print/print-page-layout.c @@ -272,7 +272,7 @@ print_size_frame (PrintData *data, gtk_grid_set_row_spacing (GTK_GRID (entry), 2); - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); height = gtk_spin_button_new (adj, 1, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry), @@ -314,7 +314,7 @@ print_size_frame (PrintData *data, gtk_grid_set_row_spacing (GTK_GRID (entry), 2); - adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); height = gtk_spin_button_new (adj, 1, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE); gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry), @@ -398,7 +398,7 @@ print_offset_frame (PrintData *data, gtk_widget_show (grid); /* left */ - info.left_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + info.left_adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinner = gtk_spin_button_new (info.left_adj, 1, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); @@ -415,7 +415,7 @@ print_offset_frame (PrintData *data, gtk_widget_show (label); /* right */ - info.right_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + info.right_adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinner = gtk_spin_button_new (info.right_adj, 1, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); @@ -435,7 +435,7 @@ print_offset_frame (PrintData *data, gtk_widget_show (label); /* top */ - info.top_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + info.top_adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinner = gtk_spin_button_new (info.top_adj, 1, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); @@ -452,7 +452,7 @@ print_offset_frame (PrintData *data, gtk_widget_show (label); /* bottom */ - info.bottom_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0); + info.bottom_adj = gtk_adjustment_new (1, 1, 1, 1, 10, 0); spinner = gtk_spin_button_new (info.bottom_adj, 1, 2); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); diff --git a/plug-ins/screenshot/screenshot.c b/plug-ins/screenshot/screenshot.c index c99ad01c04..c1677abad4 100644 --- a/plug-ins/screenshot/screenshot.c +++ b/plug-ins/screenshot/screenshot.c @@ -693,9 +693,8 @@ shoot_dialog (GdkMonitor **monitor) gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1); gtk_widget_show (label); - adj = (GtkAdjustment *) - gtk_adjustment_new (shootvals.select_delay, - 0.0, 100.0, 1.0, 5.0, 0.0); + adj = gtk_adjustment_new (shootvals.select_delay, + 0.0, 100.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); gtk_grid_attach (GTK_GRID (grid), spinner, 1, 0, 1, 1); @@ -753,9 +752,8 @@ shoot_dialog (GdkMonitor **monitor) gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1); gtk_widget_show (label); - adj = (GtkAdjustment *) - gtk_adjustment_new (shootvals.screenshot_delay, - 0.0, 100.0, 1.0, 5.0, 0.0); + adj = gtk_adjustment_new (shootvals.screenshot_delay, + 0.0, 100.0, 1.0, 5.0, 0.0); spinner = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE); gtk_grid_attach (GTK_GRID (grid), spinner, 1, 0, 1, 1); diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c index f24fedbc72..2c43dd9d18 100644 --- a/plug-ins/script-fu/script-fu-interface.c +++ b/plug-ins/script-fu/script-fu-interface.c @@ -410,7 +410,7 @@ script_fu_interface (SFScript *script, switch (arg->default_value.sfa_adjustment.type) { case SF_SLIDER: - arg->value.sfa_adjustment.adj = (GtkAdjustment *) + arg->value.sfa_adjustment.adj = gimp_scale_entry_new (GTK_GRID (sf_interface->grid), 0, row, label_text, SLIDER_WIDTH, -1, @@ -432,7 +432,7 @@ script_fu_interface (SFScript *script, case SF_SPINNER: left_align = TRUE; - arg->value.sfa_adjustment.adj = (GtkAdjustment *) + arg->value.sfa_adjustment.adj = gtk_adjustment_new (arg->value.sfa_adjustment.value, arg->default_value.sfa_adjustment.lower, arg->default_value.sfa_adjustment.upper,