1/* GtkIconTheme - a loader for icon themes
2 * gtk-icon-loader.h Copyright (C) 2002, 2003 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#ifndef __GTK_ICON_THEME_H__
19#define __GTK_ICON_THEME_H__
20
21#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22#error "Only <gtk/gtk.h> can be included directly."
23#endif
24
25#include <gdk/gdk.h>
26#include <gtk/gtkenums.h>
27
28G_BEGIN_DECLS
29
30#define GTK_TYPE_ICON_PAINTABLE (gtk_icon_paintable_get_type ())
31#define GTK_ICON_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_PAINTABLE, GtkIconPaintable))
32#define GTK_IS_ICON_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_PAINTABLE))
33
34#define GTK_TYPE_ICON_THEME (gtk_icon_theme_get_type ())
35#define GTK_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_THEME, GtkIconTheme))
36#define GTK_IS_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_THEME))
37
38typedef struct _GtkIconPaintable GtkIconPaintable;
39typedef struct _GtkIconTheme GtkIconTheme;
40
41/**
42 * GtkIconLookupFlags:
43 * @GTK_ICON_LOOKUP_FORCE_REGULAR: Try to always load regular icons, even
44 * when symbolic icon names are given
45 * @GTK_ICON_LOOKUP_FORCE_SYMBOLIC: Try to always load symbolic icons, even
46 * when regular icon names are given
47 * @GTK_ICON_LOOKUP_PRELOAD: Starts loading the texture in the background
48 * so it is ready when later needed.
49 *
50 * Used to specify options for gtk_icon_theme_lookup_icon().
51 */
52typedef enum
53{
54 GTK_ICON_LOOKUP_FORCE_REGULAR = 1 << 0,
55 GTK_ICON_LOOKUP_FORCE_SYMBOLIC = 1 << 1,
56 GTK_ICON_LOOKUP_PRELOAD = 1 << 2,
57} GtkIconLookupFlags;
58
59/**
60 * GTK_ICON_THEME_ERROR:
61 *
62 * The `GQuark` used for `GtkIconThemeError` errors.
63 */
64#define GTK_ICON_THEME_ERROR gtk_icon_theme_error_quark ()
65
66/**
67 * GtkIconThemeError:
68 * @GTK_ICON_THEME_NOT_FOUND: The icon specified does not exist in the theme
69 * @GTK_ICON_THEME_FAILED: An unspecified error occurred.
70 *
71 * Error codes for `GtkIconTheme` operations.
72 **/
73typedef enum {
74 GTK_ICON_THEME_NOT_FOUND,
75 GTK_ICON_THEME_FAILED
76} GtkIconThemeError;
77
78GDK_AVAILABLE_IN_ALL
79GQuark gtk_icon_theme_error_quark (void);
80
81GDK_AVAILABLE_IN_ALL
82GType gtk_icon_theme_get_type (void) G_GNUC_CONST;
83
84GDK_AVAILABLE_IN_ALL
85GtkIconTheme *gtk_icon_theme_new (void);
86GDK_AVAILABLE_IN_ALL
87GtkIconTheme *gtk_icon_theme_get_for_display (GdkDisplay *display);
88
89GDK_AVAILABLE_IN_ALL
90GdkDisplay * gtk_icon_theme_get_display (GtkIconTheme *self);
91
92GDK_AVAILABLE_IN_ALL
93void gtk_icon_theme_set_search_path (GtkIconTheme *self,
94 const char * const *path);
95GDK_AVAILABLE_IN_ALL
96char ** gtk_icon_theme_get_search_path (GtkIconTheme *self);
97GDK_AVAILABLE_IN_ALL
98void gtk_icon_theme_add_search_path (GtkIconTheme *self,
99 const char *path);
100
101GDK_AVAILABLE_IN_ALL
102void gtk_icon_theme_set_resource_path (GtkIconTheme *self,
103 const char * const *path);
104GDK_AVAILABLE_IN_ALL
105char ** gtk_icon_theme_get_resource_path (GtkIconTheme *self);
106GDK_AVAILABLE_IN_ALL
107void gtk_icon_theme_add_resource_path (GtkIconTheme *self,
108 const char *path);
109
110GDK_AVAILABLE_IN_ALL
111void gtk_icon_theme_set_theme_name (GtkIconTheme *self,
112 const char *theme_name);
113GDK_AVAILABLE_IN_ALL
114char * gtk_icon_theme_get_theme_name (GtkIconTheme *self);
115
116GDK_AVAILABLE_IN_ALL
117gboolean gtk_icon_theme_has_icon (GtkIconTheme *self,
118 const char *icon_name);
119GDK_AVAILABLE_IN_4_2
120gboolean gtk_icon_theme_has_gicon (GtkIconTheme *self,
121 GIcon *gicon);
122GDK_AVAILABLE_IN_ALL
123int *gtk_icon_theme_get_icon_sizes (GtkIconTheme *self,
124 const char *icon_name);
125GDK_AVAILABLE_IN_ALL
126GtkIconPaintable *gtk_icon_theme_lookup_icon (GtkIconTheme *self,
127 const char *icon_name,
128 const char *fallbacks[],
129 int size,
130 int scale,
131 GtkTextDirection direction,
132 GtkIconLookupFlags flags);
133GDK_AVAILABLE_IN_ALL
134GtkIconPaintable *gtk_icon_theme_lookup_by_gicon (GtkIconTheme *self,
135 GIcon *icon,
136 int size,
137 int scale,
138 GtkTextDirection direction,
139 GtkIconLookupFlags flags);
140GDK_AVAILABLE_IN_ALL
141GtkIconPaintable *gtk_icon_paintable_new_for_file (GFile *file,
142 int size,
143 int scale);
144GDK_AVAILABLE_IN_ALL
145char ** gtk_icon_theme_get_icon_names (GtkIconTheme *self);
146
147GDK_AVAILABLE_IN_ALL
148GType gtk_icon_paintable_get_type (void) G_GNUC_CONST;
149
150GDK_AVAILABLE_IN_ALL
151GFile * gtk_icon_paintable_get_file (GtkIconPaintable *self);
152GDK_AVAILABLE_IN_ALL
153const char * gtk_icon_paintable_get_icon_name (GtkIconPaintable *self);
154GDK_AVAILABLE_IN_ALL
155gboolean gtk_icon_paintable_is_symbolic (GtkIconPaintable *self);
156
157G_END_DECLS
158
159#endif /* __GTK_ICON_THEME_H__ */
160

source code of gtk/gtk/gtkicontheme.h