diff --git a/ChangeLog b/ChangeLog index d40e5327bd..c7ee6b0323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-11-14 Sven Neumann + + * libgimpwidgets/gimpwidgets.[ch]: guard old functions using + GIMP_DISABLE_DEPRECATED. Added a note to the docs what functions + should be used instead. + 2003-11-14 Manish Singh * libgimpwidgets/gimpwidgets.[ch]: add gimp_int_option_menu_set_history diff --git a/devel-docs/ChangeLog b/devel-docs/ChangeLog index 352c981c4d..15bfabd5f0 100644 --- a/devel-docs/ChangeLog +++ b/devel-docs/ChangeLog @@ -1,3 +1,13 @@ +2003-11-14 Sven Neumann + + * libgimpwidgets/Makefile.am: tell gtk-doc about + GIMP_DISABLE_DEPRECATED. + + * libgimpwidgets/libgimpwidgets-sections.txt: added new functions. + + * libgimpwidgets/tmpl/gimpwidgets.sgml: removed outdated docs of + deprecated functions. + 2003-11-13 Sven Neumann * app/app-sections.txt: updated. diff --git a/devel-docs/libgimpwidgets/Makefile.am b/devel-docs/libgimpwidgets/Makefile.am index fb5ba353d4..f66760148f 100644 --- a/devel-docs/libgimpwidgets/Makefile.am +++ b/devel-docs/libgimpwidgets/Makefile.am @@ -13,7 +13,7 @@ DOC_SOURCE_DIR = $(top_srcdir)/$(DOC_MODULE) SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan -SCAN_OPTIONS = +SCAN_OPTIONS = --deprecated-guards="GIMP_DISABLE_DEPRECATED" # Extra options to supply to gtkdoc-mkdb MKDB_OPTIONS = --sgml-mode --output-format=xml diff --git a/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt b/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt index abb06812d0..194545cd76 100644 --- a/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt +++ b/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt @@ -480,11 +480,14 @@ GIMP_STOCK_WILBER_EEK
gimpwidgets GimpWidgets +gimp_int_option_menu_new +gimp_int_option_menu_set_history gimp_option_menu_new gimp_option_menu_new2 gimp_option_menu_set_history gimp_option_menu_set_sensitive GimpOptionMenuSensitivityCallback +gimp_int_radio_group_new gimp_radio_group_new gimp_radio_group_new2 gimp_radio_group_set_active diff --git a/devel-docs/libgimpwidgets/tmpl/gimpwidgets.sgml b/devel-docs/libgimpwidgets/tmpl/gimpwidgets.sgml index 348f1c4191..04343efd30 100644 --- a/devel-docs/libgimpwidgets/tmpl/gimpwidgets.sgml +++ b/devel-docs/libgimpwidgets/tmpl/gimpwidgets.sgml @@ -15,48 +15,30 @@ helper functions. - + -The @va_list describing the #GtkMenuItem's has the following format: + - - - +@menu_only: +@menu_item_callback: +@menu_item_callback_data: +@initial: +@Varargs: +@Returns: - -#gchar *label, -The menu item's label. - - -#GtkSignalFunc callback, -The callback which will be connected to the menu item's -"activate" signal - + + - -#gpointer data, -The callback data which will be used in gtk_signal_connect(). - + - -#gpointer user_data, -The menu item's @user_data which will be set with -gtk_object_set_user_data(). - +@option_menu: +@item_data: - -#GtkWidget **widget_ptr, -A pointer to store the created menu item in. - - -#gboolean active, -#TRUE if this should be the initially selected menu item. - - - + + @@ -68,30 +50,6 @@ gtk_object_set_user_data(). -The @va_list describing the #GtkMenuItem's has the following format: - - - - - - -#gchar *label, -The menu item's label. - - - -#gpointer user_data, -The menu item's @user_data which will be set with -gtk_object_set_user_data(). - - - -#GtkWidget **widget_ptr, -A pointer to store the created menu item in. - - - - @menu_only: @@ -131,48 +89,22 @@ gtk_object_set_user_data(). @Returns: - + -The @va_list describing the #GtkRadioButton's has the following format: + - - - +@in_frame: +@frame_title: +@radio_button_callback: +@radio_button_callback_data: +@initial: +@Varargs: +@Returns: - -#gchar *label, -The radio button's label. - - -#GtkSignalFunc callback, -The callback which will be connected to the radio button's -"toggled" signal - - - -#gpointer data, -The callback data which will be used in gtk_signal_connect(). - - - -#gpointer user_data, -The radio button's @user_data which will be set with -gtk_object_set_user_data(). - - - -#GtkWidget **widget_ptr, -A pointer to store the created radio button in. - - - -#gboolean active, -#TRUE if this should be the initially pressed radio button. - - - + + @@ -185,30 +117,6 @@ gtk_object_set_user_data(). -The @va_list describing the #GtkRadioButton's has the following format: - - - - - - -#gchar *label, -The radio button's label. - - - -#gpointer user_data, -The radio button's @user_data which will be set with -gtk_object_set_user_data(). - - - -#GtkWidget **widget_ptr, -A pointer to store the created radio button in. - - - - @in_frame: diff --git a/libgimpwidgets/gimpwidgets.c b/libgimpwidgets/gimpwidgets.c index e638458b77..9c6b0ce8ad 100644 --- a/libgimpwidgets/gimpwidgets.c +++ b/libgimpwidgets/gimpwidgets.c @@ -51,6 +51,8 @@ * @menu_only: %TRUE if the function should return a #GtkMenu only. * @...: A %NULL-terminated @va_list describing the menu items. * + * DEPRECATED. Use gimp_int_option_menu_new() instead. + * * Convenience function to create a #GtkOptionMenu or a #GtkMenu. * * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only). @@ -165,6 +167,8 @@ gimp_option_menu_new (gboolean menu_only, * @initial: The @item_data of the initially selected menu item. * @...: A %NULL-terminated @va_list describing the menu items. * + * DEPRECATED. Use gimp_int_option_menu_new() instead. + * * Convenience function to create a #GtkOptionMenu or a #GtkMenu. * * Returns: A #GtkOptionMenu or a #GtkMenu (depending on @menu_only). @@ -274,9 +278,10 @@ gimp_option_menu_new2 (gboolean menu_only, * @...: 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). + * function does the same thing as the deprecated function + * 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). **/ @@ -383,9 +388,12 @@ gimp_int_option_menu_new (gboolean menu_only, * gimp_option_menu_new2(). * @item_data: The @item_data of the menu item you want to select. * - * Iterates over all entries in a #GtkOptionMenu and selects the one with the - * matching @item_data. Probably only makes sense to use with a #GtkOptionMenu - * that was created using gimp_option_menu_new() or gimp_option_menu_new2(). + * DEPRECATED. Use gimp_int_option_menu_set_history() instead. + * + * Iterates over all entries in a #GtkOptionMenu and selects the one + * with the matching @item_data. Probably only makes sense to use with + * a #GtkOptionMenu that was created using gimp_option_menu_new() or + * gimp_option_menu_new2(). **/ void gimp_option_menu_set_history (GtkOptionMenu *option_menu, @@ -484,6 +492,8 @@ gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu, * @frame_title: The title of the Frame or %NULL if you don't want a title. * @...: A %NULL-terminated @va_list describing the radio buttons. * + * DEPRECATED. Use gimp_int_radio_group_new() instead. + * * Convenience function to create a group of radio buttons embedded into * a #GtkFrame or #GtkVbox. * @@ -595,6 +605,8 @@ gimp_radio_group_new (gboolean in_frame, * @...: A %NULL-terminated @va_list describing * the radio buttons. * + * DEPRECATED. Use gimp_int_radio_group_new() instead. + * * Convenience function to create a group of radio buttons embedded into * a #GtkFrame or #GtkVbox. * diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h index 2df7f3e625..10ebc23cb2 100644 --- a/libgimpwidgets/gimpwidgets.h +++ b/libgimpwidgets/gimpwidgets.h @@ -60,49 +60,48 @@ G_BEGIN_DECLS * Widget Constructors */ -GtkWidget * gimp_option_menu_new (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, - * GCallback callback, - * gpointer callback_data, - * gpointer item_data, - * GtkWidget **widget_ptr, - * gboolean active - */ + /* specify menu items as va_list: + * gchar *label, + * gint item_data, + * GtkWidget **widget_ptr, + */ - ...); + ...); -GtkWidget * gimp_option_menu_new2 (gboolean menu_only, - GCallback menu_item_callback, - gpointer menu_item_callback_data, - gpointer initial, /* item_data */ +void gimp_int_option_menu_set_history (GtkOptionMenu *option_menu, + gint item_data); - /* specify menu items as va_list: - * gchar *label, - * gpointer item_data, - * GtkWidget **widget_ptr, - */ +#ifndef GIMP_DISABLE_DEPRECATED +GtkWidget * gimp_option_menu_new (gboolean menu_only, - ...); + /* specify menu items as va_list: + * gchar *label, + * GCallback callback, + * gpointer callback_data, + * gpointer item_data, + * GtkWidget **widget_ptr, + * gboolean active + */ -GtkWidget * gimp_int_option_menu_new (gboolean menu_only, - GCallback menu_item_callback, - gpointer menu_item_callback_data, - gint initial, /* item_data */ + ...); +GtkWidget * gimp_option_menu_new2 (gboolean menu_only, + GCallback menu_item_callback, + gpointer menu_item_callback_data, + gpointer 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); -void gimp_int_option_menu_set_history (GtkOptionMenu *option_menu, - gint item_data); + /* specify menu items as va_list: + * gchar *label, + * gpointer item_data, + * GtkWidget **widget_ptr, + */ + ...); +void gimp_option_menu_set_history (GtkOptionMenu *option_menu, + gpointer item_data); typedef gboolean (*GimpOptionMenuSensitivityCallback) (gpointer item_data, gpointer callback_data); @@ -110,6 +109,24 @@ void gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu, GimpOptionMenuSensitivityCallback callback, gpointer callback_data); +#endif /* GIMP_DISABLE_DEPRECATED */ + + +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, + */ + + ...); + +#ifndef GIMP_DISABLE_DEPRECATED GtkWidget * gimp_radio_group_new (gboolean in_frame, const gchar *frame_title, @@ -123,7 +140,6 @@ GtkWidget * gimp_radio_group_new (gboolean in_frame, */ ...); - GtkWidget * gimp_radio_group_new2 (gboolean in_frame, const gchar *frame_title, GCallback radio_button_callback, @@ -137,23 +153,10 @@ 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); +#endif /* GIMP_DISABLE_DEPRECATED */ + GtkWidget * gimp_spin_button_new (/* return value: */ GtkObject **adjustment,