diff options
author | Benjamin Otte <otte@redhat.com> | 2015-12-01 04:44:29 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-12-02 00:29:30 +0100 |
commit | 4a42aa5229e0ba80cf4673c67575ef57d60ae6c5 (patch) | |
tree | 07105523d8a985130f75681fd0922ebe412cb27f /gtk/gtkimagedefinition.c | |
parent | e99eba4415d138f8eadcb9858b3196e6e5aecc75 (diff) | |
download | gtk+-4a42aa5229e0ba80cf4673c67575ef57d60ae6c5.tar.gz |
imagedefinition: Remove icon-size
The size of icons is a property that is relevant to who is rendering the
icon, not to the icon itself.
Example: Starting a DND operation from an entry icon should cause the
icon to resize (from the entr icon's size to the DND icon size).
Diffstat (limited to 'gtk/gtkimagedefinition.c')
-rw-r--r-- | gtk/gtkimagedefinition.c | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/gtk/gtkimagedefinition.c b/gtk/gtkimagedefinition.c index 1486031da8..351dbe4b02 100644 --- a/gtk/gtkimagedefinition.c +++ b/gtk/gtkimagedefinition.c @@ -48,7 +48,6 @@ struct _GtkImageDefinitionStock { gint ref_count; char *id; - GtkIconSize icon_size; }; struct _GtkImageDefinitionIconSet { @@ -56,7 +55,6 @@ struct _GtkImageDefinitionIconSet { gint ref_count; GtkIconSet *icon_set; - GtkIconSize icon_size; }; struct _GtkImageDefinitionAnimation { @@ -72,7 +70,6 @@ struct _GtkImageDefinitionIconName { gint ref_count; char *icon_name; - GtkIconSize icon_size; }; struct _GtkImageDefinitionGIcon { @@ -80,7 +77,6 @@ struct _GtkImageDefinitionGIcon { gint ref_count; GIcon *gicon; - GtkIconSize icon_size; }; struct _GtkImageDefinitionSurface { @@ -152,8 +148,7 @@ gtk_image_definition_new_pixbuf (GdkPixbuf *pixbuf, } GtkImageDefinition * -gtk_image_definition_new_stock (const char *stock_id, - GtkIconSize icon_size) +gtk_image_definition_new_stock (const char *stock_id) { GtkImageDefinition *def; @@ -162,14 +157,12 @@ gtk_image_definition_new_stock (const char *stock_id, def = gtk_image_definition_alloc (GTK_IMAGE_STOCK); def->stock.id = g_strdup (stock_id); - def->stock.icon_size = icon_size; return def; } GtkImageDefinition * -gtk_image_definition_new_icon_set (GtkIconSet *icon_set, - GtkIconSize icon_size) +gtk_image_definition_new_icon_set (GtkIconSet *icon_set) { GtkImageDefinition *def; @@ -180,7 +173,6 @@ gtk_image_definition_new_icon_set (GtkIconSet *icon_set, G_GNUC_BEGIN_IGNORE_DEPRECATIONS; def->icon_set.icon_set = gtk_icon_set_ref (icon_set); G_GNUC_END_IGNORE_DEPRECATIONS; - def->icon_set.icon_size = icon_size; return def; } @@ -202,8 +194,7 @@ gtk_image_definition_new_animation (GdkPixbufAnimation *animation, } GtkImageDefinition * -gtk_image_definition_new_icon_name (const char *icon_name, - GtkIconSize icon_size) +gtk_image_definition_new_icon_name (const char *icon_name) { GtkImageDefinition *def; @@ -212,14 +203,12 @@ gtk_image_definition_new_icon_name (const char *icon_name, def = gtk_image_definition_alloc (GTK_IMAGE_ICON_NAME); def->icon_name.icon_name = g_strdup (icon_name); - def->icon_name.icon_size = icon_size; return def; } GtkImageDefinition * -gtk_image_definition_new_gicon (GIcon *gicon, - GtkIconSize icon_size) +gtk_image_definition_new_gicon (GIcon *gicon) { GtkImageDefinition *def; @@ -228,7 +217,6 @@ gtk_image_definition_new_gicon (GIcon *gicon, def = gtk_image_definition_alloc (GTK_IMAGE_GICON); def->gicon.gicon = g_object_ref (gicon); - def->gicon.icon_size = icon_size; return def; } @@ -303,29 +291,6 @@ gtk_image_definition_get_storage_type (const GtkImageDefinition *def) return def->type; } -GtkIconSize -gtk_image_definition_get_icon_size (const GtkImageDefinition *def) -{ - switch (def->type) - { - default: - g_assert_not_reached (); - case GTK_IMAGE_EMPTY: - case GTK_IMAGE_PIXBUF: - case GTK_IMAGE_ANIMATION: - case GTK_IMAGE_SURFACE: - return GTK_ICON_SIZE_INVALID; - case GTK_IMAGE_STOCK: - return def->stock.icon_size; - case GTK_IMAGE_ICON_SET: - return def->icon_set.icon_size; - case GTK_IMAGE_ICON_NAME: - return def->icon_name.icon_size; - case GTK_IMAGE_GICON: - return def->gicon.icon_size; - } -} - gint gtk_image_definition_get_scale (const GtkImageDefinition *def) { |