Commit aef9dca9 authored by William Jon McCann's avatar William Jon McCann

Deprecate GtkIconFactory, GtkIconSet, GtkIconSource

We want to use GtkIconTheme instead. It is worth noting that
the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
parent 88177d8b
......@@ -169,12 +169,9 @@ gtk_image_accessible_get_image_size (AtkImage *image,
case GTK_IMAGE_GICON:
{
GtkIconSize size;
GtkSettings *settings;
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
g_object_get (gtk_image, "icon-size", &size, NULL);
gtk_icon_size_lookup_for_settings (settings, size, width, height);
gtk_icon_size_lookup (size, width, height);
break;
}
case GTK_IMAGE_ANIMATION:
......
......@@ -1291,10 +1291,14 @@ gtk_action_group_add_toggle_actions_full (GtkActionGroup *action_gro
if (entries[i].stock_id)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (gtk_icon_factory_lookup_default (entries[i].stock_id))
g_object_set (action, "stock-id", entries[i].stock_id, NULL);
else
g_object_set (action, "icon-name", entries[i].stock_id, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS;
}
gtk_toggle_action_set_active (action, entries[i].is_active);
......@@ -1407,10 +1411,14 @@ gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group
if (entries[i].stock_id)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (gtk_icon_factory_lookup_default (entries[i].stock_id))
g_object_set (action, "stock-id", entries[i].stock_id, NULL);
else
g_object_set (action, "icon-name", entries[i].stock_id, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS;
}
if (i == 0)
......
......@@ -196,16 +196,11 @@ gtk_cell_renderer_spinner_update_size (GtkCellRendererSpinner *cell,
GtkWidget *widget)
{
GtkCellRendererSpinnerPrivate *priv = cell->priv;
GdkScreen *screen;
GtkSettings *settings;
if (priv->old_icon_size == priv->icon_size)
return;
screen = gtk_widget_get_screen (GTK_WIDGET (widget));
settings = gtk_settings_get_for_screen (screen);
if (!gtk_icon_size_lookup_for_settings (settings, priv->icon_size, &priv->size, NULL))
if (!gtk_icon_size_lookup (priv->icon_size, &priv->size, NULL))
{
g_warning ("Invalid icon size %u\n", priv->icon_size);
priv->size = 24;
......
......@@ -1372,7 +1372,6 @@ static void
change_icon_theme (GtkFileChooserButton *button)
{
GtkFileChooserButtonPrivate *priv = button->priv;
GtkSettings *settings;
GtkIconTheme *theme;
GtkTreeIter iter;
GSList *l;
......@@ -1386,10 +1385,7 @@ change_icon_theme (GtkFileChooserButton *button)
g_slist_free (button->priv->change_icon_theme_cancellables);
button->priv->change_icon_theme_cancellables = NULL;
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)));
if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
&width, &height))
if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
priv->icon_size = MAX (width, height);
else
priv->icon_size = FALLBACK_ICON_SIZE;
......
......@@ -3119,14 +3119,11 @@ static void
change_icon_theme (GtkFileChooserDefault *impl)
{
GtkFileChooserDefaultPrivate *priv = impl->priv;
GtkSettings *settings;
gint width, height;
profile_start ("start", NULL);
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height))
if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
priv->icon_size = MAX (width, height);
else
priv->icon_size = FALLBACK_ICON_SIZE;
......
......@@ -24,6 +24,8 @@
#include "config.h"
#define GDK_DISABLE_DEPRECATION_WARNINGS
#include <stdlib.h>
#include <errno.h>
#include <string.h>
......@@ -41,7 +43,6 @@
#include "gtktypebuiltins.h"
#include "deprecated/gtkstyle.h"
/**
* SECTION:gtkiconfactory
* @Short_description: Manipulating stock icons
......@@ -285,6 +286,8 @@ gtk_icon_factory_finalize (GObject *object)
* themes to override the icons for the application.
*
* Return value: a new #GtkIconFactory
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconFactory*
gtk_icon_factory_new (void)
......@@ -308,6 +311,8 @@ gtk_icon_factory_new (void)
* override your application's default icons. If an icon already
* existed in @factory for @stock_id, it is unreferenced and replaced
* with the new @icon_set.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_factory_add (GtkIconFactory *factory,
......@@ -352,6 +357,8 @@ gtk_icon_factory_add (GtkIconFactory *factory,
* function directly, so that themes are taken into account.
*
* Return value: (transfer none): icon set of @stock_id.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet *
gtk_icon_factory_lookup (GtkIconFactory *factory,
......@@ -379,6 +386,8 @@ static GSList *default_factories = NULL;
* There will normally be an icon factory added for each library or
* application that comes with icons. The default icon factories
* can be overridden by themes.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_factory_add_default (GtkIconFactory *factory)
......@@ -397,6 +406,8 @@ gtk_icon_factory_add_default (GtkIconFactory *factory)
* Removes an icon factory from the list of default icon
* factories. Not normally used; you might use it for a library that
* can be unloaded or shut down.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_factory_remove_default (GtkIconFactory *factory)
......@@ -447,6 +458,8 @@ _gtk_icon_factory_get_default_icons (void)
* account.
*
* Return value: (transfer none): a #GtkIconSet, or %NULL
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet *
gtk_icon_factory_lookup_default (const gchar *stock_id)
......@@ -867,6 +880,8 @@ icon_size_register_intern (const gchar *name,
* etc. Returns the integer value for the size.
*
* Returns: (type int): integer value representing the size
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSize
gtk_icon_size_register (const gchar *name,
......@@ -888,6 +903,8 @@ gtk_icon_size_register (const gchar *name,
* Registers @alias as another name for @target.
* So calling gtk_icon_size_from_name() with @alias as argument
* will return @target.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_size_register_alias (const gchar *alias,
......@@ -931,6 +948,8 @@ gtk_icon_size_register_alias (const gchar *alias,
* Looks up the icon size associated with @name.
*
* Return value: (type int): the icon size
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSize
gtk_icon_size_from_name (const gchar *name)
......@@ -955,6 +974,8 @@ gtk_icon_size_from_name (const gchar *name)
* is statically allocated and should not be freed.
*
* Returns: the name of the given icon size.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
const gchar*
gtk_icon_size_get_name (GtkIconSize size)
......@@ -1025,6 +1046,8 @@ static guint cache_serial = 0;
* a #GtkIconFactory.
*
* Return value: a new #GtkIconSet
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet*
gtk_icon_set_new (void)
......@@ -1053,6 +1076,8 @@ gtk_icon_set_new (void)
* or make the icon look insensitive/prelighted.
*
* Return value: a new #GtkIconSet
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet *
gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf)
......@@ -1080,6 +1105,8 @@ gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf)
* Increments the reference count on @icon_set.
*
* Return value: @icon_set.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet*
gtk_icon_set_ref (GtkIconSet *icon_set)
......@@ -1098,6 +1125,8 @@ gtk_icon_set_ref (GtkIconSet *icon_set)
*
* Decrements the reference count on @icon_set, and frees memory
* if the reference count reaches 0.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_set_unref (GtkIconSet *icon_set)
......@@ -1135,6 +1164,8 @@ G_DEFINE_BOXED_TYPE (GtkIconSet, gtk_icon_set,
* Copies @icon_set by value.
*
* Return value: a new #GtkIconSet identical to the first.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
**/
GtkIconSet*
gtk_icon_set_copy (GtkIconSet *icon_set)
......@@ -1475,6 +1506,8 @@ render_fallback_image (GtkStyleContext *context,
* Return value: (transfer full): a #GdkPixbuf to be displayed
*
* Since: 3.0
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GdkPixbuf *
gtk_icon_set_render_icon_pixbuf (GtkIconSet *icon_set,
......@@ -1665,6 +1698,8 @@ icon_source_compare (gconstpointer ap, gconstpointer bp)
*
* gtk_icon_set_new_from_pixbuf() creates a new icon set with a
* default icon source based on the given pixbuf.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_set_add_source (GtkIconSet *icon_set,
......@@ -1693,6 +1728,8 @@ gtk_icon_set_add_source (GtkIconSet *icon_set,
*
* Obtains a list of icon sizes this icon set can render. The returned
* array must be freed with g_free().
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_set_get_sizes (GtkIconSet *icon_set,
......@@ -1797,6 +1834,8 @@ gtk_icon_set_get_sizes (GtkIconSet *icon_set,
* direction, widget state, or icon size.
*
* Return value: a new #GtkIconSource
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSource*
gtk_icon_source_new (void)
......@@ -1823,6 +1862,8 @@ gtk_icon_source_new (void)
* Creates a copy of @source; mostly useful for language bindings.
*
* Return value: a new #GtkIconSource
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSource*
gtk_icon_source_copy (const GtkIconSource *source)
......@@ -1864,6 +1905,8 @@ gtk_icon_source_copy (const GtkIconSource *source)
*
* Frees a dynamically-allocated icon source, along with its
* filename, size, and pixbuf fields if those are not %NULL.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_free (GtkIconSource *source)
......@@ -1916,6 +1959,8 @@ icon_source_clear (GtkIconSource *source)
*
* Sets the name of an image file to use as a base image when creating
* icon variants for #GtkIconSet. The filename must be absolute.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_filename (GtkIconSource *source,
......@@ -1944,6 +1989,8 @@ gtk_icon_source_set_filename (GtkIconSource *source,
*
* Sets the name of an icon to look up in the current icon theme
* to use as a base image when creating icon variants for #GtkIconSet.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_icon_name (GtkIconSource *source,
......@@ -1971,6 +2018,8 @@ gtk_icon_source_set_icon_name (GtkIconSource *source,
*
* Sets a pixbuf to use as a base image when creating icon variants
* for #GtkIconSet.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_pixbuf (GtkIconSource *source,
......@@ -2002,6 +2051,8 @@ gtk_icon_source_set_pixbuf (GtkIconSource *source,
*
* Return value: (type filename): image filename. This string must not
* be modified or freed.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
const gchar*
gtk_icon_source_get_filename (const GtkIconSource *source)
......@@ -2023,6 +2074,8 @@ gtk_icon_source_get_filename (const GtkIconSource *source)
* persist beyond the lifetime of the icon source.
*
* Return value: icon name. This string must not be modified or freed.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
const gchar*
gtk_icon_source_get_icon_name (const GtkIconSource *source)
......@@ -2049,6 +2102,8 @@ gtk_icon_source_get_icon_name (const GtkIconSource *source)
* not incremented.
*
* Return value: (transfer none): source pixbuf
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GdkPixbuf*
gtk_icon_source_get_pixbuf (const GtkIconSource *source)
......@@ -2077,6 +2132,8 @@ gtk_icon_source_get_pixbuf (const GtkIconSource *source)
*
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
* wildcarded sources, and will use an exact match when possible.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
......@@ -2105,6 +2162,8 @@ gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
* produce an appropriate icon for a given state, for example
* lightening an image on prelight, but will not modify source images
* that match exactly.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
......@@ -2133,6 +2192,8 @@ gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
* #GtkIconSet will normally scale wildcarded source images to produce
* an appropriate icon at a given size, but will not change the size
* of source images that match exactly.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
......@@ -2150,6 +2211,8 @@ gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
* Gets the value set by gtk_icon_source_set_size_wildcarded().
*
* Return value: %TRUE if this icon source is a base for any icon size variant
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
gboolean
gtk_icon_source_get_size_wildcarded (const GtkIconSource *source)
......@@ -2166,6 +2229,8 @@ gtk_icon_source_get_size_wildcarded (const GtkIconSource *source)
* Gets the value set by gtk_icon_source_set_state_wildcarded().
*
* Return value: %TRUE if this icon source is a base for any widget state variant
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
gboolean
gtk_icon_source_get_state_wildcarded (const GtkIconSource *source)
......@@ -2182,6 +2247,8 @@ gtk_icon_source_get_state_wildcarded (const GtkIconSource *source)
* Gets the value set by gtk_icon_source_set_direction_wildcarded().
*
* Return value: %TRUE if this icon source is a base for any text direction variant
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
gboolean
gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source)
......@@ -2203,6 +2270,8 @@ gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source)
* if the text direction is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
* in addition to calling this function.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_direction (GtkIconSource *source,
......@@ -2225,6 +2294,8 @@ gtk_icon_source_set_direction (GtkIconSource *source,
* if the state is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_state_wildcarded() to un-wildcard it
* in addition to calling this function.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_state (GtkIconSource *source,
......@@ -2247,6 +2318,8 @@ gtk_icon_source_set_state (GtkIconSource *source,
* if the size is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_size_wildcarded() to un-wildcard it
* in addition to calling this function.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_size (GtkIconSource *source,
......@@ -2266,6 +2339,8 @@ gtk_icon_source_set_size (GtkIconSource *source,
* wildcarded.
*
* Return value: text direction this source matches
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkTextDirection
gtk_icon_source_get_direction (const GtkIconSource *source)
......@@ -2284,6 +2359,8 @@ gtk_icon_source_get_direction (const GtkIconSource *source)
* wildcarded.
*
* Return value: widget state this source matches
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkStateType
gtk_icon_source_get_state (const GtkIconSource *source)
......@@ -2301,6 +2378,8 @@ gtk_icon_source_get_state (const GtkIconSource *source)
* is only useful/meaningful if the icon size is <emphasis>not</emphasis> wildcarded.
*
* Return value: (type int): icon size this source matches.
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSize
gtk_icon_source_get_size (const GtkIconSource *source)
......@@ -2583,6 +2662,8 @@ _gtk_icon_set_invalidate_caches (void)
* The list itself should be freed.
*
* Return value: List of ids in icon factories
*
* Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GList*
_gtk_icon_factory_list_ids (void)
......
......@@ -68,25 +68,25 @@ struct _GtkIconFactoryClass
void (*_gtk_reserved4) (void);
};
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GType gtk_icon_factory_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconFactory* gtk_icon_factory_new (void);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_factory_add (GtkIconFactory *factory,
const gchar *stock_id,
GtkIconSet *icon_set);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_factory_lookup (GtkIconFactory *factory,
const gchar *stock_id);
/* Manage the default icon factory stack */
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_factory_add_default (GtkIconFactory *factory);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_factory_remove_default (GtkIconFactory *factory);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_factory_lookup_default (const gchar *stock_id);
/* Get preferred real size from registered semantic size. Note that
......@@ -112,32 +112,32 @@ gboolean gtk_icon_size_lookup_for_settings (GtkSettings *settings,
gint *width,
gint *height);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSize gtk_icon_size_register (const gchar *name,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_size_register_alias (const gchar *alias,
GtkIconSize target);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSize gtk_icon_size_from_name (const gchar *name);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
const gchar* gtk_icon_size_get_name (GtkIconSize size);
/* Icon sets */
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GType gtk_icon_set_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_new (void);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_ref (GtkIconSet *icon_set);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_set_unref (GtkIconSet *icon_set);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set);
GDK_DEPRECATED_IN_3_0_FOR(gtk_icon_set_render_icon_pixbuf)
......@@ -149,70 +149,70 @@ GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set,
GtkWidget *widget,
const gchar *detail);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_set_add_source (GtkIconSet *icon_set,
const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_set_get_sizes (GtkIconSet *icon_set,
GtkIconSize **sizes,
gint *n_sizes);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GType gtk_icon_source_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSource* gtk_icon_source_new (void);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_free (GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_filename (GtkIconSource *source,
const gchar *filename);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_icon_name (GtkIconSource *source,
const gchar *icon_name);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_pixbuf (GtkIconSource *source,
GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
const gchar * gtk_icon_source_get_filename (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
const gchar * gtk_icon_source_get_icon_name (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
gboolean setting);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
gboolean setting);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
gboolean setting);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_direction (GtkIconSource *source,
GtkTextDirection direction);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_state (GtkIconSource *source,
GtkStateType state);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_size (GtkIconSource *source,
GtkIconSize size);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkStateType gtk_icon_source_get_state (const GtkIconSource *source);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_10
GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source);
......
......@@ -53,7 +53,9 @@ _gtk_icon_helper_clear (GtkIconHelper *self)
if (self->priv->icon_set != NULL)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_icon_set_unref (self->priv->icon_set);
G_GNUC_END_IGNORE_DEPRECATIONS;
self->priv->icon_set = NULL;
}
......@@ -113,19 +115,12 @@ ensure_icon_size (GtkIconHelper *self,
gint *height_out)
{
gint width, height;
GtkSettings *settings;
GdkScreen *screen;
screen = gtk_style_context_get_screen (context);
settings = gtk_settings_get_for_screen (screen);
if (self->priv->pixel_size != -1)
{
width = height = self->priv->pixel_size;
}
else if (!gtk_icon_size_lookup_for_settings (settings,
self->priv->icon_size,
&width, &height))
else if (!gtk_icon_size_lookup (self->priv->icon_size, &width, &height))
{
if (self->priv->icon_size == GTK_ICON_SIZE_INVALID)
{
......@@ -177,6 +172,10 @@ ensure_stated_icon_from_info (GtkIconHelper *self,
GtkIconSource *source;
GdkPixbuf *rendered;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
/* FIXME: use gtk_icon_info_load_icon? */
source = gtk_icon_source_new ();
gtk_icon_source_set_pixbuf (source, destination);
/* The size here is arbitrary; since size isn't
......@@ -190,6 +189,8 @@ ensure_stated_icon_from_info (GtkIconHelper *self,
rendered = gtk_render_icon_pixbuf (context, source, (GtkIconSize) -1);
gtk_icon_source_free (source);
G_GNUC_END_IGNORE_DEPRECATIONS;
g_object_unref (destination);
destination = rendered;
}
......@@ -279,8 +280,10 @@ ensure_pixbuf_for_icon_set (GtkIconHelper *self,
if (!check_invalidate_pixbuf (self, context))
return;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
self->priv->rendered_pixbuf =
gtk_icon_set_render_icon_pixbuf (icon_set, context, self->priv->icon_size);
G_GNUC_END_IGNORE_DEPRECATIONS;
}
static void
......@@ -329,11 +332,13 @@ _gtk_icon_helper_ensure_pixbuf (GtkIconHelper *self,
break;
case GTK_IMAGE_STOCK:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
icon_set = gtk_style_context_lookup_icon_set (context, self->priv->stock_id);
if (icon_set != NULL)
ensure_pixbuf_for_icon_set (self, context, icon_set);
else
pixbuf = NULL;
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case GTK_IMAGE_ICON_SET:
......@@ -436,7 +441,9 @@ _gtk_icon_helper_set_icon_set (GtkIconHelper *self,
if (icon_set != NULL)
{
self->priv->storage_type = GTK_IMAGE_ICON_SET;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
self->priv->icon_set = gtk_icon_set_ref (icon_set);
G_GNUC_END_IGNORE_DEPRECATIONS;
_gtk_icon_helper_set_icon_size (self, icon_size);
}
}
......
......@@ -251,6 +251,12 @@ gtk_image_class_init (GtkImageClass *class)
NULL,
GTK_PARAM_READWRITE));
/**
* GtkImage:icon-set:
*
* Deprecated: 3.10: Use #GtkImage:icon-name instead.
*/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_object_class_install_property (gobject_class,
PROP_ICON_SET,
g_param_spec_boxed ("icon-set",
......@@ -258,7 +264,8 @@ gtk_image_class_init (GtkImageClass *class)
P_("Icon set to display"),
GTK_TYPE_ICON_SET,
GTK_PARAM_READWRITE));
G_GNUC_END_IGNORE_DEPRECATIONS;
g_object_class_install_property (gobject_class,
PROP_ICON_SIZE,
g_param_spec_int ("icon-size",
......@@ -431,8 +438,10 @@ gtk_image_set_property (GObject *object,
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_SET:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_icon_set (image, g_value_get_boxed (value),
icon_size);
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_SIZE:
_gtk_icon_helper_set_icon_size (priv->icon_helper, g_value_get_int (value));
......@@ -487,8 +496,10 @@ gtk_image_get_property (GObject *object,
g_value_set_string (value, _gtk_icon_helper_get_stock_id (priv->icon_helper));
break;
case PROP_ICON_SET:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_boxed (value, _gtk_icon_helper_peek_icon_set (priv->icon_helper));
break;
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_SIZE:
g_value_set_int (value, _gtk_icon_helper_get_icon_size (priv->icon_helper));
break;
......@@ -603,7 +614,7 @@ gtk_image_new_from_resource (const gchar *resource_path)
*
* Note that this function just creates an #GtkImage from the pixbuf. The
* #GtkImage created will not react to state changes. Should you want that,
* you should use gtk_image_new_from_icon_set().
* you should use gtk_image_new_from_icon_name().
*
* Return value: a new #GtkImage
**/
......@@ -668,6 +679,8 @@ gtk_image_new_from_stock (const gchar *stock_id,
* #GtkImage will add its own reference rather than adopting yours.
*
* Return value: a new #GtkImage