diff --git a/app/dialogs/convert-precision-dialog.c b/app/dialogs/convert-precision-dialog.c index 106cdb0014..ec652f14df 100644 --- a/app/dialogs/convert-precision-dialog.c +++ b/app/dialogs/convert-precision-dialog.c @@ -179,7 +179,7 @@ convert_precision_dialog_new (GimpImage *image, vbox = gimp_int_radio_group_new (FALSE, NULL, G_CALLBACK (gimp_radio_button_update), - &private->trc, + &private->trc, NULL, trc, _("Linear light"), diff --git a/app/tools/gimpoffsettool.c b/app/tools/gimpoffsettool.c index d2b53c5937..7b9536a102 100644 --- a/app/tools/gimpoffsettool.c +++ b/app/tools/gimpoffsettool.c @@ -529,7 +529,7 @@ gimp_offset_tool_dialog (GimpFilterTool *filter_tool) frame = gimp_int_radio_group_new (TRUE, _("Edge Behavior"), G_CALLBACK (gimp_offset_tool_edge_behavior_toggled), - offset_tool, + offset_tool, NULL, GIMP_OFFSET_WRAP_AROUND, diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c index 372ac08c2e..be006d644d 100644 --- a/libgimpwidgets/gimppropwidgets.c +++ b/libgimpwidgets/gimppropwidgets.c @@ -1186,7 +1186,7 @@ gimp_prop_boolean_radio_frame_new (GObject *config, frame = gimp_int_radio_group_new (TRUE, title, G_CALLBACK (gimp_prop_radio_button_callback), - config, value, + config, NULL, value, false_text, FALSE, &button, true_text, TRUE, NULL, diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index 03b5917e9a..74d8eddd58 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -50,10 +50,11 @@ * radio button group. * @frame_title: The title of the Frame or %NULL if you don't want * a title. - * @radio_button_callback: The callback each button's "toggled" signal will - * be connected with. - * @radio_button_callback_data: + * @radio_button_callback: (scope notified): The callback each button's + * "toggled" signal will be connected with. + * @radio_button_callback_data: (closure radio_button_callback): * The data which will be passed to g_signal_connect(). + * @radio_button_callback_destroy: (destroy radio_button_callback_data): * @initial: The @item_data of the initially pressed radio button. * @...: A %NULL-terminated @va_list describing * the radio buttons. @@ -70,7 +71,8 @@ GtkWidget * gimp_int_radio_group_new (gboolean in_frame, const gchar *frame_title, GCallback radio_button_callback, - gpointer callback_data, + gpointer radio_button_callback_data, + GDestroyNotify radio_button_callback_destroy, gint initial, /* item_data */ /* specify radio buttons as va_list: @@ -97,6 +99,11 @@ gimp_int_radio_group_new (gboolean in_frame, group = NULL; + if (radio_button_callback_destroy) + g_object_weak_ref (G_OBJECT (vbox), + (GWeakNotify) radio_button_callback_destroy, + radio_button_callback_data); + /* create the radio buttons */ va_start (args, initial); label = va_arg (args, const gchar *); @@ -132,7 +139,7 @@ gimp_int_radio_group_new (gboolean in_frame, g_signal_connect (button, "toggled", radio_button_callback, - callback_data); + radio_button_callback_data); gtk_widget_show (button); diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h index 9438d4f148..a31e072b74 100644 --- a/libgimpwidgets/gimpwidgets.h +++ b/libgimpwidgets/gimpwidgets.h @@ -102,6 +102,7 @@ GtkWidget * gimp_int_radio_group_new (gboolean in_frame, const gchar *frame_title, GCallback radio_button_callback, gpointer radio_button_callback_data, + GDestroyNotify radio_button_callback_destroy, gint initial, /* item_data */ ...) G_GNUC_NULL_TERMINATED; diff --git a/plug-ins/common/blinds.c b/plug-ins/common/blinds.c index 4cf736a85d..f6b859782a 100644 --- a/plug-ins/common/blinds.c +++ b/plug-ins/common/blinds.c @@ -307,7 +307,7 @@ blinds_dialog (GimpDrawable *drawable) frame = gimp_int_radio_group_new (TRUE, _("Orientation"), G_CALLBACK (gimp_radio_button_update), - &bvals.orientation, bvals.orientation, + &bvals.orientation, NULL, bvals.orientation, _("_Horizontal"), GIMP_ORIENTATION_HORIZONTAL, &horizontal, diff --git a/plug-ins/common/curve-bend.c b/plug-ins/common/curve-bend.c index 67a7290d55..748d57675e 100644 --- a/plug-ins/common/curve-bend.c +++ b/plug-ins/common/curve-bend.c @@ -1359,7 +1359,7 @@ bender_new_dialog (GimpDrawable *drawable) frame = gimp_int_radio_group_new (TRUE, _("Curve for Border"), G_CALLBACK (bender_border_callback), - &cd->outline, cd->outline, + &cd->outline, NULL, cd->outline, C_("curve-border", "_Upper"), OUTLINE_UPPER, &upper, C_("curve-border", "_Lower"), OUTLINE_LOWER, &lower, @@ -1374,7 +1374,7 @@ bender_new_dialog (GimpDrawable *drawable) frame = gimp_int_radio_group_new (TRUE, _("Curve Type"), G_CALLBACK (bender_type_callback), - &cd->curve_type, cd->curve_type, + &cd->curve_type, NULL, cd->curve_type, _("Smoot_h"), SMOOTH, &smooth, _("_Free"), GFREE, &freew, diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c index a25e95974e..9ea972e154 100644 --- a/plug-ins/common/file-ps.c +++ b/plug-ins/common/file-ps.c @@ -3670,7 +3670,7 @@ load_dialog (GFile *file) /* Coloring */ frame = gimp_int_radio_group_new (TRUE, _("Coloring"), G_CALLBACK (gimp_radio_button_update), - &plvals.pnm_type, plvals.pnm_type, + &plvals.pnm_type, NULL, plvals.pnm_type, _("B/W"), 4, NULL, _("Gray"), 5, NULL, @@ -3688,7 +3688,7 @@ load_dialog (GFile *file) frame = gimp_int_radio_group_new (TRUE, _("Text antialiasing"), G_CALLBACK (gimp_radio_button_update), - &plvals.textalpha, plvals.textalpha, + &plvals.textalpha, NULL, plvals.textalpha, C_("antialiasing", "None"), 1, NULL, _("Weak"), 2, NULL, @@ -3700,7 +3700,7 @@ load_dialog (GFile *file) frame = gimp_int_radio_group_new (TRUE, _("Graphic antialiasing"), G_CALLBACK (gimp_radio_button_update), - &plvals.graphicsalpha, plvals.graphicsalpha, + &plvals.graphicsalpha, NULL, plvals.graphicsalpha, C_("antialiasing", "None"), 1, NULL, _("Weak"), 2, NULL, @@ -3864,7 +3864,7 @@ save_dialog (void) /* Unit */ uframe = gimp_int_radio_group_new (TRUE, _("Unit"), G_CALLBACK (save_unit_toggle_update), - vals, psvals.unit_mm, + vals, NULL, psvals.unit_mm, _("_Inch"), FALSE, NULL, _("_Millimeter"), TRUE, NULL, @@ -3880,7 +3880,7 @@ save_dialog (void) /* Rotation */ frame = gimp_int_radio_group_new (TRUE, _("Rotation"), G_CALLBACK (gimp_radio_button_update), - &psvals.rotate, psvals.rotate, + &psvals.rotate, NULL, psvals.rotate, "_0", 0, NULL, "_90", 90, NULL, diff --git a/plug-ins/common/file-xmc.c b/plug-ins/common/file-xmc.c index 510648e884..45511e94a5 100644 --- a/plug-ins/common/file-xmc.c +++ b/plug-ins/common/file-xmc.c @@ -1243,7 +1243,7 @@ save_dialog (GimpImage *image, /* Replace size ? */ tmpwidget = gimp_int_radio_group_new (FALSE, NULL, G_CALLBACK (gimp_radio_button_update), - &xmcvals.size_replace, xmcvals.size_replace, + &xmcvals.size_replace, NULL, xmcvals.size_replace, _("_Use this value only for a frame which size " "is not specified."), FALSE, NULL, @@ -1294,7 +1294,7 @@ save_dialog (GimpImage *image, /* Replace delay? */ tmpwidget = gimp_int_radio_group_new (FALSE, NULL, G_CALLBACK (gimp_radio_button_update), - &xmcvals.delay_replace, xmcvals.delay_replace, + &xmcvals.delay_replace, NULL, xmcvals.delay_replace, _("_Use this value only for a frame which delay " "is not specified."), FALSE, NULL, diff --git a/plug-ins/common/hot.c b/plug-ins/common/hot.c index c02050811f..49e6888c90 100644 --- a/plug-ins/common/hot.c +++ b/plug-ins/common/hot.c @@ -677,7 +677,7 @@ plugin_dialog (piArgs *argp) frame = gimp_int_radio_group_new (TRUE, _("Mode"), G_CALLBACK (gimp_radio_button_update), - &argp->mode, argp->mode, + &argp->mode, NULL, argp->mode, "N_TSC", MODE_NTSC, NULL, "_PAL", MODE_PAL, NULL, @@ -698,7 +698,7 @@ plugin_dialog (piArgs *argp) frame = gimp_int_radio_group_new (TRUE, _("Action"), G_CALLBACK (gimp_radio_button_update), - &argp->action, argp->action, + &argp->action, NULL, argp->action, _("Reduce _Luminance"), ACT_LREDUX, NULL, _("Reduce _Saturation"), ACT_SREDUX, NULL, diff --git a/plug-ins/common/jigsaw.c b/plug-ins/common/jigsaw.c index de65c1be1a..44187b4f4e 100644 --- a/plug-ins/common/jigsaw.c +++ b/plug-ins/common/jigsaw.c @@ -2591,7 +2591,7 @@ jigsaw_dialog (GimpDrawable *drawable) frame = gimp_int_radio_group_new (TRUE, _("Jigsaw Style"), G_CALLBACK (gimp_radio_button_update), - &config.style, config.style, + &config.style, NULL, config.style, _("_Square"), BEZIER_1, &rbutton1, _("C_urved"), BEZIER_2, &rbutton2, diff --git a/plug-ins/common/nl-filter.c b/plug-ins/common/nl-filter.c index 3eef5d4cc7..d3bb736775 100644 --- a/plug-ins/common/nl-filter.c +++ b/plug-ins/common/nl-filter.c @@ -1124,7 +1124,7 @@ nlfilter_dialog (GimpDrawable *drawable) frame = gimp_int_radio_group_new (TRUE, _("Filter"), G_CALLBACK (gimp_radio_button_update), - &nlfvals.filter, nlfvals.filter, + &nlfvals.filter, NULL, nlfvals.filter, _("_Alpha trimmed mean"), filter_alpha_trim, &alpha_trim, diff --git a/plug-ins/common/sparkle.c b/plug-ins/common/sparkle.c index 140dc4f4be..dcb1ae56e3 100644 --- a/plug-ins/common/sparkle.c +++ b/plug-ins/common/sparkle.c @@ -606,7 +606,7 @@ sparkle_dialog (GimpDrawable *drawable) /* colortype */ vbox = gimp_int_radio_group_new (FALSE, NULL, G_CALLBACK (gimp_radio_button_update), - &svals.colortype, svals.colortype, + &svals.colortype, NULL, svals.colortype, _("_Natural color"), NATURAL, &r1, _("_Foreground color"), FOREGROUND, &r2, diff --git a/plug-ins/common/van-gogh-lic.c b/plug-ins/common/van-gogh-lic.c index 099d6fb9c8..33f962b6d4 100644 --- a/plug-ins/common/van-gogh-lic.c +++ b/plug-ins/common/van-gogh-lic.c @@ -725,7 +725,7 @@ create_main_dialog (void) frame = gimp_int_radio_group_new (TRUE, _("Effect Channel"), G_CALLBACK (gimp_radio_button_update), - &licvals.effect_channel, + &licvals.effect_channel, NULL, licvals.effect_channel, _("_Hue"), 0, NULL, @@ -738,7 +738,7 @@ create_main_dialog (void) frame = gimp_int_radio_group_new (TRUE, _("Effect Operator"), G_CALLBACK (gimp_radio_button_update), - &licvals.effect_operator, + &licvals.effect_operator, NULL, licvals.effect_operator, _("_Derivative"), 0, NULL, @@ -750,7 +750,7 @@ create_main_dialog (void) frame = gimp_int_radio_group_new (TRUE, _("Convolve"), G_CALLBACK (gimp_radio_button_update), - &licvals.effect_convolve, + &licvals.effect_convolve, NULL, licvals.effect_convolve, _("_With white noise"), 0, NULL, diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c index a56ed6e3d3..8b7a22ac28 100644 --- a/plug-ins/file-tiff/file-tiff-load.c +++ b/plug-ins/file-tiff/file-tiff-load.c @@ -1935,7 +1935,7 @@ load_dialog (TIFF *tif, extra_radio = gimp_int_radio_group_new (TRUE, _("Process extra channel as:"), (GCallback) gimp_radio_button_update, - default_extra, GIMP_TIFF_LOAD_UNASSALPHA, + default_extra, NULL, GIMP_TIFF_LOAD_UNASSALPHA, _("_Non-premultiplied alpha"), GIMP_TIFF_LOAD_UNASSALPHA, NULL, _("Pre_multiplied alpha"), GIMP_TIFF_LOAD_ASSOCALPHA, NULL, _("Channe_l"), GIMP_TIFF_LOAD_CHANNEL, NULL, diff --git a/plug-ins/file-tiff/file-tiff-save.c b/plug-ins/file-tiff/file-tiff-save.c index 646ad7314d..f23904ee78 100644 --- a/plug-ins/file-tiff/file-tiff-save.c +++ b/plug-ins/file-tiff/file-tiff-save.c @@ -1193,7 +1193,7 @@ save_dialog (TiffSaveVals *tsvals, frame = gimp_int_radio_group_new (TRUE, _("Compression"), G_CALLBACK (gimp_radio_button_update), - &tsvals->compression, tsvals->compression, + &tsvals->compression, NULL, tsvals->compression, _("_None"), COMPRESSION_NONE, NULL, _("_LZW"), COMPRESSION_LZW, NULL, diff --git a/plug-ins/fractal-explorer/fractal-explorer-dialogs.c b/plug-ins/fractal-explorer/fractal-explorer-dialogs.c index ddd8a93ff1..6860e5b566 100644 --- a/plug-ins/fractal-explorer/fractal-explorer-dialogs.c +++ b/plug-ins/fractal-explorer/fractal-explorer-dialogs.c @@ -838,7 +838,7 @@ explorer_dialog (void) toggle_vbox = gimp_int_radio_group_new (FALSE, NULL, G_CALLBACK (explorer_radio_update), - &wvals.fractaltype, wvals.fractaltype, + &wvals.fractaltype, NULL, wvals.fractaltype, _("Mandelbrot"), TYPE_MANDELBROT, &(elements->type[TYPE_MANDELBROT]), @@ -991,7 +991,7 @@ explorer_dialog (void) /* Redmode radio frame */ frame = gimp_int_radio_group_new (TRUE, _("Red"), G_CALLBACK (explorer_radio_update), - &wvals.redmode, wvals.redmode, + &wvals.redmode, NULL, wvals.redmode, _("Sine"), SINUS, &elements->redmode[SINUS], @@ -1032,7 +1032,7 @@ explorer_dialog (void) /* Greenmode radio frame */ frame = gimp_int_radio_group_new (TRUE, _("Green"), G_CALLBACK (explorer_radio_update), - &wvals.greenmode, wvals.greenmode, + &wvals.greenmode, NULL, wvals.greenmode, _("Sine"), SINUS, &elements->greenmode[SINUS], @@ -1073,7 +1073,7 @@ explorer_dialog (void) /* Bluemode radio frame */ frame = gimp_int_radio_group_new (TRUE, _("Blue"), G_CALLBACK (explorer_radio_update), - &wvals.bluemode, wvals.bluemode, + &wvals.bluemode, NULL, wvals.bluemode, _("Sine"), SINUS, &elements->bluemode[SINUS], diff --git a/plug-ins/gimpressionist/color.c b/plug-ins/gimpressionist/color.c index 6e34f37322..36d3d10e99 100644 --- a/plug-ins/gimpressionist/color.c +++ b/plug-ins/gimpressionist/color.c @@ -64,7 +64,7 @@ create_colorpage (GtkNotebook *notebook) frame = gimp_int_radio_group_new (TRUE, _("Color"), G_CALLBACK (gimp_radio_button_update), - &pcvals.color_type, 0, + &pcvals.color_type, NULL, 0, _("A_verage under brush"), COLOR_TYPE_AVERAGE, &colorradio[COLOR_TYPE_AVERAGE], diff --git a/plug-ins/gimpressionist/orientmap.c b/plug-ins/gimpressionist/orientmap.c index 3da8df1f23..681b09deb5 100644 --- a/plug-ins/gimpressionist/orientmap.c +++ b/plug-ins/gimpressionist/orientmap.c @@ -637,7 +637,7 @@ create_orientmap_dialog (GtkWidget *parent) frame = gimp_int_radio_group_new (TRUE, _("Type"), G_CALLBACK (vector_type_click_callback), - &vector_type, 0, + &vector_type, NULL, 0, _("_Normal"), 0, &vector_types[0], _("Vorte_x"), 1, &vector_types[1], diff --git a/plug-ins/gimpressionist/placement.c b/plug-ins/gimpressionist/placement.c index 00db94f3b6..5973c03895 100644 --- a/plug-ins/gimpressionist/placement.c +++ b/plug-ins/gimpressionist/placement.c @@ -71,7 +71,7 @@ create_placementpage (GtkNotebook *notebook) frame = gimp_int_radio_group_new (TRUE, _("Placement"), G_CALLBACK (gimp_radio_button_update), - &pcvals.place_type, 0, + &pcvals.place_type, NULL, 0, _("Randomly"), PLACEMENT_TYPE_RANDOM, diff --git a/plug-ins/screenshot/screenshot.c b/plug-ins/screenshot/screenshot.c index d8c3a91fd9..2d179e318a 100644 --- a/plug-ins/screenshot/screenshot.c +++ b/plug-ins/screenshot/screenshot.c @@ -828,7 +828,7 @@ shoot_dialog (GdkMonitor **monitor) frame = gimp_int_radio_group_new (TRUE, _("Color Profile"), G_CALLBACK (gimp_radio_button_update), - &shootvals.profile_policy, + &shootvals.profile_policy, NULL, shootvals.profile_policy, _("Tag image with _monitor profile"),