From 38c66a651c49cf63df58d4e0fc8dff114aba9585 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 27 Jan 2000 01:22:27 +0000 Subject: [PATCH] added one more option menu constructor and made the namespace more 2000-01-28 Michael Natterer * libgimp/gimpwidgets.[ch]: added one more option menu constructor and made the namespace more consistent, minor fixes. * libgimp/gimpdialog.c * libgimp/gimpunitmenu.c: minor fixes. * app/preferences_dialog.c * plug-ins/borderaverage/borderaverage.c * plug-ins/common/gif.c * plug-ins/common/randomize.c: changed according to the above namespace cleanups. --- ChangeLog | 14 +++ app/dialogs/preferences-dialog.c | 142 ++++++++++++------------- app/gui/preferences-dialog.c | 142 ++++++++++++------------- app/preferences_dialog.c | 142 ++++++++++++------------- libgimp/gimpdialog.c | 4 +- libgimp/gimpunitmenu.c | 6 +- libgimp/gimpwidgets.c | 142 ++++++++++++++++++++----- libgimp/gimpwidgets.h | 20 +++- libgimpwidgets/gimpdialog.c | 4 +- libgimpwidgets/gimpunitmenu.c | 6 +- libgimpwidgets/gimpwidgets.c | 142 ++++++++++++++++++++----- libgimpwidgets/gimpwidgets.h | 20 +++- plug-ins/borderaverage/borderaverage.c | 35 +++--- plug-ins/common/borderaverage.c | 35 +++--- plug-ins/common/gif.c | 20 ++-- plug-ins/common/randomize.c | 1 - 16 files changed, 553 insertions(+), 322 deletions(-) diff --git a/ChangeLog b/ChangeLog index 85f9efe2b2..81a050be40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2000-01-28 Michael Natterer + + * libgimp/gimpwidgets.[ch]: added one more option menu constructor + and made the namespace more consistent, minor fixes. + + * libgimp/gimpdialog.c + * libgimp/gimpunitmenu.c: minor fixes. + + * app/preferences_dialog.c + * plug-ins/borderaverage/borderaverage.c + * plug-ins/common/gif.c + * plug-ins/common/randomize.c: changed according to the above + namespace cleanups. + Thu Jan 27 23:54:05 CET 2000 Sven Neumann * plug-ins/common/newsprint.c diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 52db6324e3..061b932157 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -1628,13 +1628,13 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &default_type, (gpointer) default_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &default_type, (gpointer) default_type, - _("RGB"), (gpointer) RGB, NULL, - _("Grayscale"), (gpointer) GRAY, NULL, + _("RGB"), (gpointer) RGB, NULL, + _("Grayscale"), (gpointer) GRAY, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Default Image Type:"), 1.0, 0.5, optionmenu, TRUE); @@ -1669,14 +1669,14 @@ file_pref_cmd_callback (GtkWidget *widget, (gpointer) mem_size_unit); optionmenu = - gimp_option_menu_new (file_prefs_mem_size_unit_callback, - adjustment, (gpointer) mem_size_unit, + gimp_option_menu_new2 (FALSE, file_prefs_mem_size_unit_callback, + adjustment, (gpointer) mem_size_unit, - _("Bytes"), (gpointer) 1, NULL, - _("KiloBytes"), (gpointer) 1024, NULL, - _("MegaBytes"), (gpointer) (1024 * 1024), NULL, + _("Bytes"), (gpointer) 1, NULL, + _("KiloBytes"), (gpointer) 1024, NULL, + _("MegaBytes"), (gpointer) (1024 * 1024), NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); gimp_table_attach_aligned (GTK_TABLE (table), 1, @@ -1711,30 +1711,30 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &transparency_type, (gpointer) transparency_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &transparency_type, (gpointer) transparency_type, - _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, - _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, - _("Dark Checks"), (gpointer) DARK_CHECKS, NULL, - _("White Only"), (gpointer) WHITE_ONLY, NULL, - _("Gray Only"), (gpointer) GRAY_ONLY, NULL, - _("Black Only"), (gpointer) BLACK_ONLY, NULL, + _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, + _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, + _("Dark Checks"), (gpointer) DARK_CHECKS, NULL, + _("White Only"), (gpointer) WHITE_ONLY, NULL, + _("Gray Only"), (gpointer) GRAY_ONLY, NULL, + _("Black Only"), (gpointer) BLACK_ONLY, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Transparency Type:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &transparency_size, (gpointer) transparency_size, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &transparency_size, (gpointer) transparency_size, - _("Small"), (gpointer) SMALL_CHECKS, NULL, - _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, - _("Large"), (gpointer) LARGE_CHECKS, NULL, + _("Small"), (gpointer) SMALL_CHECKS, NULL, + _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, + _("Large"), (gpointer) LARGE_CHECKS, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Check Size:"), 1.0, 0.5, optionmenu, TRUE); @@ -1797,29 +1797,29 @@ file_pref_cmd_callback (GtkWidget *widget, */ optionmenu = - gimp_option_menu_new (file_prefs_preview_size_callback, - &preview_size, (gpointer) preview_size, + gimp_option_menu_new2 (FALSE, file_prefs_preview_size_callback, + &preview_size, (gpointer) preview_size, - _("None"), (gpointer) 0, NULL, - _("Tiny"), (gpointer) 24, NULL, - _("Small"), (gpointer) 32, NULL, - _("Medium"), (gpointer) 48, NULL, - _("Large"), (gpointer) 64, NULL, - _("Huge"), (gpointer) 128, NULL, + _("None"), (gpointer) 0, NULL, + _("Tiny"), (gpointer) 24, NULL, + _("Small"), (gpointer) 32, NULL, + _("Medium"), (gpointer) 48, NULL, + _("Large"), (gpointer) 64, NULL, + _("Huge"), (gpointer) 128, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Preview Size:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_nav_preview_size_callback, - &nav_preview_size, (gpointer) nav_preview_size, + gimp_option_menu_new2 (FALSE, file_prefs_nav_preview_size_callback, + &nav_preview_size, (gpointer) nav_preview_size, - _("Small"), (gpointer) 48, NULL, - _("Medium"), (gpointer) 80, NULL, - _("Large"), (gpointer) 112, NULL, + _("Small"), (gpointer) 48, NULL, + _("Medium"), (gpointer) 80, NULL, + _("Large"), (gpointer) 112, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Nav Preview Size:"), 1.0, 0.5, optionmenu, TRUE); @@ -1908,13 +1908,13 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &help_browser, (gpointer) help_browser, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &help_browser, (gpointer) help_browser, - _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, - _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, + _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, + _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Help Browser to Use:"), 1.0, 0.5, optionmenu, TRUE); @@ -2151,14 +2151,14 @@ file_pref_cmd_callback (GtkWidget *widget, (gpointer) mem_size_unit); optionmenu = - gimp_option_menu_new (file_prefs_mem_size_unit_callback, - adjustment, (gpointer) mem_size_unit, + gimp_option_menu_new2 (FALSE, file_prefs_mem_size_unit_callback, + adjustment, (gpointer) mem_size_unit, - _("Bytes"), (gpointer) 1, NULL, - _("KiloBytes"), (gpointer) 1024, NULL, - _("MegaBytes"), (gpointer) (1024 * 1024), NULL, + _("Bytes"), (gpointer) 1, NULL, + _("KiloBytes"), (gpointer) 1024, NULL, + _("MegaBytes"), (gpointer) (1024 * 1024), NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); gimp_table_attach_aligned (GTK_TABLE (table), 1, @@ -2191,17 +2191,17 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &interpolation_type, (gpointer) interpolation_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &interpolation_type, (gpointer) interpolation_type, - _("Nearest Neighbor (Fast)"), - (gpointer) NEAREST_NEIGHBOR_INTERPOLATION, NULL, - _("Linear"), - (gpointer) LINEAR_INTERPOLATION, NULL, - _("Cubic (Slow)"), - (gpointer) CUBIC_INTERPOLATION, NULL, + _("Nearest Neighbor (Fast)"), + (gpointer) NEAREST_NEIGHBOR_INTERPOLATION, NULL, + _("Linear"), + (gpointer) LINEAR_INTERPOLATION, NULL, + _("Cubic (Slow)"), + (gpointer) CUBIC_INTERPOLATION, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Interpolation Type:"), 1.0, 0.5, optionmenu, TRUE); @@ -2220,25 +2220,25 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &thumbnail_mode, (gpointer) thumbnail_mode, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &thumbnail_mode, (gpointer) thumbnail_mode, - _("Always"), (gpointer) 1, NULL, - _("Never"), (gpointer) 0, NULL, + _("Always"), (gpointer) 1, NULL, + _("Never"), (gpointer) 0, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Try to Write a Thumbnail File:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &trust_dirty_flag, (gpointer) trust_dirty_flag, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &trust_dirty_flag, (gpointer) trust_dirty_flag, - _("Only when Modified"), (gpointer) 1, NULL, - _("Always"), (gpointer) 0, NULL, + _("Only when Modified"), (gpointer) 1, NULL, + _("Always"), (gpointer) 0, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("\"File > Save\" Saves the Image:"), 1.0, 0.5, optionmenu, TRUE); diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 52db6324e3..061b932157 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -1628,13 +1628,13 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &default_type, (gpointer) default_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &default_type, (gpointer) default_type, - _("RGB"), (gpointer) RGB, NULL, - _("Grayscale"), (gpointer) GRAY, NULL, + _("RGB"), (gpointer) RGB, NULL, + _("Grayscale"), (gpointer) GRAY, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Default Image Type:"), 1.0, 0.5, optionmenu, TRUE); @@ -1669,14 +1669,14 @@ file_pref_cmd_callback (GtkWidget *widget, (gpointer) mem_size_unit); optionmenu = - gimp_option_menu_new (file_prefs_mem_size_unit_callback, - adjustment, (gpointer) mem_size_unit, + gimp_option_menu_new2 (FALSE, file_prefs_mem_size_unit_callback, + adjustment, (gpointer) mem_size_unit, - _("Bytes"), (gpointer) 1, NULL, - _("KiloBytes"), (gpointer) 1024, NULL, - _("MegaBytes"), (gpointer) (1024 * 1024), NULL, + _("Bytes"), (gpointer) 1, NULL, + _("KiloBytes"), (gpointer) 1024, NULL, + _("MegaBytes"), (gpointer) (1024 * 1024), NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); gimp_table_attach_aligned (GTK_TABLE (table), 1, @@ -1711,30 +1711,30 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &transparency_type, (gpointer) transparency_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &transparency_type, (gpointer) transparency_type, - _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, - _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, - _("Dark Checks"), (gpointer) DARK_CHECKS, NULL, - _("White Only"), (gpointer) WHITE_ONLY, NULL, - _("Gray Only"), (gpointer) GRAY_ONLY, NULL, - _("Black Only"), (gpointer) BLACK_ONLY, NULL, + _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, + _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, + _("Dark Checks"), (gpointer) DARK_CHECKS, NULL, + _("White Only"), (gpointer) WHITE_ONLY, NULL, + _("Gray Only"), (gpointer) GRAY_ONLY, NULL, + _("Black Only"), (gpointer) BLACK_ONLY, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Transparency Type:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &transparency_size, (gpointer) transparency_size, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &transparency_size, (gpointer) transparency_size, - _("Small"), (gpointer) SMALL_CHECKS, NULL, - _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, - _("Large"), (gpointer) LARGE_CHECKS, NULL, + _("Small"), (gpointer) SMALL_CHECKS, NULL, + _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, + _("Large"), (gpointer) LARGE_CHECKS, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Check Size:"), 1.0, 0.5, optionmenu, TRUE); @@ -1797,29 +1797,29 @@ file_pref_cmd_callback (GtkWidget *widget, */ optionmenu = - gimp_option_menu_new (file_prefs_preview_size_callback, - &preview_size, (gpointer) preview_size, + gimp_option_menu_new2 (FALSE, file_prefs_preview_size_callback, + &preview_size, (gpointer) preview_size, - _("None"), (gpointer) 0, NULL, - _("Tiny"), (gpointer) 24, NULL, - _("Small"), (gpointer) 32, NULL, - _("Medium"), (gpointer) 48, NULL, - _("Large"), (gpointer) 64, NULL, - _("Huge"), (gpointer) 128, NULL, + _("None"), (gpointer) 0, NULL, + _("Tiny"), (gpointer) 24, NULL, + _("Small"), (gpointer) 32, NULL, + _("Medium"), (gpointer) 48, NULL, + _("Large"), (gpointer) 64, NULL, + _("Huge"), (gpointer) 128, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Preview Size:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_nav_preview_size_callback, - &nav_preview_size, (gpointer) nav_preview_size, + gimp_option_menu_new2 (FALSE, file_prefs_nav_preview_size_callback, + &nav_preview_size, (gpointer) nav_preview_size, - _("Small"), (gpointer) 48, NULL, - _("Medium"), (gpointer) 80, NULL, - _("Large"), (gpointer) 112, NULL, + _("Small"), (gpointer) 48, NULL, + _("Medium"), (gpointer) 80, NULL, + _("Large"), (gpointer) 112, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Nav Preview Size:"), 1.0, 0.5, optionmenu, TRUE); @@ -1908,13 +1908,13 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &help_browser, (gpointer) help_browser, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &help_browser, (gpointer) help_browser, - _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, - _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, + _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, + _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Help Browser to Use:"), 1.0, 0.5, optionmenu, TRUE); @@ -2151,14 +2151,14 @@ file_pref_cmd_callback (GtkWidget *widget, (gpointer) mem_size_unit); optionmenu = - gimp_option_menu_new (file_prefs_mem_size_unit_callback, - adjustment, (gpointer) mem_size_unit, + gimp_option_menu_new2 (FALSE, file_prefs_mem_size_unit_callback, + adjustment, (gpointer) mem_size_unit, - _("Bytes"), (gpointer) 1, NULL, - _("KiloBytes"), (gpointer) 1024, NULL, - _("MegaBytes"), (gpointer) (1024 * 1024), NULL, + _("Bytes"), (gpointer) 1, NULL, + _("KiloBytes"), (gpointer) 1024, NULL, + _("MegaBytes"), (gpointer) (1024 * 1024), NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); gimp_table_attach_aligned (GTK_TABLE (table), 1, @@ -2191,17 +2191,17 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &interpolation_type, (gpointer) interpolation_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &interpolation_type, (gpointer) interpolation_type, - _("Nearest Neighbor (Fast)"), - (gpointer) NEAREST_NEIGHBOR_INTERPOLATION, NULL, - _("Linear"), - (gpointer) LINEAR_INTERPOLATION, NULL, - _("Cubic (Slow)"), - (gpointer) CUBIC_INTERPOLATION, NULL, + _("Nearest Neighbor (Fast)"), + (gpointer) NEAREST_NEIGHBOR_INTERPOLATION, NULL, + _("Linear"), + (gpointer) LINEAR_INTERPOLATION, NULL, + _("Cubic (Slow)"), + (gpointer) CUBIC_INTERPOLATION, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Interpolation Type:"), 1.0, 0.5, optionmenu, TRUE); @@ -2220,25 +2220,25 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &thumbnail_mode, (gpointer) thumbnail_mode, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &thumbnail_mode, (gpointer) thumbnail_mode, - _("Always"), (gpointer) 1, NULL, - _("Never"), (gpointer) 0, NULL, + _("Always"), (gpointer) 1, NULL, + _("Never"), (gpointer) 0, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Try to Write a Thumbnail File:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &trust_dirty_flag, (gpointer) trust_dirty_flag, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &trust_dirty_flag, (gpointer) trust_dirty_flag, - _("Only when Modified"), (gpointer) 1, NULL, - _("Always"), (gpointer) 0, NULL, + _("Only when Modified"), (gpointer) 1, NULL, + _("Always"), (gpointer) 0, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("\"File > Save\" Saves the Image:"), 1.0, 0.5, optionmenu, TRUE); diff --git a/app/preferences_dialog.c b/app/preferences_dialog.c index 52db6324e3..061b932157 100644 --- a/app/preferences_dialog.c +++ b/app/preferences_dialog.c @@ -1628,13 +1628,13 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &default_type, (gpointer) default_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &default_type, (gpointer) default_type, - _("RGB"), (gpointer) RGB, NULL, - _("Grayscale"), (gpointer) GRAY, NULL, + _("RGB"), (gpointer) RGB, NULL, + _("Grayscale"), (gpointer) GRAY, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Default Image Type:"), 1.0, 0.5, optionmenu, TRUE); @@ -1669,14 +1669,14 @@ file_pref_cmd_callback (GtkWidget *widget, (gpointer) mem_size_unit); optionmenu = - gimp_option_menu_new (file_prefs_mem_size_unit_callback, - adjustment, (gpointer) mem_size_unit, + gimp_option_menu_new2 (FALSE, file_prefs_mem_size_unit_callback, + adjustment, (gpointer) mem_size_unit, - _("Bytes"), (gpointer) 1, NULL, - _("KiloBytes"), (gpointer) 1024, NULL, - _("MegaBytes"), (gpointer) (1024 * 1024), NULL, + _("Bytes"), (gpointer) 1, NULL, + _("KiloBytes"), (gpointer) 1024, NULL, + _("MegaBytes"), (gpointer) (1024 * 1024), NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); gimp_table_attach_aligned (GTK_TABLE (table), 1, @@ -1711,30 +1711,30 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &transparency_type, (gpointer) transparency_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &transparency_type, (gpointer) transparency_type, - _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, - _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, - _("Dark Checks"), (gpointer) DARK_CHECKS, NULL, - _("White Only"), (gpointer) WHITE_ONLY, NULL, - _("Gray Only"), (gpointer) GRAY_ONLY, NULL, - _("Black Only"), (gpointer) BLACK_ONLY, NULL, + _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, + _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, + _("Dark Checks"), (gpointer) DARK_CHECKS, NULL, + _("White Only"), (gpointer) WHITE_ONLY, NULL, + _("Gray Only"), (gpointer) GRAY_ONLY, NULL, + _("Black Only"), (gpointer) BLACK_ONLY, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Transparency Type:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &transparency_size, (gpointer) transparency_size, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &transparency_size, (gpointer) transparency_size, - _("Small"), (gpointer) SMALL_CHECKS, NULL, - _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, - _("Large"), (gpointer) LARGE_CHECKS, NULL, + _("Small"), (gpointer) SMALL_CHECKS, NULL, + _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, + _("Large"), (gpointer) LARGE_CHECKS, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Check Size:"), 1.0, 0.5, optionmenu, TRUE); @@ -1797,29 +1797,29 @@ file_pref_cmd_callback (GtkWidget *widget, */ optionmenu = - gimp_option_menu_new (file_prefs_preview_size_callback, - &preview_size, (gpointer) preview_size, + gimp_option_menu_new2 (FALSE, file_prefs_preview_size_callback, + &preview_size, (gpointer) preview_size, - _("None"), (gpointer) 0, NULL, - _("Tiny"), (gpointer) 24, NULL, - _("Small"), (gpointer) 32, NULL, - _("Medium"), (gpointer) 48, NULL, - _("Large"), (gpointer) 64, NULL, - _("Huge"), (gpointer) 128, NULL, + _("None"), (gpointer) 0, NULL, + _("Tiny"), (gpointer) 24, NULL, + _("Small"), (gpointer) 32, NULL, + _("Medium"), (gpointer) 48, NULL, + _("Large"), (gpointer) 64, NULL, + _("Huge"), (gpointer) 128, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Preview Size:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_nav_preview_size_callback, - &nav_preview_size, (gpointer) nav_preview_size, + gimp_option_menu_new2 (FALSE, file_prefs_nav_preview_size_callback, + &nav_preview_size, (gpointer) nav_preview_size, - _("Small"), (gpointer) 48, NULL, - _("Medium"), (gpointer) 80, NULL, - _("Large"), (gpointer) 112, NULL, + _("Small"), (gpointer) 48, NULL, + _("Medium"), (gpointer) 80, NULL, + _("Large"), (gpointer) 112, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Nav Preview Size:"), 1.0, 0.5, optionmenu, TRUE); @@ -1908,13 +1908,13 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &help_browser, (gpointer) help_browser, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &help_browser, (gpointer) help_browser, - _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, - _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, + _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, + _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Help Browser to Use:"), 1.0, 0.5, optionmenu, TRUE); @@ -2151,14 +2151,14 @@ file_pref_cmd_callback (GtkWidget *widget, (gpointer) mem_size_unit); optionmenu = - gimp_option_menu_new (file_prefs_mem_size_unit_callback, - adjustment, (gpointer) mem_size_unit, + gimp_option_menu_new2 (FALSE, file_prefs_mem_size_unit_callback, + adjustment, (gpointer) mem_size_unit, - _("Bytes"), (gpointer) 1, NULL, - _("KiloBytes"), (gpointer) 1024, NULL, - _("MegaBytes"), (gpointer) (1024 * 1024), NULL, + _("Bytes"), (gpointer) 1, NULL, + _("KiloBytes"), (gpointer) 1024, NULL, + _("MegaBytes"), (gpointer) (1024 * 1024), NULL, - NULL); + NULL); gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0); gtk_widget_show (optionmenu); gimp_table_attach_aligned (GTK_TABLE (table), 1, @@ -2191,17 +2191,17 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &interpolation_type, (gpointer) interpolation_type, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &interpolation_type, (gpointer) interpolation_type, - _("Nearest Neighbor (Fast)"), - (gpointer) NEAREST_NEIGHBOR_INTERPOLATION, NULL, - _("Linear"), - (gpointer) LINEAR_INTERPOLATION, NULL, - _("Cubic (Slow)"), - (gpointer) CUBIC_INTERPOLATION, NULL, + _("Nearest Neighbor (Fast)"), + (gpointer) NEAREST_NEIGHBOR_INTERPOLATION, NULL, + _("Linear"), + (gpointer) LINEAR_INTERPOLATION, NULL, + _("Cubic (Slow)"), + (gpointer) CUBIC_INTERPOLATION, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Interpolation Type:"), 1.0, 0.5, optionmenu, TRUE); @@ -2220,25 +2220,25 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_widget_show (table); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &thumbnail_mode, (gpointer) thumbnail_mode, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &thumbnail_mode, (gpointer) thumbnail_mode, - _("Always"), (gpointer) 1, NULL, - _("Never"), (gpointer) 0, NULL, + _("Always"), (gpointer) 1, NULL, + _("Never"), (gpointer) 0, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Try to Write a Thumbnail File:"), 1.0, 0.5, optionmenu, TRUE); optionmenu = - gimp_option_menu_new (file_prefs_toggle_callback, - &trust_dirty_flag, (gpointer) trust_dirty_flag, + gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback, + &trust_dirty_flag, (gpointer) trust_dirty_flag, - _("Only when Modified"), (gpointer) 1, NULL, - _("Always"), (gpointer) 0, NULL, + _("Only when Modified"), (gpointer) 1, NULL, + _("Always"), (gpointer) 0, NULL, - NULL); + NULL); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("\"File > Save\" Saves the Image:"), 1.0, 0.5, optionmenu, TRUE); diff --git a/libgimp/gimpdialog.c b/libgimp/gimpdialog.c index b3d27c1a1b..a33ca08672 100644 --- a/libgimp/gimpdialog.c +++ b/libgimp/gimpdialog.c @@ -226,8 +226,8 @@ gimp_dialog_create_action_areav (GtkDialog *dialog, { callback = va_arg (args, GtkSignalFunc); data = va_arg (args, gpointer); - slot_object = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + slot_object = va_arg (args, GtkObject *); + widget_ptr = va_arg (args, GtkWidget **); default_action = va_arg (args, gboolean); connect_delete = va_arg (args, gboolean); diff --git a/libgimp/gimpunitmenu.c b/libgimp/gimpunitmenu.c index ba09bbce7c..bc2702636b 100644 --- a/libgimp/gimpunitmenu.c +++ b/libgimp/gimpunitmenu.c @@ -27,10 +27,10 @@ #include "gimpintl.h" /* private functions */ -static const gchar * gimp_unit_menu_build_string (gchar *format, - GUnit unit); +static const gchar * gimp_unit_menu_build_string (gchar *format, + GUnit unit); static void gimp_unit_menu_callback (GtkWidget *widget, - gpointer data); + gpointer data); enum { diff --git a/libgimp/gimpwidgets.c b/libgimp/gimpwidgets.c index 157126a14d..693ceaf229 100644 --- a/libgimp/gimpwidgets.c +++ b/libgimp/gimpwidgets.c @@ -35,25 +35,110 @@ static void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button) /* - * Widget Constructors... + * Widget Constructors */ GtkWidget * -gimp_option_menu_new (GtkSignalFunc menu_item_callback, - gpointer data, - gpointer initial, /* user_data */ +gimp_option_menu_new (gboolean menu_only, /* specify menu items as va_list: - * gchar *label, - * gpointer user_data, - * GtkWidget **widget_ptr, + * gchar *label, + * GtkSignalFunc callback, + * gpointer data, + * gpointer user_data, + * GtkWidget **widget_ptr, + * gboolean active */ - ...) + ...) +{ + GtkWidget *menu; + GtkWidget *menuitem; + + /* menu item variables */ + gchar *label; + GtkSignalFunc callback; + gpointer data; + gpointer user_data; + GtkWidget **widget_ptr; + gboolean active; + + va_list args; + gint i; + gint initial_index; + + menu = gtk_menu_new (); + + /* create the menu items */ + initial_index = 0; + va_start (args, menu_only); + label = va_arg (args, gchar*); + for (i = 0; label; i++) + { + callback = va_arg (args, GtkSignalFunc); + data = va_arg (args, gpointer); + user_data = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); + active = va_arg (args, gboolean); + + if (label != (gpointer) 1) + menuitem = gtk_menu_item_new_with_label (label); + else + menuitem = gtk_menu_item_new (); + + gtk_menu_append (GTK_MENU (menu), menuitem); + gtk_signal_connect (GTK_OBJECT (menuitem), "activate", + callback, + data); + + if (user_data) + gtk_object_set_user_data (GTK_OBJECT (menuitem), user_data); + + if (widget_ptr) + *widget_ptr = menuitem; + + gtk_widget_show (menuitem); + + /* remember the initial menu item */ + if (active) + initial_index = i; + + label = va_arg (args, 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; +} + +GtkWidget * +gimp_option_menu_new2 (gboolean menu_only, + GtkSignalFunc menu_item_callback, + gpointer data, + gpointer initial, /* user_data */ + + /* specify menu items as va_list: + * gchar *label, + * gpointer user_data, + * GtkWidget **widget_ptr, + */ + + ...) { GtkWidget *menu; GtkWidget *menuitem; - GtkWidget *optionmenu; /* menu item variables */ gchar *label; @@ -73,7 +158,7 @@ gimp_option_menu_new (GtkSignalFunc menu_item_callback, for (i = 0; label; i++) { user_data = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); if (label != (gpointer) 1) menuitem = gtk_menu_item_new_with_label (label); @@ -101,13 +186,20 @@ gimp_option_menu_new (GtkSignalFunc menu_item_callback, } va_end (args); - optionmenu = gtk_option_menu_new (); - gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu); + if (! menu_only) + { + GtkWidget *optionmenu; - /* select the initial menu item */ - gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), initial_index); + optionmenu = gtk_option_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu); - return optionmenu; + /* select the initial menu item */ + gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), initial_index); + + return optionmenu; + } + + return menu; } GtkWidget * @@ -160,7 +252,7 @@ gimp_radio_group_new (gboolean in_frame, callback = va_arg (args, GtkSignalFunc); data = va_arg (args, gpointer); user_data = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); active = va_arg (args, gboolean); if (label != (gpointer) 1) @@ -181,7 +273,7 @@ gimp_radio_group_new (gboolean in_frame, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (callback), + callback, data); gtk_widget_show (button); @@ -199,7 +291,7 @@ gimp_radio_group_new (gboolean in_frame, GtkWidget * gimp_radio_group_new2 (gboolean in_frame, gchar *frame_title, - GtkSignalFunc callback, + GtkSignalFunc radio_button_callback, gpointer data, gpointer initial, /* user_data */ @@ -241,7 +333,7 @@ gimp_radio_group_new2 (gboolean in_frame, while (label) { user_data = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); if (label != (gpointer) 1) button = gtk_radio_button_new_with_label (group, label); @@ -261,7 +353,7 @@ gimp_radio_group_new2 (gboolean in_frame, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (callback), + radio_button_callback, data); gtk_widget_show (button); @@ -433,7 +525,7 @@ gimp_random_seed_new (gint *seed, } /* - * Standard Callbacks... + * Standard Callbacks */ static void @@ -561,24 +653,24 @@ gimp_unit_menu_update (GtkWidget *widget, } /* - * Helper Functions... + * Helper Functions */ /* add aligned label & widget to a two-column table */ void gimp_table_attach_aligned (GtkTable *table, gint row, - gchar *text, + gchar *label_text, gfloat xalign, gfloat yalign, GtkWidget *widget, gboolean left_adjust) { - if (text) + if (label_text) { GtkWidget *label; - label = gtk_label_new (text); + label = gtk_label_new (label_text); gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); gtk_table_attach (table, GTK_WIDGET (label), 0, 1, row, row + 1, diff --git a/libgimp/gimpwidgets.h b/libgimp/gimpwidgets.h index da81ab9a5c..bfa79e0bc0 100644 --- a/libgimp/gimpwidgets.h +++ b/libgimp/gimpwidgets.h @@ -32,7 +32,21 @@ extern "C" { * Widget Constructors */ -GtkWidget * gimp_option_menu_new (GtkSignalFunc menu_item_callback, +GtkWidget * gimp_option_menu_new (gboolean menu_only, + + /* specify menu items as va_list: + * gchar *label, + * GtkSignalFunc callback, + * gpointer data, + * gpointer user_data, + * GtkWidget **widget_ptr, + * gboolean active + */ + + ...); + +GtkWidget * gimp_option_menu_new2 (gboolean menu_only, + GtkSignalFunc menu_item_callback, gpointer data, gpointer initial, /* user_data */ @@ -60,7 +74,7 @@ GtkWidget * gimp_radio_group_new (gboolean in_frame, GtkWidget * gimp_radio_group_new2 (gboolean in_frame, gchar *frame_title, - GtkSignalFunc callback, + GtkSignalFunc radio_button_callback, gpointer data, gpointer initial, /* user_data */ @@ -136,7 +150,7 @@ void gimp_unit_menu_update (GtkWidget *widget, /* add aligned label & widget to a two-column table */ void gimp_table_attach_aligned (GtkTable *table, gint row, - gchar *text, + gchar *label_text, gfloat xalign, gfloat yalign, GtkWidget *widget, diff --git a/libgimpwidgets/gimpdialog.c b/libgimpwidgets/gimpdialog.c index b3d27c1a1b..a33ca08672 100644 --- a/libgimpwidgets/gimpdialog.c +++ b/libgimpwidgets/gimpdialog.c @@ -226,8 +226,8 @@ gimp_dialog_create_action_areav (GtkDialog *dialog, { callback = va_arg (args, GtkSignalFunc); data = va_arg (args, gpointer); - slot_object = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + slot_object = va_arg (args, GtkObject *); + widget_ptr = va_arg (args, GtkWidget **); default_action = va_arg (args, gboolean); connect_delete = va_arg (args, gboolean); diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index ba09bbce7c..bc2702636b 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -27,10 +27,10 @@ #include "gimpintl.h" /* private functions */ -static const gchar * gimp_unit_menu_build_string (gchar *format, - GUnit unit); +static const gchar * gimp_unit_menu_build_string (gchar *format, + GUnit unit); static void gimp_unit_menu_callback (GtkWidget *widget, - gpointer data); + gpointer data); enum { diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index 157126a14d..693ceaf229 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -35,25 +35,110 @@ static void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button) /* - * Widget Constructors... + * Widget Constructors */ GtkWidget * -gimp_option_menu_new (GtkSignalFunc menu_item_callback, - gpointer data, - gpointer initial, /* user_data */ +gimp_option_menu_new (gboolean menu_only, /* specify menu items as va_list: - * gchar *label, - * gpointer user_data, - * GtkWidget **widget_ptr, + * gchar *label, + * GtkSignalFunc callback, + * gpointer data, + * gpointer user_data, + * GtkWidget **widget_ptr, + * gboolean active */ - ...) + ...) +{ + GtkWidget *menu; + GtkWidget *menuitem; + + /* menu item variables */ + gchar *label; + GtkSignalFunc callback; + gpointer data; + gpointer user_data; + GtkWidget **widget_ptr; + gboolean active; + + va_list args; + gint i; + gint initial_index; + + menu = gtk_menu_new (); + + /* create the menu items */ + initial_index = 0; + va_start (args, menu_only); + label = va_arg (args, gchar*); + for (i = 0; label; i++) + { + callback = va_arg (args, GtkSignalFunc); + data = va_arg (args, gpointer); + user_data = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); + active = va_arg (args, gboolean); + + if (label != (gpointer) 1) + menuitem = gtk_menu_item_new_with_label (label); + else + menuitem = gtk_menu_item_new (); + + gtk_menu_append (GTK_MENU (menu), menuitem); + gtk_signal_connect (GTK_OBJECT (menuitem), "activate", + callback, + data); + + if (user_data) + gtk_object_set_user_data (GTK_OBJECT (menuitem), user_data); + + if (widget_ptr) + *widget_ptr = menuitem; + + gtk_widget_show (menuitem); + + /* remember the initial menu item */ + if (active) + initial_index = i; + + label = va_arg (args, 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; +} + +GtkWidget * +gimp_option_menu_new2 (gboolean menu_only, + GtkSignalFunc menu_item_callback, + gpointer data, + gpointer initial, /* user_data */ + + /* specify menu items as va_list: + * gchar *label, + * gpointer user_data, + * GtkWidget **widget_ptr, + */ + + ...) { GtkWidget *menu; GtkWidget *menuitem; - GtkWidget *optionmenu; /* menu item variables */ gchar *label; @@ -73,7 +158,7 @@ gimp_option_menu_new (GtkSignalFunc menu_item_callback, for (i = 0; label; i++) { user_data = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); if (label != (gpointer) 1) menuitem = gtk_menu_item_new_with_label (label); @@ -101,13 +186,20 @@ gimp_option_menu_new (GtkSignalFunc menu_item_callback, } va_end (args); - optionmenu = gtk_option_menu_new (); - gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu); + if (! menu_only) + { + GtkWidget *optionmenu; - /* select the initial menu item */ - gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), initial_index); + optionmenu = gtk_option_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu); - return optionmenu; + /* select the initial menu item */ + gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), initial_index); + + return optionmenu; + } + + return menu; } GtkWidget * @@ -160,7 +252,7 @@ gimp_radio_group_new (gboolean in_frame, callback = va_arg (args, GtkSignalFunc); data = va_arg (args, gpointer); user_data = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); active = va_arg (args, gboolean); if (label != (gpointer) 1) @@ -181,7 +273,7 @@ gimp_radio_group_new (gboolean in_frame, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (callback), + callback, data); gtk_widget_show (button); @@ -199,7 +291,7 @@ gimp_radio_group_new (gboolean in_frame, GtkWidget * gimp_radio_group_new2 (gboolean in_frame, gchar *frame_title, - GtkSignalFunc callback, + GtkSignalFunc radio_button_callback, gpointer data, gpointer initial, /* user_data */ @@ -241,7 +333,7 @@ gimp_radio_group_new2 (gboolean in_frame, while (label) { user_data = va_arg (args, gpointer); - widget_ptr = va_arg (args, gpointer); + widget_ptr = va_arg (args, GtkWidget **); if (label != (gpointer) 1) button = gtk_radio_button_new_with_label (group, label); @@ -261,7 +353,7 @@ gimp_radio_group_new2 (gboolean in_frame, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (callback), + radio_button_callback, data); gtk_widget_show (button); @@ -433,7 +525,7 @@ gimp_random_seed_new (gint *seed, } /* - * Standard Callbacks... + * Standard Callbacks */ static void @@ -561,24 +653,24 @@ gimp_unit_menu_update (GtkWidget *widget, } /* - * Helper Functions... + * Helper Functions */ /* add aligned label & widget to a two-column table */ void gimp_table_attach_aligned (GtkTable *table, gint row, - gchar *text, + gchar *label_text, gfloat xalign, gfloat yalign, GtkWidget *widget, gboolean left_adjust) { - if (text) + if (label_text) { GtkWidget *label; - label = gtk_label_new (text); + label = gtk_label_new (label_text); gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); gtk_table_attach (table, GTK_WIDGET (label), 0, 1, row, row + 1, diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h index da81ab9a5c..bfa79e0bc0 100644 --- a/libgimpwidgets/gimpwidgets.h +++ b/libgimpwidgets/gimpwidgets.h @@ -32,7 +32,21 @@ extern "C" { * Widget Constructors */ -GtkWidget * gimp_option_menu_new (GtkSignalFunc menu_item_callback, +GtkWidget * gimp_option_menu_new (gboolean menu_only, + + /* specify menu items as va_list: + * gchar *label, + * GtkSignalFunc callback, + * gpointer data, + * gpointer user_data, + * GtkWidget **widget_ptr, + * gboolean active + */ + + ...); + +GtkWidget * gimp_option_menu_new2 (gboolean menu_only, + GtkSignalFunc menu_item_callback, gpointer data, gpointer initial, /* user_data */ @@ -60,7 +74,7 @@ GtkWidget * gimp_radio_group_new (gboolean in_frame, GtkWidget * gimp_radio_group_new2 (gboolean in_frame, gchar *frame_title, - GtkSignalFunc callback, + GtkSignalFunc radio_button_callback, gpointer data, gpointer initial, /* user_data */ @@ -136,7 +150,7 @@ void gimp_unit_menu_update (GtkWidget *widget, /* add aligned label & widget to a two-column table */ void gimp_table_attach_aligned (GtkTable *table, gint row, - gchar *text, + gchar *label_text, gfloat xalign, gfloat yalign, GtkWidget *widget, diff --git a/plug-ins/borderaverage/borderaverage.c b/plug-ins/borderaverage/borderaverage.c index dc5d593003..37e2f739c4 100644 --- a/plug-ins/borderaverage/borderaverage.c +++ b/plug-ins/borderaverage/borderaverage.c @@ -66,7 +66,12 @@ struct borderaverage_data { gint thickness; gint bucket_exponent; -} borderaverage_data = { 3, 4 }; +} +borderaverage_data = +{ + 3, + 4 +}; MAIN () @@ -444,23 +449,21 @@ borderaverage_dialog (void) gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); - menu = gimp_option_menu_new (gimp_menu_item_update, - &borderaverage_bucket_exponent, - (gpointer) borderaverage_bucket_exponent, + menu = gimp_option_menu_new2 (FALSE, gimp_menu_item_update, + &borderaverage_bucket_exponent, + (gpointer) 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?)"), (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, - NULL); - - + NULL); gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0); gtk_widget_show (menu); diff --git a/plug-ins/common/borderaverage.c b/plug-ins/common/borderaverage.c index dc5d593003..37e2f739c4 100644 --- a/plug-ins/common/borderaverage.c +++ b/plug-ins/common/borderaverage.c @@ -66,7 +66,12 @@ struct borderaverage_data { gint thickness; gint bucket_exponent; -} borderaverage_data = { 3, 4 }; +} +borderaverage_data = +{ + 3, + 4 +}; MAIN () @@ -444,23 +449,21 @@ borderaverage_dialog (void) gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); - menu = gimp_option_menu_new (gimp_menu_item_update, - &borderaverage_bucket_exponent, - (gpointer) borderaverage_bucket_exponent, + menu = gimp_option_menu_new2 (FALSE, gimp_menu_item_update, + &borderaverage_bucket_exponent, + (gpointer) 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?)"), (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, - NULL); - - + NULL); gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0); gtk_widget_show (menu); diff --git a/plug-ins/common/gif.c b/plug-ins/common/gif.c index 7a1f7c4159..13d117e70b 100644 --- a/plug-ins/common/gif.c +++ b/plug-ins/common/gif.c @@ -1365,18 +1365,18 @@ save_dialog (gint32 image_ID) gtk_widget_show (label); disposal_option_menu = - gimp_option_menu_new (gimp_menu_item_update, - &gsvals.default_dispose, - (gpointer) gsvals.default_dispose, + gimp_option_menu_new2 (FALSE, gimp_menu_item_update, + &gsvals.default_dispose, + (gpointer) gsvals.default_dispose, - _("I don't Care"), - (gpointer) DISPOSE_UNSPECIFIED, NULL, - _("Cumulative Layers (Combine)"), - (gpointer) DISPOSE_COMBINE, NULL, - _("One Frame per Layer (Replace)"), - (gpointer) DISPOSE_REPLACE, NULL, + _("I don't Care"), + (gpointer) DISPOSE_UNSPECIFIED, NULL, + _("Cumulative Layers (Combine)"), + (gpointer) DISPOSE_COMBINE, NULL, + _("One Frame per Layer (Replace)"), + (gpointer) 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/randomize.c b/plug-ins/common/randomize.c index 227d70d74a..c62da9bd60 100644 --- a/plug-ins/common/randomize.c +++ b/plug-ins/common/randomize.c @@ -697,7 +697,6 @@ randomize_dialog (void) GtkWidget *frame; GtkWidget *table; GtkWidget *seed_hbox; - GtkWidget *spinbutton; GtkObject *adj; gchar **argv; gint argc;