diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-10-25 04:36:39 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-10-25 04:36:39 +0000 |
commit | b63431c82ade00c522ab2df06ee3476085bd6941 (patch) | |
tree | e37b71b3eb98a0ef9fb0c57e1bcf3e1b197728a9 /gtk/gtkimage.h | |
parent | 2b4ef0648abbc50db56ca367004153f6ce3f10ba (diff) | |
download | gtk+-b63431c82ade00c522ab2df06ee3476085bd6941.tar.gz |
Add a new type GTK_IMAGE_ICON_NAME for named icons, update the size and
2004-10-25 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimage.h:
* gtk/gtkimage.c (gtk_image_new_from_icon_name)
(gtk_image_set_from_icon_name, gtk_image_get_icon_name)
(gtk_image_set_pixel_size, gtk_image_get_pixel_size): Add a
new type GTK_IMAGE_ICON_NAME for named icons, update the size
and content of stock, icon set and named icon images upon style
changes, and allow to set a fixed pixel size for named icon
images. (#155688, James Henstridge)
* tests/testimage.c: Test application for theming behaviour of
different image types and for image dnd.
Diffstat (limited to 'gtk/gtkimage.h')
-rw-r--r-- | gtk/gtkimage.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/gtk/gtkimage.h b/gtk/gtkimage.h index 2b997ab6d8..28c6776c64 100644 --- a/gtk/gtkimage.h +++ b/gtk/gtkimage.h @@ -53,6 +53,7 @@ typedef struct _GtkImagePixbufData GtkImagePixbufData; typedef struct _GtkImageStockData GtkImageStockData; typedef struct _GtkImageIconSetData GtkImageIconSetData; typedef struct _GtkImageAnimationData GtkImageAnimationData; +typedef struct _GtkImageIconNameData GtkImageIconNameData; struct _GtkImagePixmapData { @@ -86,6 +87,13 @@ struct _GtkImageAnimationData guint frame_timeout; }; +struct _GtkImageIconNameData +{ + gchar *icon_name; + GdkPixbuf *pixbuf; + guint theme_change_id; +}; + typedef enum { GTK_IMAGE_EMPTY, @@ -94,7 +102,8 @@ typedef enum GTK_IMAGE_PIXBUF, GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET, - GTK_IMAGE_ANIMATION + GTK_IMAGE_ANIMATION, + GTK_IMAGE_ICON_NAME } GtkImageType; struct _GtkImage @@ -111,12 +120,13 @@ struct _GtkImage GtkImageStockData stock; GtkImageIconSetData icon_set; GtkImageAnimationData anim; + GtkImageIconNameData name; } data; /* Only used with GTK_IMAGE_PIXMAP, GTK_IMAGE_IMAGE */ GdkBitmap *mask; - /* Only used with GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET */ + /* Only used with GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET, GTK_IMAGE_ICON_NAME */ GtkIconSize icon_size; }; @@ -145,6 +155,8 @@ GtkWidget* gtk_image_new_from_stock (const gchar *stock_id, GtkWidget* gtk_image_new_from_icon_set (GtkIconSet *icon_set, GtkIconSize size); GtkWidget* gtk_image_new_from_animation (GdkPixbufAnimation *animation); +GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name, + GtkIconSize size); void gtk_image_set_from_pixmap (GtkImage *image, GdkPixmap *pixmap, @@ -164,6 +176,11 @@ void gtk_image_set_from_icon_set (GtkImage *image, GtkIconSize size); void gtk_image_set_from_animation (GtkImage *image, GdkPixbufAnimation *animation); +void gtk_image_set_from_icon_name (GtkImage *image, + const gchar *icon_name, + GtkIconSize size); +void gtk_image_set_pixel_size (GtkImage *image, + gint pixel_size); GtkImageType gtk_image_get_storage_type (GtkImage *image); @@ -181,7 +198,10 @@ void gtk_image_get_icon_set (GtkImage *image, GtkIconSet **icon_set, GtkIconSize *size); GdkPixbufAnimation* gtk_image_get_animation (GtkImage *image); - +void gtk_image_get_icon_name (GtkImage *image, + gchar **icon_name, + GtkIconSize *size); +gint gtk_image_get_pixel_size (GtkImage *image); #ifndef GTK_DISABLE_DEPRECATED /* These three are deprecated */ |