gio2 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/gio2/extconf.rb +4 -42
- data/ext/gio2/gio2.c +18 -117
- data/ext/gio2/gio2.h +20 -339
- data/ext/gio2/rbgio.c +132 -0
- data/ext/gio2/rbgio2.h +156 -0
- data/ext/gio2/rbgio2conversions.h +154 -0
- data/ext/gio2/rbgio2private.h +147 -0
- data/ext/gio2/{gappinfo.c → rbgioappinfo.c} +81 -82
- data/ext/gio2/rbgioapplaunchcontext.c +81 -0
- data/ext/gio2/{gasyncinitable.c → rbgioasyncinitable.c} +33 -30
- data/ext/gio2/rbgioasyncresult.c +41 -0
- data/ext/gio2/{gbufferedinputstream.c → rbgiobufferedinputstream.c} +37 -35
- data/ext/gio2/rbgiobufferedoutputstream.c +50 -0
- data/ext/gio2/rbgiocancellable.c +180 -0
- data/ext/gio2/rbgiocharsetconverter.c +57 -0
- data/ext/gio2/rbgiocontenttype.c +131 -0
- data/ext/gio2/{gconverter.c → rbgioconverter.c} +24 -28
- data/ext/gio2/rbgioconverterinputstream.c +43 -0
- data/ext/gio2/rbgioconverteroutputstream.c +43 -0
- data/ext/gio2/{gdatainputstream.c → rbgiodatainputstream.c} +49 -58
- data/ext/gio2/{gdataoutputstream.c → rbgiodataoutputstream.c} +39 -37
- data/ext/gio2/rbgiodesktopappinfo.c +87 -0
- data/ext/gio2/{gdrive.c → rbgiodrive.c} +75 -76
- data/ext/gio2/rbgioemblem.c +52 -0
- data/ext/gio2/rbgioemblemedicon.c +65 -0
- data/ext/gio2/{gfile.c → rbgiofile.c} +256 -266
- data/ext/gio2/rbgiofileattribute.c +114 -0
- data/ext/gio2/rbgiofileattributeinfo.c +86 -0
- data/ext/gio2/rbgiofileattributeinfolist.c +106 -0
- data/ext/gio2/rbgiofileattributematcher.c +93 -0
- data/ext/gio2/rbgiofiledescriptorbased.c +45 -0
- data/ext/gio2/{gfileenumerator.c → rbgiofileenumerator.c} +42 -40
- data/ext/gio2/rbgiofileicon.c +41 -0
- data/ext/gio2/{gfileinfo.c → rbgiofileinfo.c} +159 -163
- data/ext/gio2/{gfileinputstream.c → rbgiofileinputstream.c} +26 -25
- data/ext/gio2/{gfileiostream.c → rbgiofileiostream.c} +28 -26
- data/ext/gio2/rbgiofilemonitor.c +46 -0
- data/ext/gio2/rbgiofilenamecompleter.c +74 -0
- data/ext/gio2/{gfileoutputstream.c → rbgiofileoutputstream.c} +28 -26
- data/ext/gio2/rbgiofilterinputstream.c +28 -0
- data/ext/gio2/rbgiofilteroutputstream.c +28 -0
- data/ext/gio2/rbgioicon.c +69 -0
- data/ext/gio2/rbgioinetaddress.c +118 -0
- data/ext/gio2/rbgioinetsocketaddress.c +41 -0
- data/ext/gio2/{ginitable.c → rbgioinitable.c} +29 -25
- data/ext/gio2/{ginputstream.c → rbgioinputstream.c} +50 -48
- data/ext/gio2/rbgioio.c +73 -0
- data/ext/gio2/rbgioiomodule.c +45 -0
- data/ext/gio2/rbgioiomodules.c +47 -0
- data/ext/gio2/rbgioioscheduler.c +102 -0
- data/ext/gio2/rbgioioschedulerjob.c +121 -0
- data/ext/gio2/rbgioiostream.c +108 -0
- data/ext/gio2/{gloadableicon.c → rbgioloadableicon.c} +26 -24
- data/ext/gio2/rbgiomemoryinputstream.c +67 -0
- data/ext/gio2/rbgiomemoryoutputstream.c +44 -0
- data/ext/gio2/{gmount.c → rbgiomount.c} +70 -68
- data/ext/gio2/rbgiomountoperation.c +53 -0
- data/ext/gio2/rbgionetworkaddress.c +59 -0
- data/ext/gio2/rbgionetworkservice.c +45 -0
- data/ext/gio2/{goutputstream.c → rbgiooutputstream.c} +61 -62
- data/ext/gio2/{gresolver.c → rbgioresolver.c} +50 -48
- data/ext/gio2/rbgioseekable.c +91 -0
- data/ext/gio2/rbgiosimpleasyncresult.c +155 -0
- data/ext/gio2/{gsocket.c → rbgiosocket.c} +74 -76
- data/ext/gio2/rbgiosocketaddress.c +34 -0
- data/ext/gio2/rbgiosocketaddressenumerator.c +83 -0
- data/ext/gio2/{gsocketclient.c → rbgiosocketclient.c} +41 -39
- data/ext/gio2/rbgiosocketconnectable.c +41 -0
- data/ext/gio2/rbgiosocketconnection.c +66 -0
- data/ext/gio2/rbgiosocketconnectionfactory.c +39 -0
- data/ext/gio2/rbgiosocketcontrolmessage.c +82 -0
- data/ext/gio2/{gsocketlistener.c → rbgiosocketlistener.c} +49 -47
- data/ext/gio2/rbgiosocketservice.c +66 -0
- data/ext/gio2/rbgiosrvtarget.c +76 -0
- data/ext/gio2/rbgiotcpconnection.c +28 -0
- data/ext/gio2/rbgiothemedicon.c +83 -0
- data/ext/gio2/rbgiothreadedsocketservice.c +43 -0
- data/ext/gio2/rbgiounixconnection.c +71 -0
- data/ext/gio2/rbgiounixfdlist.c +115 -0
- data/ext/gio2/rbgiounixfdmessage.c +74 -0
- data/ext/gio2/rbgiounixinputstream.c +51 -0
- data/ext/gio2/rbgiounixmount.c +164 -0
- data/ext/gio2/rbgiounixmountmonitor.c +66 -0
- data/ext/gio2/rbgiounixmountpoint.c +136 -0
- data/ext/gio2/rbgiounixmountpoints.c +58 -0
- data/ext/gio2/rbgiounixmounts.c +58 -0
- data/ext/gio2/rbgiounixoutputstream.c +51 -0
- data/ext/gio2/rbgiounixsocketaddress.c +69 -0
- data/ext/gio2/rbgiovfs.c +84 -0
- data/ext/gio2/rbgiovolume.c +193 -0
- data/ext/gio2/rbgiovolumemonitor.c +77 -0
- data/ext/gio2/rbgiozlibcompressor.c +52 -0
- data/ext/gio2/rbgiozlibdecompressor.c +45 -0
- data/ext/gio2/util.c +57 -60
- data/lib/1.8/gio2.so +0 -0
- data/lib/1.9/gio2.so +0 -0
- data/lib/gio2/deprecated.rb +102 -0
- data/lib/gio2.rb +14 -12
- metadata +100 -88
- data/ChangeLog +0 -129
- data/ext/gio2/gapplaunchcontext.c +0 -79
- data/ext/gio2/gasyncresult.c +0 -39
- data/ext/gio2/gbufferedoutputstream.c +0 -48
- data/ext/gio2/gcancellable.c +0 -177
- data/ext/gio2/gcharsetconverter.c +0 -55
- data/ext/gio2/gcontenttype.c +0 -128
- data/ext/gio2/gconverterinputstream.c +0 -41
- data/ext/gio2/gconverteroutputstream.c +0 -41
- data/ext/gio2/gdesktopappinfo.c +0 -88
- data/ext/gio2/gemblem.c +0 -52
- data/ext/gio2/gemblemedicon.c +0 -63
- data/ext/gio2/gfileattribute.c +0 -111
- data/ext/gio2/gfileattributeinfo.c +0 -89
- data/ext/gio2/gfileattributeinfolist.c +0 -109
- data/ext/gio2/gfileattributematcher.c +0 -90
- data/ext/gio2/gfiledescriptorbased.c +0 -42
- data/ext/gio2/gfileicon.c +0 -39
- data/ext/gio2/gfilemonitor.c +0 -44
- data/ext/gio2/gfilenamecompleter.c +0 -72
- data/ext/gio2/gfilterinputstream.c +0 -27
- data/ext/gio2/gfilteroutputstream.c +0 -27
- data/ext/gio2/gicon.c +0 -67
- data/ext/gio2/ginetaddress.c +0 -116
- data/ext/gio2/ginetsocketaddress.c +0 -38
- data/ext/gio2/gioerror.c +0 -70
- data/ext/gio2/giomodule.c +0 -63
- data/ext/gio2/gioscheduler.c +0 -193
- data/ext/gio2/giostream.c +0 -106
- data/ext/gio2/gmemoryinputstream.c +0 -65
- data/ext/gio2/gmemoryoutputstream.c +0 -41
- data/ext/gio2/gmountoperation.c +0 -66
- data/ext/gio2/gnetworkaddress.c +0 -57
- data/ext/gio2/gnetworkservice.c +0 -43
- data/ext/gio2/gseekable.c +0 -89
- data/ext/gio2/gsimpleasyncresult.c +0 -153
- data/ext/gio2/gsocketaddress.c +0 -33
- data/ext/gio2/gsocketconnectable.c +0 -97
- data/ext/gio2/gsocketconnection.c +0 -75
- data/ext/gio2/gsocketcontrolmessage.c +0 -80
- data/ext/gio2/gsocketservice.c +0 -64
- data/ext/gio2/gsrvtarget.c +0 -77
- data/ext/gio2/gtcpconnection.c +0 -27
- data/ext/gio2/gthemedicon.c +0 -81
- data/ext/gio2/gthreadedsocketservice.c +0 -40
- data/ext/gio2/gunixconnection.c +0 -69
- data/ext/gio2/gunixfdlist.c +0 -112
- data/ext/gio2/gunixfdmessage.c +0 -72
- data/ext/gio2/gunixinputstream.c +0 -49
- data/ext/gio2/gunixmounts.c +0 -343
- data/ext/gio2/gunixoutputstream.c +0 -49
- data/ext/gio2/gunixsocketaddress.c +0 -67
- data/ext/gio2/gvfs.c +0 -82
- data/ext/gio2/gvolume.c +0 -191
- data/ext/gio2/gvolumemonitor.c +0 -75
- data/ext/gio2/gzlibcompressor.c +0 -50
- data/ext/gio2/gzlibdecompressor.c +0 -43
@@ -0,0 +1,43 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
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, or (at your option) any later version.
|
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., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbgio2private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cConverterOutputStream
|
25
|
+
#define _SELF(value) RVAL2GCONVERTEROUTPUTSTREAM(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self, VALUE base_stream, VALUE converter)
|
29
|
+
{
|
30
|
+
G_INITIALIZE(self,
|
31
|
+
g_converter_output_stream_new(RVAL2GOUTPUTSTREAM(base_stream),
|
32
|
+
RVAL2GCONVERTER(converter)));
|
33
|
+
|
34
|
+
return Qnil;
|
35
|
+
}
|
36
|
+
|
37
|
+
void
|
38
|
+
Init_gconverteroutputstream(VALUE mGio)
|
39
|
+
{
|
40
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CONVERTER_OUTPUT_STREAM, "ConverterOutputStream", mGio);
|
41
|
+
|
42
|
+
RG_DEF_METHOD(initialize, 2);
|
43
|
+
}
|
@@ -1,32 +1,31 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
4
|
-
*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
5
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
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, or (at your option) any later version.
|
10
10
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
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
15
|
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
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., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
19
20
|
*/
|
20
21
|
|
21
|
-
#include "
|
22
|
+
#include "rbgio2private.h"
|
22
23
|
|
23
|
-
#define
|
24
|
-
|
25
|
-
#define RVAL2GDATASTREAMNEWLINETYPE(value) \
|
26
|
-
GENUM2RVAL((value), G_TYPE_DATA_STREAM_NEWLINE_TYPE)
|
24
|
+
#define RG_TARGET_NAMESPACE cDataInputStream
|
25
|
+
#define _SELF(value) RVAL2GDATAINPUTSTREAM(value)
|
27
26
|
|
28
27
|
static VALUE
|
29
|
-
|
28
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
30
29
|
{
|
31
30
|
VALUE base_stream, byte_order, newline_type;
|
32
31
|
|
@@ -46,7 +45,7 @@ datainputstream_initialize(int argc, VALUE *argv, VALUE self)
|
|
46
45
|
}
|
47
46
|
|
48
47
|
static VALUE
|
49
|
-
|
48
|
+
rg_read_byte(int argc, VALUE *argv, VALUE self)
|
50
49
|
{
|
51
50
|
VALUE cancellable;
|
52
51
|
GError *error = NULL;
|
@@ -63,7 +62,7 @@ datainputstream_read_byte(int argc, VALUE *argv, VALUE self)
|
|
63
62
|
}
|
64
63
|
|
65
64
|
static VALUE
|
66
|
-
|
65
|
+
rg_read_int16(int argc, VALUE *argv, VALUE self)
|
67
66
|
{
|
68
67
|
VALUE cancellable;
|
69
68
|
GError *error = NULL;
|
@@ -80,7 +79,7 @@ datainputstream_read_int16(int argc, VALUE *argv, VALUE self)
|
|
80
79
|
}
|
81
80
|
|
82
81
|
static VALUE
|
83
|
-
|
82
|
+
rg_read_uint16(int argc, VALUE *argv, VALUE self)
|
84
83
|
{
|
85
84
|
VALUE cancellable;
|
86
85
|
GError *error = NULL;
|
@@ -97,7 +96,7 @@ datainputstream_read_uint16(int argc, VALUE *argv, VALUE self)
|
|
97
96
|
}
|
98
97
|
|
99
98
|
static VALUE
|
100
|
-
|
99
|
+
rg_read_int32(int argc, VALUE *argv, VALUE self)
|
101
100
|
{
|
102
101
|
VALUE cancellable;
|
103
102
|
GError *error = NULL;
|
@@ -114,7 +113,7 @@ datainputstream_read_int32(int argc, VALUE *argv, VALUE self)
|
|
114
113
|
}
|
115
114
|
|
116
115
|
static VALUE
|
117
|
-
|
116
|
+
rg_read_uint32(int argc, VALUE *argv, VALUE self)
|
118
117
|
{
|
119
118
|
VALUE cancellable;
|
120
119
|
GError *error = NULL;
|
@@ -131,7 +130,7 @@ datainputstream_read_uint32(int argc, VALUE *argv, VALUE self)
|
|
131
130
|
}
|
132
131
|
|
133
132
|
static VALUE
|
134
|
-
|
133
|
+
rg_read_int64(int argc, VALUE *argv, VALUE self)
|
135
134
|
{
|
136
135
|
VALUE cancellable;
|
137
136
|
GError *error = NULL;
|
@@ -148,7 +147,7 @@ datainputstream_read_int64(int argc, VALUE *argv, VALUE self)
|
|
148
147
|
}
|
149
148
|
|
150
149
|
static VALUE
|
151
|
-
|
150
|
+
rg_read_uint64(int argc, VALUE *argv, VALUE self)
|
152
151
|
{
|
153
152
|
VALUE cancellable;
|
154
153
|
GError *error = NULL;
|
@@ -165,7 +164,7 @@ datainputstream_read_uint64(int argc, VALUE *argv, VALUE self)
|
|
165
164
|
}
|
166
165
|
|
167
166
|
static VALUE
|
168
|
-
|
167
|
+
rg_read_line(int argc, VALUE *argv, VALUE self)
|
169
168
|
{
|
170
169
|
VALUE cancellable;
|
171
170
|
gsize length;
|
@@ -184,7 +183,7 @@ datainputstream_read_line(int argc, VALUE *argv, VALUE self)
|
|
184
183
|
}
|
185
184
|
|
186
185
|
static VALUE
|
187
|
-
|
186
|
+
rg_read_line_async(int argc, VALUE *argv, VALUE self)
|
188
187
|
{
|
189
188
|
VALUE rbio_priority, rbcancellable, block;
|
190
189
|
int io_priority;
|
@@ -204,7 +203,7 @@ datainputstream_read_line_async(int argc, VALUE *argv, VALUE self)
|
|
204
203
|
}
|
205
204
|
|
206
205
|
static VALUE
|
207
|
-
|
206
|
+
rg_read_line_finish(VALUE self, VALUE result)
|
208
207
|
{
|
209
208
|
GError *error = NULL;
|
210
209
|
gsize length;
|
@@ -222,7 +221,7 @@ datainputstream_read_line_finish(VALUE self, VALUE result)
|
|
222
221
|
|
223
222
|
#if GLIB_CHECK_VERSION(2, 26, 0)
|
224
223
|
static VALUE
|
225
|
-
|
224
|
+
rg_read_upto(int argc, VALUE *argv, VALUE self)
|
226
225
|
{
|
227
226
|
VALUE rbstop_chars, cancellable;
|
228
227
|
const char *stop_chars;
|
@@ -245,7 +244,7 @@ datainputstream_read_upto(int argc, VALUE *argv, VALUE self)
|
|
245
244
|
}
|
246
245
|
|
247
246
|
static VALUE
|
248
|
-
|
247
|
+
rg_read_upto_async(int argc, VALUE *argv, VALUE self)
|
249
248
|
{
|
250
249
|
VALUE rbstop_chars, rbcancellable, rbio_priority, block;
|
251
250
|
const char *stop_chars;
|
@@ -269,7 +268,7 @@ datainputstream_read_upto_async(int argc, VALUE *argv, VALUE self)
|
|
269
268
|
}
|
270
269
|
|
271
270
|
static VALUE
|
272
|
-
|
271
|
+
rg_read_upto_finish(VALUE self, VALUE result)
|
273
272
|
{
|
274
273
|
GError *error = NULL;
|
275
274
|
gsize length;
|
@@ -287,32 +286,24 @@ datainputstream_read_upto_finish(VALUE self, VALUE result)
|
|
287
286
|
#endif
|
288
287
|
|
289
288
|
void
|
290
|
-
Init_gdatainputstream(VALUE
|
289
|
+
Init_gdatainputstream(VALUE mGio)
|
291
290
|
{
|
292
|
-
VALUE
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
rb_define_method(datainputstream, "read_uint16", datainputstream_read_uint16, -1);
|
306
|
-
rb_define_method(datainputstream, "read_int32", datainputstream_read_int32, -1);
|
307
|
-
rb_define_method(datainputstream, "read_uint32", datainputstream_read_uint32, -1);
|
308
|
-
rb_define_method(datainputstream, "read_int64", datainputstream_read_int64, -1);
|
309
|
-
rb_define_method(datainputstream, "read_uint64", datainputstream_read_uint64, -1);
|
310
|
-
rb_define_method(datainputstream, "read_line", datainputstream_read_line, -1);
|
311
|
-
rb_define_method(datainputstream, "read_line_async", datainputstream_read_line_async, -1);
|
312
|
-
rb_define_method(datainputstream, "read_line_finish", datainputstream_read_line_finish, 1);
|
291
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATA_INPUT_STREAM, "DataInputStream", mGio);
|
292
|
+
|
293
|
+
RG_DEF_METHOD(initialize, -1);
|
294
|
+
RG_DEF_METHOD(read_byte, -1);
|
295
|
+
RG_DEF_METHOD(read_int16, -1);
|
296
|
+
RG_DEF_METHOD(read_uint16, -1);
|
297
|
+
RG_DEF_METHOD(read_int32, -1);
|
298
|
+
RG_DEF_METHOD(read_uint32, -1);
|
299
|
+
RG_DEF_METHOD(read_int64, -1);
|
300
|
+
RG_DEF_METHOD(read_uint64, -1);
|
301
|
+
RG_DEF_METHOD(read_line, -1);
|
302
|
+
RG_DEF_METHOD(read_line_async, -1);
|
303
|
+
RG_DEF_METHOD(read_line_finish, 1);
|
313
304
|
#if GLIB_CHECK_VERSION(2, 26, 0)
|
314
|
-
|
315
|
-
|
316
|
-
|
305
|
+
RG_DEF_METHOD(read_upto, -1);
|
306
|
+
RG_DEF_METHOD(read_upto_async, -1);
|
307
|
+
RG_DEF_METHOD(read_upto_finish, 1);
|
317
308
|
#endif
|
318
309
|
}
|
@@ -1,29 +1,31 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
4
|
-
*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
5
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
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, or (at your option) any later version.
|
10
10
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
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
15
|
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
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., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
19
20
|
*/
|
20
21
|
|
21
|
-
#include "
|
22
|
+
#include "rbgio2private.h"
|
22
23
|
|
23
|
-
#define
|
24
|
+
#define RG_TARGET_NAMESPACE cDataOutputStream
|
25
|
+
#define _SELF(value) RVAL2GDATAOUTPUTSTREAM(value)
|
24
26
|
|
25
27
|
static VALUE
|
26
|
-
|
28
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
27
29
|
{
|
28
30
|
VALUE base_stream,
|
29
31
|
byte_order;
|
@@ -40,7 +42,7 @@ dataoutputstream_initialize(int argc, VALUE *argv, VALUE self)
|
|
40
42
|
}
|
41
43
|
|
42
44
|
static VALUE
|
43
|
-
|
45
|
+
rg_put_byte(int argc, VALUE *argv, VALUE self)
|
44
46
|
{
|
45
47
|
VALUE value, cancellable;
|
46
48
|
GError *error = NULL;
|
@@ -56,7 +58,7 @@ dataoutputstream_put_byte(int argc, VALUE *argv, VALUE self)
|
|
56
58
|
}
|
57
59
|
|
58
60
|
static VALUE
|
59
|
-
|
61
|
+
rg_put_int16(int argc, VALUE *argv, VALUE self)
|
60
62
|
{
|
61
63
|
VALUE value, cancellable;
|
62
64
|
GError *error = NULL;
|
@@ -72,7 +74,7 @@ dataoutputstream_put_int16(int argc, VALUE *argv, VALUE self)
|
|
72
74
|
}
|
73
75
|
|
74
76
|
static VALUE
|
75
|
-
|
77
|
+
rg_put_uint16(int argc, VALUE *argv, VALUE self)
|
76
78
|
{
|
77
79
|
VALUE value, cancellable;
|
78
80
|
GError *error = NULL;
|
@@ -88,7 +90,7 @@ dataoutputstream_put_uint16(int argc, VALUE *argv, VALUE self)
|
|
88
90
|
}
|
89
91
|
|
90
92
|
static VALUE
|
91
|
-
|
93
|
+
rg_put_int32(int argc, VALUE *argv, VALUE self)
|
92
94
|
{
|
93
95
|
VALUE value, cancellable;
|
94
96
|
GError *error = NULL;
|
@@ -104,7 +106,7 @@ dataoutputstream_put_int32(int argc, VALUE *argv, VALUE self)
|
|
104
106
|
}
|
105
107
|
|
106
108
|
static VALUE
|
107
|
-
|
109
|
+
rg_put_uint32(int argc, VALUE *argv, VALUE self)
|
108
110
|
{
|
109
111
|
VALUE value, cancellable;
|
110
112
|
GError *error = NULL;
|
@@ -120,7 +122,7 @@ dataoutputstream_put_uint32(int argc, VALUE *argv, VALUE self)
|
|
120
122
|
}
|
121
123
|
|
122
124
|
static VALUE
|
123
|
-
|
125
|
+
rg_put_int64(int argc, VALUE *argv, VALUE self)
|
124
126
|
{
|
125
127
|
VALUE value, cancellable;
|
126
128
|
GError *error = NULL;
|
@@ -136,7 +138,7 @@ dataoutputstream_put_int64(int argc, VALUE *argv, VALUE self)
|
|
136
138
|
}
|
137
139
|
|
138
140
|
static VALUE
|
139
|
-
|
141
|
+
rg_put_uint64(int argc, VALUE *argv, VALUE self)
|
140
142
|
{
|
141
143
|
VALUE value, cancellable;
|
142
144
|
GError *error = NULL;
|
@@ -152,7 +154,7 @@ dataoutputstream_put_uint64(int argc, VALUE *argv, VALUE self)
|
|
152
154
|
}
|
153
155
|
|
154
156
|
static VALUE
|
155
|
-
|
157
|
+
rg_put_string(int argc, VALUE *argv, VALUE self)
|
156
158
|
{
|
157
159
|
VALUE value, cancellable;
|
158
160
|
GError *error = NULL;
|
@@ -168,17 +170,17 @@ dataoutputstream_put_string(int argc, VALUE *argv, VALUE self)
|
|
168
170
|
}
|
169
171
|
|
170
172
|
void
|
171
|
-
Init_gdataoutputstream(VALUE
|
173
|
+
Init_gdataoutputstream(VALUE mGio)
|
172
174
|
{
|
173
|
-
VALUE
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
175
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATA_OUTPUT_STREAM, "DataOutputStream", mGio);
|
176
|
+
|
177
|
+
RG_DEF_METHOD(initialize, -1);
|
178
|
+
RG_DEF_METHOD(put_byte, -1);
|
179
|
+
RG_DEF_METHOD(put_int16, -1);
|
180
|
+
RG_DEF_METHOD(put_uint16, -1);
|
181
|
+
RG_DEF_METHOD(put_int32, -1);
|
182
|
+
RG_DEF_METHOD(put_uint32, -1);
|
183
|
+
RG_DEF_METHOD(put_int64, -1);
|
184
|
+
RG_DEF_METHOD(put_uint64, -1);
|
185
|
+
RG_DEF_METHOD(put_string, -1);
|
184
186
|
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
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, or (at your option) any later version.
|
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., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbgio2private.h"
|
23
|
+
|
24
|
+
#ifdef HAVE_GIO_UNIX
|
25
|
+
#include <gio/gdesktopappinfo.h>
|
26
|
+
|
27
|
+
#define RG_TARGET_NAMESPACE cDesktopAppInfo
|
28
|
+
#define _SELF(value) RVAL2GDESKTOPAPPINFO(value)
|
29
|
+
|
30
|
+
static VALUE
|
31
|
+
rg_s_new_from_filename(G_GNUC_UNUSED VALUE self, VALUE filename)
|
32
|
+
{
|
33
|
+
return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_filename(RVAL2CSTR(filename)));
|
34
|
+
}
|
35
|
+
|
36
|
+
static VALUE
|
37
|
+
rg_s_new_from_keyfile(G_GNUC_UNUSED VALUE self, VALUE keyfile)
|
38
|
+
{
|
39
|
+
return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_keyfile(RVAL2GKEYFILE(keyfile)));
|
40
|
+
}
|
41
|
+
|
42
|
+
static VALUE
|
43
|
+
rg_initialize(VALUE self, VALUE desktop_id)
|
44
|
+
{
|
45
|
+
G_INITIALIZE(self, g_desktop_app_info_new(RVAL2CSTR(desktop_id)));
|
46
|
+
|
47
|
+
return Qnil;
|
48
|
+
}
|
49
|
+
|
50
|
+
static VALUE
|
51
|
+
rg_filename(VALUE self)
|
52
|
+
{
|
53
|
+
return CSTR2RVAL(g_desktop_app_info_get_filename(_SELF(self)));
|
54
|
+
}
|
55
|
+
|
56
|
+
static VALUE
|
57
|
+
rg_hidden_p(VALUE self)
|
58
|
+
{
|
59
|
+
return CBOOL2RVAL(g_desktop_app_info_get_is_hidden(_SELF(self)));
|
60
|
+
}
|
61
|
+
|
62
|
+
static VALUE
|
63
|
+
rg_s_set_desktop_env(G_GNUC_UNUSED VALUE self, VALUE desktop_env)
|
64
|
+
{
|
65
|
+
g_desktop_app_info_set_desktop_env(RVAL2CSTR(desktop_env));
|
66
|
+
|
67
|
+
return self;
|
68
|
+
}
|
69
|
+
|
70
|
+
/* TODO: g_desktop_app_info_lookup_get_default_for_uri_scheme ()? */
|
71
|
+
#endif
|
72
|
+
|
73
|
+
void
|
74
|
+
Init_gdesktopappinfo(G_GNUC_UNUSED VALUE mGio)
|
75
|
+
{
|
76
|
+
#ifdef HAVE_GIO_UNIX
|
77
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DESKTOP_APP_INFO, "DesktopAppInfo", mGio);
|
78
|
+
|
79
|
+
RG_DEF_SMETHOD(new_from_filename, 1);
|
80
|
+
RG_DEF_SMETHOD(new_from_keyfile, 1);
|
81
|
+
RG_DEF_SMETHOD(set_desktop_env, 1);
|
82
|
+
|
83
|
+
RG_DEF_METHOD(initialize, 1);
|
84
|
+
RG_DEF_METHOD(filename, 0);
|
85
|
+
RG_DEF_METHOD_P(hidden, 0);
|
86
|
+
#endif
|
87
|
+
}
|