1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
27 #ifndef __G_RESOURCE_H__
28 #define __G_RESOURCE_H__
30 #include <gio/giotypes.h>
37 * The #GType for #GResource.
39 #define G_TYPE_RESOURCE (g_resource_get_type ())
45 * Error domain for #GResource. Errors in this domain will be from the
46 * #GResourceError enumeration. See #GError for more information on
49 #define G_RESOURCE_ERROR (g_resource_error_quark ())
50 GQuark g_resource_error_quark (void);
52 typedef struct _GStaticResource GStaticResource;
54 struct _GStaticResource {
58 GStaticResource *next;
62 GLIB_AVAILABLE_IN_2_32
63 GType g_resource_get_type (void) G_GNUC_CONST;
64 GLIB_AVAILABLE_IN_2_32
65 GResource * g_resource_new_from_data (GBytes *data,
67 GResource * g_resource_ref (GResource *resource);
68 GLIB_AVAILABLE_IN_2_32
69 void g_resource_unref (GResource *resource);
70 GLIB_AVAILABLE_IN_2_32
71 GResource * g_resource_load (const gchar *filename,
73 GLIB_AVAILABLE_IN_2_32
74 GInputStream *g_resource_open_stream (GResource *resource,
76 GResourceLookupFlags lookup_flags,
78 GLIB_AVAILABLE_IN_2_32
79 GBytes * g_resource_lookup_data (GResource *resource,
81 GResourceLookupFlags lookup_flags,
83 GLIB_AVAILABLE_IN_2_32
84 char ** g_resource_enumerate_children (GResource *resource,
86 GResourceLookupFlags lookup_flags,
88 GLIB_AVAILABLE_IN_2_32
89 gboolean g_resource_get_info (GResource *resource,
91 GResourceLookupFlags lookup_flags,
96 GLIB_AVAILABLE_IN_2_32
97 void g_resources_register (GResource *resource);
98 GLIB_AVAILABLE_IN_2_32
99 void g_resources_unregister (GResource *resource);
100 GLIB_AVAILABLE_IN_2_32
101 GInputStream *g_resources_open_stream (const char *path,
102 GResourceLookupFlags lookup_flags,
104 GLIB_AVAILABLE_IN_2_32
105 GBytes * g_resources_lookup_data (const char *path,
106 GResourceLookupFlags lookup_flags,
108 GLIB_AVAILABLE_IN_2_32
109 char ** g_resources_enumerate_children (const char *path,
110 GResourceLookupFlags lookup_flags,
112 GLIB_AVAILABLE_IN_2_32
113 gboolean g_resources_get_info (const char *path,
114 GResourceLookupFlags lookup_flags,
120 GLIB_AVAILABLE_IN_2_32
121 void g_static_resource_init (GStaticResource *static_resource);
122 GLIB_AVAILABLE_IN_2_32
123 void g_static_resource_fini (GStaticResource *static_resource);
124 GLIB_AVAILABLE_IN_2_32
125 GResource *g_static_resource_get_resource (GStaticResource *static_resource);
129 #endif /* __G_RESOURCE_H__ */