Make GSettingsSchemaKey public
[platform/upstream/glib.git] / gio / gresource.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
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.
9  *
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.
14  *
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.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_RESOURCE_H__
24 #define __G_RESOURCE_H__
25
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
28 #endif
29
30 #include <gio/giotypes.h>
31
32 G_BEGIN_DECLS
33
34 /**
35  * G_TYPE_RESOURCE:
36  *
37  * The #GType for #GResource.
38  */
39 #define G_TYPE_RESOURCE (g_resource_get_type ())
40
41
42 /**
43  * G_RESOURCE_ERROR:
44  *
45  * Error domain for #GResource. Errors in this domain will be from the
46  * #GResourceError enumeration. See #GError for more information on
47  * error domains.
48  */
49 #define G_RESOURCE_ERROR (g_resource_error_quark ())
50 GLIB_AVAILABLE_IN_2_32
51 GQuark g_resource_error_quark (void);
52
53 typedef struct _GStaticResource GStaticResource;
54
55 struct _GStaticResource {
56   const guint8 *data;
57   gsize data_len;
58   GResource *resource;
59   GStaticResource *next;
60   gpointer padding;
61 };
62
63 GLIB_AVAILABLE_IN_2_32
64 GType         g_resource_get_type            (void) G_GNUC_CONST;
65 GLIB_AVAILABLE_IN_2_32
66 GResource *   g_resource_new_from_data       (GBytes                *data,
67                                               GError               **error);
68 GLIB_AVAILABLE_IN_2_32
69 GResource *   g_resource_ref                 (GResource             *resource);
70 GLIB_AVAILABLE_IN_2_32
71 void          g_resource_unref               (GResource             *resource);
72 GLIB_AVAILABLE_IN_2_32
73 GResource *   g_resource_load                (const gchar           *filename,
74                                               GError               **error);
75 GLIB_AVAILABLE_IN_2_32
76 GInputStream *g_resource_open_stream         (GResource             *resource,
77                                               const char            *path,
78                                               GResourceLookupFlags   lookup_flags,
79                                               GError               **error);
80 GLIB_AVAILABLE_IN_2_32
81 GBytes *      g_resource_lookup_data         (GResource             *resource,
82                                               const char            *path,
83                                               GResourceLookupFlags   lookup_flags,
84                                               GError               **error);
85 GLIB_AVAILABLE_IN_2_32
86 char **       g_resource_enumerate_children  (GResource             *resource,
87                                               const char            *path,
88                                               GResourceLookupFlags   lookup_flags,
89                                               GError               **error);
90 GLIB_AVAILABLE_IN_2_32
91 gboolean      g_resource_get_info            (GResource             *resource,
92                                               const char            *path,
93                                               GResourceLookupFlags   lookup_flags,
94                                               gsize                 *size,
95                                               guint32               *flags,
96                                               GError               **error);
97
98 GLIB_AVAILABLE_IN_2_32
99 void          g_resources_register           (GResource             *resource);
100 GLIB_AVAILABLE_IN_2_32
101 void          g_resources_unregister         (GResource             *resource);
102 GLIB_AVAILABLE_IN_2_32
103 GInputStream *g_resources_open_stream        (const char            *path,
104                                               GResourceLookupFlags   lookup_flags,
105                                               GError               **error);
106 GLIB_AVAILABLE_IN_2_32
107 GBytes *      g_resources_lookup_data        (const char            *path,
108                                               GResourceLookupFlags   lookup_flags,
109                                               GError               **error);
110 GLIB_AVAILABLE_IN_2_32
111 char **       g_resources_enumerate_children (const char            *path,
112                                               GResourceLookupFlags   lookup_flags,
113                                               GError               **error);
114 GLIB_AVAILABLE_IN_2_32
115 gboolean      g_resources_get_info           (const char            *path,
116                                               GResourceLookupFlags   lookup_flags,
117                                               gsize                 *size,
118                                               guint32               *flags,
119                                               GError               **error);
120
121
122 GLIB_AVAILABLE_IN_2_32
123 void          g_static_resource_init          (GStaticResource *static_resource);
124 GLIB_AVAILABLE_IN_2_32
125 void          g_static_resource_fini          (GStaticResource *static_resource);
126 GLIB_AVAILABLE_IN_2_32
127 GResource    *g_static_resource_get_resource  (GStaticResource *static_resource);
128
129 G_END_DECLS
130
131 #endif /* __G_RESOURCE_H__ */