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,121 @@
|
|
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 G_TYPE_IO_SCHEDULER_JOB (g_io_scheduler_job_get_type())
|
25
|
+
|
26
|
+
#define RVAL2GIOSCHEDULERJOB(object) \
|
27
|
+
((GIOSchedulerJob *)(RVAL2BOXED(object, G_TYPE_IO_SCHEDULER_JOB)))
|
28
|
+
|
29
|
+
#define GIOSCHEDULERJOB2RVAL(object) \
|
30
|
+
BOXED2RVAL(object, G_TYPE_IO_SCHEDULER_JOB)
|
31
|
+
|
32
|
+
#define RG_TARGET_NAMESPACE cIOSchedulerJob
|
33
|
+
#define _SELF(value) RVAL2GIOSCHEDULERJOB(value)
|
34
|
+
|
35
|
+
static GIOSchedulerJob *
|
36
|
+
ioschedulerjob_copy(const GIOSchedulerJob *job)
|
37
|
+
{
|
38
|
+
return (GIOSchedulerJob *)job;
|
39
|
+
}
|
40
|
+
|
41
|
+
static void
|
42
|
+
ioschedulerjob_free(G_GNUC_UNUSED GIOSchedulerJob *job)
|
43
|
+
{
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
static GType
|
48
|
+
g_io_scheduler_job_get_type(void)
|
49
|
+
{
|
50
|
+
static GType our_type = 0;
|
51
|
+
|
52
|
+
if (our_type == 0)
|
53
|
+
our_type = g_boxed_type_register_static("GIOSchedulerJob",
|
54
|
+
(GBoxedCopyFunc)ioschedulerjob_copy,
|
55
|
+
(GBoxedFreeFunc)ioschedulerjob_free);
|
56
|
+
|
57
|
+
return our_type;
|
58
|
+
}
|
59
|
+
|
60
|
+
static VALUE
|
61
|
+
ioscheduler_source_callback_call(VALUE data)
|
62
|
+
{
|
63
|
+
static VALUE s_id_call;
|
64
|
+
|
65
|
+
if (s_id_call == 0)
|
66
|
+
s_id_call = rb_intern("call");
|
67
|
+
|
68
|
+
return rb_funcall(USE_BLOCK_AND_SAVE(data), s_id_call, 0);
|
69
|
+
}
|
70
|
+
|
71
|
+
static gboolean
|
72
|
+
ioscheduler_source_callback(gpointer data)
|
73
|
+
{
|
74
|
+
return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_source_callback_call,
|
75
|
+
data));
|
76
|
+
}
|
77
|
+
|
78
|
+
static void
|
79
|
+
ioscheduler_source_callback_free(gpointer data)
|
80
|
+
{
|
81
|
+
USE_BLOCK(data);
|
82
|
+
}
|
83
|
+
|
84
|
+
static VALUE
|
85
|
+
rg_send_to_mainloop(VALUE self)
|
86
|
+
{
|
87
|
+
VALUE block;
|
88
|
+
|
89
|
+
block = rb_block_proc();
|
90
|
+
SAVE_BLOCK(block);
|
91
|
+
|
92
|
+
return CBOOL2RVAL(g_io_scheduler_job_send_to_mainloop(_SELF(self),
|
93
|
+
ioscheduler_source_callback,
|
94
|
+
(gpointer)block,
|
95
|
+
ioscheduler_source_callback_free));
|
96
|
+
}
|
97
|
+
|
98
|
+
static VALUE
|
99
|
+
rg_send_to_mainloop_async(VALUE self)
|
100
|
+
{
|
101
|
+
VALUE block;
|
102
|
+
|
103
|
+
block = rb_block_proc();
|
104
|
+
SAVE_BLOCK(block);
|
105
|
+
|
106
|
+
g_io_scheduler_job_send_to_mainloop_async(_SELF(self),
|
107
|
+
ioscheduler_source_callback,
|
108
|
+
(gpointer)block,
|
109
|
+
ioscheduler_source_callback_free);
|
110
|
+
|
111
|
+
return self;
|
112
|
+
}
|
113
|
+
|
114
|
+
void
|
115
|
+
Init_gioschedulerjob(VALUE mGio)
|
116
|
+
{
|
117
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_SCHEDULER_JOB, "IOSchedulerJob", mGio);
|
118
|
+
|
119
|
+
RG_DEF_METHOD(send_to_mainloop, 0);
|
120
|
+
RG_DEF_METHOD(send_to_mainloop_async, 0);
|
121
|
+
}
|
@@ -0,0 +1,108 @@
|
|
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 cIOStream
|
25
|
+
#define _SELF(value) RVAL2GIOSTREAM(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_close(VALUE self, VALUE cancellable)
|
29
|
+
{
|
30
|
+
GError *error = NULL;
|
31
|
+
|
32
|
+
if (!g_io_stream_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
|
33
|
+
rbgio_raise_error(error);
|
34
|
+
|
35
|
+
return self;
|
36
|
+
}
|
37
|
+
|
38
|
+
static VALUE
|
39
|
+
rg_close_async(int argc, VALUE *argv, VALUE self)
|
40
|
+
{
|
41
|
+
VALUE rbio_priority, rbcancellable, block;
|
42
|
+
int io_priority;
|
43
|
+
GCancellable *cancellable;
|
44
|
+
|
45
|
+
rb_scan_args(argc, argv, "01&", &rbio_priority, &rbcancellable, &block);
|
46
|
+
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
47
|
+
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
48
|
+
SAVE_BLOCK(block);
|
49
|
+
g_io_stream_close_async(_SELF(self),
|
50
|
+
io_priority,
|
51
|
+
cancellable,
|
52
|
+
rbgio_async_ready_callback,
|
53
|
+
(gpointer)block);
|
54
|
+
|
55
|
+
return self;
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
rg_close_finish(VALUE self, VALUE result)
|
60
|
+
{
|
61
|
+
GError *error = NULL;
|
62
|
+
|
63
|
+
if (!g_io_stream_close_finish(_SELF(self),
|
64
|
+
RVAL2GASYNCRESULT(result),
|
65
|
+
&error))
|
66
|
+
rbgio_raise_error(error);
|
67
|
+
|
68
|
+
return self;
|
69
|
+
}
|
70
|
+
|
71
|
+
static VALUE
|
72
|
+
rg_has_pending_p(VALUE self)
|
73
|
+
{
|
74
|
+
return CBOOL2RVAL(g_io_stream_has_pending(_SELF(self)));
|
75
|
+
}
|
76
|
+
|
77
|
+
static VALUE
|
78
|
+
rg_set_pending(VALUE self)
|
79
|
+
{
|
80
|
+
GError *error = NULL;
|
81
|
+
|
82
|
+
if (!g_io_stream_set_pending(_SELF(self), &error))
|
83
|
+
rbgio_raise_error(error);
|
84
|
+
|
85
|
+
return self;
|
86
|
+
}
|
87
|
+
|
88
|
+
static VALUE
|
89
|
+
rg_clear_pending(VALUE self)
|
90
|
+
{
|
91
|
+
g_io_stream_clear_pending(_SELF(self));
|
92
|
+
|
93
|
+
return self;
|
94
|
+
}
|
95
|
+
|
96
|
+
void
|
97
|
+
Init_giostream(VALUE mGio)
|
98
|
+
{
|
99
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", mGio);
|
100
|
+
|
101
|
+
RG_DEF_METHOD(close, 1);
|
102
|
+
RG_DEF_METHOD(close_async, -1);
|
103
|
+
RG_DEF_METHOD(close_finish, 1);
|
104
|
+
RG_DEF_METHOD_P(has_pending, 0);
|
105
|
+
RG_DEF_METHOD(set_pending, 0);
|
106
|
+
G_DEF_SETTER(RG_TARGET_NAMESPACE, "pending");
|
107
|
+
RG_DEF_METHOD(clear_pending, 0);
|
108
|
+
}
|
@@ -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 mLoadableIcon
|
25
|
+
#define _SELF(value) RVAL2GLOADABLEICON(value)
|
24
26
|
|
25
27
|
static VALUE
|
26
|
-
|
28
|
+
rg_load(int argc, VALUE *argv, VALUE self)
|
27
29
|
{
|
28
30
|
VALUE size, cancellable;
|
29
31
|
char *type;
|
@@ -43,7 +45,7 @@ loadableicon_load(int argc, VALUE *argv, VALUE self)
|
|
43
45
|
}
|
44
46
|
|
45
47
|
static VALUE
|
46
|
-
|
48
|
+
rg_load_async(int argc, VALUE *argv, VALUE self)
|
47
49
|
{
|
48
50
|
VALUE rbsize, rbcancellable, block;
|
49
51
|
int size;
|
@@ -63,7 +65,7 @@ loadableicon_load_async(int argc, VALUE *argv, VALUE self)
|
|
63
65
|
}
|
64
66
|
|
65
67
|
static VALUE
|
66
|
-
|
68
|
+
rg_load_finish(VALUE self, VALUE result)
|
67
69
|
{
|
68
70
|
char *type;
|
69
71
|
GError *error = NULL;
|
@@ -80,11 +82,11 @@ loadableicon_load_finish(VALUE self, VALUE result)
|
|
80
82
|
}
|
81
83
|
|
82
84
|
void
|
83
|
-
Init_gloadableicon(VALUE
|
85
|
+
Init_gloadableicon(VALUE mGio)
|
84
86
|
{
|
85
|
-
VALUE
|
87
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_LOADABLE_ICON, "LoadableIcon", mGio);
|
86
88
|
|
87
|
-
|
88
|
-
|
89
|
-
|
89
|
+
RG_DEF_METHOD(load, -1);
|
90
|
+
RG_DEF_METHOD(load_async, -1);
|
91
|
+
RG_DEF_METHOD(load_finish, 1);
|
90
92
|
}
|
@@ -0,0 +1,67 @@
|
|
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 cMemoryInputStream
|
25
|
+
#define _SELF(value) RVAL2GMEMORYINPUTSTREAM(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
29
|
+
{
|
30
|
+
VALUE data;
|
31
|
+
|
32
|
+
rb_scan_args(argc, argv, "01", &data);
|
33
|
+
if (NIL_P(data)) {
|
34
|
+
G_INITIALIZE(self, g_memory_input_stream_new());
|
35
|
+
return Qnil;
|
36
|
+
}
|
37
|
+
|
38
|
+
StringValue(data);
|
39
|
+
G_RELATIVE(self, data);
|
40
|
+
G_INITIALIZE(self, g_memory_input_stream_new_from_data(RSTRING_PTR(data),
|
41
|
+
RSTRING_LEN(data),
|
42
|
+
NULL));
|
43
|
+
|
44
|
+
return Qnil;
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rg_add_data(VALUE self, VALUE data)
|
49
|
+
{
|
50
|
+
StringValue(data);
|
51
|
+
G_RELATIVE(self, data);
|
52
|
+
g_memory_input_stream_add_data(_SELF(self),
|
53
|
+
RSTRING_PTR(data),
|
54
|
+
RSTRING_LEN(data),
|
55
|
+
NULL);
|
56
|
+
|
57
|
+
return self;
|
58
|
+
}
|
59
|
+
|
60
|
+
void
|
61
|
+
Init_gmemoryinputstream(VALUE mGio)
|
62
|
+
{
|
63
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_INPUT_STREAM, "MemoryInputStream", mGio);
|
64
|
+
|
65
|
+
RG_DEF_METHOD(initialize, -1);
|
66
|
+
RG_DEF_METHOD(add_data, 1);
|
67
|
+
}
|
@@ -0,0 +1,44 @@
|
|
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 cMemoryOutputStream
|
25
|
+
|
26
|
+
/* TODO: Take string argument? */
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self)
|
29
|
+
{
|
30
|
+
G_INITIALIZE(self, g_memory_output_stream_new(NULL,
|
31
|
+
0,
|
32
|
+
g_realloc,
|
33
|
+
g_free));
|
34
|
+
|
35
|
+
return Qnil;
|
36
|
+
}
|
37
|
+
|
38
|
+
void
|
39
|
+
Init_gmemoryoutputstream(VALUE mGio)
|
40
|
+
{
|
41
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_OUTPUT_STREAM, "MemoryOutputStream", mGio);
|
42
|
+
|
43
|
+
RG_DEF_METHOD(initialize, 0);
|
44
|
+
}
|