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) ...@@ -76,6 +76,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
g_free (image_accessible->priv->stock_name); g_free (image_accessible->priv->stock_name);
image_accessible->priv->stock_name = NULL; image_accessible->priv->stock_name = NULL;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK) if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK)
return NULL; return NULL;
...@@ -86,6 +88,8 @@ gtk_image_accessible_get_name (AtkObject *accessible) ...@@ -86,6 +88,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
if (!gtk_stock_lookup (stock_id, &stock_item)) if (!gtk_stock_lookup (stock_id, &stock_item))
return NULL; return NULL;
G_GNUC_END_IGNORE_DEPRECATIONS;
image_accessible->priv->stock_name = _gtk_toolbar_elide_underscores (stock_item.label); image_accessible->priv->stock_name = _gtk_toolbar_elide_underscores (stock_item.label);
return image_accessible->priv->stock_name; return image_accessible->priv->stock_name;
} }
......
...@@ -884,17 +884,23 @@ gtk_action_unblock_activate (GtkAction *action) ...@@ -884,17 +884,23 @@ gtk_action_unblock_activate (GtkAction *action)
GtkWidget * GtkWidget *
gtk_action_create_icon (GtkAction *action, GtkIconSize icon_size) gtk_action_create_icon (GtkAction *action, GtkIconSize icon_size)
{ {
GtkWidget *widget = NULL;
g_return_val_if_fail (GTK_IS_ACTION (action), NULL); g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (action->private_data->stock_id && if (action->private_data->stock_id &&
gtk_icon_factory_lookup_default (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) 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) else if (action->private_data->icon_name)
return gtk_image_new_from_icon_name (action->private_data->icon_name, icon_size); widget = gtk_image_new_from_icon_name (action->private_data->icon_name, icon_size);
else
return NULL; G_GNUC_END_IGNORE_DEPRECATIONS;
return widget;
} }
/** /**
......
...@@ -260,6 +260,11 @@ gtk_button_class_init (GtkButtonClass *klass) ...@@ -260,6 +260,11 @@ gtk_button_class_init (GtkButtonClass *klass)
FALSE, FALSE,
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT)); GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GtkButton:use-stock:
*
* Deprecated: 3.10
*/
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_USE_STOCK, PROP_USE_STOCK,
g_param_spec_boolean ("use-stock", g_param_spec_boolean ("use-stock",
...@@ -779,7 +784,9 @@ gtk_button_set_property (GObject *object, ...@@ -779,7 +784,9 @@ gtk_button_set_property (GObject *object,
gtk_button_set_use_underline (button, g_value_get_boolean (value)); gtk_button_set_use_underline (button, g_value_get_boolean (value));
break; break;
case PROP_USE_STOCK: case PROP_USE_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_button_set_use_stock (button, g_value_get_boolean (value)); gtk_button_set_use_stock (button, g_value_get_boolean (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break; break;
case PROP_FOCUS_ON_CLICK: case PROP_FOCUS_ON_CLICK:
gtk_button_set_focus_on_click (button, g_value_get_boolean (value)); gtk_button_set_focus_on_click (button, g_value_get_boolean (value));
...@@ -906,10 +913,18 @@ static void ...@@ -906,10 +913,18 @@ static void
activatable_update_stock_id (GtkButton *button, activatable_update_stock_id (GtkButton *button,
GtkAction *action) 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; return;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_button_set_label (button, gtk_action_get_stock_id (action)); gtk_button_set_label (button, gtk_action_get_stock_id (action));
G_GNUC_END_IGNORE_DEPRECATIONS;
} }
static void static void
...@@ -918,8 +933,13 @@ activatable_update_short_label (GtkButton *button, ...@@ -918,8 +933,13 @@ activatable_update_short_label (GtkButton *button,
{ {
GtkWidget *child; GtkWidget *child;
GtkWidget *image; 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; return;
image = gtk_button_get_image (button); image = gtk_button_get_image (button);
...@@ -940,8 +960,13 @@ activatable_update_icon_name (GtkButton *button, ...@@ -940,8 +960,13 @@ activatable_update_icon_name (GtkButton *button,
GtkAction *action) GtkAction *action)
{ {
GtkWidget *image; GtkWidget *image;
gboolean use_stock;
if (gtk_button_get_use_stock (button))
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
use_stock = gtk_button_get_use_stock (button);
G_GNUC_END_IGNORE_DEPRECATIONS;
if (use_stock)
return; return;
image = gtk_button_get_image (button); image = gtk_button_get_image (button);
...@@ -1142,6 +1167,8 @@ gtk_button_construct_child (GtkButton *button) ...@@ -1142,6 +1167,8 @@ gtk_button_construct_child (GtkButton *button)
if (child) if (child)
gtk_container_remove (GTK_CONTAINER (button), child); gtk_container_remove (GTK_CONTAINER (button), child);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (priv->use_stock && if (priv->use_stock &&
priv->label_text && priv->label_text &&
gtk_stock_lookup (priv->label_text, &item)) gtk_stock_lookup (priv->label_text, &item))
...@@ -1154,6 +1181,8 @@ gtk_button_construct_child (GtkButton *button) ...@@ -1154,6 +1181,8 @@ gtk_button_construct_child (GtkButton *button)
else else
label_text = priv->label_text; label_text = priv->label_text;
G_GNUC_END_IGNORE_DEPRECATIONS;
if (image) if (image)
{ {
priv->image = image; priv->image = image;
...@@ -1258,6 +1287,8 @@ gtk_button_new_with_label (const gchar *label) ...@@ -1258,6 +1287,8 @@ gtk_button_new_with_label (const gchar *label)
* label (as for gtk_button_new_with_mnemonic()). * label (as for gtk_button_new_with_mnemonic()).
* *
* Returns: a new #GtkButton * Returns: a new #GtkButton
*
* Deprecated: 3.10: Use gtk_button_new_with_label() instead.
**/ **/
GtkWidget* GtkWidget*
gtk_button_new_from_stock (const gchar *stock_id) gtk_button_new_from_stock (const gchar *stock_id)
...@@ -2312,6 +2343,8 @@ gtk_button_get_use_underline (GtkButton *button) ...@@ -2312,6 +2343,8 @@ gtk_button_get_use_underline (GtkButton *button)
* *
* If %TRUE, the label set on the button is used as a * If %TRUE, the label set on the button is used as a
* stock id to select the stock item for the button. * stock id to select the stock item for the button.
*
* Deprecated: 3.10
*/ */
void void
gtk_button_set_use_stock (GtkButton *button, gtk_button_set_use_stock (GtkButton *button,
...@@ -2344,6 +2377,8 @@ 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 * Return value: %TRUE if the button label is used to
* select a stock item instead of being * select a stock item instead of being
* used directly as the label text. * used directly as the label text.
*
* Deprecated: 3.10
*/ */
gboolean gboolean
gtk_button_get_use_stock (GtkButton *button) gtk_button_get_use_stock (GtkButton *button)
......
...@@ -80,7 +80,7 @@ GDK_AVAILABLE_IN_ALL ...@@ -80,7 +80,7 @@ GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new (void); GtkWidget* gtk_button_new (void);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new_with_label (const gchar *label); 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); GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new_with_mnemonic (const gchar *label); GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
...@@ -110,10 +110,10 @@ void gtk_button_set_use_underline (GtkButton *button, ...@@ -110,10 +110,10 @@ void gtk_button_set_use_underline (GtkButton *button,
gboolean use_underline); gboolean use_underline);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gtk_button_get_use_underline (GtkButton *button); 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, void gtk_button_set_use_stock (GtkButton *button,
gboolean use_stock); gboolean use_stock);
GDK_AVAILABLE_IN_ALL GDK_DEPRECATED_IN_3_10
gboolean gtk_button_get_use_stock (GtkButton *button); gboolean gtk_button_get_use_stock (GtkButton *button);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_button_set_focus_on_click (GtkButton *button, void gtk_button_set_focus_on_click (GtkButton *button,
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
* *
* A #GtkCellRendererPixbuf can be used to render an image in a cell. It allows * A #GtkCellRendererPixbuf can be used to render an image in a cell. It allows
* to render either a given #GdkPixbuf (set via the * to render either a given #GdkPixbuf (set via the
* #GtkCellRendererPixbuf:pixbuf property) or a stock icon (set via the * #GtkCellRendererPixbuf:pixbuf property) or a named icon (set via the
* #GtkCellRendererPixbuf:stock-id property). * #GtkCellRendererPixbuf:icon-name property).
* *
* To support the tree view, #GtkCellRendererPixbuf also supports rendering two * To support the tree view, #GtkCellRendererPixbuf also supports rendering two
* alternative pixbufs, when the #GtkCellRenderer:is-expander property is %TRUE. * alternative pixbufs, when the #GtkCellRenderer:is-expander property is %TRUE.
...@@ -169,6 +169,11 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class) ...@@ -169,6 +169,11 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
GDK_TYPE_PIXBUF, GDK_TYPE_PIXBUF,
GTK_PARAM_READWRITE)); GTK_PARAM_READWRITE));
/**
* GtkCellRendererPixbuf:stock-id:
*
* Deprecated: 3.10: Use #GtkCellRendererPixbuf:icon-name instead.
*/
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_STOCK_ID, PROP_STOCK_ID,
g_param_spec_string ("stock-id", g_param_spec_string ("stock-id",
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "gtkprivate.h" #include "gtkprivate.h"
#include "gtkbuildable.h" #include "gtkbuildable.h"
#include "gtksettings.h" #include "gtksettings.h"
#include "gtkstock.h"
/** /**
* SECTION:gtkdialog * SECTION:gtkdialog
...@@ -563,7 +564,7 @@ gtk_dialog_new_empty (const gchar *title, ...@@ -563,7 +564,7 @@ gtk_dialog_new_empty (const gchar *title,
* @title: (allow-none): Title of the dialog, or %NULL * @title: (allow-none): Title of the dialog, or %NULL
* @parent: (allow-none): Transient parent of the dialog, or %NULL * @parent: (allow-none): Transient parent of the dialog, or %NULL
* @flags: from #GtkDialogFlags * @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 * @...: response ID for first button, then additional buttons, ending with %NULL
* *
* Creates a new #GtkDialog with title @title (or %NULL for the default * Creates a new #GtkDialog with title @title (or %NULL for the default
...@@ -573,8 +574,7 @@ gtk_dialog_new_empty (const gchar *title, ...@@ -573,8 +574,7 @@ gtk_dialog_new_empty (const gchar *title,
* and/or to have it destroyed along with its transient parent * and/or to have it destroyed along with its transient parent
* (#GTK_DIALOG_DESTROY_WITH_PARENT). After @flags, button * (#GTK_DIALOG_DESTROY_WITH_PARENT). After @flags, button
* text/response ID pairs should be listed, with a %NULL pointer ending * text/response ID pairs should be listed, with a %NULL pointer ending
* the list. Button text can be either a stock ID such as * the list. Button text can be arbitrary text. A response ID can be
* #GTK_STOCK_OK, or some arbitrary text. A response ID can be
* any positive number, or one of the values in the #GtkResponseType * any positive number, or one of the values in the #GtkResponseType
* enumeration. If the user clicks one of these dialog buttons, * enumeration. If the user clicks one of these dialog buttons,
* #GtkDialog will emit the #GtkDialog::response signal with the corresponding * #GtkDialog will emit the #GtkDialog::response signal with the corresponding
...@@ -720,14 +720,14 @@ gtk_dialog_add_action_widget (GtkDialog *dialog, ...@@ -720,14 +720,14 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
/** /**
* gtk_dialog_add_button: * gtk_dialog_add_button:
* @dialog: a #GtkDialog * @dialog: a #GtkDialog
* @button_text: text of button, or stock ID * @button_text: text of button
* @response_id: response ID for the button * @response_id: response ID for the button
* *
* Adds a button with the given text (or a stock button, if @button_text is a * Adds a button with the given text and sets things up so that
* stock ID) and sets things up so that clicking the button will emit the * clicking the button will emit the #GtkDialog::response signal with
* #GtkDialog::response signal with the given @response_id. The button is * the given @response_id. The button is appended to the end of the
* appended to the end of the dialog's action area. The button widget is * dialog's action area. The button widget is returned, but usually
* returned, but usually you don't need it. * you don't need it.
* *
* Return value: (transfer none): the #GtkButton widget that was added * Return value: (transfer none): the #GtkButton widget that was added
**/ **/
...@@ -741,7 +741,15 @@ gtk_dialog_add_button (GtkDialog *dialog, ...@@ -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 (GTK_IS_DIALOG (dialog), NULL);
g_return_val_if_fail (button_text != NULL, 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_can_default (button, TRUE);
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE); gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
...@@ -785,7 +793,7 @@ gtk_dialog_add_buttons_valist (GtkDialog *dialog, ...@@ -785,7 +793,7 @@ gtk_dialog_add_buttons_valist (GtkDialog *dialog,
/** /**
* gtk_dialog_add_buttons: * gtk_dialog_add_buttons:
* @dialog: a #GtkDialog * @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 * @...: response ID for first button, then more text-response_id pairs
* *
* Adds more buttons, same as calling gtk_dialog_add_button() * Adds more buttons, same as calling gtk_dialog_add_button()
......
...@@ -2940,9 +2940,11 @@ gtk_drag_source_set_icon_pixbuf (GtkWidget *widget, ...@@ -2940,9 +2940,11 @@ gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
* @stock_id: the ID of the stock icon to use * @stock_id: the ID of the stock icon to use
* *
* Sets the icon that will be used for drags from a particular source * 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, gtk_drag_source_set_icon_stock (GtkWidget *widget,
const gchar *stock_id) const gchar *stock_id)
{ {
...@@ -3297,6 +3299,8 @@ gtk_drag_set_icon_pixbuf (GdkDragContext *context, ...@@ -3297,6 +3299,8 @@ gtk_drag_set_icon_pixbuf (GdkDragContext *context,
* @hot_y: the Y offset within the icon of the hotspot. * @hot_y: the Y offset within the icon of the hotspot.
* *
* Sets the icon for a given drag from a stock ID. * Sets the icon for a given drag from a stock ID.
*
* Deprecated: 3.10: Use gtk_drag_set_icon_name() instead.
**/ **/
void void
gtk_drag_set_icon_stock (GdkDragContext *context, gtk_drag_set_icon_stock (GdkDragContext *context,
......
...@@ -173,7 +173,7 @@ void gtk_drag_source_add_uri_targets (GtkWidget *widget); ...@@ -173,7 +173,7 @@ void gtk_drag_source_add_uri_targets (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget, void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
GdkPixbuf *pixbuf); 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, void gtk_drag_source_set_icon_stock (GtkWidget *widget,
const gchar *stock_id); const gchar *stock_id);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
...@@ -206,7 +206,7 @@ void gtk_drag_set_icon_pixbuf (GdkDragContext *context, ...@@ -206,7 +206,7 @@ void gtk_drag_set_icon_pixbuf (GdkDragContext *context,
GdkPixbuf *pixbuf, GdkPixbuf *pixbuf,
gint hot_x, gint hot_x,
gint hot_y); 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, void gtk_drag_set_icon_stock (GdkDragContext *context,
const gchar *stock_id, const gchar *stock_id,
gint hot_x, gint hot_x,
......
...@@ -1065,6 +1065,8 @@ gtk_entry_class_init (GtkEntryClass *class) ...@@ -1065,6 +1065,8 @@ gtk_entry_class_init (GtkEntryClass *class)
* The stock id to use for the primary icon for the entry. * The stock id to use for the primary icon for the entry.
* *
* Since: 2.16 * Since: 2.16
*
* Deprecated: 3.10: Use #GtkEntry:primary-icon-name instead.
*/ */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_STOCK_PRIMARY, PROP_STOCK_PRIMARY,
...@@ -1080,6 +1082,8 @@ gtk_entry_class_init (GtkEntryClass *class) ...@@ -1080,6 +1082,8 @@ gtk_entry_class_init (GtkEntryClass *class)
* The stock id to use for the secondary icon for the entry. * The stock id to use for the secondary icon for the entry.
* *
* Since: 2.16 * Since: 2.16
*
* Deprecated: 3.10: Use #GtkEntry:secondary-icon-name instead.
*/ */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_STOCK_SECONDARY, PROP_STOCK_SECONDARY,
...@@ -2161,15 +2165,19 @@ gtk_entry_set_property (GObject *object, ...@@ -2161,15 +2165,19 @@ gtk_entry_set_property (GObject *object,
break; break;
case PROP_STOCK_PRIMARY: case PROP_STOCK_PRIMARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_entry_set_icon_from_stock (entry, gtk_entry_set_icon_from_stock (entry,
GTK_ENTRY_ICON_PRIMARY, GTK_ENTRY_ICON_PRIMARY,
g_value_get_string (value)); g_value_get_string (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break; break;
case PROP_STOCK_SECONDARY: case PROP_STOCK_SECONDARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_entry_set_icon_from_stock (entry, gtk_entry_set_icon_from_stock (entry,
GTK_ENTRY_ICON_SECONDARY, GTK_ENTRY_ICON_SECONDARY,
g_value_get_string (value)); g_value_get_string (value));
G_GNUC_END_IGNORE_DEPRECATIONS;
break; break;
case PROP_ICON_NAME_PRIMARY: case PROP_ICON_NAME_PRIMARY:
...@@ -2403,15 +2411,19 @@ gtk_entry_get_property (GObject *object, ...@@ -2403,15 +2411,19 @@ gtk_entry_get_property (GObject *object,
break; break;
case PROP_STOCK_PRIMARY: case PROP_STOCK_PRIMARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_string (value, g_value_set_string (value,
gtk_entry_get_icon_stock (entry, gtk_entry_get_icon_stock (entry,
GTK_ENTRY_ICON_PRIMARY)); GTK_ENTRY_ICON_PRIMARY));
G_GNUC_END_IGNORE_DEPRECATIONS;
break; break;
case PROP_STOCK_SECONDARY: case PROP_STOCK_SECONDARY:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_string (value, g_value_set_string (value,
gtk_entry_get_icon_stock (entry, gtk_entry_get_icon_stock (entry,
GTK_ENTRY_ICON_SECONDARY)); GTK_ENTRY_ICON_SECONDARY));
G_GNUC_END_IGNORE_DEPRECATIONS;
break; break;
case PROP_ICON_NAME_PRIMARY: case PROP_ICON_NAME_PRIMARY:
...@@ -8134,6 +8146,8 @@ gtk_entry_set_icon_from_pixbuf (GtkEntry *entry, ...@@ -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. * If @stock_id is %NULL, no icon will be shown in the specified position.
* *
* Since: 2.16 * Since: 2.16
*
* Deprecated: 3.10: Use gtk_entry_set_icon_from_icon_name() instead.
*/ */
void void
gtk_entry_set_icon_from_stock (GtkEntry *entry, gtk_entry_set_icon_from_stock (GtkEntry *entry,
...@@ -8476,6 +8490,8 @@ gtk_entry_get_icon_gicon (GtkEntry *entry, ...@@ -8476,6 +8490,8 @@ gtk_entry_get_icon_gicon (GtkEntry *entry,
* wasn't set from a stock id * wasn't set from a stock id
* *
* Since: 2.16 * Since: 2.16
*
* Deprecated: 3.10: Use gtk_entry_get_icon_name() instead.
*/ */
const gchar * const gchar *
gtk_entry_get_icon_stock (GtkEntry *entry, gtk_entry_get_icon_stock (GtkEntry *entry,
...@@ -10297,7 +10313,7 @@ remove_capslock_feedback (GtkEntry *entry) ...@@ -10297,7 +10313,7 @@ remove_capslock_feedback (GtkEntry *entry)
if (priv->caps_lock_warning_shown) 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; priv->caps_lock_warning_shown = FALSE;
} }
} }
......
...@@ -266,7 +266,7 @@ GDK_AVAILABLE_IN_ALL ...@@ -266,7 +266,7 @@ GDK_AVAILABLE_IN_ALL
void gtk_entry_set_icon_from_pixbuf (GtkEntry *entry, void gtk_entry_set_icon_from_pixbuf (GtkEntry *entry,
GtkEntryIconPosition icon_pos, GtkEntryIconPosition icon_pos,
GdkPixbuf *pixbuf); 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, void gtk_entry_set_icon_from_stock (GtkEntry *entry,
GtkEntryIconPosition icon_pos, GtkEntryIconPosition icon_pos,
const gchar *stock_id); const gchar *stock_id);
...@@ -284,7 +284,7 @@ GtkImageType gtk_entry_get_icon_storage_type (GtkEntry * ...@@ -284,7 +284,7 @@ GtkImageType gtk_entry_get_icon_storage_type (GtkEntry *
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkPixbuf* gtk_entry_get_icon_pixbuf (GtkEntry *entry, GdkPixbuf* gtk_entry_get_icon_pixbuf (GtkEntry *entry,
GtkEntryIconPosition icon_pos); 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, const gchar* gtk_entry_get_icon_stock (GtkEntry *entry,
GtkEntryIconPosition icon_pos); GtkEntryIconPosition icon_pos);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
......
...@@ -238,6 +238,11 @@ gtk_image_class_init (GtkImageClass *class) ...@@ -238,6 +238,11 @@ gtk_image_class_init (GtkImageClass *class)
GTK_PARAM_READWRITE)); GTK_PARAM_READWRITE));
/**
* GtkImage:stock:
*
* Deprecated: 3.10: Use #GtkImage:icon-name instead.
*/
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_STOCK, PROP_STOCK,
g_param_spec_string ("stock", g_param_spec_string ("stock",
...@@ -420,8 +425,10 @@ gtk_image_set_property (GObject *object, ...@@ -420,8 +425,10 @@ gtk_image_set_property (GObject *object,
gtk_image_set_from_file (image, g_value_get_string (value)); gtk_image_set_from_file (image, g_value_get_string (value));
break; break;
case PROP_STOCK: case PROP_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_stock (image, g_value_get_string (value), gtk_image_set_from_stock (image, g_value_get_string (value),
icon_size); icon_size);
G_GNUC_END_IGNORE_DEPRECATIONS;
break; break;
case PROP_ICON_SET: case PROP_ICON_SET:
gtk_image_set_from_icon_set (image, g_value_get_boxed (value), gtk_image_set_from_icon_set (image, g_value_get_boxed (value),
...@@ -625,6 +632,8 @@ gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf) ...@@ -625,6 +632,8 @@ gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf)
* gtk_icon_factory_add_default() and gtk_icon_factory_add(). * gtk_icon_factory_add_default() and gtk_icon_factory_add().
* *
* Return value: a new #GtkImage displaying the stock icon * Return value: a new #GtkImage displaying the stock icon
*
* Deprecated: 3.10: Use gtk_image_new_from_icon_name() instead.
**/ **/
GtkWidget* GtkWidget*
gtk_image_new_from_stock (const gchar *stock_id, gtk_image_new_from_stock (const gchar *stock_id,
...@@ -634,7 +643,9 @@ 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); image = g_object_new (GTK_TYPE_IMAGE, NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_stock (image, stock_id, size); gtk_image_set_from_stock (image, stock_id, size);
G_GNUC_END_IGNORE_DEPRECATIONS;
return GTK_WIDGET (image); return GTK_WIDGET (image);
} }
...@@ -905,6 +916,8 @@ gtk_image_set_from_pixbuf (GtkImage *image, ...@@ -905,6 +916,8 @@ gtk_image_set_from_pixbuf (GtkImage *image,
* @size: (type int): a stock icon size * @size: (type int): a stock icon size
* *
* See gtk_image_new_from_stock() for details. * See gtk_image_new_from_stock() for details.
*
* Deprecated: 3.10: Use gtk_image_set_from_icon_name() instead.
**/ **/
void void
gtk_image_set_from_stock (GtkImage *image, gtk_image_set_from_stock (GtkImage *image,
...@@ -1142,6 +1155,8 @@ gtk_image_get_pixbuf (GtkImage *image) ...@@ -1142,6 +1155,8 @@ gtk_image_get_pixbuf (GtkImage *image)
* %GTK_IMAGE_STOCK (see gtk_image_get_storage_type()). * %GTK_IMAGE_STOCK (see gtk_image_get_storage_type()).
* The returned string is owned by the #GtkImage and should not * The returned string is owned by the #GtkImage and should not
* be freed. * be freed.
*
* Deprecated: 3.10: Use gtk_image_get_icon_name() instead.
**/ **/
void void
gtk_image_get_stock (GtkImage *image, gtk_image_get_stock (GtkImage *image,
......
...@@ -116,7 +116,7 @@ GDK_AVAILABLE_IN_ALL ...@@ -116,7 +116,7 @@ GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_new_from_resource (const gchar *resource_path); GtkWidget* gtk_image_new_from_resource (const gchar *resource_path);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf); 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, GtkWidget* gtk_image_new_from_stock (const gchar *stock_id,
GtkIconSize size); GtkIconSize size);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
...@@ -142,7 +142,7 @@ void gtk_image_set_from_resource (GtkImage *image, ...@@ -142,7 +142,7 @@ void gtk_image_set_from_resource (GtkImage *image,
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_image_set_from_pixbuf (GtkImage *image, void gtk_image_set_from_pixbuf (GtkImage *image,
GdkPixbuf *pixbuf); 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, void gtk_image_set_from_stock (GtkImage *image,
const gchar *stock_id, const gchar *stock_id,
GtkIconSize size); GtkIconSize size);
...@@ -170,7 +170,7 @@ GtkImageType gtk_image_get_storage_type (GtkImage *image); ...@@ -170,7 +170,7 @@ GtkImageType gtk_image_get_storage_type (GtkImage *image);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkPixbuf* gtk_image_get_pixbuf (GtkImage *image); 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, void gtk_image_get_stock (GtkImage *image,
gchar **stock_id, gchar **stock_id,
GtkIconSize *size); GtkIconSize *size);
......
...@@ -166,6 +166,8 @@ gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass) ...@@ -166,6 +166,8 @@ gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
* stock id to select the stock item for the item. * stock id to select the stock item for the item.
* *
* Since: 2.16 * Since: 2.16
*
* Deprecated: 3.10
*/ */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,