mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
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.
This commit is contained in:
parent
88177d8bd1
commit
aef9dca9d5
@ -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,6 +264,7 @@ 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,
|
||||
@ -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,7 +496,9 @@ 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));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
break;
|
||||
case PROP_ICON_SIZE:
|
||||
g_value_set_int (value, _gtk_icon_helper_get_icon_size (priv->icon_helper));
|
||||
@ -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
|
||||
*
|
||||
* Deprecated: 3.10: Use gtk_image_new_from_icon_name() instead.
|
||||
**/
|
||||
GtkWidget*
|
||||
gtk_image_new_from_icon_set (GtkIconSet *icon_set,
|
||||
@ -677,8 +690,12 @@ gtk_image_new_from_icon_set (GtkIconSet *icon_set,
|
||||
|
||||
image = g_object_new (GTK_TYPE_IMAGE, NULL);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
gtk_image_set_from_icon_set (image, icon_set, size);
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
return GTK_WIDGET (image);
|
||||
}
|
||||
|
||||
@ -955,6 +972,8 @@ gtk_image_set_from_stock (GtkImage *image,
|
||||
* @size: (type int): a stock icon size
|
||||
*
|
||||
* See gtk_image_new_from_icon_set() for details.
|
||||
*
|
||||
* Deprecated: 3.10: Use gtk_image_set_from_icon_name() instead.
|
||||
**/
|
||||
void
|
||||
gtk_image_set_from_icon_set (GtkImage *image,
|
||||
@ -969,6 +988,8 @@ gtk_image_set_from_icon_set (GtkImage *image,
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (image));
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
if (icon_set)
|
||||
gtk_icon_set_ref (icon_set);
|
||||
|
||||
@ -980,6 +1001,8 @@ gtk_image_set_from_icon_set (GtkImage *image,
|
||||
gtk_icon_set_unref (icon_set);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
g_object_notify (G_OBJECT (image), "icon-set");
|
||||
g_object_notify (G_OBJECT (image), "icon-size");
|
||||
|
||||
|
@ -119,7 +119,7 @@ GtkWidget* gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf);
|
||||
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
|
||||
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_new_from_icon_name)
|
||||
GtkWidget* gtk_image_new_from_icon_set (GtkIconSet *icon_set,
|
||||
GtkIconSize size);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@ -146,7 +146,7 @@ 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);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_set_from_icon_name)
|
||||
void gtk_image_set_from_icon_set (GtkImage *image,
|
||||
GtkIconSet *icon_set,
|
||||
GtkIconSize size);
|
||||
|
@ -653,6 +653,8 @@ activatable_update_stock_id (GtkImageMenuItem *image_menu_item, GtkAction *actio
|
||||
|
||||
image = gtk_image_menu_item_get_image (image_menu_item);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
if (GTK_IS_IMAGE (image) &&
|
||||
stock_id && gtk_icon_factory_lookup_default (stock_id))
|
||||
{
|
||||
@ -662,6 +664,8 @@ activatable_update_stock_id (GtkImageMenuItem *image_menu_item, GtkAction *actio
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -670,7 +674,12 @@ activatable_update_gicon (GtkImageMenuItem *image_menu_item, GtkAction *action)
|
||||
{
|
||||
GtkWidget *image;
|
||||
GIcon *icon = gtk_action_get_gicon (action);
|
||||
const gchar *stock_id = gtk_action_get_stock_id (action);
|
||||
const gchar *stock_id;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
stock_id = gtk_action_get_stock_id (action);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
image = gtk_image_menu_item_get_image (image_menu_item);
|
||||
|
||||
@ -678,10 +687,12 @@ activatable_update_gicon (GtkImageMenuItem *image_menu_item, GtkAction *action)
|
||||
!(stock_id && gtk_icon_factory_lookup_default (stock_id)))
|
||||
{
|
||||
gtk_image_set_from_gicon (GTK_IMAGE (image), icon, GTK_ICON_SIZE_MENU);
|
||||
return TRUE;
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1270,12 +1270,9 @@ reload_icons (GtkPathBar *path_bar)
|
||||
static void
|
||||
change_icon_theme (GtkPathBar *path_bar)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
gint width, height;
|
||||
|
||||
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (path_bar)));
|
||||
|
||||
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))
|
||||
path_bar->priv->icon_size = MAX (width, height);
|
||||
else
|
||||
path_bar->priv->icon_size = FALLBACK_ICON_SIZE;
|
||||
|
@ -409,12 +409,9 @@ emit_drag_perform_drop (GtkPlacesSidebar *sidebar,
|
||||
static gint
|
||||
get_icon_size (GtkPlacesSidebar *sidebar)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
gint width, height;
|
||||
|
||||
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (sidebar)));
|
||||
|
||||
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))
|
||||
return MAX (width, height);
|
||||
else
|
||||
return 16;
|
||||
|
@ -2146,7 +2146,6 @@ draw_collate_cb (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
GtkPrintUnixDialog *dialog)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
gint size;
|
||||
gfloat scale;
|
||||
gboolean collate, reverse, rtl;
|
||||
@ -2159,11 +2158,7 @@ draw_collate_cb (GtkWidget *widget,
|
||||
|
||||
rtl = (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL);
|
||||
|
||||
settings = gtk_widget_get_settings (widget);
|
||||
gtk_icon_size_lookup_for_settings (settings,
|
||||
GTK_ICON_SIZE_DIALOG,
|
||||
&size,
|
||||
NULL);
|
||||
gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
|
||||
scale = size / 48.0;
|
||||
text_x = rtl ? 4 : 11;
|
||||
|
||||
@ -2193,15 +2188,10 @@ gtk_print_unix_dialog_style_updated (GtkWidget *widget)
|
||||
{
|
||||
GtkPrintUnixDialog *dialog = (GtkPrintUnixDialog *)widget;
|
||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||
GtkSettings *settings;
|
||||
gint size;
|
||||
gfloat scale;
|
||||
|
||||
settings = gtk_widget_get_settings (widget);
|
||||
gtk_icon_size_lookup_for_settings (settings,
|
||||
GTK_ICON_SIZE_DIALOG,
|
||||
&size,
|
||||
NULL);
|
||||
gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
|
||||
scale = size / 48.0;
|
||||
|
||||
gtk_widget_set_size_request (priv->collate_image,
|
||||
|
@ -1327,16 +1327,9 @@ static gint
|
||||
get_icon_size_for_widget (GtkWidget *widget,
|
||||
GtkIconSize icon_size)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
gint width, height;
|
||||
|
||||
if (gtk_widget_has_screen (widget))
|
||||
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
|
||||
else
|
||||
settings = gtk_settings_get_default ();
|
||||
|
||||
if (gtk_icon_size_lookup_for_settings (settings, icon_size,
|
||||
&width, &height))
|
||||
if (gtk_icon_size_lookup (icon_size, &width, &height))
|
||||
return MAX (width, height);
|
||||
|
||||
return FALLBACK_ICON_SIZE;
|
||||
|
@ -1332,24 +1332,15 @@ static gint
|
||||
round_pixel_size (GtkWidget *widget,
|
||||
gint pixel_size)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GtkSettings *settings;
|
||||
GtkIconSize s;
|
||||
gint w, h, d, dist, size;
|
||||
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
if (!screen)
|
||||
return GTK_ICON_SIZE_MENU;
|
||||
|
||||
settings = gtk_settings_get_for_screen (screen);
|
||||
|
||||
dist = G_MAXINT;
|
||||
size = 0;
|
||||
|
||||
for (s = GTK_ICON_SIZE_MENU; s <= GTK_ICON_SIZE_DIALOG; s++)
|
||||
{
|
||||
if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h))
|
||||
if (gtk_icon_size_lookup (s, &w, &h))
|
||||
{
|
||||
d = MAX (abs (pixel_size - w), abs (pixel_size - h));
|
||||
if (d < dist)
|
||||
|
@ -2547,12 +2547,15 @@ gtk_style_context_get_style (GtkStyleContext *context,
|
||||
* %NULL.
|
||||
*
|
||||
* Returns: (transfer none): The looked up %GtkIconSet, or %NULL
|
||||
*
|
||||
* Deprecated: 3.10: Use gtk_icon_theme_lookup_icon() instead.
|
||||
**/
|
||||
GtkIconSet *
|
||||
gtk_style_context_lookup_icon_set (GtkStyleContext *context,
|
||||
const gchar *stock_id)
|
||||
{
|
||||
GtkStyleContextPrivate *priv;
|
||||
GtkIconSet *icon_set;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (stock_id != NULL, NULL);
|
||||
@ -2560,7 +2563,13 @@ gtk_style_context_lookup_icon_set (GtkStyleContext *context,
|
||||
priv = context->priv;
|
||||
g_return_val_if_fail (priv->widget != NULL || priv->widget_path != NULL, NULL);
|
||||
|
||||
return gtk_icon_factory_lookup_default (stock_id);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
icon_set = gtk_icon_factory_lookup_default (stock_id);
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
return icon_set;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4401,6 +4410,8 @@ gtk_render_activity (GtkStyleContext *context,
|
||||
* Returns: (transfer full): a newly-created #GdkPixbuf containing the rendered icon
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.10: Use gtk_icon_theme_load_icon() instead.
|
||||
**/
|
||||
GdkPixbuf *
|
||||
gtk_render_icon_pixbuf (GtkStyleContext *context,
|
||||
|
@ -2662,13 +2662,7 @@ lookup_icon_size (GtkThemingEngine *engine,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GtkSettings *settings;
|
||||
|
||||
screen = gtk_theming_engine_get_screen (engine);
|
||||
settings = gtk_settings_get_for_screen (screen);
|
||||
|
||||
return gtk_icon_size_lookup_for_settings (settings, size, width, height);
|
||||
return gtk_icon_size_lookup (size, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2704,8 +2698,12 @@ gtk_theming_engine_render_icon_pixbuf (GtkThemingEngine *engine,
|
||||
gint height = 1;
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
gboolean wildcarded;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
base_pixbuf = gtk_icon_source_get_pixbuf (source);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
state = gtk_theming_engine_get_state (engine);
|
||||
|
||||
g_return_val_if_fail (base_pixbuf != NULL, NULL);
|
||||
@ -2720,14 +2718,16 @@ gtk_theming_engine_render_icon_pixbuf (GtkThemingEngine *engine,
|
||||
/* If the size was wildcarded, and we're allowed to scale, then scale; otherwise,
|
||||
* leave it alone.
|
||||
*/
|
||||
if (size != (GtkIconSize) -1 &&
|
||||
gtk_icon_source_get_size_wildcarded (source))
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
wildcarded = gtk_icon_source_get_size_wildcarded (source);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
if (size != (GtkIconSize) -1 && wildcarded)
|
||||
scaled = scale_or_ref (base_pixbuf, width, height);
|
||||
else
|
||||
scaled = g_object_ref (base_pixbuf);
|
||||
|
||||
/* If the state was wildcarded, then generate a state. */
|
||||
if (gtk_icon_source_get_state_wildcarded (source))
|
||||
if (wildcarded)
|
||||
{
|
||||
if (state & GTK_STATE_FLAG_INSENSITIVE)
|
||||
{
|
||||
|
@ -504,6 +504,15 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
|
||||
icon_size = gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (button));
|
||||
if (need_icon)
|
||||
{
|
||||
GtkIconSet *icon_set = NULL;
|
||||
|
||||
if (button->priv->stock_id)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
icon_set = gtk_icon_factory_lookup_default (button->priv->stock_id);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
}
|
||||
|
||||
if (button->priv->icon_widget)
|
||||
{
|
||||
icon = button->priv->icon_widget;
|
||||
@ -515,8 +524,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
else if (button->priv->stock_id &&
|
||||
gtk_icon_factory_lookup_default (button->priv->stock_id))
|
||||
else if (icon_set != NULL)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
icon = gtk_image_new_from_stock (button->priv->stock_id, icon_size);
|
||||
@ -758,7 +766,7 @@ gtk_tool_button_finalize (GObject *object)
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
clone_image_menu_size (GtkImage *image, GtkSettings *settings)
|
||||
clone_image_menu_size (GtkImage *image)
|
||||
{
|
||||
GtkImageType storage_type = gtk_image_get_storage_type (image);
|
||||
|
||||
@ -780,9 +788,13 @@ clone_image_menu_size (GtkImage *image, GtkSettings *settings)
|
||||
}
|
||||
else if (storage_type == GTK_IMAGE_ICON_SET)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkIconSet *icon_set;
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
gtk_image_get_icon_set (image, &icon_set, NULL);
|
||||
return gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU);
|
||||
widget = gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
return widget;
|
||||
}
|
||||
else if (storage_type == GTK_IMAGE_GICON)
|
||||
{
|
||||
@ -794,9 +806,7 @@ clone_image_menu_size (GtkImage *image, GtkSettings *settings)
|
||||
{
|
||||
gint width, height;
|
||||
|
||||
if (settings &&
|
||||
gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
|
||||
&width, &height))
|
||||
if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
|
||||
{
|
||||
GdkPixbuf *src_pixbuf, *dest_pixbuf;
|
||||
GtkWidget *cloned_image;
|
||||
@ -854,8 +864,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
|
||||
|
||||
if (GTK_IS_IMAGE (button->priv->icon_widget))
|
||||
{
|
||||
menu_image = clone_image_menu_size (GTK_IMAGE (button->priv->icon_widget),
|
||||
gtk_widget_get_settings (GTK_WIDGET (button)));
|
||||
menu_image = clone_image_menu_size (GTK_IMAGE (button->priv->icon_widget));
|
||||
}
|
||||
else if (button->priv->stock_id)
|
||||
{
|
||||
@ -958,8 +967,16 @@ gtk_tool_button_update (GtkActivatable *activatable,
|
||||
const gchar *stock_id = gtk_action_get_stock_id (action);
|
||||
GIcon *icon = gtk_action_get_gicon (action);
|
||||
GtkIconSize icon_size = GTK_ICON_SIZE_BUTTON;
|
||||
GtkIconSet *icon_set = NULL;
|
||||
|
||||
if ((stock_id && gtk_icon_factory_lookup_default (stock_id)) || !icon)
|
||||
if (stock_id)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
icon_set = gtk_icon_factory_lookup_default (stock_id);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
}
|
||||
|
||||
if (icon_set != NULL || !icon)
|
||||
image = NULL;
|
||||
else
|
||||
{
|
||||
@ -985,6 +1002,7 @@ gtk_tool_button_sync_action_properties (GtkActivatable *activatable,
|
||||
GtkToolButton *button;
|
||||
GIcon *icon;
|
||||
const gchar *stock_id;
|
||||
GtkIconSet *icon_set = NULL;
|
||||
|
||||
parent_activatable_iface->sync_action_properties (activatable, action);
|
||||
|
||||
@ -1006,7 +1024,14 @@ gtk_tool_button_sync_action_properties (GtkActivatable *activatable,
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
gtk_tool_button_set_icon_name (button, gtk_action_get_icon_name (action));
|
||||
|
||||
if (stock_id && gtk_icon_factory_lookup_default (stock_id))
|
||||
if (stock_id)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
icon_set = gtk_icon_factory_lookup_default (stock_id);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
}
|
||||
|
||||
if (icon_set != NULL)
|
||||
gtk_tool_button_set_icon_widget (button, NULL);
|
||||
else if ((icon = gtk_action_get_gicon (action)) != NULL)
|
||||
{
|
||||
|
@ -154,7 +154,6 @@ main (int argc, char **argv)
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_REDO, GTK_ICON_SIZE_DIALOG);
|
||||
gtk_grid_attach (GTK_GRID (grid), image, 1, 2, 1, 1);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
label = gtk_label_new ("GTK_IMAGE_ICON_SET");
|
||||
gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
|
||||
@ -165,6 +164,7 @@ main (int argc, char **argv)
|
||||
gtk_icon_set_add_source (iconset, iconsource);
|
||||
image = gtk_image_new_from_icon_set (iconset, GTK_ICON_SIZE_DIALOG);
|
||||
gtk_grid_attach (GTK_GRID (grid), image, 1, 3, 1, 1);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
label = gtk_label_new ("GTK_IMAGE_ICON_NAME");
|
||||
gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
|
||||
|
@ -1923,6 +1923,8 @@ test_icon_factory (void)
|
||||
GtkIconSource *icon_source;
|
||||
GtkWidget *image;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
builder = builder_new_from_string (buffer1, -1, NULL);
|
||||
factory = gtk_builder_get_object (builder, "iconfactory1");
|
||||
g_assert (factory != NULL);
|
||||
@ -1983,6 +1985,7 @@ test_icon_factory (void)
|
||||
GTK_BUILDER_ERROR_INVALID_ATTRIBUTE));
|
||||
g_error_free (error);
|
||||
#endif
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user