1 | /* GTK - The GIMP Toolkit |
2 | * Copyright (C) 2000 Red Hat, Inc. |
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_ICON_FACTORY_H__ |
26 | #define __GTK_ICON_FACTORY_H__ |
27 | |
28 | #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
29 | #error "Only <gtk/gtk.h> can be included directly." |
30 | #endif |
31 | |
32 | #include <gdk/gdk.h> |
33 | #include <gtk/gtkenums.h> |
34 | #include <gtk/gtktypes.h> |
35 | |
36 | G_BEGIN_DECLS |
37 | |
38 | |
39 | #define GTK_TYPE_ICON_FACTORY (gtk_icon_factory_get_type ()) |
40 | #define GTK_ICON_FACTORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ICON_FACTORY, GtkIconFactory)) |
41 | #define GTK_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_FACTORY, GtkIconFactoryClass)) |
42 | #define GTK_IS_ICON_FACTORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ICON_FACTORY)) |
43 | #define GTK_IS_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_FACTORY)) |
44 | #define GTK_ICON_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_FACTORY, GtkIconFactoryClass)) |
45 | #define GTK_TYPE_ICON_SET (gtk_icon_set_get_type ()) |
46 | #define GTK_TYPE_ICON_SOURCE (gtk_icon_source_get_type ()) |
47 | |
48 | typedef struct _GtkIconFactory GtkIconFactory; |
49 | typedef struct _GtkIconFactoryPrivate GtkIconFactoryPrivate; |
50 | typedef struct _GtkIconFactoryClass GtkIconFactoryClass; |
51 | |
52 | struct _GtkIconFactory |
53 | { |
54 | GObject parent_instance; |
55 | |
56 | /*< private >*/ |
57 | GtkIconFactoryPrivate *priv; |
58 | }; |
59 | |
60 | /** |
61 | * GtkIconFactoryClass: |
62 | * @parent_class: The parent class. |
63 | */ |
64 | struct _GtkIconFactoryClass |
65 | { |
66 | GObjectClass parent_class; |
67 | |
68 | /*< private >*/ |
69 | |
70 | /* Padding for future expansion */ |
71 | void (*_gtk_reserved1) (void); |
72 | void (*_gtk_reserved2) (void); |
73 | void (*_gtk_reserved3) (void); |
74 | void (*_gtk_reserved4) (void); |
75 | }; |
76 | |
77 | GDK_DEPRECATED_IN_3_10 |
78 | GType gtk_icon_factory_get_type (void) G_GNUC_CONST; |
79 | GDK_DEPRECATED_IN_3_10 |
80 | GtkIconFactory* gtk_icon_factory_new (void); |
81 | GDK_DEPRECATED_IN_3_10 |
82 | void gtk_icon_factory_add (GtkIconFactory *factory, |
83 | const gchar *stock_id, |
84 | GtkIconSet *icon_set); |
85 | GDK_DEPRECATED_IN_3_10 |
86 | GtkIconSet* gtk_icon_factory_lookup (GtkIconFactory *factory, |
87 | const gchar *stock_id); |
88 | |
89 | /* Manage the default icon factory stack */ |
90 | |
91 | GDK_DEPRECATED_IN_3_10 |
92 | void gtk_icon_factory_add_default (GtkIconFactory *factory); |
93 | GDK_DEPRECATED_IN_3_10 |
94 | void gtk_icon_factory_remove_default (GtkIconFactory *factory); |
95 | GDK_DEPRECATED_IN_3_10 |
96 | GtkIconSet* gtk_icon_factory_lookup_default (const gchar *stock_id); |
97 | |
98 | /* Get preferred real size from registered semantic size. Note that |
99 | * themes SHOULD use this size, but they aren’t required to; for size |
100 | * requests and such, you should get the actual pixbuf from the icon |
101 | * set and see what size was rendered. |
102 | * |
103 | * This function is intended for people who are scaling icons, |
104 | * rather than for people who are displaying already-scaled icons. |
105 | * That is, if you are displaying an icon, you should get the |
106 | * size from the rendered pixbuf, not from here. |
107 | */ |
108 | |
109 | #ifndef GDK_MULTIHEAD_SAFE |
110 | GDK_AVAILABLE_IN_ALL |
111 | gboolean gtk_icon_size_lookup (GtkIconSize size, |
112 | gint *width, |
113 | gint *height); |
114 | #endif /* GDK_MULTIHEAD_SAFE */ |
115 | GDK_DEPRECATED_IN_3_10_FOR(gtk_icon_size_lookup) |
116 | gboolean gtk_icon_size_lookup_for_settings (GtkSettings *settings, |
117 | GtkIconSize size, |
118 | gint *width, |
119 | gint *height); |
120 | |
121 | GDK_DEPRECATED_IN_3_10 |
122 | GtkIconSize gtk_icon_size_register (const gchar *name, |
123 | gint width, |
124 | gint height); |
125 | GDK_DEPRECATED_IN_3_10 |
126 | void gtk_icon_size_register_alias (const gchar *alias, |
127 | GtkIconSize target); |
128 | GDK_DEPRECATED_IN_3_10 |
129 | GtkIconSize gtk_icon_size_from_name (const gchar *name); |
130 | GDK_DEPRECATED_IN_3_10 |
131 | const gchar* gtk_icon_size_get_name (GtkIconSize size); |
132 | |
133 | /* Icon sets */ |
134 | |
135 | GDK_DEPRECATED_IN_3_10 |
136 | GType gtk_icon_set_get_type (void) G_GNUC_CONST; |
137 | GDK_DEPRECATED_IN_3_10 |
138 | GtkIconSet* gtk_icon_set_new (void); |
139 | GDK_DEPRECATED_IN_3_10 |
140 | GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf); |
141 | |
142 | GDK_DEPRECATED_IN_3_10 |
143 | GtkIconSet* gtk_icon_set_ref (GtkIconSet *icon_set); |
144 | GDK_DEPRECATED_IN_3_10 |
145 | void gtk_icon_set_unref (GtkIconSet *icon_set); |
146 | GDK_DEPRECATED_IN_3_10 |
147 | GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set); |
148 | |
149 | GDK_DEPRECATED_IN_3_0_FOR(gtk_icon_set_render_icon_pixbuf) |
150 | GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set, |
151 | GtkStyle *style, |
152 | GtkTextDirection direction, |
153 | GtkStateType state, |
154 | GtkIconSize size, |
155 | GtkWidget *widget, |
156 | const gchar *detail); |
157 | |
158 | GDK_DEPRECATED_IN_3_10 |
159 | void gtk_icon_set_add_source (GtkIconSet *icon_set, |
160 | const GtkIconSource *source); |
161 | |
162 | GDK_DEPRECATED_IN_3_10 |
163 | void gtk_icon_set_get_sizes (GtkIconSet *icon_set, |
164 | GtkIconSize **sizes, |
165 | gint *n_sizes); |
166 | |
167 | GDK_DEPRECATED_IN_3_10 |
168 | GType gtk_icon_source_get_type (void) G_GNUC_CONST; |
169 | GDK_DEPRECATED_IN_3_10 |
170 | GtkIconSource* gtk_icon_source_new (void); |
171 | GDK_DEPRECATED_IN_3_10 |
172 | GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source); |
173 | GDK_DEPRECATED_IN_3_10 |
174 | void gtk_icon_source_free (GtkIconSource *source); |
175 | |
176 | GDK_DEPRECATED_IN_3_10 |
177 | void gtk_icon_source_set_filename (GtkIconSource *source, |
178 | const gchar *filename); |
179 | GDK_DEPRECATED_IN_3_10 |
180 | void gtk_icon_source_set_icon_name (GtkIconSource *source, |
181 | const gchar *icon_name); |
182 | GDK_DEPRECATED_IN_3_10 |
183 | void gtk_icon_source_set_pixbuf (GtkIconSource *source, |
184 | GdkPixbuf *pixbuf); |
185 | |
186 | GDK_DEPRECATED_IN_3_10 |
187 | const gchar * gtk_icon_source_get_filename (const GtkIconSource *source); |
188 | GDK_DEPRECATED_IN_3_10 |
189 | const gchar * gtk_icon_source_get_icon_name (const GtkIconSource *source); |
190 | GDK_DEPRECATED_IN_3_10 |
191 | GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source); |
192 | |
193 | GDK_DEPRECATED_IN_3_10 |
194 | void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source, |
195 | gboolean setting); |
196 | GDK_DEPRECATED_IN_3_10 |
197 | void gtk_icon_source_set_state_wildcarded (GtkIconSource *source, |
198 | gboolean setting); |
199 | GDK_DEPRECATED_IN_3_10 |
200 | void gtk_icon_source_set_size_wildcarded (GtkIconSource *source, |
201 | gboolean setting); |
202 | GDK_DEPRECATED_IN_3_10 |
203 | gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source); |
204 | GDK_DEPRECATED_IN_3_10 |
205 | gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source); |
206 | GDK_DEPRECATED_IN_3_10 |
207 | gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source); |
208 | GDK_DEPRECATED_IN_3_10 |
209 | void gtk_icon_source_set_direction (GtkIconSource *source, |
210 | GtkTextDirection direction); |
211 | GDK_DEPRECATED_IN_3_10 |
212 | void gtk_icon_source_set_state (GtkIconSource *source, |
213 | GtkStateType state); |
214 | GDK_DEPRECATED_IN_3_10 |
215 | void gtk_icon_source_set_size (GtkIconSource *source, |
216 | GtkIconSize size); |
217 | GDK_DEPRECATED_IN_3_10 |
218 | GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source); |
219 | GDK_DEPRECATED_IN_3_10 |
220 | GtkStateType gtk_icon_source_get_state (const GtkIconSource *source); |
221 | GDK_DEPRECATED_IN_3_10 |
222 | GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source); |
223 | |
224 | G_END_DECLS |
225 | |
226 | #endif /* __GTK_ICON_FACTORY_H__ */ |
227 | |