gio2 0.90.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +60 -0
- data/README +34 -0
- data/Rakefile +76 -0
- data/ext/gio2/depend +5 -0
- data/ext/gio2/extconf.rb +91 -0
- data/ext/gio2/gappinfo.c +318 -0
- data/ext/gio2/gapplaunchcontext.c +79 -0
- data/ext/gio2/gasyncinitable.c +244 -0
- data/ext/gio2/gasyncresult.c +39 -0
- data/ext/gio2/gbufferedinputstream.c +184 -0
- data/ext/gio2/gbufferedoutputstream.c +82 -0
- data/ext/gio2/gcancellable.c +177 -0
- data/ext/gio2/gcharsetconverter.c +72 -0
- data/ext/gio2/gcontenttype.c +135 -0
- data/ext/gio2/gconverter.c +117 -0
- data/ext/gio2/gconverterinputstream.c +48 -0
- data/ext/gio2/gconverteroutputstream.c +48 -0
- data/ext/gio2/gdatainputstream.c +341 -0
- data/ext/gio2/gdataoutputstream.c +202 -0
- data/ext/gio2/gdesktopappinfo.c +90 -0
- data/ext/gio2/gdrive.c +267 -0
- data/ext/gio2/gemblem.c +71 -0
- data/ext/gio2/gemblemedicon.c +63 -0
- data/ext/gio2/gfile.c +2058 -0
- data/ext/gio2/gfileattribute.c +263 -0
- data/ext/gio2/gfileattributematcher.c +90 -0
- data/ext/gio2/gfiledescriptorbased.c +42 -0
- data/ext/gio2/gfileenumerator.c +167 -0
- data/ext/gio2/gfileicon.c +46 -0
- data/ext/gio2/gfileinfo.c +641 -0
- data/ext/gio2/gfileinputstream.c +92 -0
- data/ext/gio2/gfileiostream.c +98 -0
- data/ext/gio2/gfilemonitor.c +63 -0
- data/ext/gio2/gfilenamecompleter.c +72 -0
- data/ext/gio2/gfileoutputstream.c +100 -0
- data/ext/gio2/gfilterinputstream.c +56 -0
- data/ext/gio2/gfilteroutputstream.c +56 -0
- data/ext/gio2/gicon.c +69 -0
- data/ext/gio2/ginetaddress.c +188 -0
- data/ext/gio2/ginetsocketaddress.c +54 -0
- data/ext/gio2/ginitable.c +195 -0
- data/ext/gio2/ginputstream.c +341 -0
- data/ext/gio2/gio2.c +120 -0
- data/ext/gio2/gio2.def +2 -0
- data/ext/gio2/gio2.h +343 -0
- data/ext/gio2/gioerror.c +67 -0
- data/ext/gio2/giomodule.c +63 -0
- data/ext/gio2/gioscheduler.c +195 -0
- data/ext/gio2/giostream.c +129 -0
- data/ext/gio2/gloadableicon.c +91 -0
- data/ext/gio2/gmemoryinputstream.c +65 -0
- data/ext/gio2/gmemoryoutputstream.c +65 -0
- data/ext/gio2/gmount.c +283 -0
- data/ext/gio2/gmountoperation.c +168 -0
- data/ext/gio2/gnetworkaddress.c +71 -0
- data/ext/gio2/gnetworkservice.c +64 -0
- data/ext/gio2/goutputstream.c +343 -0
- data/ext/gio2/gresolver.c +230 -0
- data/ext/gio2/gseekable.c +89 -0
- data/ext/gio2/gsimpleasyncresult.c +153 -0
- data/ext/gio2/gsocket.c +451 -0
- data/ext/gio2/gsocketaddress.c +45 -0
- data/ext/gio2/gsocketclient.c +273 -0
- data/ext/gio2/gsocketconnectable.c +97 -0
- data/ext/gio2/gsocketconnection.c +82 -0
- data/ext/gio2/gsocketcontrolmessage.c +82 -0
- data/ext/gio2/gsocketlistener.c +239 -0
- data/ext/gio2/gsocketservice.c +64 -0
- data/ext/gio2/gsrvtarget.c +77 -0
- data/ext/gio2/gtcpconnection.c +48 -0
- data/ext/gio2/gthemedicon.c +86 -0
- data/ext/gio2/gthreadedsocketservice.c +39 -0
- data/ext/gio2/gunixconnection.c +69 -0
- data/ext/gio2/gunixfdlist.c +112 -0
- data/ext/gio2/gunixfdmessage.c +81 -0
- data/ext/gio2/gunixinputstream.c +73 -0
- data/ext/gio2/gunixmounts.c +346 -0
- data/ext/gio2/gunixoutputstream.c +73 -0
- data/ext/gio2/gunixsocketaddress.c +79 -0
- data/ext/gio2/gvfs.c +84 -0
- data/ext/gio2/gvolume.c +191 -0
- data/ext/gio2/gvolumemonitor.c +77 -0
- data/ext/gio2/gzlibcompressor.c +47 -0
- data/ext/gio2/gzlibdecompressor.c +43 -0
- data/ext/gio2/util.c +323 -0
- data/extconf.rb +49 -0
- data/lib/gio2.rb +141 -0
- metadata +184 -0
data/ext/gio2/gio2.def
ADDED
data/ext/gio2/gio2.h
ADDED
@@ -0,0 +1,343 @@
|
|
1
|
+
/* -*- c-file-style: "ruby" -*- */
|
2
|
+
/*
|
3
|
+
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef GIO2_H
|
22
|
+
#define GIO2_H
|
23
|
+
|
24
|
+
#ifdef __cplusplus
|
25
|
+
extern "C" {
|
26
|
+
#endif /* __cplusplus */
|
27
|
+
|
28
|
+
#include <ruby.h>
|
29
|
+
#include <gio/gio.h>
|
30
|
+
|
31
|
+
#include <rbglib.h>
|
32
|
+
#include <rbgobject.h>
|
33
|
+
|
34
|
+
/* Block Handling */
|
35
|
+
#define SAVE_BLOCK(block) G_STMT_START { \
|
36
|
+
if (!NIL_P(block)) \
|
37
|
+
G_CHILD_ADD(mGLib, (block)); \
|
38
|
+
} G_STMT_END
|
39
|
+
|
40
|
+
#define USE_BLOCK(data) \
|
41
|
+
rbgio_child_remove_and_return(mGLib, (VALUE)(data))
|
42
|
+
|
43
|
+
#define USE_BLOCK_AND_SAVE(data) ((VALUE)data)
|
44
|
+
|
45
|
+
/* Conversion Macros */
|
46
|
+
#define RVAL2TYPE_WITH_DEFAULT(value, type, default_value) \
|
47
|
+
(NIL_P(value) ? (default_value) : type(value))
|
48
|
+
|
49
|
+
#define RVAL2ATTRIBUTESDEFAULT(value) \
|
50
|
+
RVAL2TYPE_WITH_DEFAULT((value), RVAL2CSTR, "standard::*")
|
51
|
+
|
52
|
+
#define RVAL2GAPPINFO(value) G_APP_INFO(RVAL2GOBJ(value))
|
53
|
+
|
54
|
+
#define RVAL2GAPPLAUNCHCONTEXT(value) G_APP_LAUNCH_CONTEXT(RVAL2GOBJ(value))
|
55
|
+
|
56
|
+
#define RVAL2GASYNCRESULT(value) G_ASYNC_RESULT(RVAL2GOBJ(value))
|
57
|
+
|
58
|
+
#define RVAL2GCANCELLABLE(value) G_CANCELLABLE(RVAL2GOBJ(value))
|
59
|
+
|
60
|
+
#define RVAL2GCONVERTER(value) G_CONVERTER(RVAL2GOBJ(value))
|
61
|
+
|
62
|
+
#define GDATASTREAMBYTEORDER2RVAL(value) \
|
63
|
+
RVAL2GENUM((value), G_TYPE_DATA_STREAM_BYTE_ORDER)
|
64
|
+
|
65
|
+
#define RVAL2GDATASTREAMBYTEORDER(value) \
|
66
|
+
GENUM2RVAL((value), G_TYPE_DATA_STREAM_BYTE_ORDER)
|
67
|
+
|
68
|
+
#define RVAL2GDRIVESTARTFLAGS(value) \
|
69
|
+
RVAL2GENUM((value), G_TYPE_DRIVE_START_FLAGS)
|
70
|
+
#define RVAL2GDRIVESTARTFLAGSDEFAULT(value) \
|
71
|
+
RVAL2TYPE_WITH_DEFAULT((value), \
|
72
|
+
RVAL2GDRIVESTARTFLAGS, \
|
73
|
+
G_DRIVE_START_NONE)
|
74
|
+
#define RVAL2GEMBLEM(value) G_EMBLEM(RVAL2GOBJ(value))
|
75
|
+
|
76
|
+
#define RVAL2GFILE(value) G_FILE(RVAL2GOBJ(value))
|
77
|
+
|
78
|
+
#define G_TYPE_FILE_ATTRIBUTE_MATCHER (g_file_attribute_matcher_get_type())
|
79
|
+
GType g_file_attribute_matcher_get_type(void);
|
80
|
+
|
81
|
+
#define RVAL2GFILEATTRIBUTEMATCHER(value) \
|
82
|
+
((GFileAttributeMatcher *)(RVAL2BOXED(value, G_TYPE_FILE_ATTRIBUTE_MATCHER)))
|
83
|
+
|
84
|
+
#define GFILEATTRIBUTETYPE2RVAL(value) \
|
85
|
+
GENUM2RVAL((value), G_TYPE_FILE_ATTRIBUTE_TYPE)
|
86
|
+
|
87
|
+
#define G_TYPE_FILE_ATTRIBUTE_INFO_LIST (g_file_attribute_info_list_get_type())
|
88
|
+
GType g_file_attribute_info_list_get_type();
|
89
|
+
|
90
|
+
#define GFILEATTRIBUTEINFOLIST2RVAL(object) \
|
91
|
+
BOXED2RVAL(object, G_TYPE_FILE_ATTRIBUTE_INFO_LIST)
|
92
|
+
|
93
|
+
#define RVAL2GFILEATTRIBUTETYPE(value) \
|
94
|
+
RVAL2GENUM((value), G_TYPE_FILE_ATTRIBUTE_TYPE)
|
95
|
+
|
96
|
+
#define RVAL2GFILEINFO(value) G_FILE_INFO(RVAL2GOBJ(value))
|
97
|
+
|
98
|
+
#define GFILETYPE2RVAL(value) GENUM2RVAL((value), G_TYPE_FILE_TYPE)
|
99
|
+
#define RVAL2GFILETYPE(value) RVAL2GENUM((value), G_TYPE_FILE_TYPE)
|
100
|
+
|
101
|
+
#define RVAL2GICON(value) G_ICON(RVAL2GOBJ(value))
|
102
|
+
|
103
|
+
#define RVAL2GINETADDRESS(value) G_INET_ADDRESS(RVAL2GOBJ(value))
|
104
|
+
|
105
|
+
#define RVAL2GINPUTSTREAM(value) G_INPUT_STREAM(RVAL2GOBJ(value))
|
106
|
+
|
107
|
+
#define RVAL2GMOUNT(value) G_MOUNT(RVAL2GOBJ(value))
|
108
|
+
|
109
|
+
#define RVAL2GMOUNTMOUNTFLAGS(value) \
|
110
|
+
RVAL2GFLAGS((value), G_TYPE_MOUNT_MOUNT_FLAGS)
|
111
|
+
#define RVAL2GMOUNTMOUNTFLAGSDEFAULT(value) \
|
112
|
+
RVAL2TYPE_WITH_DEFAULT((value), \
|
113
|
+
RVAL2GMOUNTMOUNTFLAGS, \
|
114
|
+
G_MOUNT_MOUNT_NONE)
|
115
|
+
|
116
|
+
#define RVAL2GMOUNTUNMOUNTFLAGS(value) \
|
117
|
+
RVAL2GFLAGS((value), G_TYPE_MOUNT_UNMOUNT_FLAGS)
|
118
|
+
#define RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(value) \
|
119
|
+
RVAL2TYPE_WITH_DEFAULT((value), \
|
120
|
+
RVAL2GMOUNTUNMOUNTFLAGS, \
|
121
|
+
G_MOUNT_UNMOUNT_NONE)
|
122
|
+
|
123
|
+
#define RVAL2GMOUNTOPERATION(value) G_MOUNT_OPERATION(RVAL2GOBJ(value))
|
124
|
+
|
125
|
+
#define RVAL2GOUTPUTSTREAM(value) G_OUTPUT_STREAM(RVAL2GOBJ(value))
|
126
|
+
|
127
|
+
#define RVAL2GSOCKET(value) G_SOCKET(RVAL2GOBJ(value))
|
128
|
+
|
129
|
+
#define RVAL2GSOCKETADDRESS(value) G_SOCKET_ADDRESS(RVAL2GOBJ(value))
|
130
|
+
|
131
|
+
#define RVAL2GSOCKETCONNECTABLE(value) G_SOCKET_CONNECTABLE(RVAL2GOBJ(value))
|
132
|
+
|
133
|
+
#define GSOCKETFAMILY2RVAL(value) GENUM2RVAL((value), G_TYPE_SOCKET_FAMILY)
|
134
|
+
#define RVAL2GSOCKETFAMILY(value) RVAL2GENUM((value), G_TYPE_SOCKET_FAMILY)
|
135
|
+
|
136
|
+
#define GSOCKETPROTOCOL2RVAL(value) GENUM2RVAL((value), G_TYPE_SOCKET_PROTOCOL)
|
137
|
+
#define RVAL2GSOCKETPROTOCOL(value) RVAL2GFLAGS((value), G_TYPE_SOCKET_PROTOCOL)
|
138
|
+
#define RVAL2GSOCKETPROTOCOLDEFAULT(value) \
|
139
|
+
RVAL2TYPE_WITH_DEFAULT((value), \
|
140
|
+
RVAL2GSOCKETPROTOCOL, \
|
141
|
+
G_SOCKET_PROTOCOL_DEFAULT)
|
142
|
+
|
143
|
+
#define GSOCKETTYPE2RVAL(value) GENUM2RVAL((value), G_TYPE_SOCKET_TYPE)
|
144
|
+
#define RVAL2GSOCKETTYPE(value) RVAL2GFLAGS((value), G_TYPE_SOCKET_TYPE)
|
145
|
+
|
146
|
+
#define GTIMEVAL2RVAL(value) rb_time_new((value)->tv_sec, (value)->tv_usec)
|
147
|
+
|
148
|
+
#define RVAL2GZLIBCOMPRESSORFORMAT(value) \
|
149
|
+
RVAL2GFLAGS((value), G_TYPE_ZLIB_COMPRESSOR_FORMAT)
|
150
|
+
#define RVAL2GZLIBCOMPRESSORFORMATDEFAULT(value) \
|
151
|
+
RVAL2TYPE_WITH_DEFAULT((value), \
|
152
|
+
RVAL2GZLIBCOMPRESSORFORMAT, \
|
153
|
+
G_ZLIB_COMPRESSOR_FORMAT_ZLIB)
|
154
|
+
|
155
|
+
#define RVAL2IOPRIORITYDEFAULT(value) \
|
156
|
+
RVAL2TYPE_WITH_DEFAULT((value), NUM2INT, G_PRIORITY_DEFAULT)
|
157
|
+
|
158
|
+
#ifdef HAVE_GIO_UNIX
|
159
|
+
# define RVAL2GUNIXFDLIST(value) G_UNIX_FD_LIST(RVAL2GOBJ(value))
|
160
|
+
#endif
|
161
|
+
|
162
|
+
/* Integer Type Conversion Macros */
|
163
|
+
#define FD2RVAL(value) INT2FIX(value)
|
164
|
+
#define RVAL2FD(value) FIX2INT(value)
|
165
|
+
|
166
|
+
#define GINT2RVAL(value) INT2NUM(value)
|
167
|
+
#define RVAL2GINT(value) NUM2INT(value)
|
168
|
+
|
169
|
+
#define GINT162RVAL(value) INT2FIX(value)
|
170
|
+
#define RVAL2GINT16(value) FIX2INT(value)
|
171
|
+
|
172
|
+
#define GINT322RVAL(value) INT2NUM(value)
|
173
|
+
#define RVAL2GINT32(value) NUM2INT(value)
|
174
|
+
|
175
|
+
#define GINT642RVAL(value) rbglib_int64_to_num(value)
|
176
|
+
#define RVAL2GINT64(value) rbglib_num_to_int64(value)
|
177
|
+
|
178
|
+
#define GSIZE2RVAL(value) ULONG2NUM(value)
|
179
|
+
#define RVAL2GSIZE(value) NUM2ULONG(value)
|
180
|
+
|
181
|
+
#define GLONG2RVAL(value) LONG2NUM(value)
|
182
|
+
#define RVAL2GLONG(value) NUM2LONG(value)
|
183
|
+
|
184
|
+
#define GOFFSET2RVAL(value) rbglib_int64_to_num(value)
|
185
|
+
#define RVAL2GOFFSET(value) rbglib_num_to_int64(value)
|
186
|
+
|
187
|
+
#define GSSIZE2RVAL(value) LONG2NUM(value)
|
188
|
+
#define RVAL2GSSIZE(value) NUM2LONG(value)
|
189
|
+
|
190
|
+
/* TODO: Should we be zeroing out bits? */
|
191
|
+
#define GUCHAR2RVAL(value) INT2FIX(value)
|
192
|
+
#define RVAL2GUCHAR(value) FIX2INT(value)
|
193
|
+
|
194
|
+
#define GUINT2RVAL(value) UINT2NUM(value)
|
195
|
+
#define RVAL2GUINT(value) NUM2UINT(value)
|
196
|
+
|
197
|
+
/* TODO: Should we be zeroing out bits? */
|
198
|
+
#define GUINT162RVAL(value) INT2FIX(value)
|
199
|
+
#define RVAL2GUINT16(value) FIX2INT(value)
|
200
|
+
|
201
|
+
#define GUINT322RVAL(value) UINT2NUM(value)
|
202
|
+
#define RVAL2GUINT32(value) NUM2UINT(value)
|
203
|
+
|
204
|
+
#define GUINT642RVAL(value) rbglib_uint64_to_num(value)
|
205
|
+
#define RVAL2GUINT64(value) rbglib_num_to_uint64(value)
|
206
|
+
|
207
|
+
#define GULONG2RVAL(value) ULONG2NUM(value)
|
208
|
+
#define RVAL2GULONG(value) NUM2ULONG(value)
|
209
|
+
|
210
|
+
#define CSTR2RVAL_TAINTED(string, length) \
|
211
|
+
rbgio_cstr_to_rval_tainted((string), (length))
|
212
|
+
#define CSTR2RVAL_TAINTED_FREE(string, length) \
|
213
|
+
rbgio_cstr_to_rval_tainted_free((string), (length))
|
214
|
+
|
215
|
+
#define GLIST2ARY_UNREF_FREE(list) rbgio_glist_to_ary_unref_free(list)
|
216
|
+
|
217
|
+
#define GFDS2ARY(fds) rbgio_fds_to_ary(fds)
|
218
|
+
#define GFDS2ARY_FREE(fds) rbgio_fds_to_ary_free(fds)
|
219
|
+
|
220
|
+
#define GFILEARY2GLIST(ary) rbgio_gfile_ary_to_glist(ary)
|
221
|
+
#define GFILEARY2GLIST_ACCEPT_NIL(ary) rbgio_gfile_ary_to_glist_accept_nil(ary)
|
222
|
+
|
223
|
+
#define STRVECTOR2ARY(vector) rbgio_str_vector_to_ary(vector)
|
224
|
+
#define STRVECTOR2ARY_FREE(vector) rbgio_str_vector_to_ary_free(vector)
|
225
|
+
#define ARY2STRVECTOR(ary) rbgio_ary_to_str_vector(ary)
|
226
|
+
|
227
|
+
G_GNUC_INTERNAL VALUE rbgio_cstr_to_rval_tainted(const char *string,
|
228
|
+
gsize length);
|
229
|
+
G_GNUC_INTERNAL VALUE rbgio_cstr_to_rval_tainted_free(char *string,
|
230
|
+
gsize length);
|
231
|
+
G_GNUC_INTERNAL VALUE rbgio_glist_to_ary_unref_free(GList *list);
|
232
|
+
G_GNUC_INTERNAL VALUE rbgio_fds_to_ary(const gint *fds);
|
233
|
+
G_GNUC_INTERNAL VALUE rbgio_fds_to_ary_free(gint *fds);
|
234
|
+
G_GNUC_INTERNAL GList *rbgio_gfile_ary_to_glist(VALUE ary);
|
235
|
+
G_GNUC_INTERNAL GList *rbgio_gfile_ary_to_glist_accept_nil(VALUE ary);
|
236
|
+
G_GNUC_INTERNAL void rbgio_rval_to_gtimeval(VALUE value, GTimeVal *time);
|
237
|
+
G_GNUC_INTERNAL VALUE rbgio_str_vector_to_ary(const gchar * const *vector);
|
238
|
+
G_GNUC_INTERNAL VALUE rbgio_str_vector_to_ary_free(gchar **vector);
|
239
|
+
G_GNUC_INTERNAL char **rbgio_ary_to_str_vector(VALUE ary);
|
240
|
+
G_GNUC_INTERNAL void rbgio_async_ready_callback(GObject *source,
|
241
|
+
GAsyncResult *result,
|
242
|
+
gpointer data);
|
243
|
+
G_GNUC_INTERNAL VALUE rbgio_child_remove_and_return(VALUE parent, VALUE child);
|
244
|
+
VALUE rbgio_define_domain_error(VALUE module,
|
245
|
+
const char *name,
|
246
|
+
GQuark domain,
|
247
|
+
const char *enum_name,
|
248
|
+
VALUE parent);
|
249
|
+
VALUE rbgio_define_error(VALUE module,
|
250
|
+
const char *name,
|
251
|
+
gint code,
|
252
|
+
VALUE domain_error);
|
253
|
+
NORETURN(void rbgio_raise_error(GError *error));
|
254
|
+
GObject *rbgio_ginitable_new(GType type, VALUE parameters, VALUE cancellable);
|
255
|
+
void rbgio_gasyncinitable_new_async(GType type,
|
256
|
+
VALUE parameters,
|
257
|
+
VALUE io_priority,
|
258
|
+
VALUE cancellable,
|
259
|
+
VALUE block);
|
260
|
+
|
261
|
+
G_GNUC_INTERNAL void Init_gappinfo(VALUE glib);
|
262
|
+
G_GNUC_INTERNAL void Init_gapplaunchcontext(VALUE glib);
|
263
|
+
G_GNUC_INTERNAL void Init_gasyncinitable(VALUE glib);
|
264
|
+
G_GNUC_INTERNAL void Init_gasyncresult(VALUE glib);
|
265
|
+
G_GNUC_INTERNAL void Init_gbufferedinputstream(VALUE glib);
|
266
|
+
G_GNUC_INTERNAL void Init_gbufferedoutputstream(VALUE glib);
|
267
|
+
G_GNUC_INTERNAL void Init_gcancellable(VALUE glib);
|
268
|
+
G_GNUC_INTERNAL void Init_gcharsetconverter(VALUE glib);
|
269
|
+
G_GNUC_INTERNAL void Init_gcontenttype(VALUE glib);
|
270
|
+
G_GNUC_INTERNAL void Init_gconverter(VALUE glib);
|
271
|
+
G_GNUC_INTERNAL void Init_gconverterinputstream(VALUE glib);
|
272
|
+
G_GNUC_INTERNAL void Init_gconverteroutputstream(VALUE glib);
|
273
|
+
G_GNUC_INTERNAL void Init_gdatainputstream(VALUE glib);
|
274
|
+
G_GNUC_INTERNAL void Init_gdataoutputstream(VALUE glib);
|
275
|
+
G_GNUC_INTERNAL void Init_gdesktopappinfo(VALUE glib);
|
276
|
+
G_GNUC_INTERNAL void Init_gdrive(VALUE glib);
|
277
|
+
G_GNUC_INTERNAL void Init_gemblem(VALUE glib);
|
278
|
+
G_GNUC_INTERNAL void Init_gemblemedicon(VALUE glib);
|
279
|
+
G_GNUC_INTERNAL void Init_gfile(VALUE glib);
|
280
|
+
G_GNUC_INTERNAL void Init_gfileattribute(VALUE glib);
|
281
|
+
G_GNUC_INTERNAL void Init_gfileattributematcher(VALUE glib);
|
282
|
+
G_GNUC_INTERNAL void Init_gfiledescriptorbased(VALUE glib);
|
283
|
+
G_GNUC_INTERNAL void Init_gfileenumerator(VALUE glib);
|
284
|
+
G_GNUC_INTERNAL void Init_gfileicon(VALUE glib);
|
285
|
+
G_GNUC_INTERNAL void Init_gfileinfo(VALUE glib);
|
286
|
+
G_GNUC_INTERNAL void Init_gfileinputstream(VALUE glib);
|
287
|
+
G_GNUC_INTERNAL void Init_gfileiostream(VALUE glib);
|
288
|
+
G_GNUC_INTERNAL void Init_gfilemonitor(VALUE glib);
|
289
|
+
G_GNUC_INTERNAL void Init_gfilenamecompleter(VALUE glib);
|
290
|
+
G_GNUC_INTERNAL void Init_gfileoutputstream(VALUE glib);
|
291
|
+
G_GNUC_INTERNAL void Init_gfilterinputstream(VALUE glib);
|
292
|
+
G_GNUC_INTERNAL void Init_gfilteroutputstream(VALUE glib);
|
293
|
+
G_GNUC_INTERNAL void Init_gicon(VALUE glib);
|
294
|
+
G_GNUC_INTERNAL void Init_ginetaddress(VALUE glib);
|
295
|
+
G_GNUC_INTERNAL void Init_ginetsocketaddress(VALUE glib);
|
296
|
+
G_GNUC_INTERNAL void Init_ginitable(VALUE glib);
|
297
|
+
G_GNUC_INTERNAL void Init_ginputstream(VALUE glib);
|
298
|
+
G_GNUC_INTERNAL void Init_gioerror(VALUE glib);
|
299
|
+
G_GNUC_INTERNAL void Init_giomodule(VALUE glib);
|
300
|
+
G_GNUC_INTERNAL void Init_gioscheduler(VALUE glib);
|
301
|
+
G_GNUC_INTERNAL void Init_giostream(VALUE glib);
|
302
|
+
G_GNUC_INTERNAL void Init_gloadableicon(VALUE glib);
|
303
|
+
G_GNUC_INTERNAL void Init_gmemoryinputstream(VALUE glib);
|
304
|
+
G_GNUC_INTERNAL void Init_gmemoryoutputstream(VALUE glib);
|
305
|
+
G_GNUC_INTERNAL void Init_gmount(VALUE glib);
|
306
|
+
G_GNUC_INTERNAL void Init_gmountoperation(VALUE glib);
|
307
|
+
G_GNUC_INTERNAL void Init_gnetworkaddress(VALUE glib);
|
308
|
+
G_GNUC_INTERNAL void Init_gnetworkservice(VALUE glib);
|
309
|
+
G_GNUC_INTERNAL void Init_goutputstream(VALUE glib);
|
310
|
+
G_GNUC_INTERNAL void Init_gresolver(VALUE glib);
|
311
|
+
G_GNUC_INTERNAL void Init_gseekable(VALUE glib);
|
312
|
+
G_GNUC_INTERNAL void Init_gsimpleasyncresult(VALUE glib);
|
313
|
+
G_GNUC_INTERNAL void Init_gsocket(VALUE glib);
|
314
|
+
G_GNUC_INTERNAL void Init_gsocketaddress(VALUE glib);
|
315
|
+
G_GNUC_INTERNAL void Init_gsocketclient(VALUE glib);
|
316
|
+
G_GNUC_INTERNAL void Init_gsocketconnectable(VALUE glib);
|
317
|
+
G_GNUC_INTERNAL void Init_gsocketconnection(VALUE glib);
|
318
|
+
G_GNUC_INTERNAL void Init_gsocketcontrolmessage(VALUE glib);
|
319
|
+
G_GNUC_INTERNAL void Init_gsocketlistener(VALUE glib);
|
320
|
+
G_GNUC_INTERNAL void Init_gsocketservice(VALUE glib);
|
321
|
+
G_GNUC_INTERNAL void Init_gsrvtarget(VALUE glib);
|
322
|
+
G_GNUC_INTERNAL void Init_gtcpconnection(VALUE glib);
|
323
|
+
G_GNUC_INTERNAL void Init_gthreadedsocketservice(VALUE glib);
|
324
|
+
G_GNUC_INTERNAL void Init_gthemedicon(VALUE glib);
|
325
|
+
G_GNUC_INTERNAL void Init_gunixconnection(VALUE glib);
|
326
|
+
G_GNUC_INTERNAL void Init_gunixfdlist(VALUE glib);
|
327
|
+
G_GNUC_INTERNAL void Init_gunixfdmessage(VALUE glib);
|
328
|
+
G_GNUC_INTERNAL void Init_gunixinputstream(VALUE glib);
|
329
|
+
G_GNUC_INTERNAL void Init_gunixmounts(VALUE glib);
|
330
|
+
G_GNUC_INTERNAL void Init_gunixoutputstream(VALUE glib);
|
331
|
+
G_GNUC_INTERNAL void Init_gunixsocketaddress(VALUE glib);
|
332
|
+
G_GNUC_INTERNAL void Init_gvfs(VALUE glib);
|
333
|
+
G_GNUC_INTERNAL void Init_gvolume(VALUE glib);
|
334
|
+
G_GNUC_INTERNAL void Init_gvolumemonitor(VALUE glib);
|
335
|
+
G_GNUC_INTERNAL void Init_gzlibcompressor(VALUE glib);
|
336
|
+
G_GNUC_INTERNAL void Init_gzlibdecompressor(VALUE glib);
|
337
|
+
G_GNUC_INTERNAL void Init_util(void);
|
338
|
+
|
339
|
+
#ifdef __cplusplus
|
340
|
+
}
|
341
|
+
#endif /* __cplusplus */
|
342
|
+
|
343
|
+
#endif /* GNOMEVFS_H */
|
data/ext/gio2/gioerror.c
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
/* -*- c-file-style: "ruby" -*- */
|
2
|
+
/*
|
3
|
+
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "gio2.h"
|
22
|
+
|
23
|
+
/* NOTE: g_io_error_from_errno doesn’t make sense from Ruby. */
|
24
|
+
|
25
|
+
void
|
26
|
+
Init_gioerror(VALUE glib)
|
27
|
+
{
|
28
|
+
VALUE io, error;
|
29
|
+
|
30
|
+
/* TODO: Is this naming scheme correct/the best? */
|
31
|
+
io = rb_define_module_under(glib, "IO");
|
32
|
+
|
33
|
+
error = rbgio_define_domain_error(io, "Error", G_IO_ERROR, "GIOErrorEnum", rb_eIOError);
|
34
|
+
|
35
|
+
rbgio_define_error(io, "FailedError", G_IO_ERROR_FAILED, error);
|
36
|
+
rbgio_define_error(io, "NotFoundError", G_IO_ERROR_NOT_FOUND, error);
|
37
|
+
rbgio_define_error(io, "ExistsError", G_IO_ERROR_EXISTS, error);
|
38
|
+
rbgio_define_error(io, "IsDirectoryError", G_IO_ERROR_IS_DIRECTORY, error);
|
39
|
+
rbgio_define_error(io, "NotDirectoryError", G_IO_ERROR_NOT_DIRECTORY, error);
|
40
|
+
rbgio_define_error(io, "NotEmptyError", G_IO_ERROR_NOT_EMPTY, error);
|
41
|
+
rbgio_define_error(io, "NotRegularFileError", G_IO_ERROR_NOT_REGULAR_FILE, error);
|
42
|
+
rbgio_define_error(io, "NotSymbolicLinkError", G_IO_ERROR_NOT_SYMBOLIC_LINK, error);
|
43
|
+
rbgio_define_error(io, "NotMountableFileError", G_IO_ERROR_NOT_MOUNTABLE_FILE, error);
|
44
|
+
rbgio_define_error(io, "FilenameTooLongError", G_IO_ERROR_FILENAME_TOO_LONG, error);
|
45
|
+
rbgio_define_error(io, "InvalidFilenameError", G_IO_ERROR_INVALID_FILENAME, error);
|
46
|
+
rbgio_define_error(io, "TooManyLinksError", G_IO_ERROR_TOO_MANY_LINKS, error);
|
47
|
+
rbgio_define_error(io, "NoSpaceError", G_IO_ERROR_NO_SPACE, error);
|
48
|
+
rbgio_define_error(io, "InvalidArgumentError", G_IO_ERROR_INVALID_ARGUMENT, error);
|
49
|
+
rbgio_define_error(io, "PermissionDeniedError", G_IO_ERROR_PERMISSION_DENIED, error);
|
50
|
+
rbgio_define_error(io, "NotSupportedError", G_IO_ERROR_NOT_SUPPORTED, error);
|
51
|
+
rbgio_define_error(io, "NotMountedError", G_IO_ERROR_NOT_MOUNTED, error);
|
52
|
+
rbgio_define_error(io, "AlreadyMountedError", G_IO_ERROR_ALREADY_MOUNTED, error);
|
53
|
+
rbgio_define_error(io, "ClosedError", G_IO_ERROR_CLOSED, error);
|
54
|
+
rbgio_define_error(io, "CancelledError", G_IO_ERROR_CANCELLED, error);
|
55
|
+
rbgio_define_error(io, "PendingError", G_IO_ERROR_PENDING, error);
|
56
|
+
rbgio_define_error(io, "ReadOnlyError", G_IO_ERROR_READ_ONLY, error);
|
57
|
+
rbgio_define_error(io, "CantCreateBackupError", G_IO_ERROR_CANT_CREATE_BACKUP, error);
|
58
|
+
rbgio_define_error(io, "WrongEtagError", G_IO_ERROR_WRONG_ETAG, error);
|
59
|
+
rbgio_define_error(io, "TimedOutError", G_IO_ERROR_TIMED_OUT, error);
|
60
|
+
rbgio_define_error(io, "WouldRecurseError", G_IO_ERROR_WOULD_RECURSE, error);
|
61
|
+
rbgio_define_error(io, "BusyError", G_IO_ERROR_BUSY, error);
|
62
|
+
rbgio_define_error(io, "WouldBlockError", G_IO_ERROR_WOULD_BLOCK, error);
|
63
|
+
rbgio_define_error(io, "HostNotFoundError", G_IO_ERROR_HOST_NOT_FOUND, error);
|
64
|
+
rbgio_define_error(io, "WouldMergeError", G_IO_ERROR_WOULD_MERGE, error);
|
65
|
+
rbgio_define_error(io, "FailedHandledError", G_IO_ERROR_FAILED_HANDLED, error);
|
66
|
+
rbgio_define_error(io, "TooManyOpenFilesError", G_IO_ERROR_TOO_MANY_OPEN_FILES, error);
|
67
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/* -*- c-file-style: "ruby" -*- */
|
2
|
+
/*
|
3
|
+
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "gio2.h"
|
22
|
+
|
23
|
+
#define _SELF(value) G_IO_MODULE(RVAL2GOBJ(value))
|
24
|
+
|
25
|
+
static VALUE
|
26
|
+
iomodule_initialize(VALUE self, VALUE filename)
|
27
|
+
{
|
28
|
+
G_INITIALIZE(self, g_io_module_new(RVAL2CSTR(filename)));
|
29
|
+
|
30
|
+
return Qnil;
|
31
|
+
}
|
32
|
+
|
33
|
+
static VALUE
|
34
|
+
iomodule_load_all_in_directory(G_GNUC_UNUSED VALUE self, VALUE dirname)
|
35
|
+
{
|
36
|
+
return GLIST2ARY_FREE(g_io_modules_load_all_in_directory(RVAL2CSTR(dirname)));
|
37
|
+
}
|
38
|
+
|
39
|
+
static VALUE
|
40
|
+
iomodule_scan_all_in_directory(VALUE self, VALUE dirname)
|
41
|
+
{
|
42
|
+
g_io_modules_scan_all_in_directory(RVAL2CSTR(dirname));
|
43
|
+
|
44
|
+
return self;
|
45
|
+
}
|
46
|
+
|
47
|
+
/* NOTE: No point in implementing g_io_module_query. */
|
48
|
+
|
49
|
+
void
|
50
|
+
Init_giomodule(VALUE glib)
|
51
|
+
{
|
52
|
+
VALUE iomodule, iomodules;
|
53
|
+
|
54
|
+
iomodule = G_DEF_CLASS(G_IO_TYPE_MODULE, "IOModule", glib);
|
55
|
+
|
56
|
+
rb_define_method(iomodule, "initialize", iomodule_initialize, 1);
|
57
|
+
|
58
|
+
iomodules = rb_define_module_under(glib, "IOModules");
|
59
|
+
|
60
|
+
rb_define_module_function(iomodule, "load_all_in_directory", iomodule_load_all_in_directory, 1);
|
61
|
+
rb_define_module_function(iomodule, "scan_all_in_directory", iomodule_scan_all_in_directory, 1);
|
62
|
+
|
63
|
+
}
|