1 | /* GTK - The GIMP Toolkit |
2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
3 | * |
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. |
8 | * |
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. |
13 | * |
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/>. |
16 | */ |
17 | |
18 | /* |
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/. |
23 | */ |
24 | |
25 | #ifndef __GTK_IMAGE_H__ |
26 | #define __GTK_IMAGE_H__ |
27 | |
28 | |
29 | #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
30 | #error "Only <gtk/gtk.h> can be included directly." |
31 | #endif |
32 | |
33 | #include <gio/gio.h> |
34 | #include <gtk/gtkwidget.h> |
35 | |
36 | |
37 | G_BEGIN_DECLS |
38 | |
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_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE)) |
42 | |
43 | typedef struct _GtkImage GtkImage; |
44 | |
45 | /** |
46 | * GtkImageType: |
47 | * @GTK_IMAGE_EMPTY: there is no image displayed by the widget |
48 | * @GTK_IMAGE_ICON_NAME: the widget contains a named icon |
49 | * @GTK_IMAGE_GICON: the widget contains a `GIcon` |
50 | * @GTK_IMAGE_PAINTABLE: the widget contains a `GdkPaintable` |
51 | * |
52 | * Describes the image data representation used by a [class@Gtk.Image]. |
53 | * |
54 | * If you want to get the image from the widget, you can only get the |
55 | * currently-stored representation; for instance, if the gtk_image_get_storage_type() |
56 | * returns %GTK_IMAGE_PAINTABLE, then you can call gtk_image_get_paintable(). |
57 | * |
58 | * For empty images, you can request any storage type (call any of the "get" |
59 | * functions), but they will all return %NULL values. |
60 | */ |
61 | typedef enum |
62 | { |
63 | GTK_IMAGE_EMPTY, |
64 | GTK_IMAGE_ICON_NAME, |
65 | GTK_IMAGE_GICON, |
66 | GTK_IMAGE_PAINTABLE |
67 | } GtkImageType; |
68 | |
69 | GDK_AVAILABLE_IN_ALL |
70 | GType gtk_image_get_type (void) G_GNUC_CONST; |
71 | |
72 | GDK_AVAILABLE_IN_ALL |
73 | GtkWidget* gtk_image_new (void); |
74 | GDK_AVAILABLE_IN_ALL |
75 | GtkWidget* gtk_image_new_from_file (const char *filename); |
76 | GDK_AVAILABLE_IN_ALL |
77 | GtkWidget* gtk_image_new_from_resource (const char *resource_path); |
78 | GDK_AVAILABLE_IN_ALL |
79 | GtkWidget* gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf); |
80 | GDK_AVAILABLE_IN_ALL |
81 | GtkWidget* gtk_image_new_from_paintable (GdkPaintable *paintable); |
82 | GDK_AVAILABLE_IN_ALL |
83 | GtkWidget* gtk_image_new_from_icon_name (const char *icon_name); |
84 | GDK_AVAILABLE_IN_ALL |
85 | GtkWidget* gtk_image_new_from_gicon (GIcon *icon); |
86 | |
87 | GDK_AVAILABLE_IN_ALL |
88 | void gtk_image_clear (GtkImage *image); |
89 | GDK_AVAILABLE_IN_ALL |
90 | void gtk_image_set_from_file (GtkImage *image, |
91 | const char *filename); |
92 | GDK_AVAILABLE_IN_ALL |
93 | void gtk_image_set_from_resource (GtkImage *image, |
94 | const char *resource_path); |
95 | GDK_AVAILABLE_IN_ALL |
96 | void gtk_image_set_from_pixbuf (GtkImage *image, |
97 | GdkPixbuf *pixbuf); |
98 | GDK_AVAILABLE_IN_ALL |
99 | void gtk_image_set_from_paintable (GtkImage *image, |
100 | GdkPaintable *paintable); |
101 | GDK_AVAILABLE_IN_ALL |
102 | void gtk_image_set_from_icon_name (GtkImage *image, |
103 | const char *icon_name); |
104 | GDK_AVAILABLE_IN_ALL |
105 | void gtk_image_set_from_gicon (GtkImage *image, |
106 | GIcon *icon); |
107 | GDK_AVAILABLE_IN_ALL |
108 | void gtk_image_set_pixel_size (GtkImage *image, |
109 | int pixel_size); |
110 | GDK_AVAILABLE_IN_ALL |
111 | void gtk_image_set_icon_size (GtkImage *image, |
112 | GtkIconSize icon_size); |
113 | |
114 | GDK_AVAILABLE_IN_ALL |
115 | GtkImageType gtk_image_get_storage_type (GtkImage *image); |
116 | |
117 | GDK_AVAILABLE_IN_ALL |
118 | GdkPaintable *gtk_image_get_paintable (GtkImage *image); |
119 | |
120 | GDK_AVAILABLE_IN_ALL |
121 | const char *gtk_image_get_icon_name (GtkImage *image); |
122 | GDK_AVAILABLE_IN_ALL |
123 | GIcon * gtk_image_get_gicon (GtkImage *image); |
124 | GDK_AVAILABLE_IN_ALL |
125 | int gtk_image_get_pixel_size (GtkImage *image); |
126 | GDK_AVAILABLE_IN_ALL |
127 | GtkIconSize gtk_image_get_icon_size (GtkImage *image); |
128 | |
129 | G_END_DECLS |
130 | |
131 | #endif /* __GTK_IMAGE_H__ */ |
132 | |