1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25 #ifndef __GTK_IMAGE_H__
26 #define __GTK_IMAGE_H__
29 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
30 #error "Only <gtk/gtk.h> can be included directly."
34 #include <gtk/gtkmisc.h>
39 #define GTK_TYPE_IMAGE (gtk_image_get_type ())
40 #define GTK_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IMAGE, GtkImage))
41 #define GTK_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMAGE, GtkImageClass))
42 #define GTK_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE))
43 #define GTK_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE))
44 #define GTK_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE, GtkImageClass))
47 typedef struct _GtkImage GtkImage;
48 typedef struct _GtkImagePrivate GtkImagePrivate;
49 typedef struct _GtkImageClass GtkImageClass;
53 * @GTK_IMAGE_EMPTY: there is no image displayed by the widget
54 * @GTK_IMAGE_PIXBUF: the widget contains a #GdkPixbuf
55 * @GTK_IMAGE_STOCK: the widget contains a stock icon name (see
56 * <xref linkend="gtk3-Stock-Items"/>)
57 * @GTK_IMAGE_ICON_SET: the widget contains a #GtkIconSet
58 * @GTK_IMAGE_ANIMATION: the widget contains a #GdkPixbufAnimation
59 * @GTK_IMAGE_ICON_NAME: the widget contains a named icon.
60 * This image type was added in GTK+ 2.6
61 * @GTK_IMAGE_GICON: the widget contains a #GIcon.
62 * This image type was added in GTK+ 2.14
64 * Describes the image data representation used by a #GtkImage. If you
65 * want to get the image from the widget, you can only get the
66 * currently-stored representation. e.g. if the
67 * gtk_image_get_storage_type() returns #GTK_IMAGE_PIXBUF, then you can
68 * call gtk_image_get_pixbuf() but not gtk_image_get_stock(). For empty
69 * images, you can request any storage type (call any of the "get"
70 * functions), but they will all return %NULL values.
86 * This struct contain private data only and should be accessed by the functions
94 GtkImagePrivate *priv;
99 GtkMiscClass parent_class;
101 /* Padding for future expansion */
102 void (*_gtk_reserved1) (void);
103 void (*_gtk_reserved2) (void);
104 void (*_gtk_reserved3) (void);
105 void (*_gtk_reserved4) (void);
108 GType gtk_image_get_type (void) G_GNUC_CONST;
110 GtkWidget* gtk_image_new (void);
111 GtkWidget* gtk_image_new_from_file (const gchar *filename);
112 GtkWidget* gtk_image_new_from_resource (const gchar *resource_path);
113 GtkWidget* gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf);
114 GtkWidget* gtk_image_new_from_stock (const gchar *stock_id,
116 GtkWidget* gtk_image_new_from_icon_set (GtkIconSet *icon_set,
118 GtkWidget* gtk_image_new_from_animation (GdkPixbufAnimation *animation);
119 GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name,
121 GtkWidget* gtk_image_new_from_gicon (GIcon *icon,
124 void gtk_image_clear (GtkImage *image);
125 void gtk_image_set_from_file (GtkImage *image,
126 const gchar *filename);
127 void gtk_image_set_from_resource (GtkImage *image,
128 const gchar *resource_path);
129 void gtk_image_set_from_pixbuf (GtkImage *image,
131 void gtk_image_set_from_stock (GtkImage *image,
132 const gchar *stock_id,
134 void gtk_image_set_from_icon_set (GtkImage *image,
135 GtkIconSet *icon_set,
137 void gtk_image_set_from_animation (GtkImage *image,
138 GdkPixbufAnimation *animation);
139 void gtk_image_set_from_icon_name (GtkImage *image,
140 const gchar *icon_name,
142 void gtk_image_set_from_gicon (GtkImage *image,
145 void gtk_image_set_pixel_size (GtkImage *image,
148 GtkImageType gtk_image_get_storage_type (GtkImage *image);
150 GdkPixbuf* gtk_image_get_pixbuf (GtkImage *image);
151 void gtk_image_get_stock (GtkImage *image,
154 void gtk_image_get_icon_set (GtkImage *image,
155 GtkIconSet **icon_set,
157 GdkPixbufAnimation* gtk_image_get_animation (GtkImage *image);
158 void gtk_image_get_icon_name (GtkImage *image,
159 const gchar **icon_name,
161 void gtk_image_get_gicon (GtkImage *image,
164 gint gtk_image_get_pixel_size (GtkImage *image);
168 #endif /* __GTK_IMAGE_H__ */