Commit 424e1d00 authored by William Jon McCann's avatar William Jon McCann

Start deprecating some GtkStock API

parent 0091fc35
......@@ -76,6 +76,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
g_free (image_accessible->priv->stock_name);
image_accessible->priv->stock_name = NULL;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK)
return NULL;
......@@ -86,6 +88,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
if (!gtk_stock_lookup (stock_id, &stock_item))
return NULL;
G_GNUC_END_IGNORE_DEPRECATIONS;
image_accessible->priv->stock_name = _gtk_toolbar_elide_underscores (stock_item.label);
return image_accessible->priv->stock_name;
}
......
......@@ -884,17 +884,23 @@ gtk_action_unblock_activate (GtkAction *action)
GtkWidget *
gtk_action_create_icon (GtkAction *action, GtkIconSize icon_size)
{
GtkWidget *widget = NULL;
g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (action->private_data->stock_id &&
gtk_icon_factory_lookup_default (action->private_data->stock_id))
return gtk_image_new_from_stock (action->private_data->stock_id, icon_size);
widget = gtk_image_new_from_stock (action->private_data->stock_id, icon_size);
else if (action->private_data->gicon)
return gtk_image_new_from_gicon (action->private_data->gicon, icon_size);
widget = gtk_image_new_from_gicon (action->private_data->gicon, icon_size);
else if (action->private_data->icon_name)
return gtk_image_new_from_icon_name (action->private_data->icon_name, icon_size);
else
return NULL;
widget = gtk_image_new_from_icon_name (action->private_data->icon_name, icon_size);
G_GNUC_END_IGNORE_DEPRECATIONS;
return widget;
}
/**
......
......@@ -260,6 +260,11 @@ gtk_button_class_init (GtkButtonClass *klass)
FALSE,
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GtkButton:use-stock:
*
* Deprecated: 3.10
*/
g_object_class_install_property (gobject_class,
PROP_USE_STOCK,
g_param_spec_boolean ("use-stock",
......@@ -779,7 +784,9 @@ gtk_button_set_property (GObject *object,
gtk_button_set_use_underline (button, g_value_get_boolean (value));
break;
case PROP_USE_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_button_set_use_stock (button, g_value_get_boolean (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_FOCUS_ON_CLICK:
gtk_button_set_focus_on_click (button, g_value_get_boolean (value));
......@@ -906,10 +913,18 @@ static void
activatable_update_stock_id (GtkButton *button,
GtkAction *action)
{
if (!gtk_button_get_use_stock (button))
gboolean use_stock;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
use_stock = gtk_button_get_use_stock (button);
G_GNUC_END_IGNORE_DEPRECATIONS;
if (!use_stock)
return;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_button_set_label (button, gtk_action_get_stock_id (action));
G_GNUC_END_IGNORE_DEPRECATIONS;
}
static void
......@@ -918,8 +933,13 @@ activatable_update_short_label (GtkButton *button,
{
GtkWidget *child;
GtkWidget *image;
gboolean use_stock;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
use_stock = gtk_button_get_use_stock (button);
G_GNUC_END_IGNORE_DEPRECATIONS;
if (gtk_button_get_use_stock (button))
if (use_stock)
return;
image = gtk_button_get_image (button);
......@@ -940,8 +960,13 @@ activatable_update_icon_name (GtkButton *button,
GtkAction *action)
{
GtkWidget *image;
if (gtk_button_get_use_stock (button))
gboolean use_stock;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
use_stock = gtk_button_get_use_stock (button);
G_GNUC_END_IGNORE_DEPRECATIONS;
if (use_stock)
return;
image = gtk_button_get_image (button);
......@@ -1142,6 +1167,8 @@ gtk_button_construct_child (GtkButton *button)
if (child)
gtk_container_remove (GTK_CONTAINER (button), child);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (priv->use_stock &&
priv->label_text &&
gtk_stock_lookup (priv->label_text, &item))
......@@ -1154,6 +1181,8 @@ gtk_button_construct_child (GtkButton *button)
else
label_text = priv->label_text;
G_GNUC_END_IGNORE_DEPRECATIONS;
if (image)
{
priv->image = image;
......@@ -1258,6 +1287,8 @@ gtk_button_new_with_label (const gchar *label)
* label (as for gtk_button_new_with_mnemonic()).
*
* Returns: a new #GtkButton
*
* Deprecated: 3.10: Use gtk_button_new_with_label() instead.
**/
GtkWidget*
gtk_button_new_from_stock (const gchar *stock_id)
......@@ -2312,6 +2343,8 @@ gtk_button_get_use_underline (GtkButton *button)
*
* If %TRUE, the label set on the button is used as a
* stock id to select the stock item for the button.
*
* Deprecated: 3.10
*/
void
gtk_button_set_use_stock (GtkButton *button,
......@@ -2344,6 +2377,8 @@ gtk_button_set_use_stock (GtkButton *button,
* Return value: %TRUE if the button label is used to
* select a stock item instead of being
* used directly as the label text.
*
* Deprecated: 3.10
*/
gboolean
gtk_button_get_use_stock (GtkButton *button)
......
......@@ -80,7 +80,7 @@ GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new (void);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new_with_label (const gchar *label);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_button_new_with_label)
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
......@@ -110,10 +110,10 @@ void gtk_button_set_use_underline (GtkButton *button,
gboolean use_underline);
GDK_AVAILABLE_IN_ALL
gboolean gtk_button_get_use_underline (GtkButton *button);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_button_set_use_stock (GtkButton *button,
gboolean use_stock);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
gboolean gtk_button_get_use_stock (GtkButton *button);
GDK_AVAILABLE_IN_ALL
void gtk_button_set_focus_on_click (GtkButton *button,
......
......@@ -33,8 +33,8 @@
*
* A #GtkCellRendererPixbuf can be used to render an image in a cell. It allows
* to render either a given #GdkPixbuf (set via the
* #GtkCellRendererPixbuf:pixbuf property) or a stock icon (set via the
* #GtkCellRendererPixbuf:stock-id property).
* #GtkCellRendererPixbuf:pixbuf property) or a named icon (set via the
* #GtkCellRendererPixbuf:icon-name property).
*
* To support the tree view, #GtkCellRendererPixbuf also supports rendering two
* alternative pixbufs, when the #GtkCellRenderer:is-expander property is %TRUE.
......@@ -169,6 +169,11 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
GDK_TYPE_PIXBUF,
GTK_PARAM_READWRITE));
/**
* GtkCellRendererPixbuf:stock-id:
*
* Deprecated: 3.10: Use #GtkCellRendererPixbuf:icon-name instead.
*/
g_object_class_install_property (object_class,
PROP_STOCK_ID,
g_param_spec_string ("stock-id",
......
......@@ -40,6 +40,7 @@
#include "gtkprivate.h"
#include "gtkbuildable.h"
#include "gtksettings.h"
#include "gtkstock.h"
/**
* SECTION:gtkdialog
......@@ -563,7 +564,7 @@ gtk_dialog_new_empty (const gchar *title,
* @title: (allow-none): Title of the dialog, or %NULL
* @parent: (allow-none): Transient parent of the dialog, or %NULL
* @flags: from #GtkDialogFlags
* @first_button_text: (allow-none): stock ID or text to go in first button, or %NULL
* @first_button_text: (allow-none): text to go in first button, or %NULL
* @...: response ID for first button, then additional buttons, ending with %NULL
*
* Creates a new #GtkDialog with title @title (or %NULL for the default
......@@ -573,8 +574,7 @@ gtk_dialog_new_empty (const gchar *title,
* and/or to have it destroyed along with its transient parent
* (#GTK_DIALOG_DESTROY_WITH_PARENT). After @flags, button
* text/response ID pairs should be listed, with a %NULL pointer ending
* the list. Button text can be either a stock ID such as
* #GTK_STOCK_OK, or some arbitrary text. A response ID can be
* the list. Button text can be arbitrary text. A response ID can be
* any positive number, or one of the values in the #GtkResponseType
* enumeration. If the user clicks one of these dialog buttons,
* #GtkDialog will emit the #GtkDialog::response signal with the corresponding
......@@ -720,14 +720,14 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
/**
* gtk_dialog_add_button:
* @dialog: a #GtkDialog
* @button_text: text of button, or stock ID
* @button_text: text of button
* @response_id: response ID for the button
*
* Adds a button with the given text (or a stock button, if @button_text is a
* stock ID) and sets things up so that clicking the button will emit the
* #GtkDialog::response signal with the given @response_id. The button is
* appended to the end of the dialog's action area. The button widget is
* returned, but usually you don't need it.
* Adds a button with the given text and sets things up so that
* clicking the button will emit the #GtkDialog::response signal with
* the given @response_id. The button is appended to the end of the
* dialog's action area. The button widget is returned, but usually
* you don't need it.
*
* Return value: (transfer none): the #GtkButton widget that was added
**/
......@@ -741,7 +741,15 @@ gtk_dialog_add_button (GtkDialog *dialog,
g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
g_return_val_if_fail (button_text != NULL, NULL);
button = gtk_button_new_from_stock (button_text);
button = gtk_button_new_with_label (button_text);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
if (button_text)
{
GtkStockItem item;
if (gtk_stock_lookup (button_text, &item))
g_object_set (button, "use-stock", TRUE, NULL);
}
gtk_widget_set_can_default (button, TRUE);
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
......@@ -785,7 +793,7 @@ gtk_dialog_add_buttons_valist (GtkDialog *dialog,
/**
* gtk_dialog_add_buttons:
* @dialog: a #GtkDialog
* @first_button_text: button text or stock ID
* @first_button_text: button text
* @...: response ID for first button, then more text-response_id pairs
*
* Adds more buttons, same as calling gtk_dialog_add_button()
......
......@@ -2940,9 +2940,11 @@ gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
* @stock_id: the ID of the stock icon to use
*
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* to a stock icon.
*
* Deprecated: 3.10: Use gtk_drag_source_set_icon_name() instead.
**/
void
void
gtk_drag_source_set_icon_stock (GtkWidget *widget,
const gchar *stock_id)
{
......@@ -3297,6 +3299,8 @@ gtk_drag_set_icon_pixbuf (GdkDragContext *context,
* @hot_y: the Y offset within the icon of the hotspot.
*
* Sets the icon for a given drag from a stock ID.
*
* Deprecated: 3.10: Use gtk_drag_set_icon_name() instead.
**/
void
gtk_drag_set_icon_stock (GdkDragContext *context,
......
......@@ -173,7 +173,7 @@ void gtk_drag_source_add_uri_targets (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_drag_source_set_icon_name)
void gtk_drag_source_set_icon_stock (GtkWidget *widget,
const gchar *stock_id);
GDK_AVAILABLE_IN_ALL
......@@ -206,7 +206,7 @@ void gtk_drag_set_icon_pixbuf (GdkDragContext *context,
GdkPixbuf *pixbuf,
gint hot_x,
gint hot_y);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_drag_set_icon_name)
void gtk_drag_set_icon_stock (GdkDragContext *context,
const gchar *stock_id,
gint hot_x,
......
......@@ -1065,6 +1065,8 @@ gtk_entry_class_init (GtkEntryClass *class)
* The stock id to use for the primary icon for the entry.
*
* Since: 2.16
*
* Deprecated: 3.10: Use #GtkEntry:primary-icon-name instead.
*/
g_object_class_install_property (gobject_class,
PROP_STOCK_PRIMARY,
......@@ -1080,6 +1082,8 @@ gtk_entry_class_init (GtkEntryClass *class)
* The stock id to use for the secondary icon for the entry.
*
* Since: 2.16
*
* Deprecated: 3.10: Use #GtkEntry:secondary-icon-name instead.
*/
g_object_class_install_property (gobject_class,
PROP_STOCK_SECONDARY,
......@@ -2161,15 +2165,19 @@ gtk_entry_set_property (GObject *object,
break;
case PROP_STOCK_PRIMARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_entry_set_icon_from_stock (entry,
GTK_ENTRY_ICON_PRIMARY,
g_value_get_string (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_STOCK_SECONDARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_entry_set_icon_from_stock (entry,
GTK_ENTRY_ICON_SECONDARY,
g_value_get_string (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_NAME_PRIMARY:
......@@ -2403,15 +2411,19 @@ gtk_entry_get_property (GObject *object,
break;
case PROP_STOCK_PRIMARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_string (value,
gtk_entry_get_icon_stock (entry,
GTK_ENTRY_ICON_PRIMARY));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_STOCK_SECONDARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_string (value,
gtk_entry_get_icon_stock (entry,
GTK_ENTRY_ICON_SECONDARY));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_NAME_PRIMARY:
......@@ -8134,6 +8146,8 @@ gtk_entry_set_icon_from_pixbuf (GtkEntry *entry,
* If @stock_id is %NULL, no icon will be shown in the specified position.
*
* Since: 2.16
*
* Deprecated: 3.10: Use gtk_entry_set_icon_from_icon_name() instead.
*/
void
gtk_entry_set_icon_from_stock (GtkEntry *entry,
......@@ -8476,6 +8490,8 @@ gtk_entry_get_icon_gicon (GtkEntry *entry,
* wasn't set from a stock id
*
* Since: 2.16
*
* Deprecated: 3.10: Use gtk_entry_get_icon_name() instead.
*/
const gchar *
gtk_entry_get_icon_stock (GtkEntry *entry,
......@@ -10297,7 +10313,7 @@ remove_capslock_feedback (GtkEntry *entry)
if (priv->caps_lock_warning_shown)
{
gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
priv->caps_lock_warning_shown = FALSE;
}
}
......
......@@ -266,7 +266,7 @@ GDK_AVAILABLE_IN_ALL
void gtk_entry_set_icon_from_pixbuf (GtkEntry *entry,
GtkEntryIconPosition icon_pos,
GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_entry_set_icon_from_icon_name)
void gtk_entry_set_icon_from_stock (GtkEntry *entry,
GtkEntryIconPosition icon_pos,
const gchar *stock_id);
......@@ -284,7 +284,7 @@ GtkImageType gtk_entry_get_icon_storage_type (GtkEntry *
GDK_AVAILABLE_IN_ALL
GdkPixbuf* gtk_entry_get_icon_pixbuf (GtkEntry *entry,
GtkEntryIconPosition icon_pos);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_entry_get_icon_name)
const gchar* gtk_entry_get_icon_stock (GtkEntry *entry,
GtkEntryIconPosition icon_pos);
GDK_AVAILABLE_IN_ALL
......
......@@ -238,6 +238,11 @@ gtk_image_class_init (GtkImageClass *class)
GTK_PARAM_READWRITE));
/**
* GtkImage:stock:
*
* Deprecated: 3.10: Use #GtkImage:icon-name instead.
*/
g_object_class_install_property (gobject_class,
PROP_STOCK,
g_param_spec_string ("stock",
......@@ -420,8 +425,10 @@ gtk_image_set_property (GObject *object,
gtk_image_set_from_file (image, g_value_get_string (value));
break;
case PROP_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_stock (image, g_value_get_string (value),
icon_size);
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_SET:
gtk_image_set_from_icon_set (image, g_value_get_boxed (value),
......@@ -625,6 +632,8 @@ gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf)
* gtk_icon_factory_add_default() and gtk_icon_factory_add().
*
* Return value: a new #GtkImage displaying the stock icon
*
* Deprecated: 3.10: Use gtk_image_new_from_icon_name() instead.
**/
GtkWidget*
gtk_image_new_from_stock (const gchar *stock_id,
......@@ -634,7 +643,9 @@ gtk_image_new_from_stock (const gchar *stock_id,
image = g_object_new (GTK_TYPE_IMAGE, NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_stock (image, stock_id, size);
G_GNUC_END_IGNORE_DEPRECATIONS;
return GTK_WIDGET (image);
}
......@@ -905,6 +916,8 @@ gtk_image_set_from_pixbuf (GtkImage *image,
* @size: (type int): a stock icon size
*
* See gtk_image_new_from_stock() for details.
*
* Deprecated: 3.10: Use gtk_image_set_from_icon_name() instead.
**/
void
gtk_image_set_from_stock (GtkImage *image,
......@@ -1142,6 +1155,8 @@ gtk_image_get_pixbuf (GtkImage *image)
* %GTK_IMAGE_STOCK (see gtk_image_get_storage_type()).
* The returned string is owned by the #GtkImage and should not
* be freed.
*
* Deprecated: 3.10: Use gtk_image_get_icon_name() instead.
**/
void
gtk_image_get_stock (GtkImage *image,
......
......@@ -116,7 +116,7 @@ GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_new_from_resource (const gchar *resource_path);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_new_from_icon_name)
GtkWidget* gtk_image_new_from_stock (const gchar *stock_id,
GtkIconSize size);
GDK_AVAILABLE_IN_ALL
......@@ -142,7 +142,7 @@ void gtk_image_set_from_resource (GtkImage *image,
GDK_AVAILABLE_IN_ALL
void gtk_image_set_from_pixbuf (GtkImage *image,
GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_set_from_icon_name)
void gtk_image_set_from_stock (GtkImage *image,
const gchar *stock_id,
GtkIconSize size);
......@@ -170,7 +170,7 @@ GtkImageType gtk_image_get_storage_type (GtkImage *image);
GDK_AVAILABLE_IN_ALL
GdkPixbuf* gtk_image_get_pixbuf (GtkImage *image);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_get_icon_name)
void gtk_image_get_stock (GtkImage *image,
gchar **stock_id,
GtkIconSize *size);
......
......@@ -166,6 +166,8 @@ gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
* stock id to select the stock item for the item.
*
* Since: 2.16
*
* Deprecated: 3.10
*/
g_object_class_install_property (gobject_class,
PROP_USE_STOCK,
......@@ -200,6 +202,8 @@ gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
* The Accel Group to use for stock accelerator keys
*
* Since: 2.16
*
* Deprecated: 3.10
*/
g_object_class_install_property (gobject_class,
PROP_ACCEL_GROUP,
......@@ -252,13 +256,17 @@ gtk_image_menu_item_set_property (GObject *object,
gtk_image_menu_item_set_image (image_menu_item, (GtkWidget *) g_value_get_object (value));
break;
case PROP_USE_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_menu_item_set_use_stock (image_menu_item, g_value_get_boolean (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ALWAYS_SHOW_IMAGE:
gtk_image_menu_item_set_always_show_image (image_menu_item, g_value_get_boolean (value));
break;
case PROP_ACCEL_GROUP:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_menu_item_set_accel_group (image_menu_item, g_value_get_object (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -280,7 +288,9 @@ gtk_image_menu_item_get_property (GObject *object,
g_value_set_object (value, gtk_image_menu_item_get_image (image_menu_item));
break;
case PROP_USE_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_boolean (value, gtk_image_menu_item_get_use_stock (image_menu_item));
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ALWAYS_SHOW_IMAGE:
g_value_set_boolean (value, gtk_image_menu_item_get_always_show_image (image_menu_item));
......@@ -387,6 +397,8 @@ gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item)
if (priv->use_stock && priv->label)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (!priv->image)
{
image = gtk_image_new_from_stock (priv->label, GTK_ICON_SIZE_MENU);
......@@ -396,7 +408,9 @@ gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item)
if (gtk_stock_lookup (priv->label, &stock_item))
resolved_label = stock_item.label;
gtk_menu_item_set_use_underline (GTK_MENU_ITEM (image_menu_item), TRUE);
gtk_menu_item_set_use_underline (GTK_MENU_ITEM (image_menu_item), TRUE);
G_GNUC_END_IGNORE_DEPRECATIONS;
}
GTK_MENU_ITEM_CLASS
......@@ -661,7 +675,9 @@ activatable_update_stock_id (GtkImageMenuItem *image_menu_item, GtkAction *actio
if (GTK_IS_IMAGE (image) &&
stock_id && gtk_icon_factory_lookup_default (stock_id))
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_stock (GTK_IMAGE (image), stock_id, GTK_ICON_SIZE_MENU);
G_GNUC_END_IGNORE_DEPRECATIONS;
return TRUE;
}
......@@ -836,6 +852,8 @@ gtk_image_menu_item_new_with_mnemonic (const gchar *label)
* gtk_accel_map_add_entry() to register it.
*
* Returns: a new #GtkImageMenuItem.
*
* Deprecated: 3.10: Use gtk_image_menu_item_new() instead.
*/
GtkWidget*
gtk_image_menu_item_new_from_stock (const gchar *stock_id,
......@@ -857,6 +875,8 @@ gtk_image_menu_item_new_from_stock (const gchar *stock_id,
* stock id to select the stock item for the item.
*
* Since: 2.16
*
* Deprecated: 3.10
*/
void
gtk_image_menu_item_set_use_stock (GtkImageMenuItem *image_menu_item,
......@@ -889,6 +909,8 @@ gtk_image_menu_item_set_use_stock (GtkImageMenuItem *image_menu_item,
* stock id to select the stock item for the item
*
* Since: 2.16
*
* Deprecated: 3.10
*/
gboolean
gtk_image_menu_item_get_use_stock (GtkImageMenuItem *image_menu_item)
......@@ -971,6 +993,8 @@ gtk_image_menu_item_get_always_show_image (GtkImageMenuItem *image_menu_item)
* you shouldnt need this (see gtk_image_menu_item_new_from_stock()).
*
* Since: 2.16
*
* Deprecated: 3.10
*/
void
gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item,
......
......@@ -75,7 +75,7 @@ GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_menu_item_new)
GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id,
GtkAccelGroup *accel_group);
GDK_AVAILABLE_IN_ALL
......@@ -88,12 +88,12 @@ void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_i
GtkWidget *image);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_use_stock (GtkImageMenuItem *image_menu_item,
gboolean use_stock);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
gboolean gtk_image_menu_item_get_use_stock (GtkImageMenuItem *image_menu_item);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item,
GtkAccelGroup *accel_group);
......
......@@ -45,6 +45,7 @@
#include "gtkprivate.h"
#include "gtkorientable.h"
#include "gtktypebuiltins.h"
#include "gtkstock.h"
/**
* SECTION:gtkinfobar
......@@ -677,14 +678,14 @@ gtk_info_bar_get_content_area (GtkInfoBar *info_bar)
/**
* gtk_info_bar_add_button:
* @info_bar: a #GtkInfoBar
* @button_text: text of button, or stock ID
* @button_text: text of button
* @response_id: response ID for the button
*
* Adds a button with the given text (or a stock button, if button_text
* is a stock ID) and sets things up so that clicking the button will emit
* the "response" signal with the given response_id. The button is appended
* to the end of the info bars's action area. The button widget is
* returned, but usually you don't need it.
* Adds a button with the given text and sets things up so that
* clicking the button will emit the "response" signal with the given
* response_id. The button is appended to the end of the info bars's
* action area. The button widget is returned, but usually you don't
* need it.
*
* Returns: (transfer none): the #GtkButton widget that was added
*
......@@ -700,7 +701,15 @@ gtk_info_bar_add_button (GtkInfoBar *info_bar,
g_return_val_if_fail (GTK_IS_INFO_BAR (info_bar), NULL);
g_return_val_if_fail (button_text != NULL, NULL);
button = gtk_button_new_from_stock (button_text);
button = gtk_button_new_with_label (button_text);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
if (button_text)
{
GtkStockItem item;
if (gtk_stock_lookup (button_text, &item))
g_object_set (button, "use-stock", TRUE, NULL);
}
gtk_widget_set_can_default (button, TRUE);
......
......@@ -46,8 +46,7 @@
* button pops up a dropdown menu.
*
* Use gtk_menu_tool_button_new() to create a new
* #GtkMenuToolButton. Use gtk_menu_tool_button_new_from_stock() to
* create a new #GtkMenuToolButton containing a stock item.
* #GtkMenuToolButton.
*
* <refsect2 id="GtkMenuToolButton-BUILDER-UI">
* <title>GtkMenuToolButton as GtkBuildable</title>
......@@ -376,6 +375,8 @@ gtk_menu_tool_button_new (GtkWidget *icon_widget,
* Return value: the new #GtkMenuToolButton
*
* Since: 2.6
*
* Deprecated: 3.10: Use gtk_menu_tool_button_new() instead.
**/
GtkToolItem *
gtk_menu_tool_button_new_from_stock (const gchar *stock_id)
......
......@@ -66,7 +66,7 @@ GType gtk_menu_tool_button_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkToolItem *gtk_menu_tool_button_new (GtkWidget *icon_widget,
const gchar *label);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_tool_button_new)
GtkToolItem *gtk_menu_tool_button_new_from_stock (const gchar *stock_id);
GDK_AVAILABLE_IN_ALL
......
......@@ -38,10 +38,7 @@
* Use gtk_radio_tool_button_new() to create a new
* #GtkRadioToolButton. Use gtk_radio_tool_button_new_from_widget() to
* create a new #GtkRadioToolButton that is part of the same group as an
* existing #GtkRadioToolButton. Use
* gtk_radio_tool_button_new_from_stock() or
* gtk_radio_tool_button_new_with_stock_from_widget() create a new
* #GtkRadioToolButton containing a stock item.
* existing #GtkRadioToolButton.
*/
......@@ -162,6 +159,8 @@ gtk_radio_tool_button_new (GSList *group)
* Return value: The new #GtkRadioToolButton
*
* Since: 2.4
*
* Deprecated: 3.10: Use gtk_radio_tool_button_new() instead.
**/
GtkToolItem *
gtk_radio_tool_button_new_from_stock (GSList *group,
......@@ -216,19 +215,26 @@ gtk_radio_tool_button_new_from_widget (GtkRadioToolButton *group)
* Return value: (transfer none): A new #GtkRadioToolButton
*
* Since: 2.4
*
* Deprecated: 3.10: gtk_radio_tool_button_new_from_widget
**/
GtkToolItem *
gtk_radio_tool_button_new_with_stock_from_widget (GtkRadioToolButton *group,
const gchar *stock_id)
{
GSList *list = NULL;
GtkToolItem *item;
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_TOOL_BUTTON (group), NULL);
if (group != NULL)
list = gtk_radio_tool_button_get_group (group);
return gtk_radio_tool_button_new_from_stock (list, stock_id);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
item = gtk_radio_tool_button_new_from_stock (list, stock_id);
G_GNUC_END_IGNORE_DEPRECATIONS;
return item;
}
static GtkRadioButton *
......