diff --git a/ChangeLog b/ChangeLog index b918b931fa..48e59b8185 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,76 @@ +2003-11-14 Manish Singh + + * libgimpwidgets/gimpwidgets.[ch]: implementedgimp_int_option_menu_new + and gimp_int_radio_group_new, which are the same as + gimp_option_menu_new2 and gimp_radio_group_new2, but they take + integers as values to map instead of gpointers, which avoids casts + in pretty much all uses of it in the tree. + + * app/gui/image-commands.c + * app/gui/offset-dialog.c + * app/widgets/gimppropwidgets.c + * app/widgets/gimpwidgets-constructors.c + * libgimpwidgets/gimpmemsizeentry.c + * modules/cdisplay_colorblind.c + * plug-ins/FractalExplorer/Dialogs.c + * plug-ins/Lighting/lighting_ui.c + * plug-ins/MapObject/mapobject_ui.c + * plug-ins/common/AlienMap.c + * plug-ins/common/AlienMap2.c + * plug-ins/common/CML_explorer.c + * plug-ins/common/align_layers.c + * plug-ins/common/blinds.c + * plug-ins/common/borderaverage.c + * plug-ins/common/bumpmap.c + * plug-ins/common/curve_bend.c + * plug-ins/common/deinterlace.c + * plug-ins/common/edge.c + * plug-ins/common/emboss.c + * plug-ins/common/fractaltrace.c + * plug-ins/common/gif.c + * plug-ins/common/hot.c + * plug-ins/common/iwarp.c + * plug-ins/common/jigsaw.c + * plug-ins/common/jpeg.c + * plug-ins/common/lic.c + * plug-ins/common/mail.c + * plug-ins/common/max_rgb.c + * plug-ins/common/mblur.c + * plug-ins/common/mng.c + * plug-ins/common/mosaic.c + * plug-ins/common/nlfilt.c + * plug-ins/common/papertile.c + * plug-ins/common/pnm.c + * plug-ins/common/ps.c + * plug-ins/common/psp.c + * plug-ins/common/ripple.c + * plug-ins/common/shift.c + * plug-ins/common/sinus.c + * plug-ins/common/sparkle.c + * plug-ins/common/struc.c + * plug-ins/common/sunras.c + * plug-ins/common/tiff.c + * plug-ins/common/waves.c + * plug-ins/common/wind.c + * plug-ins/fits/fits.c + * plug-ins/flame/flame.c + * plug-ins/gfig/gfig.c + * plug-ins/gimpressionist/color.c + * plug-ins/gimpressionist/orientmap.c + * plug-ins/gimpressionist/placement.c + * plug-ins/maze/maze_face.c + * plug-ins/sgi/sgi.c: Use gimp_int_option_menu_new and + gimp_int_radio_group_new. + + * plug-ins/common/CML_explorer.c: make function_graph_new take a + gpointer *data instead of a gpointer data, and properly pass an + int through it. + + * plug-ins/common/mng.c: mark menu strings for translation. + + * plug-ins/rcm/rcm.c: remove initialization for Success member + in RcmParams, since it's gone now. + 2003-11-14 Sven Neumann * app/widgets/gimpitemtreeview.c: introduced utility function diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c index 27e5a6ca75..95448b4002 100644 --- a/app/actions/image-commands.c +++ b/app/actions/image-commands.c @@ -408,24 +408,23 @@ image_layers_merge_query (GimpImage *gimage, vbox); frame = - gimp_radio_group_new2 (TRUE, - merge_visible ? - _("Final, Merged Layer should be:") : - _("Final, Anchored Layer should be:"), - G_CALLBACK (gimp_radio_button_update), - &options->merge_type, - GINT_TO_POINTER (options->merge_type), + gimp_int_radio_group_new (TRUE, + merge_visible ? + _("Final, Merged Layer should be:") : + _("Final, Anchored Layer should be:"), + G_CALLBACK (gimp_radio_button_update), + &options->merge_type, options->merge_type, - _("Expanded as necessary"), - GINT_TO_POINTER (GIMP_EXPAND_AS_NECESSARY), NULL, + _("Expanded as necessary"), + GIMP_EXPAND_AS_NECESSARY, NULL, - _("Clipped to image"), - GINT_TO_POINTER (GIMP_CLIP_TO_IMAGE), NULL, + _("Clipped to image"), + GIMP_CLIP_TO_IMAGE, NULL, - _("Clipped to bottom layer"), - GINT_TO_POINTER (GIMP_CLIP_TO_BOTTOM_LAYER), NULL, + _("Clipped to bottom layer"), + GIMP_CLIP_TO_BOTTOM_LAYER, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/app/dialogs/offset-dialog.c b/app/dialogs/offset-dialog.c index f18e6ccf0b..017ec0b48d 100644 --- a/app/dialogs/offset-dialog.c +++ b/app/dialogs/offset-dialog.c @@ -200,19 +200,17 @@ offset_dialog_create (GimpDrawable *drawable, /* The fill options */ frame = - gimp_radio_group_new2 (TRUE, _("Fill Type"), - G_CALLBACK (gimp_radio_button_update), - &off_d->fill_type, - GINT_TO_POINTER (off_d->fill_type), + gimp_int_radio_group_new (TRUE, _("Fill Type"), + G_CALLBACK (gimp_radio_button_update), + &off_d->fill_type, off_d->fill_type, - _("_Background"), - GINT_TO_POINTER (GIMP_OFFSET_BACKGROUND), NULL, + _("_Background"), + GIMP_OFFSET_BACKGROUND, NULL, - _("_Transparent"), - GINT_TO_POINTER (GIMP_OFFSET_TRANSPARENT), - &radio_button, + _("_Transparent"), + GIMP_OFFSET_TRANSPARENT, &radio_button, - NULL); + NULL); if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); diff --git a/app/gui/image-commands.c b/app/gui/image-commands.c index 27e5a6ca75..95448b4002 100644 --- a/app/gui/image-commands.c +++ b/app/gui/image-commands.c @@ -408,24 +408,23 @@ image_layers_merge_query (GimpImage *gimage, vbox); frame = - gimp_radio_group_new2 (TRUE, - merge_visible ? - _("Final, Merged Layer should be:") : - _("Final, Anchored Layer should be:"), - G_CALLBACK (gimp_radio_button_update), - &options->merge_type, - GINT_TO_POINTER (options->merge_type), + gimp_int_radio_group_new (TRUE, + merge_visible ? + _("Final, Merged Layer should be:") : + _("Final, Anchored Layer should be:"), + G_CALLBACK (gimp_radio_button_update), + &options->merge_type, options->merge_type, - _("Expanded as necessary"), - GINT_TO_POINTER (GIMP_EXPAND_AS_NECESSARY), NULL, + _("Expanded as necessary"), + GIMP_EXPAND_AS_NECESSARY, NULL, - _("Clipped to image"), - GINT_TO_POINTER (GIMP_CLIP_TO_IMAGE), NULL, + _("Clipped to image"), + GIMP_CLIP_TO_IMAGE, NULL, - _("Clipped to bottom layer"), - GINT_TO_POINTER (GIMP_CLIP_TO_BOTTOM_LAYER), NULL, + _("Clipped to bottom layer"), + GIMP_CLIP_TO_BOTTOM_LAYER, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/app/gui/offset-dialog.c b/app/gui/offset-dialog.c index f18e6ccf0b..017ec0b48d 100644 --- a/app/gui/offset-dialog.c +++ b/app/gui/offset-dialog.c @@ -200,19 +200,17 @@ offset_dialog_create (GimpDrawable *drawable, /* The fill options */ frame = - gimp_radio_group_new2 (TRUE, _("Fill Type"), - G_CALLBACK (gimp_radio_button_update), - &off_d->fill_type, - GINT_TO_POINTER (off_d->fill_type), + gimp_int_radio_group_new (TRUE, _("Fill Type"), + G_CALLBACK (gimp_radio_button_update), + &off_d->fill_type, off_d->fill_type, - _("_Background"), - GINT_TO_POINTER (GIMP_OFFSET_BACKGROUND), NULL, + _("_Background"), + GIMP_OFFSET_BACKGROUND, NULL, - _("_Transparent"), - GINT_TO_POINTER (GIMP_OFFSET_TRANSPARENT), - &radio_button, + _("_Transparent"), + GIMP_OFFSET_TRANSPARENT, &radio_button, - NULL); + NULL); if (! gimp_drawable_has_alpha (drawable)) gtk_widget_set_sensitive (radio_button, FALSE); diff --git a/app/widgets/gimppropwidgets.c b/app/widgets/gimppropwidgets.c index d7552923d4..310f9fd46b 100644 --- a/app/widgets/gimppropwidgets.c +++ b/app/widgets/gimppropwidgets.c @@ -312,15 +312,15 @@ gimp_prop_boolean_option_menu_new (GObject *config, property_name, &value, NULL); - menu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_prop_option_menu_callback), - config, - GINT_TO_POINTER (value), + menu = + gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_prop_option_menu_callback), + config, value, - true_text, GINT_TO_POINTER (TRUE), NULL, - false_text, GINT_TO_POINTER (FALSE), NULL, + true_text, TRUE, NULL, + false_text, FALSE, NULL, - NULL); + NULL); set_param_spec (G_OBJECT (menu), menu, param_spec); @@ -540,15 +540,15 @@ gimp_prop_boolean_radio_frame_new (GObject *config, property_name, &value, NULL); - frame = gimp_radio_group_new2 (TRUE, title, - G_CALLBACK (gimp_prop_radio_button_callback), - config, - GINT_TO_POINTER (value), + frame = + gimp_int_radio_group_new (TRUE, title, + G_CALLBACK (gimp_prop_radio_button_callback), + config, value, - false_text, GINT_TO_POINTER (FALSE), &button, - true_text, GINT_TO_POINTER (TRUE), NULL, + false_text, FALSE, &button, + true_text, TRUE, NULL, - NULL); + NULL); set_param_spec (G_OBJECT (GTK_BIN (frame)->child), NULL, param_spec); diff --git a/app/widgets/gimpwidgets-constructors.c b/app/widgets/gimpwidgets-constructors.c index 4720cc3561..418decc737 100644 --- a/app/widgets/gimpwidgets-constructors.c +++ b/app/widgets/gimpwidgets-constructors.c @@ -39,69 +39,69 @@ gimp_paint_mode_menu_new (GtkSignalFunc callback, if (with_behind_mode) { - menu = gimp_option_menu_new2 - (FALSE, callback, data, (gpointer) initial, + menu = gimp_int_option_menu_new + (FALSE, callback, data, initial, - _("Normal"), (gpointer) GIMP_NORMAL_MODE, NULL, - _("Dissolve"), (gpointer) GIMP_DISSOLVE_MODE, NULL, - _("Behind"), (gpointer) GIMP_BEHIND_MODE, NULL, - _("Color Erase"), (gpointer) GIMP_COLOR_ERASE_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Multiply"), (gpointer) GIMP_MULTIPLY_MODE, NULL, - _("Divide"), (gpointer) GIMP_DIVIDE_MODE, NULL, - _("Screen"), (gpointer) GIMP_SCREEN_MODE, NULL, - _("Overlay"), (gpointer) GIMP_OVERLAY_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Dodge"), (gpointer) GIMP_DODGE_MODE, NULL, - _("Burn"), (gpointer) GIMP_BURN_MODE, NULL, - _("Hard Light"), (gpointer) GIMP_HARDLIGHT_MODE, NULL, - _("Soft Light"), (gpointer) GIMP_SOFTLIGHT_MODE, NULL, - _("Grain Extract"), (gpointer) GIMP_GRAIN_EXTRACT_MODE, NULL, - _("Grain Merge"), (gpointer) GIMP_GRAIN_MERGE_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Difference"), (gpointer) GIMP_DIFFERENCE_MODE, NULL, - _("Addition"), (gpointer) GIMP_ADDITION_MODE, NULL, - _("Subtract"), (gpointer) GIMP_SUBTRACT_MODE, NULL, - _("Darken Only"), (gpointer) GIMP_DARKEN_ONLY_MODE, NULL, - _("Lighten Only"), (gpointer) GIMP_LIGHTEN_ONLY_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Hue"), (gpointer) GIMP_HUE_MODE, NULL, - _("Saturation"), (gpointer) GIMP_SATURATION_MODE, NULL, - _("Color"), (gpointer) GIMP_COLOR_MODE, NULL, - _("Value"), (gpointer) GIMP_VALUE_MODE, NULL, + _("Normal"), GIMP_NORMAL_MODE, NULL, + _("Dissolve"), GIMP_DISSOLVE_MODE, NULL, + _("Behind"), GIMP_BEHIND_MODE, NULL, + _("Color Erase"), GIMP_COLOR_ERASE_MODE, NULL, + "---", 0, NULL, + _("Multiply"), GIMP_MULTIPLY_MODE, NULL, + _("Divide"), GIMP_DIVIDE_MODE, NULL, + _("Screen"), GIMP_SCREEN_MODE, NULL, + _("Overlay"), GIMP_OVERLAY_MODE, NULL, + "---", 0, NULL, + _("Dodge"), GIMP_DODGE_MODE, NULL, + _("Burn"), GIMP_BURN_MODE, NULL, + _("Hard Light"), GIMP_HARDLIGHT_MODE, NULL, + _("Soft Light"), GIMP_SOFTLIGHT_MODE, NULL, + _("Grain Extract"), GIMP_GRAIN_EXTRACT_MODE, NULL, + _("Grain Merge"), GIMP_GRAIN_MERGE_MODE, NULL, + "---", 0, NULL, + _("Difference"), GIMP_DIFFERENCE_MODE, NULL, + _("Addition"), GIMP_ADDITION_MODE, NULL, + _("Subtract"), GIMP_SUBTRACT_MODE, NULL, + _("Darken Only"), GIMP_DARKEN_ONLY_MODE, NULL, + _("Lighten Only"), GIMP_LIGHTEN_ONLY_MODE, NULL, + "---", 0, NULL, + _("Hue"), GIMP_HUE_MODE, NULL, + _("Saturation"), GIMP_SATURATION_MODE, NULL, + _("Color"), GIMP_COLOR_MODE, NULL, + _("Value"), GIMP_VALUE_MODE, NULL, NULL); } else { - menu = gimp_option_menu_new2 - (FALSE, callback, data, (gpointer) initial, + menu = gimp_int_option_menu_new + (FALSE, callback, data, initial, - _("Normal"), (gpointer) GIMP_NORMAL_MODE, NULL, - _("Dissolve"), (gpointer) GIMP_DISSOLVE_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Multiply"), (gpointer) GIMP_MULTIPLY_MODE, NULL, - _("Divide"), (gpointer) GIMP_DIVIDE_MODE, NULL, - _("Screen"), (gpointer) GIMP_SCREEN_MODE, NULL, - _("Overlay"), (gpointer) GIMP_OVERLAY_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Dodge"), (gpointer) GIMP_DODGE_MODE, NULL, - _("Burn"), (gpointer) GIMP_BURN_MODE, NULL, - _("Hard Light"), (gpointer) GIMP_HARDLIGHT_MODE, NULL, - _("Soft Light"), (gpointer) GIMP_SOFTLIGHT_MODE, NULL, - _("Grain Extract"), (gpointer) GIMP_GRAIN_EXTRACT_MODE, NULL, - _("Grain Merge"), (gpointer) GIMP_GRAIN_MERGE_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Difference"), (gpointer) GIMP_DIFFERENCE_MODE, NULL, - _("Addition"), (gpointer) GIMP_ADDITION_MODE, NULL, - _("Subtract"), (gpointer) GIMP_SUBTRACT_MODE, NULL, - _("Darken Only"), (gpointer) GIMP_DARKEN_ONLY_MODE, NULL, - _("Lighten Only"), (gpointer) GIMP_LIGHTEN_ONLY_MODE, NULL, - "---", (gpointer) NULL, NULL, - _("Hue"), (gpointer) GIMP_HUE_MODE, NULL, - _("Saturation"), (gpointer) GIMP_SATURATION_MODE, NULL, - _("Color"), (gpointer) GIMP_COLOR_MODE, NULL, - _("Value"), (gpointer) GIMP_VALUE_MODE, NULL, + _("Normal"), GIMP_NORMAL_MODE, NULL, + _("Dissolve"), GIMP_DISSOLVE_MODE, NULL, + "---", 0, NULL, + _("Multiply"), GIMP_MULTIPLY_MODE, NULL, + _("Divide"), GIMP_DIVIDE_MODE, NULL, + _("Screen"), GIMP_SCREEN_MODE, NULL, + _("Overlay"), GIMP_OVERLAY_MODE, NULL, + "---", 0, NULL, + _("Dodge"), GIMP_DODGE_MODE, NULL, + _("Burn"), GIMP_BURN_MODE, NULL, + _("Hard Light"), GIMP_HARDLIGHT_MODE, NULL, + _("Soft Light"), GIMP_SOFTLIGHT_MODE, NULL, + _("Grain Extract"), GIMP_GRAIN_EXTRACT_MODE, NULL, + _("Grain Merge"), GIMP_GRAIN_MERGE_MODE, NULL, + "---", 0, NULL, + _("Difference"), GIMP_DIFFERENCE_MODE, NULL, + _("Addition"), GIMP_ADDITION_MODE, NULL, + _("Subtract"), GIMP_SUBTRACT_MODE, NULL, + _("Darken Only"), GIMP_DARKEN_ONLY_MODE, NULL, + _("Lighten Only"), GIMP_LIGHTEN_ONLY_MODE, NULL, + "---", 0, NULL, + _("Hue"), GIMP_HUE_MODE, NULL, + _("Saturation"), GIMP_SATURATION_MODE, NULL, + _("Color"), GIMP_COLOR_MODE, NULL, + _("Value"), GIMP_VALUE_MODE, NULL, NULL); } diff --git a/libgimpwidgets/gimpmemsizeentry.c b/libgimpwidgets/gimpmemsizeentry.c index 995489a7c9..90139a84a8 100644 --- a/libgimpwidgets/gimpmemsizeentry.c +++ b/libgimpwidgets/gimpmemsizeentry.c @@ -212,14 +212,13 @@ gimp_memsize_entry_new (guint64 value, entry); entry->menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_memsize_entry_unit_callback), - entry, - GUINT_TO_POINTER (shift), - _("KiloBytes"), GUINT_TO_POINTER (10), NULL, - _("MegaBytes"), GUINT_TO_POINTER (20), NULL, - _("GigaBytes"), GUINT_TO_POINTER (30), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_memsize_entry_unit_callback), + entry, shift, + _("KiloBytes"), 10, NULL, + _("MegaBytes"), 20, NULL, + _("GigaBytes"), 30, NULL, + NULL); gtk_box_pack_start (GTK_BOX (entry), entry->menu, FALSE, FALSE, 0); gtk_widget_show (entry->menu); diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c index d7552923d4..310f9fd46b 100644 --- a/libgimpwidgets/gimppropwidgets.c +++ b/libgimpwidgets/gimppropwidgets.c @@ -312,15 +312,15 @@ gimp_prop_boolean_option_menu_new (GObject *config, property_name, &value, NULL); - menu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_prop_option_menu_callback), - config, - GINT_TO_POINTER (value), + menu = + gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_prop_option_menu_callback), + config, value, - true_text, GINT_TO_POINTER (TRUE), NULL, - false_text, GINT_TO_POINTER (FALSE), NULL, + true_text, TRUE, NULL, + false_text, FALSE, NULL, - NULL); + NULL); set_param_spec (G_OBJECT (menu), menu, param_spec); @@ -540,15 +540,15 @@ gimp_prop_boolean_radio_frame_new (GObject *config, property_name, &value, NULL); - frame = gimp_radio_group_new2 (TRUE, title, - G_CALLBACK (gimp_prop_radio_button_callback), - config, - GINT_TO_POINTER (value), + frame = + gimp_int_radio_group_new (TRUE, title, + G_CALLBACK (gimp_prop_radio_button_callback), + config, value, - false_text, GINT_TO_POINTER (FALSE), &button, - true_text, GINT_TO_POINTER (TRUE), NULL, + false_text, FALSE, &button, + true_text, TRUE, NULL, - NULL); + NULL); set_param_spec (G_OBJECT (GTK_BIN (frame)->child), NULL, param_spec); diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index 3513b205c3..7c7f5a50f5 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -263,6 +263,120 @@ gimp_option_menu_new2 (gboolean menu_only, return menu; } +/** + * gimp_int_option_menu_new: + * @menu_only: %TRUE if the function should return a #GtkMenu only. + * @menu_item_callback: The callback each menu item's "activate" signal will + * be connected with. + * @menu_item_callback_data: + * The data which will be passed to g_signal_connect(). + * @initial: The @item_data of the initially selected menu item. + * @...: A %NULL-terminated @va_list describing the menu items. + * + * Convenience function to create a #GtkOptionMenu or a #GtkMenu. This + * function does the same thing as gimp_option_menu_new2(), but it takes + * integers as @item_data instead of pointers, since that is a very + * common case (mapping an enum to a menu). + * + * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only). + **/ +GtkWidget * +gimp_int_option_menu_new (gboolean menu_only, + GCallback menu_item_callback, + gpointer callback_data, + gint initial, /* item_data */ + + /* specify menu items as va_list: + * const gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ + + ...) +{ + GtkWidget *menu; + GtkWidget *menuitem; + + /* menu item variables */ + const gchar *label; + gint item_data; + gpointer item_ptr; + GtkWidget **widget_ptr; + + va_list args; + gint i; + gint initial_index; + + menu = gtk_menu_new (); + + /* create the menu items */ + initial_index = 0; + + va_start (args, initial); + label = va_arg (args, const gchar *); + + for (i = 0; label; i++) + { + item_data = va_arg (args, gint); + widget_ptr = va_arg (args, GtkWidget **); + + item_ptr = GINT_TO_POINTER (item_data); + + if (strcmp (label, "---")) + { + menuitem = gtk_menu_item_new_with_label (label); + + g_signal_connect (menuitem, "activate", + menu_item_callback, + callback_data); + + if (item_data) + { + g_object_set_data (G_OBJECT (menuitem), "gimp-item-data", + item_ptr); + + /* backward compat */ + g_object_set_data (G_OBJECT (menuitem), "user_data", item_ptr); + } + } + else + { + menuitem = gtk_menu_item_new (); + + gtk_widget_set_sensitive (menuitem, FALSE); + } + + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + + if (widget_ptr) + *widget_ptr = menuitem; + + gtk_widget_show (menuitem); + + /* remember the initial menu item */ + if (item_data == initial) + initial_index = i; + + label = va_arg (args, const gchar *); + } + va_end (args); + + if (! menu_only) + { + GtkWidget *optionmenu; + + optionmenu = gtk_option_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu); + + /* select the initial menu item */ + gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), initial_index); + + return optionmenu; + } + + return menu; +} + /** * gimp_option_menu_set_history: * @option_menu: A #GtkOptionMenu as returned by gimp_option_menu_new() or @@ -553,6 +667,118 @@ gimp_radio_group_new2 (gboolean in_frame, return vbox; } +/** + * gimp_int_radio_group_new: + * @in_frame: %TRUE if you want a #GtkFrame around the + * 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: + * The data which will be passed to g_signal_connect(). + * @initial: The @item_data of the initially pressed radio button. + * @...: A %NULL-terminated @va_list describing + * the radio buttons. + * + * Convenience function to create a group of radio buttons embedded into + * a #GtkFrame or #GtkVbox. This function does the same thing as + * gimp_radio_group_new2(), but it takes integers as @item_data instead of + * pointers, since that is a very common case (mapping an enum to a radio + * group). + * + * Returns: A #GtkFrame or #GtkVbox (depending on @in_frame). + **/ +GtkWidget * +gimp_int_radio_group_new (gboolean in_frame, + const gchar *frame_title, + GCallback radio_button_callback, + gpointer callback_data, + gint initial, /* item_data */ + + /* specify radio buttons as va_list: + * const gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ + + ...) +{ + GtkWidget *vbox; + GtkWidget *button; + GSList *group; + + /* radio button variables */ + const gchar *label; + gint item_data; + gpointer item_ptr; + GtkWidget **widget_ptr; + + va_list args; + + vbox = gtk_vbox_new (FALSE, 1); + + group = NULL; + + /* create the radio buttons */ + va_start (args, initial); + label = va_arg (args, const gchar *); + + while (label) + { + item_data = va_arg (args, gint); + widget_ptr = va_arg (args, GtkWidget **); + + item_ptr = GINT_TO_POINTER (item_data); + + if (label != GINT_TO_POINTER (1)) + button = gtk_radio_button_new_with_mnemonic (group, label); + else + button = gtk_radio_button_new (group); + + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + + if (item_data) + { + g_object_set_data (G_OBJECT (button), "gimp-item-data", item_ptr); + + /* backward compatibility */ + g_object_set_data (G_OBJECT (button), "user_data", item_ptr); + } + + if (widget_ptr) + *widget_ptr = button; + + if (initial == item_data) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + + g_signal_connect (button, "toggled", + radio_button_callback, + callback_data); + + gtk_widget_show (button); + + label = va_arg (args, const gchar *); + } + va_end (args); + + if (in_frame) + { + GtkWidget *frame; + + gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); + + frame = gtk_frame_new (frame_title); + gtk_container_add (GTK_CONTAINER (frame), vbox); + gtk_widget_show (vbox); + + return frame; + } + + return vbox; +} + /** * gimp_radio_group_set_active: * @radio_button: Pointer to a #GtkRadioButton. diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h index 24155d57de..7d762c01ee 100644 --- a/libgimpwidgets/gimpwidgets.h +++ b/libgimpwidgets/gimpwidgets.h @@ -86,6 +86,19 @@ GtkWidget * gimp_option_menu_new2 (gboolean menu_only, ...); +GtkWidget * gimp_int_option_menu_new (gboolean menu_only, + GCallback menu_item_callback, + gpointer menu_item_callback_data, + gint initial, /* item_data */ + + /* specify menu items as va_list: + * gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ + + ...); + void gimp_option_menu_set_history (GtkOptionMenu *option_menu, gpointer item_data); @@ -123,6 +136,20 @@ GtkWidget * gimp_radio_group_new2 (gboolean in_frame, ...); +GtkWidget * gimp_int_radio_group_new (gboolean in_frame, + const gchar *frame_title, + GCallback radio_button_callback, + gpointer radio_button_callback_data, + gint initial, /* item_data */ + + /* specify radio buttons as va_list: + * const gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ + + ...); + void gimp_radio_group_set_active (GtkRadioButton *radio_button, gpointer item_data); diff --git a/modules/cdisplay_colorblind.c b/modules/cdisplay_colorblind.c index b510effde7..b72c6395f7 100644 --- a/modules/cdisplay_colorblind.c +++ b/modules/cdisplay_colorblind.c @@ -475,28 +475,23 @@ cdisplay_colorblind_configure (GimpColorDisplay *display) gtk_widget_show (label); colorblind->optionmenu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (colorblind_deficiency_callback), - colorblind, - GINT_TO_POINTER (colorblind->deficiency), + gimp_int_option_menu_new (FALSE, + G_CALLBACK (colorblind_deficiency_callback), + colorblind, colorblind->deficiency, - _("None (normal vision)"), - GINT_TO_POINTER (COLORBLIND_DEFICIENCY_NONE), - NULL, + _("None (normal vision)"), + COLORBLIND_DEFICIENCY_NONE, NULL, - _("Protanopia (insensitivity to red)"), - GINT_TO_POINTER (COLORBLIND_DEFICIENCY_PROTANOPIA), - NULL, + _("Protanopia (insensitivity to red)"), + COLORBLIND_DEFICIENCY_PROTANOPIA, NULL, - _("Deuteranopia (insensitivity to green)"), - GINT_TO_POINTER (COLORBLIND_DEFICIENCY_DEUTERANOPIA), - NULL, + _("Deuteranopia (insensitivity to green)"), + COLORBLIND_DEFICIENCY_DEUTERANOPIA, NULL, - _("Tritanopia (insensitivity to blue)"), - GINT_TO_POINTER (COLORBLIND_DEFICIENCY_TRITANOPIA), - NULL, + _("Tritanopia (insensitivity to blue)"), + COLORBLIND_DEFICIENCY_TRITANOPIA, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (colorblind->hbox), colorblind->optionmenu, FALSE, FALSE, 0); diff --git a/plug-ins/FractalExplorer/Dialogs.c b/plug-ins/FractalExplorer/Dialogs.c index 4a7f0fd873..677ed11cdc 100644 --- a/plug-ins/FractalExplorer/Dialogs.c +++ b/plug-ins/FractalExplorer/Dialogs.c @@ -796,31 +796,30 @@ explorer_dialog (void) gtk_container_add (GTK_CONTAINER (frame), hbox); toggle_vbox = - gimp_radio_group_new2 (FALSE, NULL, - G_CALLBACK (explorer_radio_update), - &wvals.fractaltype, - (gpointer) wvals.fractaltype, + gimp_int_radio_group_new (FALSE, NULL, + G_CALLBACK (explorer_radio_update), + &wvals.fractaltype, wvals.fractaltype, - _("Mandelbrot"), (gpointer) TYPE_MANDELBROT, - &(elements->type[TYPE_MANDELBROT]), - _("Julia"), (gpointer) TYPE_JULIA, - &(elements->type[TYPE_JULIA]), - _("Barnsley 1"), (gpointer) TYPE_BARNSLEY_1, - &(elements->type[TYPE_BARNSLEY_1]), - _("Barnsley 2"), (gpointer) TYPE_BARNSLEY_2, - &(elements->type[TYPE_BARNSLEY_2]), - _("Barnsley 3"), (gpointer) TYPE_BARNSLEY_3, - &(elements->type[TYPE_BARNSLEY_3]), - _("Spider"), (gpointer) TYPE_SPIDER, - &(elements->type[TYPE_SPIDER]), - _("Man'o'war"), (gpointer) TYPE_MAN_O_WAR, - &(elements->type[TYPE_MAN_O_WAR]), - _("Lambda"), (gpointer) TYPE_LAMBDA, - &(elements->type[TYPE_LAMBDA]), - _("Sierpinski"), (gpointer) TYPE_SIERPINSKI, - &(elements->type[TYPE_SIERPINSKI]), + _("Mandelbrot"), TYPE_MANDELBROT, + &(elements->type[TYPE_MANDELBROT]), + _("Julia"), TYPE_JULIA, + &(elements->type[TYPE_JULIA]), + _("Barnsley 1"), TYPE_BARNSLEY_1, + &(elements->type[TYPE_BARNSLEY_1]), + _("Barnsley 2"), TYPE_BARNSLEY_2, + &(elements->type[TYPE_BARNSLEY_2]), + _("Barnsley 3"), TYPE_BARNSLEY_3, + &(elements->type[TYPE_BARNSLEY_3]), + _("Spider"), TYPE_SPIDER, + &(elements->type[TYPE_SPIDER]), + _("Man'o'war"), TYPE_MAN_O_WAR, + &(elements->type[TYPE_MAN_O_WAR]), + _("Lambda"), TYPE_LAMBDA, + &(elements->type[TYPE_LAMBDA]), + _("Sierpinski"), TYPE_SIERPINSKI, + &(elements->type[TYPE_SIERPINSKI]), - NULL); + NULL); toggle_vbox2 = gtk_vbox_new (FALSE, 1); for (i = TYPE_BARNSLEY_2; i <= TYPE_SPIDER; i++) @@ -959,18 +958,18 @@ explorer_dialog (void) gtk_widget_show (hbox); /* Redmode radio frame */ - frame = gimp_radio_group_new2 (TRUE, _("Red"), - G_CALLBACK (explorer_radio_update), - &wvals.redmode, (gpointer) wvals.redmode, + frame = gimp_int_radio_group_new (TRUE, _("Red"), + G_CALLBACK (explorer_radio_update), + &wvals.redmode, wvals.redmode, - _("Sine"), (gpointer) SINUS, - &elements->redmode[SINUS], - _("Cosine"), (gpointer) COSINUS, - &elements->redmode[COSINUS], - _("None"), (gpointer) NONE, - &elements->redmode[NONE], + _("Sine"), SINUS, + &elements->redmode[SINUS], + _("Cosine"), COSINUS, + &elements->redmode[COSINUS], + _("None"), NONE, + &elements->redmode[NONE], - NULL); + NULL); gimp_help_set_help_data (elements->redmode[SINUS], _("Use sine-function for this color component"), NULL); @@ -1000,18 +999,18 @@ explorer_dialog (void) "versa"), NULL); /* Greenmode radio frame */ - frame = gimp_radio_group_new2 (TRUE, _("Green"), - G_CALLBACK (explorer_radio_update), - &wvals.greenmode, (gpointer) wvals.greenmode, + frame = gimp_int_radio_group_new (TRUE, _("Green"), + G_CALLBACK (explorer_radio_update), + &wvals.greenmode, wvals.greenmode, - _("Sine"), (gpointer) SINUS, - &elements->greenmode[SINUS], - _("Cosine"), (gpointer) COSINUS, - &elements->greenmode[COSINUS], - _("None"), (gpointer) NONE, - &elements->greenmode[NONE], + _("Sine"), SINUS, + &elements->greenmode[SINUS], + _("Cosine"), COSINUS, + &elements->greenmode[COSINUS], + _("None"), NONE, + &elements->greenmode[NONE], - NULL); + NULL); gimp_help_set_help_data (elements->greenmode[SINUS], _("Use sine-function for this color component"), NULL); @@ -1041,18 +1040,18 @@ explorer_dialog (void) "versa"), NULL); /* Bluemode radio frame */ - frame = gimp_radio_group_new2 (TRUE, _("Blue"), - G_CALLBACK (explorer_radio_update), - &wvals.bluemode, (gpointer) wvals.bluemode, + frame = gimp_int_radio_group_new (TRUE, _("Blue"), + G_CALLBACK (explorer_radio_update), + &wvals.bluemode, wvals.bluemode, - _("Sine"), (gpointer) SINUS, - &elements->bluemode[SINUS], - _("Cosine"), (gpointer) COSINUS, - &elements->bluemode[COSINUS], - _("None"), (gpointer) NONE, - &elements->bluemode[NONE], + _("Sine"), SINUS, + &elements->bluemode[SINUS], + _("Cosine"), COSINUS, + &elements->bluemode[COSINUS], + _("None"), NONE, + &elements->bluemode[NONE], - NULL); + NULL); gimp_help_set_help_data (elements->bluemode[SINUS], _("Use sine-function for this color component"), NULL); diff --git a/plug-ins/Lighting/lighting_ui.c b/plug-ins/Lighting/lighting_ui.c index a201f40137..d49e6494e9 100644 --- a/plug-ins/Lighting/lighting_ui.c +++ b/plug-ins/Lighting/lighting_ui.c @@ -499,21 +499,18 @@ create_light_page (void) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (lightmenu_callback), - &mapvals.lightsource.type, - (gpointer) mapvals.lightsource.type, + optionmenu = + gimp_int_option_menu_new (FALSE, + G_CALLBACK (lightmenu_callback), + &mapvals.lightsource.type, + mapvals.lightsource.type, - _("None"), - (gpointer) NO_LIGHT, NULL, - _("Directional"), - (gpointer) DIRECTIONAL_LIGHT, NULL, - _("Point"), - (gpointer) POINT_LIGHT, NULL, -/* _("Spot"), - (gpointer) SPOT_LIGHT, NULL, */ + _("None"), NO_LIGHT, NULL, + _("Directional"), DIRECTIONAL_LIGHT, NULL, + _("Point"), POINT_LIGHT, NULL, + /* _("Spot"), SPOT_LIGHT, NULL, */ - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("L_ight Type:"), 1.0, 0.5, optionmenu, 1, TRUE); @@ -923,15 +920,15 @@ create_bump_page (void) _("Bumpm_ap Image:"), 1.0, 0.5, optionmenu, 1, TRUE); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (mapmenu2_callback), - &mapvals.bumpmaptype, - (gpointer) mapvals.bumpmaptype, - _("Linear"), (gpointer) LINEAR_MAP, NULL, - _("Logarithmic"), (gpointer) LOGARITHMIC_MAP, NULL, - _("Sinusoidal"), (gpointer) SINUSOIDAL_MAP, NULL, - _("Spherical"), (gpointer) SPHERICAL_MAP, NULL, - NULL); + optionmenu = + gimp_int_option_menu_new (FALSE, + G_CALLBACK (mapmenu2_callback), + &mapvals.bumpmaptype, mapvals.bumpmaptype, + _("Linear"), LINEAR_MAP, NULL, + _("Logarithmic"), LOGARITHMIC_MAP, NULL, + _("Sinusoidal"), SINUSOIDAL_MAP, NULL, + _("Spherical"), SPHERICAL_MAP, NULL, + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Cu_rve:"), 1.0, 0.5, optionmenu, 1, TRUE); diff --git a/plug-ins/MapObject/mapobject_ui.c b/plug-ins/MapObject/mapobject_ui.c index b5e2400020..ea92a66af1 100644 --- a/plug-ins/MapObject/mapobject_ui.c +++ b/plug-ins/MapObject/mapobject_ui.c @@ -532,17 +532,16 @@ create_options_page (void) gtk_widget_show (label); optionmenu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (mapmenu_callback), - &mapvals.maptype, - (gpointer) mapvals.maptype, + gimp_int_option_menu_new (FALSE, + G_CALLBACK (mapmenu_callback), + &mapvals.maptype, mapvals.maptype, - _("Plane"), (gpointer) MAP_PLANE, NULL, - _("Sphere"), (gpointer) MAP_SPHERE, NULL, - _("Box"), (gpointer) MAP_BOX, NULL, - _("Cylinder"), (gpointer) MAP_CYLINDER, NULL, + _("Plane"), MAP_PLANE, NULL, + _("Sphere"), MAP_SPHERE, NULL, + _("Box"), MAP_BOX, NULL, + _("Cylinder"), MAP_CYLINDER, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); @@ -675,19 +674,17 @@ create_light_page (void) gtk_container_set_border_width (GTK_CONTAINER (table), 4); gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (lightmenu_callback), - &mapvals.lightsource.type, - (gpointer) mapvals.lightsource.type, + optionmenu = + gimp_int_option_menu_new (FALSE, + G_CALLBACK (lightmenu_callback), + &mapvals.lightsource.type, + mapvals.lightsource.type, - _("Point Light"), - (gpointer) POINT_LIGHT, NULL, - _("Directional Light"), - (gpointer) DIRECTIONAL_LIGHT, NULL, - _("No Light"), - (gpointer) NO_LIGHT, NULL, + _("Point Light"), POINT_LIGHT, NULL, + _("Directional Light"), DIRECTIONAL_LIGHT, NULL, + _("No Light"), NO_LIGHT, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Lightsource Type:"), 1.0, 0.5, optionmenu, 1, TRUE); diff --git a/plug-ins/common/AlienMap.c b/plug-ins/common/AlienMap.c index 19f15189b2..41a3d507b9 100644 --- a/plug-ins/common/AlienMap.c +++ b/plug-ins/common/AlienMap.c @@ -1227,15 +1227,15 @@ alienmap_dialog (void) &wvals.bluestretch); /* Redmode toggle box */ - frame = gimp_radio_group_new2 (TRUE, _("Red"), - G_CALLBACK (alienmap_toggle_update), - &wvals.redmode, (gpointer) wvals.redmode, + frame = gimp_int_radio_group_new (TRUE, _("Red"), + G_CALLBACK (alienmap_toggle_update), + &wvals.redmode, wvals.redmode, - _("_Sine"), (gpointer) SINUS, &toggle1, - _("Cos_ine"), (gpointer) COSINUS, &toggle2, - _("_None"), (gpointer) NONE, &toggle3, + _("_Sine"), SINUS, &toggle1, + _("Cos_ine"), COSINUS, &toggle2, + _("_None"), NONE, &toggle3, - NULL); + NULL); gimp_help_set_help_data (toggle1, _("Use sine-function for red component."), NULL); @@ -1250,15 +1250,15 @@ alienmap_dialog (void) gtk_widget_show (frame); /* Greenmode toggle box */ - frame = gimp_radio_group_new2 (TRUE, _("Green"), - G_CALLBACK (alienmap_toggle_update), - &wvals.greenmode, (gpointer) wvals.greenmode, + frame = gimp_int_radio_group_new (TRUE, _("Green"), + G_CALLBACK (alienmap_toggle_update), + &wvals.greenmode, wvals.greenmode, - _("_Sine"), (gpointer) SINUS, &toggle1, - _("Cos_ine"), (gpointer) COSINUS, &toggle2, - _("_None"), (gpointer) NONE, &toggle3, + _("_Sine"), SINUS, &toggle1, + _("Cos_ine"), COSINUS, &toggle2, + _("_None"), NONE, &toggle3, - NULL); + NULL); gimp_help_set_help_data (toggle1, _("Use sine-function for green component."), NULL); @@ -1273,15 +1273,15 @@ alienmap_dialog (void) gtk_widget_show (frame); /* Bluemode toggle box */ - frame = gimp_radio_group_new2 (TRUE, _("Blue"), - G_CALLBACK (alienmap_toggle_update), - &wvals.bluemode, (gpointer) wvals.bluemode, + frame = gimp_int_radio_group_new (TRUE, _("Blue"), + G_CALLBACK (alienmap_toggle_update), + &wvals.bluemode, wvals.bluemode, - _("_Sine"), (gpointer) SINUS, &toggle1, - _("Cos_ine"), (gpointer) COSINUS, &toggle2, - _("_None"), (gpointer) NONE, &toggle3, + _("_Sine"), SINUS, &toggle1, + _("Cos_ine"), COSINUS, &toggle2, + _("_None"), NONE, &toggle3, - NULL); + NULL); gimp_help_set_help_data (toggle1, _("Use sine-function for blue component."), NULL); diff --git a/plug-ins/common/AlienMap2.c b/plug-ins/common/AlienMap2.c index 491086fc81..bad59a7d4c 100644 --- a/plug-ins/common/AlienMap2.c +++ b/plug-ins/common/AlienMap2.c @@ -1251,14 +1251,14 @@ alienmap2_dialog (void) /* Mode toggle box */ frame = - gimp_radio_group_new2 (TRUE, _("Mode"), - G_CALLBACK (alienmap2_radio_update), - &wvals.colormodel, (gpointer) wvals.colormodel, + gimp_int_radio_group_new (TRUE, _("Mode"), + G_CALLBACK (alienmap2_radio_update), + &wvals.colormodel, wvals.colormodel, - _("_RGB Color Model"), (gpointer) RGB_MODEL, NULL, - _("_HSL Color Model"), (gpointer) HSL_MODEL, NULL, + _("_RGB Color Model"), RGB_MODEL, NULL, + _("_HSL Color Model"), HSL_MODEL, NULL, - NULL); + NULL); gtk_table_attach (GTK_TABLE (top_table), frame, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); diff --git a/plug-ins/common/CML_explorer.c b/plug-ins/common/CML_explorer.c index 90684f9995..b81f31a8a9 100644 --- a/plug-ins/common/CML_explorer.c +++ b/plug-ins/common/CML_explorer.c @@ -361,7 +361,7 @@ static void CML_explorer_menu_entry_init (WidgetEntry *widget_entry, static void preview_update (void); static void function_graph_new (GtkWidget *widget, - gpointer data); + gpointer *data); static void CML_set_or_randomize_seed_callback (GtkWidget *widget, gpointer data); static void CML_copy_parameters_callback (GtkWidget *widget, @@ -1288,40 +1288,39 @@ CML_explorer_dialog (void) gtk_widget_show (table); optionmenu = - gimp_option_menu_new2 + gimp_int_option_menu_new (FALSE, G_CALLBACK (CML_initial_value_menu_update), - &VALS.initial_value, - (gpointer) VALS.initial_value, + &VALS.initial_value, VALS.initial_value, gettext (initial_value_names[0]), - (gpointer) 0, NULL, + 0, NULL, gettext (initial_value_names[1]), - (gpointer) 1, NULL, + 1, NULL, gettext (initial_value_names[2]), - (gpointer) 2, NULL, + 2, NULL, gettext (initial_value_names[3]), - (gpointer) 3, NULL, + 3, NULL, gettext (initial_value_names[4]), - (gpointer) 4, NULL, + 4, NULL, gettext (initial_value_names[5]), - (gpointer) 5, NULL, + 5, NULL, gettext (initial_value_names[CML_INITIAL_RANDOM_INDEPENDENT]), - (gpointer) CML_INITIAL_RANDOM_INDEPENDENT, NULL, + CML_INITIAL_RANDOM_INDEPENDENT, NULL, gettext (initial_value_names[CML_INITIAL_RANDOM_SHARED]), - (gpointer) CML_INITIAL_RANDOM_SHARED, NULL, + CML_INITIAL_RANDOM_SHARED, NULL, gettext (initial_value_names[CML_INITIAL_RANDOM_FROM_SEED]), - (gpointer) CML_INITIAL_RANDOM_FROM_SEED, NULL, + CML_INITIAL_RANDOM_FROM_SEED, NULL, gettext (initial_value_names[CML_INITIAL_RANDOM_FROM_SEED_SHARED]), - (gpointer) CML_INITIAL_RANDOM_FROM_SEED_SHARED, NULL, + CML_INITIAL_RANDOM_FROM_SEED_SHARED, NULL, NULL); CML_explorer_menu_entry_init (&widget_pointers[3][0], @@ -1414,35 +1413,36 @@ CML_explorer_dialog (void) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - ©_source, (gpointer) copy_source, + optionmenu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + ©_source, + copy_source, - gettext (channel_names[0]), - (gpointer) 0, NULL, - gettext (channel_names[1]), - (gpointer) 1, NULL, - gettext (channel_names[2]), - (gpointer) 2, NULL, + gettext (channel_names[0]), + 0, NULL, + gettext (channel_names[1]), + 1, NULL, + gettext (channel_names[2]), + 2, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Source Channel:"), 1.0, 0.5, optionmenu, 1, TRUE); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - ©_destination, - (gpointer) copy_destination, + optionmenu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + ©_destination, + copy_destination, - gettext (channel_names[0]), - (gpointer) 0, NULL, - gettext (channel_names[1]), - (gpointer) 1, NULL, - gettext (channel_names[2]), - (gpointer) 2, NULL, + gettext (channel_names[0]), + 0, NULL, + gettext (channel_names[1]), + 1, NULL, + gettext (channel_names[2]), + 2, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Destination Channel:"), 1.0, 0.5, optionmenu, 1, TRUE); @@ -1467,40 +1467,40 @@ CML_explorer_dialog (void) gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - &selective_load_source, - (gpointer) selective_load_source, + optionmenu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + &selective_load_source, + selective_load_source, - _("NULL"), - (gpointer) 0, NULL, - gettext (channel_names[0]), - (gpointer) 1, NULL, - gettext (channel_names[1]), - (gpointer) 2, NULL, - gettext (channel_names[2]), - (gpointer) 3, NULL, + _("NULL"), + 0, NULL, + gettext (channel_names[0]), + 1, NULL, + gettext (channel_names[1]), + 2, NULL, + gettext (channel_names[2]), + 3, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Source Channel in File:"), 1.0, 0.5, optionmenu, 1, TRUE); - optionmenu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - &selective_load_destination, - (gpointer) selective_load_destination, + optionmenu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + &selective_load_destination, + selective_load_destination, - _("NULL"), - (gpointer) 0, NULL, - gettext (channel_names[0]), - (gpointer) 1, NULL, - gettext (channel_names[1]), - (gpointer) 2, NULL, - gettext (channel_names[2]), - (gpointer) 3, NULL, + _("NULL"), + 0, NULL, + gettext (channel_names[0]), + 1, NULL, + gettext (channel_names[1]), + 2, NULL, + gettext (channel_names[2]), + 3, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Destination Channel:"), 1.0, 0.5, optionmenu, 1, TRUE); @@ -1546,49 +1546,49 @@ CML_dialog_channel_panel_new (CML_PARAM *param, gtk_widget_show (table); optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (CML_explorer_menu_update), - ¶m->function, (gpointer) param->function, + gimp_int_option_menu_new (FALSE, G_CALLBACK (CML_explorer_menu_update), + ¶m->function, param->function, - gettext (function_names[CML_KEEP_VALUES]), - (gpointer) CML_KEEP_VALUES, NULL, + gettext (function_names[CML_KEEP_VALUES]), + CML_KEEP_VALUES, NULL, - gettext (function_names[CML_KEEP_FIRST]), - (gpointer) CML_KEEP_FIRST, NULL, + gettext (function_names[CML_KEEP_FIRST]), + CML_KEEP_FIRST, NULL, - gettext (function_names[CML_FILL]), - (gpointer) CML_FILL, NULL, + gettext (function_names[CML_FILL]), + CML_FILL, NULL, - gettext (function_names[CML_LOGIST]), - (gpointer) CML_LOGIST, NULL, + gettext (function_names[CML_LOGIST]), + CML_LOGIST, NULL, - gettext (function_names[CML_LOGIST_STEP]), - (gpointer) CML_LOGIST_STEP, NULL, + gettext (function_names[CML_LOGIST_STEP]), + CML_LOGIST_STEP, NULL, - gettext (function_names[CML_POWER]), - (gpointer) CML_POWER, NULL, + gettext (function_names[CML_POWER]), + CML_POWER, NULL, - gettext (function_names[CML_POWER_STEP]), - (gpointer) CML_POWER_STEP, NULL, + gettext (function_names[CML_POWER_STEP]), + CML_POWER_STEP, NULL, - gettext (function_names[CML_REV_POWER]), - (gpointer) CML_REV_POWER, NULL, + gettext (function_names[CML_REV_POWER]), + CML_REV_POWER, NULL, - gettext (function_names[CML_REV_POWER_STEP]), - (gpointer) CML_REV_POWER_STEP, NULL, + gettext (function_names[CML_REV_POWER_STEP]), + CML_REV_POWER_STEP, NULL, - gettext (function_names[CML_DELTA]), - (gpointer) CML_DELTA, NULL, + gettext (function_names[CML_DELTA]), + CML_DELTA, NULL, - gettext (function_names[CML_DELTA_STEP]), - (gpointer) CML_DELTA_STEP, NULL, + gettext (function_names[CML_DELTA_STEP]), + CML_DELTA_STEP, NULL, - gettext (function_names[CML_SIN_CURVE]), - (gpointer) CML_SIN_CURVE, NULL, + gettext (function_names[CML_SIN_CURVE]), + CML_SIN_CURVE, NULL, - gettext (function_names[CML_SIN_CURVE_STEP]), - (gpointer) CML_SIN_CURVE_STEP, NULL, + gettext (function_names[CML_SIN_CURVE_STEP]), + CML_SIN_CURVE_STEP, NULL, - NULL); + NULL); CML_explorer_menu_entry_init (&widget_pointers[channel_id][index], optionmenu, ¶m->function); gimp_table_attach_aligned (GTK_TABLE (table), 0, index, @@ -1597,55 +1597,55 @@ CML_dialog_channel_panel_new (CML_PARAM *param, index++; optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (CML_explorer_menu_update), - ¶m->composition, (gpointer) param->composition, + gimp_int_option_menu_new (FALSE, G_CALLBACK (CML_explorer_menu_update), + ¶m->composition, param->composition, - gettext (composition_names[COMP_NONE]), - (gpointer) COMP_NONE, NULL, + gettext (composition_names[COMP_NONE]), + COMP_NONE, NULL, - gettext (composition_names[COMP_MAX_LINEAR]), - (gpointer) COMP_MAX_LINEAR, NULL, + gettext (composition_names[COMP_MAX_LINEAR]), + COMP_MAX_LINEAR, NULL, - gettext (composition_names[COMP_MAX_LINEAR_P1]), - (gpointer) COMP_MAX_LINEAR_P1, NULL, + gettext (composition_names[COMP_MAX_LINEAR_P1]), + COMP_MAX_LINEAR_P1, NULL, - gettext (composition_names[COMP_MAX_LINEAR_M1]), - (gpointer) COMP_MAX_LINEAR_M1, NULL, + gettext (composition_names[COMP_MAX_LINEAR_M1]), + COMP_MAX_LINEAR_M1, NULL, - gettext (composition_names[COMP_MIN_LINEAR]), - (gpointer) COMP_MIN_LINEAR, NULL, + gettext (composition_names[COMP_MIN_LINEAR]), + COMP_MIN_LINEAR, NULL, - gettext (composition_names[COMP_MIN_LINEAR_P1]), - (gpointer) COMP_MIN_LINEAR_P1, NULL, + gettext (composition_names[COMP_MIN_LINEAR_P1]), + COMP_MIN_LINEAR_P1, NULL, - gettext (composition_names[COMP_MIN_LINEAR_M1]), - (gpointer) COMP_MIN_LINEAR_M1, NULL, + gettext (composition_names[COMP_MIN_LINEAR_M1]), + COMP_MIN_LINEAR_M1, NULL, - gettext (composition_names[COMP_MAX_LINEAR_P1L]), - (gpointer) COMP_MAX_LINEAR_P1L, NULL, + gettext (composition_names[COMP_MAX_LINEAR_P1L]), + COMP_MAX_LINEAR_P1L, NULL, - gettext (composition_names[COMP_MAX_LINEAR_P1U]), - (gpointer) COMP_MAX_LINEAR_P1U, NULL, + gettext (composition_names[COMP_MAX_LINEAR_P1U]), + COMP_MAX_LINEAR_P1U, NULL, - gettext (composition_names[COMP_MAX_LINEAR_M1L]), - (gpointer) COMP_MAX_LINEAR_M1L, NULL, + gettext (composition_names[COMP_MAX_LINEAR_M1L]), + COMP_MAX_LINEAR_M1L, NULL, - gettext (composition_names[COMP_MAX_LINEAR_M1U]), - (gpointer) COMP_MAX_LINEAR_M1U, NULL, + gettext (composition_names[COMP_MAX_LINEAR_M1U]), + COMP_MAX_LINEAR_M1U, NULL, - gettext (composition_names[COMP_MIN_LINEAR_P1L]), - (gpointer) COMP_MIN_LINEAR_P1L, NULL, + gettext (composition_names[COMP_MIN_LINEAR_P1L]), + COMP_MIN_LINEAR_P1L, NULL, - gettext (composition_names[COMP_MIN_LINEAR_P1U]), - (gpointer) COMP_MIN_LINEAR_P1U, NULL, + gettext (composition_names[COMP_MIN_LINEAR_P1U]), + COMP_MIN_LINEAR_P1U, NULL, - gettext (composition_names[COMP_MIN_LINEAR_M1L]), - (gpointer) COMP_MIN_LINEAR_M1L, NULL, + gettext (composition_names[COMP_MIN_LINEAR_M1L]), + COMP_MIN_LINEAR_M1L, NULL, - gettext (composition_names[COMP_MIN_LINEAR_M1U]), - (gpointer) COMP_MIN_LINEAR_M1U, NULL, + gettext (composition_names[COMP_MIN_LINEAR_M1U]), + COMP_MIN_LINEAR_M1U, NULL, - NULL); + NULL); CML_explorer_menu_entry_init (&widget_pointers[channel_id][index], optionmenu, ¶m->composition); gimp_table_attach_aligned (GTK_TABLE (table), 0, index, @@ -1654,40 +1654,40 @@ CML_dialog_channel_panel_new (CML_PARAM *param, index++; optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (CML_explorer_menu_update), - ¶m->arrange, (gpointer) param->arrange, + gimp_int_option_menu_new (FALSE, G_CALLBACK (CML_explorer_menu_update), + ¶m->arrange, param->arrange, - gettext (arrange_names[STANDARD]), - (gpointer) STANDARD, NULL, + gettext (arrange_names[STANDARD]), + STANDARD, NULL, - gettext (arrange_names[AVERAGE]), - (gpointer) AVERAGE, NULL, + gettext (arrange_names[AVERAGE]), + AVERAGE, NULL, - gettext (arrange_names[ANTILOG]), - (gpointer) ANTILOG, NULL, + gettext (arrange_names[ANTILOG]), + ANTILOG, NULL, - gettext (arrange_names[RAND_POWER0]), - (gpointer) RAND_POWER0, NULL, + gettext (arrange_names[RAND_POWER0]), + RAND_POWER0, NULL, - gettext (arrange_names[RAND_POWER1]), - (gpointer) RAND_POWER1, NULL, + gettext (arrange_names[RAND_POWER1]), + RAND_POWER1, NULL, - gettext (arrange_names[RAND_POWER2]), - (gpointer) RAND_POWER2, NULL, + gettext (arrange_names[RAND_POWER2]), + RAND_POWER2, NULL, - gettext (arrange_names[MULTIPLY_RANDOM0]), - (gpointer) MULTIPLY_RANDOM0, NULL, + gettext (arrange_names[MULTIPLY_RANDOM0]), + MULTIPLY_RANDOM0, NULL, - gettext (arrange_names[MULTIPLY_RANDOM1]), - (gpointer) MULTIPLY_RANDOM1, NULL, + gettext (arrange_names[MULTIPLY_RANDOM1]), + MULTIPLY_RANDOM1, NULL, - gettext (arrange_names[MULTIPLY_GRADIENT]), - (gpointer) MULTIPLY_GRADIENT, NULL, + gettext (arrange_names[MULTIPLY_GRADIENT]), + MULTIPLY_GRADIENT, NULL, - gettext (arrange_names[RAND_AND_P]), - (gpointer) RAND_AND_P, NULL, + gettext (arrange_names[RAND_AND_P]), + RAND_AND_P, NULL, - NULL); + NULL); CML_explorer_menu_entry_init (&widget_pointers[channel_id][index], optionmenu, ¶m->arrange); gimp_table_attach_aligned (GTK_TABLE (table), 0, index, @@ -1777,8 +1777,8 @@ CML_dialog_channel_panel_new (CML_PARAM *param, index++; chank = g_new (gpointer, 2); - chank[0] = (gpointer) channel_id; - chank[1] = (gpointer) param; + chank[0] = GINT_TO_POINTER (channel_id); + chank[1] = param; button = gtk_button_new_with_label (_("Plot the Graph of the Settings")); gtk_table_attach_defaults (GTK_TABLE (table), button, @@ -1866,14 +1866,14 @@ preview_update (void) static void function_graph_new (GtkWidget *widget, - gpointer data) + gpointer *data) { GtkWidget *dlg; GtkWidget *frame; GtkWidget *abox; GtkWidget *preview; - gint channel_id = *(int *) data; - CML_PARAM *param = (CML_PARAM *) *((gpointer *) data + 1); + gint channel_id = GPOINTER_TO_INT (data[0]); + CML_PARAM *param = data[1]; dlg = gimp_dialog_new (_("Graph of the current settings"), "cml_explorer", gtk_widget_get_toplevel (widget), 0, diff --git a/plug-ins/common/align_layers.c b/plug-ins/common/align_layers.c index f7677e2fa9..5e2a473b9a 100644 --- a/plug-ins/common/align_layers.c +++ b/plug-ins/common/align_layers.c @@ -408,67 +408,57 @@ align_layers_dialog (void) table = gimp_parameter_settings_new (GTK_DIALOG (dlg)->vbox, 7, 3); optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - &VALS.h_style, (gpointer) VALS.h_style, + gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + &VALS.h_style, VALS.h_style, - _("None"), - (gpointer) H_NONE, NULL, - _("Collect"), - (gpointer) H_COLLECT, NULL, - _("Fill (left to right)"), - (gpointer) LEFT2RIGHT, NULL, - _("Fill (right to left)"), - (gpointer) RIGHT2LEFT, NULL, - _("Snap to Grid"), - (gpointer) SNAP2HGRID, NULL, + _("None"), H_NONE, NULL, + _("Collect"), H_COLLECT, NULL, + _("Fill (left to right)"), LEFT2RIGHT, NULL, + _("Fill (right to left)"), RIGHT2LEFT, NULL, + _("Snap to Grid"), SNAP2HGRID, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("_Horizontal Style:"), 1.0, 0.5, optionmenu, 1, FALSE); optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - &VALS.h_base, (gpointer) VALS.h_base, + gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + &VALS.h_base, VALS.h_base, - _("Left Edge"), (gpointer) H_BASE_LEFT, NULL, - _("Center"), (gpointer) H_BASE_CENTER, NULL, - _("Right Edge"), (gpointer) H_BASE_RIGHT, NULL, + _("Left Edge"), H_BASE_LEFT, NULL, + _("Center"), H_BASE_CENTER, NULL, + _("Right Edge"), H_BASE_RIGHT, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Ho_rizontal Base:"), 1.0, 0.5, optionmenu, 1, FALSE); optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - &VALS.v_style, (gpointer) VALS.v_style, + gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + &VALS.v_style, VALS.v_style, - _("None"), - (gpointer) V_NONE, NULL, - _("Collect"), - (gpointer) V_COLLECT, NULL, - _("Fill (top to bottom)"), - (gpointer) TOP2BOTTOM, NULL, - _("Fill (bottom to top)"), - (gpointer) BOTTOM2TOP, NULL, - _("Snap to Grid"), - (gpointer) SNAP2VGRID, NULL, + _("None"), V_NONE, NULL, + _("Collect"), V_COLLECT, NULL, + _("Fill (top to bottom)"), TOP2BOTTOM, NULL, + _("Fill (bottom to top)"), BOTTOM2TOP, NULL, + _("Snap to Grid"), SNAP2VGRID, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("_Vertical Style:"), 1.0, 0.5, optionmenu, 1, FALSE); optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - &VALS.v_base, (gpointer) VALS.v_base, + gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + &VALS.v_base, VALS.v_base, - _("Top Edge"), (gpointer) V_BASE_TOP, NULL, - _("Center"), (gpointer) V_BASE_CENTER, NULL, - _("Bottom Edge"), (gpointer) V_BASE_BOTTOM, NULL, + _("Top Edge"), V_BASE_TOP, NULL, + _("Center"), V_BASE_CENTER, NULL, + _("Bottom Edge"), V_BASE_BOTTOM, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 3, _("Ver_tical Base:"), 1.0, 0.5, optionmenu, 1, FALSE); diff --git a/plug-ins/common/blinds.c b/plug-ins/common/blinds.c index 9b8660a9b5..9a6c21a84d 100644 --- a/plug-ins/common/blinds.c +++ b/plug-ins/common/blinds.c @@ -297,14 +297,14 @@ blinds_dialog (void) gtk_widget_show (vbox); frame = - gimp_radio_group_new2 (TRUE, _("Orientation"), - G_CALLBACK (blinds_radio_update), - &bvals.orientation, (gpointer) bvals.orientation, + gimp_int_radio_group_new (TRUE, _("Orientation"), + G_CALLBACK (blinds_radio_update), + &bvals.orientation, bvals.orientation, - _("_Horizontal"), (gpointer) HORIZONTAL, NULL, - _("_Vertical"), (gpointer) VERTICAL, NULL, + _("_Horizontal"), HORIZONTAL, NULL, + _("_Vertical"), VERTICAL, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/borderaverage.c b/plug-ins/common/borderaverage.c index edeffdc26c..9aec9c6049 100644 --- a/plug-ins/common/borderaverage.c +++ b/plug-ins/common/borderaverage.c @@ -406,21 +406,21 @@ borderaverage_dialog (void) gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); - menu = gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - &borderaverage_bucket_exponent, - (gpointer) borderaverage_bucket_exponent, + menu = gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + &borderaverage_bucket_exponent, + borderaverage_bucket_exponent, - _("1 (nonsense?)"), (gpointer) 0, NULL, - "2", (gpointer) 1, NULL, - "4", (gpointer) 2, NULL, - "8", (gpointer) 3, NULL, - "16", (gpointer) 4, NULL, - "32", (gpointer) 5, NULL, - "64", (gpointer) 6, NULL, - "128", (gpointer) 7, NULL, - _("256 (nonsense?)"), (gpointer) 8, NULL, + _("1 (nonsense?)"), 0, NULL, + "2", 1, NULL, + "4", 2, NULL, + "8", 3, NULL, + "16", 4, NULL, + "32", 5, NULL, + "64", 6, NULL, + "128", 7, NULL, + _("256 (nonsense?)"), 8, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0); gtk_widget_show (menu); gtk_label_set_mnemonic_widget (GTK_LABEL (label), menu); diff --git a/plug-ins/common/bumpmap.c b/plug-ins/common/bumpmap.c index 90814686cc..5a5c0953d4 100644 --- a/plug-ins/common/bumpmap.c +++ b/plug-ins/common/bumpmap.c @@ -954,15 +954,15 @@ bumpmap_dialog (void) /* Type of map */ frame = - gimp_radio_group_new2 (TRUE, _("Map Type"), - G_CALLBACK (dialog_map_type_callback), - &bmvals.type, (gpointer) bmvals.type, + gimp_int_radio_group_new (TRUE, _("Map Type"), + G_CALLBACK (dialog_map_type_callback), + &bmvals.type, bmvals.type, - _("_Linear Map"), (gpointer) LINEAR, NULL, - _("_Spherical Map"), (gpointer) SPHERICAL, NULL, - _("S_inuosidal Map"), (gpointer) SINUOSIDAL, NULL, + _("_Linear Map"), LINEAR, NULL, + _("_Spherical Map"), SPHERICAL, NULL, + _("S_inuosidal Map"), SINUOSIDAL, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/curve_bend.c b/plug-ins/common/curve_bend.c index bb98459355..f2b418a7e3 100644 --- a/plug-ins/common/curve_bend.c +++ b/plug-ins/common/curve_bend.c @@ -1364,18 +1364,14 @@ bender_new_dialog (GimpDrawable *drawable) gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - frame = gimp_radio_group_new2 (TRUE, _("Curve for Border"), - G_CALLBACK (bender_border_callback), - &cd->outline, - GINT_TO_POINTER (cd->outline), + frame = gimp_int_radio_group_new (TRUE, _("Curve for Border"), + G_CALLBACK (bender_border_callback), + &cd->outline, cd->outline, - _("_Upper"), - GINT_TO_POINTER (OUTLINE_UPPER), &upper, + _("_Upper"), OUTLINE_UPPER, &upper, + _("_Lower"), OUTLINE_LOWER, &lower, - _("_Lower"), - GINT_TO_POINTER (OUTLINE_LOWER), &lower, - - NULL); + NULL); g_object_set_data (G_OBJECT (upper), "cd", cd); g_object_set_data (G_OBJECT (lower), "cd", cd); @@ -1383,18 +1379,14 @@ bender_new_dialog (GimpDrawable *drawable) gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); - frame = gimp_radio_group_new2 (TRUE, _("Curve Type"), - G_CALLBACK (bender_type_callback), - &cd->curve_type, - GINT_TO_POINTER (cd->curve_type), + frame = gimp_int_radio_group_new (TRUE, _("Curve Type"), + G_CALLBACK (bender_type_callback), + &cd->curve_type, cd->curve_type, - _("Smoot_h"), - GINT_TO_POINTER (SMOOTH), &smooth, + _("Smoot_h"), SMOOTH, &smooth, + _("_Free"), GFREE, &freew, - _("_Free"), - GINT_TO_POINTER (GFREE), &freew, - - NULL); + NULL); g_object_set_data (G_OBJECT (smooth), "cd", cd); g_object_set_data (G_OBJECT (freew), "cd", cd); diff --git a/plug-ins/common/deinterlace.c b/plug-ins/common/deinterlace.c index 606073120a..189d119432 100644 --- a/plug-ins/common/deinterlace.c +++ b/plug-ins/common/deinterlace.c @@ -295,18 +295,14 @@ deinterlace_dialog (void) gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, TRUE, TRUE, 0); gtk_widget_show (vbox); - frame = gimp_radio_group_new2 (TRUE, _("Mode"), - G_CALLBACK (gimp_radio_button_update), - &DeinterlaceValue, - GINT_TO_POINTER (DeinterlaceValue), + frame = gimp_int_radio_group_new (TRUE, _("Mode"), + G_CALLBACK (gimp_radio_button_update), + &DeinterlaceValue, DeinterlaceValue, - _("Keep O_dd Fields"), - GINT_TO_POINTER (ODD_FIELDS), NULL, + _("Keep O_dd Fields"), ODD_FIELDS, NULL, + _("Keep _Even Fields"), EVEN_FIELDS, NULL, - _("Keep _Even Fields"), - GINT_TO_POINTER (EVEN_FIELDS), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/edge.c b/plug-ins/common/edge.c index 58ebd46bc8..2babe39ebf 100644 --- a/plug-ins/common/edge.c +++ b/plug-ins/common/edge.c @@ -644,30 +644,18 @@ edge_dialog (GimpDrawable *drawable) NULL); /* compression */ - frame = gimp_radio_group_new2 (TRUE, _("Algorithm"), - G_CALLBACK (gimp_radio_button_update), - &evals.edgemode, - GINT_TO_POINTER (evals.edgemode), + frame = gimp_int_radio_group_new (TRUE, _("Algorithm"), + G_CALLBACK (gimp_radio_button_update), + &evals.edgemode, evals.edgemode, - _("_Sobel"), - GINT_TO_POINTER (SOBEL), NULL, + _("_Sobel"), SOBEL, NULL, + _("_Prewitt"), PREWITT, NULL, + _("_Gradient"), GRADIENT, NULL, + _("_Roberts"), ROBERTS, NULL, + _("_Differential"), DIFFERENTIAL, NULL, + _("_Laplace"), LAPLACE, NULL, - _("_Prewitt"), - GINT_TO_POINTER (PREWITT), NULL, - - _("_Gradient"), - GINT_TO_POINTER (GRADIENT), NULL, - - _("_Roberts"), - GINT_TO_POINTER (ROBERTS), NULL, - - _("_Differential"), - GINT_TO_POINTER (DIFFERENTIAL), NULL, - - _("_Laplace"), - GINT_TO_POINTER (LAPLACE), NULL, - - NULL); + NULL); gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame); gtk_widget_show (frame); diff --git a/plug-ins/common/emboss.c b/plug-ins/common/emboss.c index 0e57062bb5..25d75196e7 100644 --- a/plug-ins/common/emboss.c +++ b/plug-ins/common/emboss.c @@ -510,14 +510,14 @@ pluginCoreIA (piArgs *argp) g_object_set_data (G_OBJECT (preview), "piArgs", argp); emboss_do_preview (preview); - frame = gimp_radio_group_new2 (TRUE, _("Function"), - G_CALLBACK (emboss_radio_button_callback), - &argp->embossp, (gpointer) argp->embossp, + frame = gimp_int_radio_group_new (TRUE, _("Function"), + G_CALLBACK (emboss_radio_button_callback), + &argp->embossp, argp->embossp, - _("_Bumpmap"), (gpointer) FUNCTION_BUMPMAP, NULL, - _("_Emboss"), (gpointer) FUNCTION_EMBOSS, NULL, + _("_Bumpmap"), FUNCTION_BUMPMAP, NULL, + _("_Emboss"), FUNCTION_EMBOSS, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/fractaltrace.c b/plug-ins/common/fractaltrace.c index f7bda83222..1ca5ef89a4 100644 --- a/plug-ins/common/fractaltrace.c +++ b/plug-ins/common/fractaltrace.c @@ -775,19 +775,19 @@ dialog_show (void) gtk_widget_show (preview.preview); /* Settings */ - frame = gimp_radio_group_new2 (TRUE, _("Outside Type"), - G_CALLBACK (dialog_outside_type_callback), - ¶meters.outside_type, - (gpointer) parameters.outside_type, + frame = gimp_int_radio_group_new (TRUE, _("Outside Type"), + G_CALLBACK (dialog_outside_type_callback), + ¶meters.outside_type, + parameters.outside_type, - _("_Warp"), - (gpointer) OUTSIDE_TYPE_WRAP, NULL, - _("_Transparent"), - (gpointer) OUTSIDE_TYPE_TRANSPARENT, NULL, - _("_Black"), - (gpointer) OUTSIDE_TYPE_BLACK, NULL, - _("_White"), - (gpointer) OUTSIDE_TYPE_WHITE, NULL, + _("_Warp"), + OUTSIDE_TYPE_WRAP, NULL, + _("_Transparent"), + OUTSIDE_TYPE_TRANSPARENT, NULL, + _("_Black"), + OUTSIDE_TYPE_BLACK, NULL, + _("_White"), + OUTSIDE_TYPE_WHITE, NULL, NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); diff --git a/plug-ins/common/gif.c b/plug-ins/common/gif.c index 346d9907aa..781e8fdb14 100644 --- a/plug-ins/common/gif.c +++ b/plug-ins/common/gif.c @@ -1410,18 +1410,17 @@ save_dialog (gint32 image_ID) gtk_widget_show (label); disposal_option_menu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - &gsvals.default_dispose, - GINT_TO_POINTER (gsvals.default_dispose), + gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + &gsvals.default_dispose, gsvals.default_dispose, - _("I don't Care"), - GINT_TO_POINTER (DISPOSE_UNSPECIFIED), NULL, - _("Cumulative Layers (Combine)"), - GINT_TO_POINTER (DISPOSE_COMBINE), NULL, - _("One Frame per Layer (Replace)"), - GINT_TO_POINTER (DISPOSE_REPLACE), NULL, + _("I don't Care"), + DISPOSE_UNSPECIFIED, NULL, + _("Cumulative Layers (Combine)"), + DISPOSE_COMBINE, NULL, + _("One Frame per Layer (Replace)"), + DISPOSE_REPLACE, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), disposal_option_menu, FALSE, FALSE, 0); gtk_widget_show (disposal_option_menu); diff --git a/plug-ins/common/hot.c b/plug-ins/common/hot.c index 6459a331ee..b681a10dd4 100644 --- a/plug-ins/common/hot.c +++ b/plug-ins/common/hot.c @@ -592,34 +592,27 @@ pluginCoreIA (piArgs *argp) G_CALLBACK (gimp_toggle_button_update), &argp->new_layerp); - frame = gimp_radio_group_new2 (TRUE, _("Mode"), - G_CALLBACK (gimp_radio_button_update), - &argp->mode, - GINT_TO_POINTER (argp->mode), + frame = gimp_int_radio_group_new (TRUE, _("Mode"), + G_CALLBACK (gimp_radio_button_update), + &argp->mode, argp->mode, - "N_TSC", GINT_TO_POINTER (MODE_NTSC), NULL, - "_PAL", GINT_TO_POINTER (MODE_PAL), NULL, + "N_TSC", MODE_NTSC, NULL, + "_PAL", MODE_PAL, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - frame = gimp_radio_group_new2 (TRUE, _("Action"), - G_CALLBACK (gimp_radio_button_update), - &argp->action, - GINT_TO_POINTER (argp->action), + frame = gimp_int_radio_group_new (TRUE, _("Action"), + G_CALLBACK (gimp_radio_button_update), + &argp->action, argp->action, - _("Reduce _Luminance"), - GINT_TO_POINTER (ACT_LREDUX), NULL, + _("Reduce _Luminance"), ACT_LREDUX, NULL, + _("Reduce _Saturation"), ACT_SREDUX, NULL, + _("_Blacken"), ACT_FLAG, NULL, - _("Reduce _Saturation"), - GINT_TO_POINTER (ACT_SREDUX), NULL, - - _("_Blacken"), - GINT_TO_POINTER (ACT_FLAG), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/iwarp.c b/plug-ins/common/iwarp.c index 57e81324ef..637e273bc3 100644 --- a/plug-ins/common/iwarp.c +++ b/plug-ins/common/iwarp.c @@ -1084,30 +1084,19 @@ iwarp_settings_dialog (GtkWidget *dlg, gtk_container_add (GTK_CONTAINER (frame), hbox); gtk_widget_show (hbox); - vbox2 = gimp_radio_group_new2 (FALSE, NULL, - G_CALLBACK (gimp_radio_button_update), - &iwarp_vals.deform_mode, - GINT_TO_POINTER (iwarp_vals.deform_mode), + vbox2 = gimp_int_radio_group_new (FALSE, NULL, + G_CALLBACK (gimp_radio_button_update), + &iwarp_vals.deform_mode, + iwarp_vals.deform_mode, - _("_Move"), - GINT_TO_POINTER (MOVE), NULL, + _("_Move"), MOVE, NULL, + _("_Grow"), GROW, NULL, + _("S_wirl CCW"), SWIRL_CCW, NULL, + _("Remo_ve"), REMOVE, &widget[0], + _("S_hrink"), SHRINK, &widget[1], + _("Sw_irl CW"), SWIRL_CW, &widget[2], - _("_Grow"), - GINT_TO_POINTER (GROW), NULL, - - _("S_wirl CCW"), - GINT_TO_POINTER (SWIRL_CCW), NULL, - - _("Remo_ve"), - GINT_TO_POINTER (REMOVE), &widget[0], - - _("S_hrink"), - GINT_TO_POINTER (SHRINK), &widget[1], - - _("Sw_irl CW"), - GINT_TO_POINTER (SWIRL_CW), &widget[2], - - NULL); + NULL); gtk_container_add (GTK_CONTAINER (hbox), vbox2); gtk_widget_show (vbox2); diff --git a/plug-ins/common/jigsaw.c b/plug-ins/common/jigsaw.c index a58e366e9b..46ad558170 100644 --- a/plug-ins/common/jigsaw.c +++ b/plug-ins/common/jigsaw.c @@ -2646,18 +2646,14 @@ dialog_box (void) hbox = gtk_hbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - frame = gimp_radio_group_new2 (TRUE, _("Jigsaw Style"), - G_CALLBACK (jigsaw_radio_button_update), - &config.style, - GINT_TO_POINTER (config.style), + frame = gimp_int_radio_group_new (TRUE, _("Jigsaw Style"), + G_CALLBACK (jigsaw_radio_button_update), + &config.style, config.style, - _("_Square"), - GINT_TO_POINTER (BEZIER_1), &rbutton1, + _("_Square"), BEZIER_1, &rbutton1, + _("C_urved"), BEZIER_2, &rbutton2, - _("C_urved"), - GINT_TO_POINTER (BEZIER_2), &rbutton2, - - NULL); + NULL); gimp_help_set_help_data (rbutton1, _("Each piece has straight sides"), NULL); gimp_help_set_help_data (rbutton2, _("Each piece has curved sides"), NULL); diff --git a/plug-ins/common/jpeg.c b/plug-ins/common/jpeg.c index 5451946c28..6661562316 100644 --- a/plug-ins/common/jpeg.c +++ b/plug-ins/common/jpeg.c @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/common/lic.c b/plug-ins/common/lic.c index 7c2e8ad448..e85388d2ec 100644 --- a/plug-ins/common/lic.c +++ b/plug-ins/common/lic.c @@ -722,40 +722,40 @@ create_main_dialog (void) gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - frame = gimp_radio_group_new2 (TRUE, _("Effect Channel"), - G_CALLBACK (gimp_radio_button_update), - &licvals.effect_channel, - (gpointer) licvals.effect_channel, + frame = gimp_int_radio_group_new (TRUE, _("Effect Channel"), + G_CALLBACK (gimp_radio_button_update), + &licvals.effect_channel, + licvals.effect_channel, - _("_Hue"), (gpointer) 0, NULL, - _("_Saturation"), (gpointer) 1, NULL, - _("_Brightness"), (gpointer) 2, NULL, + _("_Hue"), 0, NULL, + _("_Saturation"), 1, NULL, + _("_Brightness"), 2, NULL, - NULL); + NULL); gtk_container_add (GTK_CONTAINER (hbox), frame); gtk_widget_show (frame); - frame = gimp_radio_group_new2 (TRUE, _("Effect Operator"), - G_CALLBACK (gimp_radio_button_update), - &licvals.effect_operator, - (gpointer) licvals.effect_operator, + frame = gimp_int_radio_group_new (TRUE, _("Effect Operator"), + G_CALLBACK (gimp_radio_button_update), + &licvals.effect_operator, + licvals.effect_operator, - _("_Derivative"), (gpointer) 0, NULL, - _("_Gradient"), (gpointer) 1, NULL, + _("_Derivative"), 0, NULL, + _("_Gradient"), 1, NULL, - NULL); + NULL); gtk_container_add (GTK_CONTAINER (hbox), frame); gtk_widget_show (frame); - frame = gimp_radio_group_new2 (TRUE, _("Convolve"), - G_CALLBACK (gimp_radio_button_update), - &licvals.effect_convolve, - (gpointer) licvals.effect_convolve, + frame = gimp_int_radio_group_new (TRUE, _("Convolve"), + G_CALLBACK (gimp_radio_button_update), + &licvals.effect_convolve, + licvals.effect_convolve, - _("_With White Noise"), (gpointer) 0, NULL, - _("W_ith Source Image"), (gpointer) 1, NULL, + _("_With White Noise"), 0, NULL, + _("W_ith Source Image"), 1, NULL, - NULL); + NULL); gtk_container_add (GTK_CONTAINER (hbox), frame); gtk_widget_show (frame); diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c index d3bb26c950..9849442aab 100644 --- a/plug-ins/common/mail.c +++ b/plug-ins/common/mail.c @@ -570,17 +570,15 @@ save_dialog (void) gtk_widget_show (label); /* Encapsulation radiobuttons */ - vbox = gimp_radio_group_new2 (FALSE, NULL, - G_CALLBACK (gimp_radio_button_update), - &mail_info.encapsulation, - (gpointer) mail_info.encapsulation, + vbox = gimp_int_radio_group_new (FALSE, NULL, + G_CALLBACK (gimp_radio_button_update), + &mail_info.encapsulation, + mail_info.encapsulation, - _("Uuencode"), - (gpointer) ENCAPSULATION_UUENCODE, NULL, - _("MIME"), - (gpointer) ENCAPSULATION_MIME, NULL, + _("Uuencode"), ENCAPSULATION_UUENCODE, NULL, + _("MIME"), ENCAPSULATION_MIME, NULL, - NULL); + NULL); gtk_table_attach (GTK_TABLE (table), vbox, 1, 2, 6, 8, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (vbox); diff --git a/plug-ins/common/max_rgb.c b/plug-ins/common/max_rgb.c index d00b5ccf99..6c0cb9a5eb 100644 --- a/plug-ins/common/max_rgb.c +++ b/plug-ins/common/max_rgb.c @@ -265,18 +265,17 @@ dialog (GimpDrawable *drawable) main_function (drawable, TRUE); gtk_widget_show (preview->widget); - frame = gimp_radio_group_new2 (TRUE, _("Parameter Settings"), - G_CALLBACK (radio_callback), - &pvals.max_p, - GINT_TO_POINTER (pvals.max_p), + frame = gimp_int_radio_group_new (TRUE, _("Parameter Settings"), + G_CALLBACK (radio_callback), + &pvals.max_p, pvals.max_p, - _("_Hold the Maximal Channels"), - GINT_TO_POINTER (MAX_CHANNELS), &max, + _("_Hold the Maximal Channels"), + MAX_CHANNELS, &max, - _("Ho_ld the Minimal Channels"), - GINT_TO_POINTER (MIN_CHANNELS), &min, + _("Ho_ld the Minimal Channels"), + MIN_CHANNELS, &min, - NULL); + NULL); g_object_set_data (G_OBJECT (max), "drawable", drawable); g_object_set_data (G_OBJECT (min), "drawable", drawable); diff --git a/plug-ins/common/mblur.c b/plug-ins/common/mblur.c index c693e0e6aa..61c3ac4ac3 100644 --- a/plug-ins/common/mblur.c +++ b/plug-ins/common/mblur.c @@ -747,21 +747,15 @@ mblur_dialog (void) gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox); gtk_widget_show (main_vbox); - frame = gimp_radio_group_new2 (TRUE, _("Blur Type"), - G_CALLBACK (mblur_radio_button_update), - &mbvals.mblur_type, - GINT_TO_POINTER (mbvals.mblur_type), + frame = gimp_int_radio_group_new (TRUE, _("Blur Type"), + G_CALLBACK (mblur_radio_button_update), + &mbvals.mblur_type, mbvals.mblur_type, - _("_Linear"), - GINT_TO_POINTER (MBLUR_LINEAR), NULL, + _("_Linear"), MBLUR_LINEAR, NULL, + _("_Radial"), MBLUR_RADIAL, NULL, + _("_Zoom"), MBLUR_ZOOM, NULL, - _("_Radial"), - GINT_TO_POINTER (MBLUR_RADIAL), NULL, - - _("_Zoom"), - GINT_TO_POINTER (MBLUR_ZOOM), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/mng.c b/plug-ins/common/mng.c index 0fc348da54..4c6f27b4c3 100644 --- a/plug-ins/common/mng.c +++ b/plug-ins/common/mng.c @@ -1270,43 +1270,42 @@ mng_save_dialog (gint32 image_id) gimp_image_get_layers (image_id, &num_layers); if (num_layers == 1) - menu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - &mng_data.default_chunks, - GINT_TO_POINTER (mng_data.default_chunks), - "PNG", - GINT_TO_POINTER (CHUNKS_PNG_D), NULL, - "JNG", - GINT_TO_POINTER (CHUNKS_JNG_D), NULL, NULL); + menu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + &mng_data.default_chunks, + mng_data.default_chunks, + + _("PNG"), CHUNKS_PNG_D, NULL, + _("JNG"), CHUNKS_JNG_D, NULL, + + NULL); else - menu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - &mng_data.default_chunks, - GINT_TO_POINTER (mng_data.default_chunks), - "PNG + Delta PNG", - GINT_TO_POINTER (CHUNKS_PNG_D), NULL, - "JNG + Delta PNG", - GINT_TO_POINTER (CHUNKS_JNG_D), NULL, - "All PNG", - GINT_TO_POINTER (CHUNKS_PNG), NULL, - "All JNG", - GINT_TO_POINTER (CHUNKS_JNG), NULL, - NULL); + menu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + &mng_data.default_chunks, + mng_data.default_chunks, + + _("PNG + Delta PNG"), CHUNKS_PNG_D, NULL, + _("JNG + Delta PNG"), CHUNKS_JNG_D, NULL, + _("All PNG"), CHUNKS_PNG, NULL, + _("All JNG"), CHUNKS_JNG, NULL, + + NULL); gtk_widget_set_sensitive (menu, FALSE); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Default Chunks Type:"), 1.0, 0.5, menu, 1, FALSE); - menu = gimp_option_menu_new2 (FALSE, - G_CALLBACK (gimp_menu_item_update), - &mng_data.default_dispose, - GINT_TO_POINTER (mng_data.default_dispose), - _("Combine"), - GINT_TO_POINTER (DISPOSE_COMBINE), NULL, - _("Replace"), - GINT_TO_POINTER (DISPOSE_REPLACE), NULL, - NULL); + menu = gimp_int_option_menu_new (FALSE, + G_CALLBACK (gimp_menu_item_update), + &mng_data.default_dispose, + mng_data.default_dispose, + + _("Combine"), DISPOSE_COMBINE, NULL, + _("Replace"), DISPOSE_REPLACE, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Default Frame Disposal:"), 1.0, 0.5, diff --git a/plug-ins/common/mosaic.c b/plug-ins/common/mosaic.c index 6b0972d61a..ef94b8907a 100644 --- a/plug-ins/common/mosaic.c +++ b/plug-ins/common/mosaic.c @@ -586,18 +586,15 @@ mosaic_dialog (void) gtk_widget_show (frame); /* tiling primitive */ - frame = gimp_radio_group_new2 (TRUE, _("Tiling Primitives"), - G_CALLBACK (gimp_radio_button_update), - &mvals.tile_type, (gpointer) mvals.tile_type, + frame = gimp_int_radio_group_new (TRUE, _("Tiling Primitives"), + G_CALLBACK (gimp_radio_button_update), + &mvals.tile_type, mvals.tile_type, - _("_Squares"), - (gpointer) SQUARES, NULL, - _("He_xagons"), - (gpointer) HEXAGONS, NULL, - _("Oc_tagons & Squares"), - (gpointer) OCTAGONS, NULL, + _("_Squares"), SQUARES, NULL, + _("He_xagons"), HEXAGONS, NULL, + _("Oc_tagons & Squares"), OCTAGONS, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/nlfilt.c b/plug-ins/common/nlfilt.c index 8ba5cae731..6649fcf3cf 100644 --- a/plug-ins/common/nlfilt.c +++ b/plug-ins/common/nlfilt.c @@ -340,18 +340,18 @@ pluginCoreIA (piArgs *argp, GimpDrawable *drawable) g_object_set_data (G_OBJECT (preview), "piArgs", argp); nlfilt_do_preview (preview); - frame = gimp_radio_group_new2 (TRUE, _("Filter"), - G_CALLBACK (nlfilt_radio_button_update), - &argp->filter, (gpointer) argp->filter, + frame = gimp_int_radio_group_new (TRUE, _("Filter"), + G_CALLBACK (nlfilt_radio_button_update), + &argp->filter, argp->filter, - _("_Alpha Trimmed Mean"), - (gpointer) filter_alpha_trim, NULL, - _("Op_timal Estimation"), - (gpointer) filter_opt_est, NULL, - _("_Edge Enhancement"), - (gpointer) filter_edge_enhance, NULL, + _("_Alpha Trimmed Mean"), + filter_alpha_trim, NULL, + _("Op_timal Estimation"), + filter_opt_est, NULL, + _("_Edge Enhancement"), + filter_edge_enhance, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/papertile.c b/plug-ins/common/papertile.c index 7526b67cfb..6a7eed090d 100644 --- a/plug-ins/common/papertile.c +++ b/plug-ins/common/papertile.c @@ -292,19 +292,19 @@ open_dialog (void) G_CALLBACK (tile_size_adj_changed), NULL); - frame = gimp_radio_group_new2 (TRUE, _("Fractional Pixels"), - G_CALLBACK (gimp_radio_button_update), - &p.params.fractional_type, - (gpointer) p.params.fractional_type, + frame = gimp_int_radio_group_new (TRUE, _("Fractional Pixels"), + G_CALLBACK (gimp_radio_button_update), + &p.params.fractional_type, + p.params.fractional_type, - _("_Background"), - (gpointer) FRACTIONAL_TYPE_BACKGROUND, NULL, - _("_Ignore"), - (gpointer) FRACTIONAL_TYPE_IGNORE, NULL, - _("_Force"), - (gpointer) FRACTIONAL_TYPE_FORCE, NULL, + _("_Background"), + FRACTIONAL_TYPE_BACKGROUND, NULL, + _("_Ignore"), + FRACTIONAL_TYPE_IGNORE, NULL, + _("_Force"), + FRACTIONAL_TYPE_FORCE, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); @@ -359,25 +359,25 @@ open_dialog (void) G_CALLBACK (gimp_toggle_button_update), &p.params.wrap_around); - frame = gimp_radio_group_new2 (TRUE, _("Background Type"), - G_CALLBACK (gimp_radio_button_update), - &p.params.background_type, - (gpointer) p.params.background_type, + frame = gimp_int_radio_group_new (TRUE, _("Background Type"), + G_CALLBACK (gimp_radio_button_update), + &p.params.background_type, + p.params.background_type, - _("_Transparent"), - (gpointer) BACKGROUND_TYPE_TRANSPARENT, NULL, - _("I_nverted Image"), - (gpointer) BACKGROUND_TYPE_INVERTED, NULL, - _("Im_age"), - (gpointer) BACKGROUND_TYPE_IMAGE, NULL, - _("Fo_reground Color"), - (gpointer) BACKGROUND_TYPE_FOREGROUND, NULL, - _("Bac_kground Color"), - (gpointer) BACKGROUND_TYPE_BACKGROUND, NULL, - _("S_elect here:"), - (gpointer) BACKGROUND_TYPE_COLOR, &button, + _("_Transparent"), + BACKGROUND_TYPE_TRANSPARENT, NULL, + _("I_nverted Image"), + BACKGROUND_TYPE_INVERTED, NULL, + _("Im_age"), + BACKGROUND_TYPE_IMAGE, NULL, + _("Fo_reground Color"), + BACKGROUND_TYPE_FOREGROUND, NULL, + _("Bac_kground Color"), + BACKGROUND_TYPE_BACKGROUND, NULL, + _("S_elect here:"), + BACKGROUND_TYPE_COLOR, &button, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/pnm.c b/plug-ins/common/pnm.c index ed38ace3a7..ff22daa2c7 100644 --- a/plug-ins/common/pnm.c +++ b/plug-ins/common/pnm.c @@ -916,15 +916,14 @@ save_dialog (void) NULL); /* file save type */ - frame = gimp_radio_group_new2 (TRUE, _("Data Formatting"), - G_CALLBACK (gimp_radio_button_update), - &psvals.raw, - GINT_TO_POINTER (psvals.raw), + frame = gimp_int_radio_group_new (TRUE, _("Data Formatting"), + G_CALLBACK (gimp_radio_button_update), + &psvals.raw, psvals.raw, - _("Raw"), GINT_TO_POINTER (TRUE), NULL, - _("Ascii"), GINT_TO_POINTER (FALSE), NULL, + _("Raw"), TRUE, NULL, + _("Ascii"), FALSE, NULL, - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, FALSE, TRUE, 0); diff --git a/plug-ins/common/postscript.c b/plug-ins/common/postscript.c index 7e89007e4a..cdfc47ea69 100644 --- a/plug-ins/common/postscript.c +++ b/plug-ins/common/postscript.c @@ -2697,16 +2697,16 @@ load_dialog (void) gtk_widget_show (frame); /* Colouring */ - frame = gimp_radio_group_new2 (TRUE, _("Coloring"), - G_CALLBACK (gimp_radio_button_update), - &plvals.pnm_type, (gpointer) plvals.pnm_type, + frame = gimp_int_radio_group_new (TRUE, _("Coloring"), + G_CALLBACK (gimp_radio_button_update), + &plvals.pnm_type, plvals.pnm_type, - _("B/W"), (gpointer) 4, NULL, - _("Gray"), (gpointer) 5, NULL, - _("Color"), (gpointer) 6, NULL, - _("Automatic"), (gpointer) 7, NULL, + _("B/W"), 4, NULL, + _("Gray"), 5, NULL, + _("Color"), 6, NULL, + _("Automatic"), 7, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); @@ -2714,29 +2714,27 @@ load_dialog (void) gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - frame = gimp_radio_group_new2 (TRUE, _("Text Antialiasing"), - G_CALLBACK (gimp_radio_button_update), - &plvals.textalpha, - (gpointer) plvals.textalpha, + frame = gimp_int_radio_group_new (TRUE, _("Text Antialiasing"), + G_CALLBACK (gimp_radio_button_update), + &plvals.textalpha, plvals.textalpha, - _("None"), (gpointer) 1, NULL, - _("Weak"), (gpointer) 2, NULL, - _("Strong"), (gpointer) 4, NULL, + _("None"), 1, NULL, + _("Weak"), 2, NULL, + _("Strong"), 4, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); gtk_widget_show (frame); - frame = gimp_radio_group_new2 (TRUE, _("Graphic Antialiasing"), - G_CALLBACK (gimp_radio_button_update), - &plvals.graphicsalpha, - (gpointer) plvals.graphicsalpha, + frame = gimp_int_radio_group_new (TRUE, _("Graphic Antialiasing"), + G_CALLBACK (gimp_radio_button_update), + &plvals.graphicsalpha, plvals.graphicsalpha, - _("None"), (gpointer) 1, NULL, - _("Weak"), (gpointer) 2, NULL, - _("Strong"), (gpointer) 4, NULL, + _("None"), 1, NULL, + _("Weak"), 2, NULL, + _("Strong"), 4, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); gtk_widget_show (frame); @@ -2869,18 +2867,14 @@ save_dialog (void) &psvals.keep_ratio); /* Unit */ - uframe = gimp_radio_group_new2 (TRUE, _("Unit"), - G_CALLBACK (save_unit_toggle_update), - vals, - GINT_TO_POINTER (psvals.unit_mm), + uframe = gimp_int_radio_group_new (TRUE, _("Unit"), + G_CALLBACK (save_unit_toggle_update), + vals, psvals.unit_mm, - _("_Inch"), - GINT_TO_POINTER (FALSE), NULL, + _("_Inch"), FALSE, NULL, + _("_Millimeter"), TRUE, NULL, - _("_Millimeter"), - GINT_TO_POINTER (TRUE), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), uframe, FALSE, FALSE, 0); gtk_widget_show (uframe); @@ -2889,17 +2883,16 @@ save_dialog (void) gtk_widget_show (frame); /* Rotation */ - frame = gimp_radio_group_new2 (TRUE, _("Rotation"), - G_CALLBACK (gimp_radio_button_update), - &psvals.rotate, - GINT_TO_POINTER (psvals.rotate), + frame = gimp_int_radio_group_new (TRUE, _("Rotation"), + G_CALLBACK (gimp_radio_button_update), + &psvals.rotate, psvals.rotate, - "_0", GINT_TO_POINTER (0), NULL, - "_90", GINT_TO_POINTER (90), NULL, - "_180", GINT_TO_POINTER (180), NULL, - "_270", GINT_TO_POINTER (270), NULL, + "_0", 0, NULL, + "_90", 90, NULL, + "_180", 180, NULL, + "_270", 270, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (main_vbox[1]), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/ps.c b/plug-ins/common/ps.c index 7e89007e4a..cdfc47ea69 100644 --- a/plug-ins/common/ps.c +++ b/plug-ins/common/ps.c @@ -2697,16 +2697,16 @@ load_dialog (void) gtk_widget_show (frame); /* Colouring */ - frame = gimp_radio_group_new2 (TRUE, _("Coloring"), - G_CALLBACK (gimp_radio_button_update), - &plvals.pnm_type, (gpointer) plvals.pnm_type, + frame = gimp_int_radio_group_new (TRUE, _("Coloring"), + G_CALLBACK (gimp_radio_button_update), + &plvals.pnm_type, plvals.pnm_type, - _("B/W"), (gpointer) 4, NULL, - _("Gray"), (gpointer) 5, NULL, - _("Color"), (gpointer) 6, NULL, - _("Automatic"), (gpointer) 7, NULL, + _("B/W"), 4, NULL, + _("Gray"), 5, NULL, + _("Color"), 6, NULL, + _("Automatic"), 7, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); @@ -2714,29 +2714,27 @@ load_dialog (void) gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - frame = gimp_radio_group_new2 (TRUE, _("Text Antialiasing"), - G_CALLBACK (gimp_radio_button_update), - &plvals.textalpha, - (gpointer) plvals.textalpha, + frame = gimp_int_radio_group_new (TRUE, _("Text Antialiasing"), + G_CALLBACK (gimp_radio_button_update), + &plvals.textalpha, plvals.textalpha, - _("None"), (gpointer) 1, NULL, - _("Weak"), (gpointer) 2, NULL, - _("Strong"), (gpointer) 4, NULL, + _("None"), 1, NULL, + _("Weak"), 2, NULL, + _("Strong"), 4, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); gtk_widget_show (frame); - frame = gimp_radio_group_new2 (TRUE, _("Graphic Antialiasing"), - G_CALLBACK (gimp_radio_button_update), - &plvals.graphicsalpha, - (gpointer) plvals.graphicsalpha, + frame = gimp_int_radio_group_new (TRUE, _("Graphic Antialiasing"), + G_CALLBACK (gimp_radio_button_update), + &plvals.graphicsalpha, plvals.graphicsalpha, - _("None"), (gpointer) 1, NULL, - _("Weak"), (gpointer) 2, NULL, - _("Strong"), (gpointer) 4, NULL, + _("None"), 1, NULL, + _("Weak"), 2, NULL, + _("Strong"), 4, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); gtk_widget_show (frame); @@ -2869,18 +2867,14 @@ save_dialog (void) &psvals.keep_ratio); /* Unit */ - uframe = gimp_radio_group_new2 (TRUE, _("Unit"), - G_CALLBACK (save_unit_toggle_update), - vals, - GINT_TO_POINTER (psvals.unit_mm), + uframe = gimp_int_radio_group_new (TRUE, _("Unit"), + G_CALLBACK (save_unit_toggle_update), + vals, psvals.unit_mm, - _("_Inch"), - GINT_TO_POINTER (FALSE), NULL, + _("_Inch"), FALSE, NULL, + _("_Millimeter"), TRUE, NULL, - _("_Millimeter"), - GINT_TO_POINTER (TRUE), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), uframe, FALSE, FALSE, 0); gtk_widget_show (uframe); @@ -2889,17 +2883,16 @@ save_dialog (void) gtk_widget_show (frame); /* Rotation */ - frame = gimp_radio_group_new2 (TRUE, _("Rotation"), - G_CALLBACK (gimp_radio_button_update), - &psvals.rotate, - GINT_TO_POINTER (psvals.rotate), + frame = gimp_int_radio_group_new (TRUE, _("Rotation"), + G_CALLBACK (gimp_radio_button_update), + &psvals.rotate, psvals.rotate, - "_0", GINT_TO_POINTER (0), NULL, - "_90", GINT_TO_POINTER (90), NULL, - "_180", GINT_TO_POINTER (180), NULL, - "_270", GINT_TO_POINTER (270), NULL, + "_0", 0, NULL, + "_90", 90, NULL, + "_180", 180, NULL, + "_270", 270, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (main_vbox[1]), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/psp.c b/plug-ins/common/psp.c index dfe36ff130..cbdabc2117 100644 --- a/plug-ins/common/psp.c +++ b/plug-ins/common/psp.c @@ -411,21 +411,15 @@ save_dialog (void) NULL); /* file save type */ - frame = gimp_radio_group_new2 (TRUE, _("Data Compression"), - G_CALLBACK (gimp_radio_button_update), - &psvals.compression, - GINT_TO_POINTER (psvals.compression), + frame = gimp_int_radio_group_new (TRUE, _("Data Compression"), + G_CALLBACK (gimp_radio_button_update), + &psvals.compression, psvals.compression, - _("None"), - GINT_TO_POINTER (PSP_COMP_NONE), NULL, + _("None"), PSP_COMP_NONE, NULL, + _("RLE"), PSP_COMP_RLE, NULL, + _("LZ77"), PSP_COMP_LZ77, NULL, - _("RLE"), - GINT_TO_POINTER (PSP_COMP_RLE), NULL, - - _("LZ77"), - GINT_TO_POINTER (PSP_COMP_LZ77), NULL, - - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, FALSE, TRUE, 0); diff --git a/plug-ins/common/ripple.c b/plug-ins/common/ripple.c index 091ee434c3..67027cd8d5 100644 --- a/plug-ins/common/ripple.c +++ b/plug-ins/common/ripple.c @@ -471,46 +471,42 @@ ripple_dialog (void) gtk_widget_show (frame); /* Orientation toggle box */ - frame = gimp_radio_group_new2 (TRUE, _("Orientation"), - G_CALLBACK (gimp_radio_button_update), - &rvals.orientation, - GINT_TO_POINTER (rvals.orientation), + frame = gimp_int_radio_group_new (TRUE, _("Orientation"), + G_CALLBACK (gimp_radio_button_update), + &rvals.orientation, rvals.orientation, - _("_Horizontal"), - GINT_TO_POINTER (HORIZONTAL), NULL, + _("_Horizontal"), HORIZONTAL, NULL, + _("_Vertical"), VERTICAL, NULL, - _("_Vertical"), - GINT_TO_POINTER (VERTICAL), NULL, - - NULL); + NULL); gtk_table_attach (GTK_TABLE (table), frame, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (frame); /* Edges toggle box */ - frame = gimp_radio_group_new2 (TRUE, _("Edges"), - G_CALLBACK (gimp_radio_button_update), - &rvals.edges, (gpointer) rvals.edges, + frame = gimp_int_radio_group_new (TRUE, _("Edges"), + G_CALLBACK (gimp_radio_button_update), + &rvals.edges, rvals.edges, - _("_Wrap"), (gpointer) WRAP, NULL, - _("_Smear"), (gpointer) SMEAR, NULL, - _("_Black"), (gpointer) BLACK, NULL, + _("_Wrap"), WRAP, NULL, + _("_Smear"), SMEAR, NULL, + _("_Black"), BLACK, NULL, - NULL); + NULL); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); gtk_widget_show (frame); /* Wave toggle box */ - frame = gimp_radio_group_new2 (TRUE, _("Wave Type"), - G_CALLBACK (gimp_radio_button_update), - &rvals.waveform, (gpointer) rvals.waveform, + frame = gimp_int_radio_group_new (TRUE, _("Wave Type"), + G_CALLBACK (gimp_radio_button_update), + &rvals.waveform, rvals.waveform, - _("Saw_tooth"), (gpointer) SAWTOOTH, NULL, - _("S_ine"), (gpointer) SINE, NULL, + _("Saw_tooth"), SAWTOOTH, NULL, + _("S_ine"), SINE, NULL, - NULL); + NULL); gtk_table_attach (GTK_TABLE (table), frame, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/shift.c b/plug-ins/common/shift.c index 0aacf8cdc8..08d16d3e92 100644 --- a/plug-ins/common/shift.c +++ b/plug-ins/common/shift.c @@ -326,18 +326,14 @@ shift_dialog (gint32 image_ID) NULL); /* parameter settings */ - frame = gimp_radio_group_new2 (TRUE, _("Parameter Settings"), - G_CALLBACK (gimp_radio_button_update), - &shvals.orientation, - GINT_TO_POINTER (shvals.orientation), + frame = gimp_int_radio_group_new (TRUE, _("Parameter Settings"), + G_CALLBACK (gimp_radio_button_update), + &shvals.orientation, shvals.orientation, - _("Shift _Horizontally"), - GINT_TO_POINTER (HORIZONTAL), NULL, + _("Shift _Horizontally"), HORIZONTAL, NULL, + _("Shift _Vertically"), VERTICAL, NULL, - _("Shift _Vertically"), - GINT_TO_POINTER (VERTICAL), NULL, - - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0); diff --git a/plug-ins/common/sinus.c b/plug-ins/common/sinus.c index 4947699b34..2267aa4722 100644 --- a/plug-ins/common/sinus.c +++ b/plug-ins/common/sinus.c @@ -749,18 +749,14 @@ sinus_dialog (void) G_CALLBACK (sinus_toggle_button_update), &svals.tiling); - vbox2 = gimp_radio_group_new2 (FALSE, NULL, - G_CALLBACK (sinus_radio_button_update), - &svals.perturbation, - GINT_TO_POINTER (svals.perturbation), + vbox2 = gimp_int_radio_group_new (FALSE, NULL, + G_CALLBACK (sinus_radio_button_update), + &svals.perturbation, svals.perturbation, - _("_Ideal"), - GINT_TO_POINTER (IDEAL), NULL, + _("_Ideal"), IDEAL, NULL, + _("_Distorted"), PERTURBED, NULL, - _("_Distorted"), - GINT_TO_POINTER (PERTURBED), NULL, - - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (vbox2), 0); gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); @@ -795,18 +791,18 @@ sinus_dialog (void) } else { - frame = gimp_radio_group_new2 (TRUE, _("Colors"), - G_CALLBACK (sinus_radio_button_update), - &svals.colors, (gpointer) svals.colors, + frame = gimp_int_radio_group_new (TRUE, _("Colors"), + G_CALLBACK (sinus_radio_button_update), + &svals.colors, svals.colors, - _("Bl_ack & White"), - (gpointer) B_W, NULL, - _("_Foreground & Background"), - (gpointer) USE_FG_BG, NULL, - _("C_hoose here:"), - (gpointer) USE_COLORS, NULL, + _("Bl_ack & White"), + B_W, NULL, + _("_Foreground & Background"), + USE_FG_BG, NULL, + _("C_hoose here:"), + USE_COLORS, NULL, - NULL); + NULL); gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0); gtk_widget_show (frame); @@ -906,15 +902,15 @@ sinus_dialog (void) gtk_widget_show (vbox); frame = - gimp_radio_group_new2 (TRUE, _("Gradient"), - G_CALLBACK (sinus_radio_button_update), - &svals.colorization, (gpointer) svals.colorization, + gimp_int_radio_group_new (TRUE, _("Gradient"), + G_CALLBACK (sinus_radio_button_update), + &svals.colorization, svals.colorization, - _("L_inear"), (gpointer) LINEAR, NULL, - _("Bili_near"), (gpointer) BILINEAR, NULL, - _("Sin_usoidal"), (gpointer) SINUS, NULL, + _("L_inear"), LINEAR, NULL, + _("Bili_near"), BILINEAR, NULL, + _("Sin_usoidal"), SINUS, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/sparkle.c b/plug-ins/common/sparkle.c index 43c7bafbfc..277724ebde 100644 --- a/plug-ins/common/sparkle.c +++ b/plug-ins/common/sparkle.c @@ -501,21 +501,15 @@ sparkle_dialog (void) gtk_widget_show (sep); /* colortype */ - vbox = gimp_radio_group_new2 (FALSE, NULL, - G_CALLBACK (gimp_radio_button_update), - &svals.colortype, - GINT_TO_POINTER (svals.colortype), + vbox = gimp_int_radio_group_new (FALSE, NULL, + G_CALLBACK (gimp_radio_button_update), + &svals.colortype, svals.colortype, - _("_Natural Color"), - GINT_TO_POINTER (NATURAL), &r1, + _("_Natural Color"), NATURAL, &r1, + _("_Foreground Color"), FOREGROUND, &r2, + _("_Background Color"), BACKGROUND, &r3, - _("_Foreground Color"), - GINT_TO_POINTER (FOREGROUND), &r2, - - _("_Background Color"), - GINT_TO_POINTER (BACKGROUND), &r3, - - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (vbox), 0); gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); diff --git a/plug-ins/common/struc.c b/plug-ins/common/struc.c index 3250885c45..097c71e4ac 100644 --- a/plug-ins/common/struc.c +++ b/plug-ins/common/struc.c @@ -1264,24 +1264,16 @@ struc_dialog (void) vbox = gimp_parameter_settings_new (GTK_DIALOG (dlg)->vbox, 0, 0); - frame = gimp_radio_group_new2 (TRUE, _("Direction"), - G_CALLBACK (gimp_radio_button_update), - &svals.direction, - GINT_TO_POINTER (svals.direction), + frame = gimp_int_radio_group_new (TRUE, _("Direction"), + G_CALLBACK (gimp_radio_button_update), + &svals.direction, svals.direction, - _("_Top-Right"), - GINT_TO_POINTER (TOP_RIGHT), NULL, + _("_Top-Right"), TOP_RIGHT, NULL, + _("Top-_Left"), TOP_LEFT, NULL, + _("_Bottom-Left"), BOTTOM_LEFT, NULL, + _("Bottom-_Right"), BOTTOM_RIGHT, NULL, - _("Top-_Left"), - GINT_TO_POINTER (TOP_LEFT), NULL, - - _("_Bottom-Left"), - GINT_TO_POINTER (BOTTOM_LEFT), NULL, - - _("Bottom-_Right"), - GINT_TO_POINTER (BOTTOM_RIGHT), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/sunras.c b/plug-ins/common/sunras.c index e2b75bee2d..88221cb952 100644 --- a/plug-ins/common/sunras.c +++ b/plug-ins/common/sunras.c @@ -1580,18 +1580,14 @@ save_dialog (void) NULL); /* file save type */ - frame = gimp_radio_group_new2 (TRUE, _("Data Formatting"), - G_CALLBACK (gimp_radio_button_update), - &psvals.rle, - GINT_TO_POINTER (psvals.rle), + frame = gimp_int_radio_group_new (TRUE, _("Data Formatting"), + G_CALLBACK (gimp_radio_button_update), + &psvals.rle, psvals.rle, - _("RunLength Encoded"), - GINT_TO_POINTER (TRUE), NULL, + _("RunLength Encoded"), TRUE, NULL, + _("Standard"), FALSE, NULL, - _("Standard"), - GINT_TO_POINTER (FALSE), NULL, - - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0); diff --git a/plug-ins/common/tiff.c b/plug-ins/common/tiff.c index fdd850fd2c..29fda2a5b3 100644 --- a/plug-ins/common/tiff.c +++ b/plug-ins/common/tiff.c @@ -1783,27 +1783,17 @@ save_dialog (void) gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, FALSE, TRUE, 0); /* compression */ - frame = gimp_radio_group_new2 (TRUE, _("Compression"), - G_CALLBACK (gimp_radio_button_update), - &tsvals.compression, - GINT_TO_POINTER (tsvals.compression), + frame = gimp_int_radio_group_new (TRUE, _("Compression"), + G_CALLBACK (gimp_radio_button_update), + &tsvals.compression, tsvals.compression, - _("_None"), - GINT_TO_POINTER (COMPRESSION_NONE), NULL, + _("_None"), COMPRESSION_NONE, NULL, + _("_LZW"), COMPRESSION_LZW, NULL, + _("_Pack Bits"), COMPRESSION_PACKBITS, NULL, + _("_Deflate"), COMPRESSION_DEFLATE, NULL, + _("_JPEG"), COMPRESSION_JPEG, NULL, - _("_LZW"), - GINT_TO_POINTER (COMPRESSION_LZW), NULL, - - _("_Pack Bits"), - GINT_TO_POINTER (COMPRESSION_PACKBITS), NULL, - - _("_Deflate"), - GINT_TO_POINTER (COMPRESSION_DEFLATE), NULL, - - _("_JPEG"), - GINT_TO_POINTER (COMPRESSION_JPEG), NULL, - - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/waves.c b/plug-ins/common/waves.c index 91d7fd06ff..2f6035d129 100644 --- a/plug-ins/common/waves.c +++ b/plug-ins/common/waves.c @@ -313,14 +313,14 @@ pluginCoreIA (piArgs *argp, g_object_set_data (G_OBJECT (preview), "piArgs", argp); waves_do_preview (); - frame = gimp_radio_group_new2 (TRUE, _("Mode"), - G_CALLBACK (waves_radio_button_update), - &argp->type, (gpointer) argp->type, + frame = gimp_int_radio_group_new (TRUE, _("Mode"), + G_CALLBACK (waves_radio_button_update), + &argp->type, argp->type, - _("_Smear"), (gpointer) MODE_SMEAR, NULL, - _("_Blacken"), (gpointer) MODE_BLACKEN, NULL, + _("_Smear"), MODE_SMEAR, NULL, + _("_Blacken"), MODE_BLACKEN, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); diff --git a/plug-ins/common/wind.c b/plug-ins/common/wind.c index 3bb48618c3..accee26aec 100644 --- a/plug-ins/common/wind.c +++ b/plug-ins/common/wind.c @@ -903,18 +903,14 @@ dialog_box (GimpDrawable *drawable) radio buttons for choosing wind rendering algorithm ******************************************************/ - frame = gimp_radio_group_new2 (TRUE, _("Style"), - G_CALLBACK (radio_callback), - &config.alg, - GINT_TO_POINTER (config.alg), + frame = gimp_int_radio_group_new (TRUE, _("Style"), + G_CALLBACK (radio_callback), + &config.alg, config.alg, - _("_Wind"), - GINT_TO_POINTER (RENDER_WIND), &style1, + _("_Wind"), RENDER_WIND, &style1, + _("_Blast"), RENDER_BLAST, &style2, - _("_Blast"), - GINT_TO_POINTER (RENDER_BLAST), &style2, - - NULL); + NULL); g_object_set_data (G_OBJECT (style1), "drawable", drawable); g_object_set_data (G_OBJECT (style2), "drawable", drawable); @@ -927,18 +923,14 @@ dialog_box (GimpDrawable *drawable) radio buttons for choosing LEFT or RIGHT **************************************************/ - frame = gimp_radio_group_new2 (TRUE, _("Direction"), - G_CALLBACK (radio_callback), - &config.direction, - GINT_TO_POINTER (config.direction), + frame = gimp_int_radio_group_new (TRUE, _("Direction"), + G_CALLBACK (radio_callback), + &config.direction, config.direction, - _("_Left"), - GINT_TO_POINTER (LEFT), &dir1, + _("_Left"), LEFT, &dir1, + _("_Right"), RIGHT, &dir2, - _("_Right"), - GINT_TO_POINTER (RIGHT), &dir2, - - NULL); + NULL); g_object_set_data (G_OBJECT (dir1), "drawable", drawable); g_object_set_data (G_OBJECT (dir2), "drawable", drawable); @@ -951,21 +943,15 @@ dialog_box (GimpDrawable *drawable) radio buttons for choosing BOTH, LEADING, TRAILING ***************************************************/ - frame = gimp_radio_group_new2 (TRUE, _("Edge Affected"), - G_CALLBACK (radio_callback), - &config.edge, - GINT_TO_POINTER (config.edge), + frame = gimp_int_radio_group_new (TRUE, _("Edge Affected"), + G_CALLBACK (radio_callback), + &config.edge, config.edge, - _("L_eading"), - GINT_TO_POINTER (LEADING), &edge1, + _("L_eading"), LEADING, &edge1, + _("Tr_ailing"), TRAILING, &edge2, + _("Bot_h"), BOTH, &edge3, - _("Tr_ailing"), - GINT_TO_POINTER (TRAILING), &edge2, - - _("Bot_h"), - GINT_TO_POINTER (BOTH), &edge3, - - NULL); + NULL); g_object_set_data (G_OBJECT (edge1), "drawable", drawable); g_object_set_data (G_OBJECT (edge2), "drawable", drawable); diff --git a/plug-ins/fits/fits.c b/plug-ins/fits/fits.c index 93a0f71506..0d3ba887f9 100644 --- a/plug-ins/fits/fits.c +++ b/plug-ins/fits/fits.c @@ -979,38 +979,38 @@ load_dialog (void) TRUE, TRUE, 0); gtk_widget_show (vbox); - frame = gimp_radio_group_new2 (TRUE, _("BLANK/NaN Pixel Replacement"), - G_CALLBACK (gimp_radio_button_update), - &plvals.replace, (gpointer) plvals.replace, + frame = gimp_int_radio_group_new (TRUE, _("BLANK/NaN Pixel Replacement"), + G_CALLBACK (gimp_radio_button_update), + &plvals.replace, plvals.replace, - _("Black"), (gpointer) 0, NULL, - _("White"), (gpointer) 255, NULL, + _("Black"), 0, NULL, + _("White"), 255, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); frame = - gimp_radio_group_new2 (TRUE, _("Pixel Value Scaling"), - G_CALLBACK (gimp_radio_button_update), - &plvals.use_datamin, (gpointer) plvals.use_datamin, + gimp_int_radio_group_new (TRUE, _("Pixel Value Scaling"), + G_CALLBACK (gimp_radio_button_update), + &plvals.use_datamin, plvals.use_datamin, - _("Automatic"), (gpointer) FALSE, NULL, - _("By DATAMIN/DATAMAX"), (gpointer) TRUE, NULL, + _("Automatic"), FALSE, NULL, + _("By DATAMIN/DATAMAX"), TRUE, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); frame = - gimp_radio_group_new2 (TRUE, _("Image Composing"), - G_CALLBACK (gimp_radio_button_update), - &plvals.compose, (gpointer) plvals.compose, + gimp_int_radio_group_new (TRUE, _("Image Composing"), + G_CALLBACK (gimp_radio_button_update), + &plvals.compose, plvals.compose, - _("None"), (gpointer) FALSE, NULL, - "NAXIS=3, NAXIS3=2,...,4", (gpointer) TRUE, NULL, + _("None"), FALSE, NULL, + "NAXIS=3, NAXIS3=2,...,4", TRUE, NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); diff --git a/plug-ins/flame/flame.c b/plug-ins/flame/flame.c index 7008a08b30..da2757d7a5 100644 --- a/plug-ins/flame/flame.c +++ b/plug-ins/flame/flame.c @@ -705,21 +705,20 @@ edit_callback (GtkWidget *widget, NULL); optionmenu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (menu_cb), - &config.variation, - (gpointer) VARIATION_SAME, + gimp_int_option_menu_new (FALSE, G_CALLBACK (menu_cb), + &config.variation, VARIATION_SAME, - _("Same"), (gpointer) VARIATION_SAME, NULL, - _("Random"), (gpointer) variation_random, NULL, - _("Linear"), (gpointer) 0, NULL, - _("Sinusoidal"), (gpointer) 1, NULL, - _("Spherical"), (gpointer) 2, NULL, - _("Swirl"), (gpointer) 3, NULL, - _("Horseshoe"), (gpointer) 4, NULL, - _("Polar"), (gpointer) 5, NULL, - _("Bent"), (gpointer) 6, NULL, + _("Same"), VARIATION_SAME, NULL, + _("Random"), variation_random, NULL, + _("Linear"), 0, NULL, + _("Sinusoidal"), 1, NULL, + _("Spherical"), 2, NULL, + _("Swirl"), 3, NULL, + _("Horseshoe"), 4, NULL, + _("Polar"), 5, NULL, + _("Bent"), 6, NULL, - NULL); + NULL); gtk_box_pack_end (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); diff --git a/plug-ins/gfig/gfig.c b/plug-ins/gfig/gfig.c index 60a360485c..5c31fefd98 100644 --- a/plug-ins/gfig/gfig.c +++ b/plug-ins/gfig/gfig.c @@ -1414,13 +1414,13 @@ num_sides_dialog (gchar *d_title, GtkWidget *option_menu; option_menu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gimp_menu_item_update), - which_way, GINT_TO_POINTER (*which_way), + gimp_int_option_menu_new (FALSE, G_CALLBACK (gimp_menu_item_update), + which_way, *which_way, - _("Clockwise"), GINT_TO_POINTER (0), NULL, - _("Anti-Clockwise"), GINT_TO_POINTER (1), NULL, + _("Clockwise"), 0, NULL, + _("Anti-Clockwise"), 1, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Orientation:"), 1.0, 0.5, option_menu, 1, TRUE); @@ -1679,15 +1679,15 @@ gfig_brush_preview (GtkWidget **pv) gtk_widget_show (vbox); option_menu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gfig_brush_menu_callback), - *pv, GINT_TO_POINTER (selvals.brshtype), + gimp_int_option_menu_new (FALSE, G_CALLBACK (gfig_brush_menu_callback), + *pv, selvals.brshtype, - _("Brush"), GINT_TO_POINTER (BRUSH_BRUSH_TYPE), NULL, - _("Airbrush"), GINT_TO_POINTER (BRUSH_AIRBRUSH_TYPE), NULL, - _("Pencil"), GINT_TO_POINTER (BRUSH_PENCIL_TYPE), NULL, - _("Pattern"), GINT_TO_POINTER (BRUSH_PATTERN_TYPE), NULL, + _("Brush"), BRUSH_BRUSH_TYPE, NULL, + _("Airbrush"), BRUSH_AIRBRUSH_TYPE, NULL, + _("Pencil"), BRUSH_PENCIL_TYPE, NULL, + _("Pattern"), BRUSH_PATTERN_TYPE, NULL, - NULL); + NULL); gtk_widget_show (option_menu); gtk_container_add (GTK_CONTAINER (vbox), option_menu); @@ -2036,14 +2036,14 @@ paint_page (void) gtk_widget_show (table); page_menu_layers = - gimp_option_menu_new2 (FALSE, G_CALLBACK (paint_menu_callback), - GINT_TO_POINTER (PAINT_LAYERS_MENU), 0, + gimp_int_option_menu_new (FALSE, G_CALLBACK (paint_menu_callback), + GINT_TO_POINTER (PAINT_LAYERS_MENU), 0, - _("Original"), GINT_TO_POINTER (ORIGINAL_LAYER), NULL, - _("New"), GINT_TO_POINTER (SINGLE_LAYER), NULL, - _("Multiple"), GINT_TO_POINTER (MULTI_LAYER), NULL, + _("Original"), ORIGINAL_LAYER, NULL, + _("New"), SINGLE_LAYER, NULL, + _("Multiple"), MULTI_LAYER, NULL, - NULL); + NULL); gimp_help_set_help_data (page_menu_layers, _("Draw all objects on one layer (original or new) " @@ -2055,17 +2055,14 @@ paint_page (void) page_menu_layers, 1, TRUE); page_menu_type = - gimp_option_menu_new2 (FALSE, G_CALLBACK (paint_menu_callback), - GINT_TO_POINTER (PAINT_TYPE_MENU), 0, + gimp_int_option_menu_new (FALSE, G_CALLBACK (paint_menu_callback), + GINT_TO_POINTER (PAINT_TYPE_MENU), 0, - _("Brush"), - GINT_TO_POINTER (PAINT_BRUSH_TYPE), &item1, - _("Selection"), - GINT_TO_POINTER (PAINT_SELECTION_TYPE), &item2, - _("Selection+Fill"), - GINT_TO_POINTER (PAINT_SELECTION_FILL_TYPE), &item3, + _("Brush"), PAINT_BRUSH_TYPE, &item1, + _("Selection"), PAINT_SELECTION_TYPE, &item2, + _("Selection+Fill"), PAINT_SELECTION_FILL_TYPE, &item3, - NULL); + NULL); gimp_help_set_help_data (page_menu_type, _("Draw type. Either a brush or a selection. " @@ -2076,16 +2073,16 @@ paint_page (void) page_menu_type, 1, TRUE); page_menu_bg = - gimp_option_menu_new2 (FALSE, G_CALLBACK (paint_menu_callback), - GINT_TO_POINTER (PAINT_BGS_MENU), 0, + gimp_int_option_menu_new (FALSE, G_CALLBACK (paint_menu_callback), + GINT_TO_POINTER (PAINT_BGS_MENU), 0, - _("Transparent"), GINT_TO_POINTER (LAYER_TRANS_BG), NULL, - _("Background"), GINT_TO_POINTER (LAYER_BG_BG), NULL, - _("Foreground"), GINT_TO_POINTER (LAYER_FG_BG), NULL, - _("White"), GINT_TO_POINTER (LAYER_WHITE_BG), NULL, - _("Copy"), GINT_TO_POINTER (LAYER_COPY_BG), NULL, + _("Transparent"), LAYER_TRANS_BG, NULL, + _("Background"), LAYER_BG_BG, NULL, + _("Foreground"), LAYER_FG_BG, NULL, + _("White"), LAYER_WHITE_BG, NULL, + _("Copy"), LAYER_COPY_BG, NULL, - NULL); + NULL); gimp_help_set_help_data (page_menu_bg, _("Layer background type. Copy causes previous " "layer to be copied before the draw is performed"), @@ -2397,15 +2394,15 @@ select_page (void) */ /* 1 */ - menu = gimp_option_menu_new2 (FALSE, G_CALLBACK (select_menu_callback), - GINT_TO_POINTER (SELECT_TYPE_MENU), 0, + menu = gimp_int_option_menu_new (FALSE, G_CALLBACK (select_menu_callback), + GINT_TO_POINTER (SELECT_TYPE_MENU), 0, - _("Add"), GINT_TO_POINTER (ADD), NULL, - _("Subtract"), GINT_TO_POINTER (SUBTRACT), NULL, - _("Replace"), GINT_TO_POINTER (REPLACE), NULL, - _("Intersect"), GINT_TO_POINTER (INTERSECT), NULL, + _("Add"), ADD, NULL, + _("Subtract"), SUBTRACT, NULL, + _("Replace"), REPLACE, NULL, + _("Intersect"), INTERSECT, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Selection Type:"), 1.0, 0.5, menu, 1, FALSE); @@ -2443,14 +2440,14 @@ select_page (void) /* 5 */ menu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (select_menu_callback), - GINT_TO_POINTER (SELECT_TYPE_MENU_FILL), 0, + gimp_int_option_menu_new (FALSE, G_CALLBACK (select_menu_callback), + GINT_TO_POINTER (SELECT_TYPE_MENU_FILL), 0, - _("Pattern"), GINT_TO_POINTER (FILL_PATTERN), NULL, - _("Foreground"), GINT_TO_POINTER (FILL_FOREGROUND), NULL, - _("Background"), GINT_TO_POINTER (FILL_BACKGROUND), NULL, + _("Pattern"), FILL_PATTERN, NULL, + _("Foreground"), FILL_FOREGROUND, NULL, + _("Background"), FILL_BACKGROUND, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Fill Type:"), 1.0, 0.5, menu, 1, FALSE); @@ -2470,25 +2467,25 @@ select_page (void) /* 7 */ menu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (select_menu_callback), - GINT_TO_POINTER (SELECT_TYPE_MENU_WHEN), 0, + gimp_int_option_menu_new (FALSE, G_CALLBACK (select_menu_callback), + GINT_TO_POINTER (SELECT_TYPE_MENU_WHEN), 0, - _("Each Selection"), GINT_TO_POINTER (FILL_EACH), NULL, - _("All Selections"), GINT_TO_POINTER (FILL_AFTER), NULL, + _("Each Selection"), FILL_EACH, NULL, + _("All Selections"), FILL_AFTER, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Fill after:"), 1.0, 0.5, menu, 1, FALSE); /* 8 */ - menu = gimp_option_menu_new2 (FALSE, G_CALLBACK (select_menu_callback), - GINT_TO_POINTER (SELECT_ARCTYPE_MENU), 0, + menu = gimp_int_option_menu_new (FALSE, G_CALLBACK (select_menu_callback), + GINT_TO_POINTER (SELECT_ARCTYPE_MENU), 0, - _("Segment"), GINT_TO_POINTER (ARC_SEGMENT), NULL, - _("Sector"), GINT_TO_POINTER (ARC_SECTOR), NULL, + _("Segment"), ARC_SEGMENT, NULL, + _("Sector"), ARC_SECTOR, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 3, _("Arc as:"), 1.0, 0.5, menu, 1, FALSE); @@ -2558,14 +2555,14 @@ options_page (void) NULL, 0, 0, button, 1, TRUE); - menu = gimp_option_menu_new2 (FALSE, G_CALLBACK (gridtype_menu_callback), - GINT_TO_POINTER (GRID_TYPE_MENU), 0, + menu = gimp_int_option_menu_new (FALSE, G_CALLBACK (gridtype_menu_callback), + GINT_TO_POINTER (GRID_TYPE_MENU), 0, - _("Rectangle"), GINT_TO_POINTER (RECT_GRID), NULL, - _("Polar"), GINT_TO_POINTER (POLAR_GRID), NULL, - _("Isometric"), GINT_TO_POINTER (ISO_GRID), NULL, + _("Rectangle"), RECT_GRID, NULL, + _("Polar"), POLAR_GRID, NULL, + _("Isometric"), ISO_GRID, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Grid Type:"), 1.0, 0.5, menu, 1, TRUE); @@ -2573,18 +2570,18 @@ options_page (void) gfig_opt_widget.gridtypemenu = menu; menu = - gimp_option_menu_new2 (FALSE, G_CALLBACK (gridtype_menu_callback), - GINT_TO_POINTER (GRID_RENDER_MENU), 0, + gimp_int_option_menu_new (FALSE, G_CALLBACK (gridtype_menu_callback), + GINT_TO_POINTER (GRID_RENDER_MENU), 0, - _("Normal"), GINT_TO_POINTER (GTK_STATE_NORMAL), NULL, - _("Black"), GINT_TO_POINTER (GFIG_BLACK_GC), NULL, - _("White"), GINT_TO_POINTER (GFIG_WHITE_GC), NULL, - _("Grey"), GINT_TO_POINTER (GFIG_GREY_GC), NULL, - _("Darker"), GINT_TO_POINTER (GTK_STATE_ACTIVE), NULL, - _("Lighter"), GINT_TO_POINTER (GTK_STATE_PRELIGHT), NULL, - _("Very Dark"), GINT_TO_POINTER (GTK_STATE_SELECTED), NULL, + _("Normal"), GTK_STATE_NORMAL, NULL, + _("Black"), GFIG_BLACK_GC, NULL, + _("White"), GFIG_WHITE_GC, NULL, + _("Grey"), GFIG_GREY_GC, NULL, + _("Darker"), GTK_STATE_ACTIVE, NULL, + _("Lighter"), GTK_STATE_PRELIGHT, NULL, + _("Very Dark"), GTK_STATE_SELECTED, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Grid Color:"), 1.0, 0.5, menu, 1, TRUE); diff --git a/plug-ins/gimpressionist/color.c b/plug-ins/gimpressionist/color.c index 4bfb6d5f7b..3bb601d899 100644 --- a/plug-ins/gimpressionist/color.c +++ b/plug-ins/gimpressionist/color.c @@ -45,13 +45,16 @@ void create_colorpage(GtkNotebook *notebook) gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - frame = gimp_radio_group_new2 (TRUE, _("Color"), - G_CALLBACK (gimp_radio_button_update), - &pcvals.colortype, (gpointer) 0, + frame = gimp_int_radio_group_new (TRUE, _("Color"), + G_CALLBACK (gimp_radio_button_update), + &pcvals.colortype, 0, - _("A_verage under brush"), 0, &colorradio[0], - _("C_enter of brush"), 1, &colorradio[1], - NULL); + _("A_verage under brush"), + 0, &colorradio[0], + _("C_enter of brush"), + 1, &colorradio[1], + + NULL); gimp_help_set_help_data (colorradio[0], diff --git a/plug-ins/gimpressionist/orientmap.c b/plug-ins/gimpressionist/orientmap.c index 7fe6a2ca7d..b64779bd8f 100644 --- a/plug-ins/gimpressionist/orientmap.c +++ b/plug-ins/gimpressionist/orientmap.c @@ -549,15 +549,16 @@ void create_orientmap_dialog(void) gtk_container_add(GTK_CONTAINER(hbox), vbox); gtk_widget_show (vbox); - frame = gimp_radio_group_new2 (TRUE, _("Type"), - G_CALLBACK (vectypeclick), - &vector_type, (gpointer) 0, + frame = gimp_int_radio_group_new (TRUE, _("Type"), + G_CALLBACK (vectypeclick), + &vector_type, 0, - _("_Normal"), 0, &vectypes[0], - _("Vorte_x"), 1, &vectypes[1], - _("Vortex_2"), 2, &vectypes[2], - _("Vortex_3"), 3, &vectypes[3], - NULL); + _("_Normal"), 0, &vectypes[0], + _("Vorte_x"), 1, &vectypes[1], + _("Vortex_2"), 2, &vectypes[2], + _("Vortex_3"), 3, &vectypes[3], + + NULL); gtk_container_add(GTK_CONTAINER(vbox), frame); gtk_widget_show(frame); diff --git a/plug-ins/gimpressionist/placement.c b/plug-ins/gimpressionist/placement.c index 7ea4d5aa3a..148efc74f6 100644 --- a/plug-ins/gimpressionist/placement.c +++ b/plug-ins/gimpressionist/placement.c @@ -47,13 +47,14 @@ void create_placementpage(GtkNotebook *notebook) gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - frame = gimp_radio_group_new2 (TRUE, _("Placement"), - G_CALLBACK (gimp_radio_button_update), - &pcvals.placetype, (gpointer) 0, + frame = gimp_int_radio_group_new (TRUE, _("Placement"), + G_CALLBACK (gimp_radio_button_update), + &pcvals.placetype, 0, - _("Randomly"), 0, &placeradio[0], - _("Evenly distributed"), 1, &placeradio[1], - NULL); + _("Randomly"), 0, &placeradio[0], + _("Evenly distributed"), 1, &placeradio[1], + + NULL); gimp_help_set_help_data (placeradio[0], _("Place strokes randomly around the image"), NULL); diff --git a/plug-ins/jpeg/jpeg-load.c b/plug-ins/jpeg/jpeg-load.c index 5451946c28..6661562316 100644 --- a/plug-ins/jpeg/jpeg-load.c +++ b/plug-ins/jpeg/jpeg-load.c @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/jpeg/jpeg-load.h b/plug-ins/jpeg/jpeg-load.h index 5451946c28..6661562316 100644 --- a/plug-ins/jpeg/jpeg-load.h +++ b/plug-ins/jpeg/jpeg-load.h @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/jpeg/jpeg-save.c b/plug-ins/jpeg/jpeg-save.c index 5451946c28..6661562316 100644 --- a/plug-ins/jpeg/jpeg-save.c +++ b/plug-ins/jpeg/jpeg-save.c @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/jpeg/jpeg-save.h b/plug-ins/jpeg/jpeg-save.h index 5451946c28..6661562316 100644 --- a/plug-ins/jpeg/jpeg-save.h +++ b/plug-ins/jpeg/jpeg-save.h @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/jpeg/jpeg.c b/plug-ins/jpeg/jpeg.c index 5451946c28..6661562316 100644 --- a/plug-ins/jpeg/jpeg.c +++ b/plug-ins/jpeg/jpeg.c @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/jpeg/jpeg.h b/plug-ins/jpeg/jpeg.h index 5451946c28..6661562316 100644 --- a/plug-ins/jpeg/jpeg.h +++ b/plug-ins/jpeg/jpeg.h @@ -1869,13 +1869,15 @@ save_dialog (void) /* Subsampling */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.subsmp, GINT_TO_POINTER (jsvals.subsmp), - "2x2,1x1,1x1", GINT_TO_POINTER (0), NULL, - "2x1,1x1,1x1 (4:2:2)", GINT_TO_POINTER (1), NULL, - "1x1,1x1,1x1", GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.subsmp, jsvals.subsmp, + + "2x2,1x1,1x1", 0, NULL, + "2x1,1x1,1x1 (4:2:2)", 1, NULL, + "1x1,1x1,1x1", 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 7, _("Subsampling:"), @@ -1884,13 +1886,15 @@ save_dialog (void) /* DCT method */ menu = - gimp_option_menu_new2 (FALSE, - G_CALLBACK (menu_callback), - &jsvals.dct, GINT_TO_POINTER (jsvals.dct), - _("Fast Integer"), GINT_TO_POINTER (1), NULL, - _("Integer"), GINT_TO_POINTER (0), NULL, - _("Floating-Point"), GINT_TO_POINTER (2), NULL, - NULL); + gimp_int_option_menu_new (FALSE, + G_CALLBACK (menu_callback), + &jsvals.dct, jsvals.dct, + + _("Fast Integer"), 1, NULL, + _("Integer"), 0, NULL, + _("Floating-Point"), 2, NULL, + + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, 8, _("DCT method (Speed/quality tradeoff):"), diff --git a/plug-ins/maze/maze_face.c b/plug-ins/maze/maze_face.c index 14dc3a7ced..a029bf37f0 100644 --- a/plug-ins/maze/maze_face.c +++ b/plug-ins/maze/maze_face.c @@ -295,23 +295,14 @@ maze_dialog (void) trow++; /* Algorithm Choice */ - frame = gimp_radio_group_new (TRUE, _("Style"), + frame = gimp_int_radio_group_new (TRUE, _("Style"), + G_CALLBACK (gimp_radio_button_update), + &mvals.algorithm, mvals.algorithm, - _("Depth First"), - gimp_radio_button_update, - &mvals.algorithm, - (gpointer) DEPTH_FIRST, - NULL, - (mvals.algorithm == DEPTH_FIRST), + _("Depth First"), DEPTH_FIRST, NULL, + _("Prim's Algorithm"), PRIMS_ALGORITHM, NULL, - _("Prim's Algorithm"), - gimp_radio_button_update, - &mvals.algorithm, - (gpointer) PRIMS_ALGORITHM, - NULL, - (mvals.algorithm == PRIMS_ALGORITHM), - - NULL); + NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_container_set_border_width (GTK_CONTAINER(frame), 6); diff --git a/plug-ins/rcm/rcm.c b/plug-ins/rcm/rcm.c index 92930191bd..f1f092d47a 100644 --- a/plug-ins/rcm/rcm.c +++ b/plug-ins/rcm/rcm.c @@ -68,7 +68,6 @@ RcmParams Current = { SELECTION, /* SELECTION ONLY */ TRUE, /* REAL TIME */ - FALSE, /* SUCCESS */ RADIANS_OVER_PI, /* START IN RADIANS OVER PI */ GRAY_TO }; diff --git a/plug-ins/sgi/sgi.c b/plug-ins/sgi/sgi.c index fbaf50b60d..d1d0f19a19 100644 --- a/plug-ins/sgi/sgi.c +++ b/plug-ins/sgi/sgi.c @@ -616,19 +616,18 @@ save_dialog (void) NULL); - frame = gimp_radio_group_new2 (TRUE, _("Compression Type"), - G_CALLBACK (gimp_radio_button_update), - &compression, - GINT_TO_POINTER (compression), + frame = gimp_int_radio_group_new (TRUE, _("Compression Type"), + G_CALLBACK (gimp_radio_button_update), + &compression, compression, - _("No Compression"), - GINT_TO_POINTER (SGI_COMP_NONE), NULL, - _("RLE Compression"), - GINT_TO_POINTER (SGI_COMP_RLE), NULL, - _("Aggressive RLE\n(Not Supported by SGI)"), - GINT_TO_POINTER (SGI_COMP_ARLE), NULL, + _("No Compression"), + SGI_COMP_NONE, NULL, + _("RLE Compression"), + SGI_COMP_RLE, NULL, + _("Aggressive RLE\n(Not Supported by SGI)"), + SGI_COMP_ARLE, NULL, - NULL); + NULL); gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);