gio2 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,39 @@
|
|
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 mSocketConnectionFactory
|
25
|
+
|
26
|
+
static VALUE
|
27
|
+
rg_m_create_connection(G_GNUC_UNUSED VALUE self, VALUE socket)
|
28
|
+
{
|
29
|
+
return GOBJ2RVAL_UNREF(g_socket_connection_factory_create_connection(RVAL2GSOCKET(socket)));
|
30
|
+
}
|
31
|
+
|
32
|
+
void
|
33
|
+
Init_gsocketconnectionfactory(VALUE mGio)
|
34
|
+
{
|
35
|
+
/* TODO: Perhaps just move this to SocketConnection? */
|
36
|
+
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "SocketConnectionFactory");
|
37
|
+
|
38
|
+
RG_DEF_MODFUNC(create_connection, 1);
|
39
|
+
}
|
@@ -0,0 +1,82 @@
|
|
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 cSocketControlMessage
|
25
|
+
#define _SELF(value) RVAL2GSOCKETCONTROLMESSAGE(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_s_deserialize(G_GNUC_UNUSED VALUE self, VALUE level, VALUE type, VALUE data)
|
29
|
+
{
|
30
|
+
StringValue(data);
|
31
|
+
return GOBJ2RVAL(g_socket_control_message_deserialize(FIX2INT(level),
|
32
|
+
FIX2INT(type),
|
33
|
+
RSTRING_LEN(data),
|
34
|
+
RSTRING_PTR(data)));
|
35
|
+
}
|
36
|
+
|
37
|
+
static VALUE
|
38
|
+
rg_level(VALUE self)
|
39
|
+
{
|
40
|
+
return INT2FIX(g_socket_control_message_get_level(_SELF(self)));
|
41
|
+
}
|
42
|
+
|
43
|
+
static VALUE
|
44
|
+
rg_msg_type(VALUE self)
|
45
|
+
{
|
46
|
+
return INT2FIX(g_socket_control_message_get_msg_type(_SELF(self)));
|
47
|
+
}
|
48
|
+
|
49
|
+
static VALUE
|
50
|
+
rg_size(VALUE self)
|
51
|
+
{
|
52
|
+
return GSIZE2RVAL(g_socket_control_message_get_size(_SELF(self)));
|
53
|
+
}
|
54
|
+
|
55
|
+
static VALUE
|
56
|
+
rg_serialize(VALUE self)
|
57
|
+
{
|
58
|
+
gsize size;
|
59
|
+
VALUE result;
|
60
|
+
|
61
|
+
/* TODO: Is tainting really necessary? Where does the message come
|
62
|
+
* from? */
|
63
|
+
size = g_socket_control_message_get_size(_SELF(self));
|
64
|
+
result = rb_str_new(NULL, size);
|
65
|
+
g_socket_control_message_serialize(_SELF(self), RSTRING_PTR(result));
|
66
|
+
OBJ_TAINT(result);
|
67
|
+
|
68
|
+
return result;
|
69
|
+
}
|
70
|
+
|
71
|
+
void
|
72
|
+
Init_gsocketcontrolmessage(VALUE mGio)
|
73
|
+
{
|
74
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CONTROL_MESSAGE, "SocketControlMessage", mGio);
|
75
|
+
|
76
|
+
RG_DEF_SMETHOD(deserialize, 3);
|
77
|
+
|
78
|
+
RG_DEF_METHOD(level, 0);
|
79
|
+
RG_DEF_METHOD(msg_type, 0);
|
80
|
+
RG_DEF_METHOD(size, 0);
|
81
|
+
RG_DEF_METHOD(serialize, 0);
|
82
|
+
}
|
@@ -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 cSocketListener
|
25
|
+
#define _SELF(value) RVAL2GSOCKETLISTENER(value)
|
24
26
|
|
25
27
|
static VALUE
|
26
|
-
|
28
|
+
rg_initialize(VALUE self)
|
27
29
|
{
|
28
30
|
G_INITIALIZE(self, g_socket_listener_new());
|
29
31
|
|
@@ -31,7 +33,7 @@ socketlistener_initialize(VALUE self)
|
|
31
33
|
}
|
32
34
|
|
33
35
|
static VALUE
|
34
|
-
|
36
|
+
rg_add_socket(int argc, VALUE *argv, VALUE self)
|
35
37
|
{
|
36
38
|
VALUE socket, source_object;
|
37
39
|
GError *error = NULL;
|
@@ -45,7 +47,7 @@ socketlistener_add_socket(int argc, VALUE *argv, VALUE self)
|
|
45
47
|
}
|
46
48
|
|
47
49
|
static VALUE
|
48
|
-
|
50
|
+
rg_add_address(int argc, VALUE *argv, VALUE self)
|
49
51
|
{
|
50
52
|
VALUE rbaddress, type, protocol, source_object;
|
51
53
|
GError *error = NULL;
|
@@ -65,7 +67,7 @@ socketlistener_add_address(int argc, VALUE *argv, VALUE self)
|
|
65
67
|
}
|
66
68
|
|
67
69
|
static VALUE
|
68
|
-
|
70
|
+
rg_add_inet_port(int argc, VALUE *argv, VALUE self)
|
69
71
|
{
|
70
72
|
VALUE port, source_object;
|
71
73
|
GError *error = NULL;
|
@@ -81,7 +83,7 @@ socketlistener_add_inet_port(int argc, VALUE *argv, VALUE self)
|
|
81
83
|
}
|
82
84
|
|
83
85
|
static VALUE
|
84
|
-
|
86
|
+
rg_add_any_inet_port(int argc, VALUE *argv, VALUE self)
|
85
87
|
{
|
86
88
|
VALUE source_object;
|
87
89
|
GError *error = NULL;
|
@@ -98,7 +100,7 @@ socketlistener_add_any_inet_port(int argc, VALUE *argv, VALUE self)
|
|
98
100
|
}
|
99
101
|
|
100
102
|
static VALUE
|
101
|
-
|
103
|
+
rg_accept(int argc, VALUE *argv, VALUE self)
|
102
104
|
{
|
103
105
|
VALUE cancellable;
|
104
106
|
GObject *source_object;
|
@@ -118,7 +120,7 @@ socketlistener_accept(int argc, VALUE *argv, VALUE self)
|
|
118
120
|
}
|
119
121
|
|
120
122
|
static VALUE
|
121
|
-
|
123
|
+
rg_accept_async(int argc, VALUE *argv, VALUE self)
|
122
124
|
{
|
123
125
|
VALUE rbcancellable, block;
|
124
126
|
GCancellable *cancellable;
|
@@ -135,7 +137,7 @@ socketlistener_accept_async(int argc, VALUE *argv, VALUE self)
|
|
135
137
|
}
|
136
138
|
|
137
139
|
static VALUE
|
138
|
-
|
140
|
+
rg_accept_finish(VALUE self, VALUE result)
|
139
141
|
{
|
140
142
|
GObject *source_object;
|
141
143
|
GError *error = NULL;
|
@@ -153,7 +155,7 @@ socketlistener_accept_finish(VALUE self, VALUE result)
|
|
153
155
|
}
|
154
156
|
|
155
157
|
static VALUE
|
156
|
-
|
158
|
+
rg_accept_socket(int argc, VALUE *argv, VALUE self)
|
157
159
|
{
|
158
160
|
VALUE cancellable;
|
159
161
|
GObject *source_object;
|
@@ -173,7 +175,7 @@ socketlistener_accept_socket(int argc, VALUE *argv, VALUE self)
|
|
173
175
|
}
|
174
176
|
|
175
177
|
static VALUE
|
176
|
-
|
178
|
+
rg_accept_socket_async(int argc, VALUE *argv, VALUE self)
|
177
179
|
{
|
178
180
|
VALUE rbcancellable, block;
|
179
181
|
GCancellable *cancellable;
|
@@ -190,7 +192,7 @@ socketlistener_accept_socket_async(int argc, VALUE *argv, VALUE self)
|
|
190
192
|
}
|
191
193
|
|
192
194
|
static VALUE
|
193
|
-
|
195
|
+
rg_accept_socket_finish(VALUE self, VALUE result)
|
194
196
|
{
|
195
197
|
GObject *source_object;
|
196
198
|
GError *error = NULL;
|
@@ -208,7 +210,7 @@ socketlistener_accept_socket_finish(VALUE self, VALUE result)
|
|
208
210
|
}
|
209
211
|
|
210
212
|
static VALUE
|
211
|
-
|
213
|
+
rg_close(VALUE self)
|
212
214
|
{
|
213
215
|
g_socket_listener_close(_SELF(self));
|
214
216
|
|
@@ -216,30 +218,30 @@ socketlistener_close(VALUE self)
|
|
216
218
|
}
|
217
219
|
|
218
220
|
static VALUE
|
219
|
-
|
221
|
+
rg_set_backlog(VALUE self, VALUE listen_backlog)
|
220
222
|
{
|
221
223
|
g_socket_listener_set_backlog(_SELF(self), FIX2INT(listen_backlog));
|
222
|
-
|
224
|
+
|
223
225
|
return self;
|
224
226
|
}
|
225
227
|
|
226
228
|
void
|
227
|
-
Init_gsocketlistener(VALUE
|
229
|
+
Init_gsocketlistener(VALUE mGio)
|
228
230
|
{
|
229
|
-
VALUE
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
G_DEF_SETTER(
|
231
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_LISTENER, "SocketListener", mGio);
|
232
|
+
|
233
|
+
RG_DEF_METHOD(initialize, 0);
|
234
|
+
RG_DEF_METHOD(add_socket, -1);
|
235
|
+
RG_DEF_METHOD(add_address, -1);
|
236
|
+
RG_DEF_METHOD(add_inet_port, -1);
|
237
|
+
RG_DEF_METHOD(add_any_inet_port, -1);
|
238
|
+
RG_DEF_METHOD(accept, -1);
|
239
|
+
RG_DEF_METHOD(accept_async, -1);
|
240
|
+
RG_DEF_METHOD(accept_finish, 1);
|
241
|
+
RG_DEF_METHOD(accept_socket, -1);
|
242
|
+
RG_DEF_METHOD(accept_socket_async, -1);
|
243
|
+
RG_DEF_METHOD(accept_socket_finish, 1);
|
244
|
+
RG_DEF_METHOD(close, 0);
|
245
|
+
RG_DEF_METHOD(set_backlog, 1);
|
246
|
+
G_DEF_SETTER(RG_TARGET_NAMESPACE, "backlog");
|
245
247
|
}
|
@@ -0,0 +1,66 @@
|
|
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 cSocketService
|
25
|
+
#define _SELF(value) RVAL2GSOCKETSERVICE(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self)
|
29
|
+
{
|
30
|
+
G_INITIALIZE(self, g_socket_service_new());
|
31
|
+
|
32
|
+
return Qnil;
|
33
|
+
}
|
34
|
+
|
35
|
+
static VALUE
|
36
|
+
rg_start(VALUE self)
|
37
|
+
{
|
38
|
+
g_socket_service_start(_SELF(self));
|
39
|
+
|
40
|
+
return self;
|
41
|
+
}
|
42
|
+
|
43
|
+
static VALUE
|
44
|
+
rg_stop(VALUE self)
|
45
|
+
{
|
46
|
+
g_socket_service_stop(_SELF(self));
|
47
|
+
|
48
|
+
return self;
|
49
|
+
}
|
50
|
+
|
51
|
+
static VALUE
|
52
|
+
rg_active_p(VALUE self)
|
53
|
+
{
|
54
|
+
return CBOOL2RVAL(g_socket_service_is_active(_SELF(self)));
|
55
|
+
}
|
56
|
+
|
57
|
+
void
|
58
|
+
Init_gsocketservice(VALUE mGio)
|
59
|
+
{
|
60
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_SERVICE, "SocketService", mGio);
|
61
|
+
|
62
|
+
RG_DEF_METHOD(initialize, 0);
|
63
|
+
RG_DEF_METHOD(start, 0);
|
64
|
+
RG_DEF_METHOD(stop, 0);
|
65
|
+
RG_DEF_METHOD_P(active, 0);
|
66
|
+
}
|
@@ -0,0 +1,76 @@
|
|
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 cSrvTarget
|
25
|
+
#define _SELF(value) RVAL2GSRVTARGET(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self, VALUE hostname, VALUE port, VALUE priority, VALUE weight)
|
29
|
+
{
|
30
|
+
/* TODO: Does this work with boxed? */
|
31
|
+
/* TODO: hostname should be infected when returned. */
|
32
|
+
G_INITIALIZE(self, g_srv_target_new(RVAL2CSTR(hostname),
|
33
|
+
RVAL2GUINT16(port),
|
34
|
+
RVAL2GUINT16(priority),
|
35
|
+
RVAL2GUINT16(weight)));
|
36
|
+
|
37
|
+
return Qnil;
|
38
|
+
}
|
39
|
+
|
40
|
+
static VALUE
|
41
|
+
rg_hostname(VALUE self)
|
42
|
+
{
|
43
|
+
return CSTR2RVAL(g_srv_target_get_hostname(_SELF(self)));
|
44
|
+
}
|
45
|
+
|
46
|
+
static VALUE
|
47
|
+
rg_port(VALUE self)
|
48
|
+
{
|
49
|
+
return GUINT162RVAL(g_srv_target_get_port(_SELF(self)));
|
50
|
+
}
|
51
|
+
|
52
|
+
static VALUE
|
53
|
+
rg_priority(VALUE self)
|
54
|
+
{
|
55
|
+
return GUINT162RVAL(g_srv_target_get_priority(_SELF(self)));
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
rg_weight(VALUE self)
|
60
|
+
{
|
61
|
+
return GUINT162RVAL(g_srv_target_get_weight(_SELF(self)));
|
62
|
+
}
|
63
|
+
|
64
|
+
/* TODO: srvtarget_list_sort */
|
65
|
+
|
66
|
+
void
|
67
|
+
Init_gsrvtarget(VALUE mGio)
|
68
|
+
{
|
69
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SRV_TARGET, "SrvTarget", mGio);
|
70
|
+
|
71
|
+
RG_DEF_METHOD(initialize, 4);
|
72
|
+
RG_DEF_METHOD(hostname, 0);
|
73
|
+
RG_DEF_METHOD(port, 0);
|
74
|
+
RG_DEF_METHOD(priority, 0);
|
75
|
+
RG_DEF_METHOD(weight, 0);
|
76
|
+
}
|
@@ -0,0 +1,28 @@
|
|
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
|
+
void
|
25
|
+
Init_gtcpconnection(VALUE mGio)
|
26
|
+
{
|
27
|
+
(void)G_DEF_CLASS(G_TYPE_TCP_CONNECTION, "TcpConnection", mGio);
|
28
|
+
}
|
@@ -0,0 +1,83 @@
|
|
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 mThemedIcon
|
25
|
+
#define _SELF(value) RVAL2GTHEMEDICON(value)
|
26
|
+
|
27
|
+
/* TODO: Is this unnecessarily complicated? */
|
28
|
+
static VALUE
|
29
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
30
|
+
{
|
31
|
+
VALUE iconnames, with_default_fallbacks;
|
32
|
+
GIcon *icon;
|
33
|
+
|
34
|
+
rb_scan_args(argc, argv, "11", &iconnames, &with_default_fallbacks);
|
35
|
+
|
36
|
+
if (TYPE(iconnames) != T_ARRAY) {
|
37
|
+
const char *iconname = RVAL2CSTR(iconnames);
|
38
|
+
|
39
|
+
icon = RVAL2CBOOL(with_default_fallbacks) ?
|
40
|
+
g_themed_icon_new_with_default_fallbacks(iconname) :
|
41
|
+
g_themed_icon_new(iconname);
|
42
|
+
|
43
|
+
G_INITIALIZE(self, icon);
|
44
|
+
|
45
|
+
return Qnil;
|
46
|
+
}
|
47
|
+
|
48
|
+
if (argc > 1)
|
49
|
+
rb_raise(rb_eArgError,
|
50
|
+
"only one argument allowed when first argument is an Array");
|
51
|
+
|
52
|
+
icon = g_themed_icon_new_from_names(RVAL2STRV_DUP(iconnames), -1);
|
53
|
+
|
54
|
+
G_INITIALIZE(self, icon);
|
55
|
+
|
56
|
+
return Qnil;
|
57
|
+
}
|
58
|
+
|
59
|
+
static VALUE
|
60
|
+
rg_prepend_name(VALUE self, VALUE iconname)
|
61
|
+
{
|
62
|
+
g_themed_icon_prepend_name(_SELF(self), RVAL2CSTR(iconname));
|
63
|
+
|
64
|
+
return self;
|
65
|
+
}
|
66
|
+
|
67
|
+
static VALUE
|
68
|
+
rg_append_name(VALUE self, VALUE iconname)
|
69
|
+
{
|
70
|
+
g_themed_icon_append_name(_SELF(self), RVAL2CSTR(iconname));
|
71
|
+
|
72
|
+
return self;
|
73
|
+
}
|
74
|
+
|
75
|
+
void
|
76
|
+
Init_gthemedicon(VALUE mGio)
|
77
|
+
{
|
78
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_THEMED_ICON, "ThemedIcon", mGio);
|
79
|
+
|
80
|
+
RG_DEF_METHOD(initialize, -1);
|
81
|
+
RG_DEF_METHOD(prepend_name, 1);
|
82
|
+
RG_DEF_METHOD(append_name, 1);
|
83
|
+
}
|
@@ -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 cThreadedSocketService
|
25
|
+
|
26
|
+
static VALUE
|
27
|
+
rg_initialize(VALUE self, VALUE max_threads)
|
28
|
+
{
|
29
|
+
G_INITIALIZE(self,
|
30
|
+
g_threaded_socket_service_new(RVAL2TYPE_WITH_DEFAULT(max_threads,
|
31
|
+
RVAL2GINT,
|
32
|
+
10)));
|
33
|
+
|
34
|
+
return Qnil;
|
35
|
+
}
|
36
|
+
|
37
|
+
void
|
38
|
+
Init_gthreadedsocketservice(VALUE mGio)
|
39
|
+
{
|
40
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_THREADED_SOCKET_SERVICE, "ThreadedSocketService", mGio);
|
41
|
+
|
42
|
+
RG_DEF_METHOD(initialize, -1);
|
43
|
+
}
|
@@ -0,0 +1,71 @@
|
|
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/gunixconnection.h>
|
26
|
+
|
27
|
+
#define RG_TARGET_NAMESPACE cUnixConnection
|
28
|
+
#define _SELF(value) RVAL2GUNIXCONNECTION(value)
|
29
|
+
|
30
|
+
static VALUE
|
31
|
+
rg_receive_fd(int argc, VALUE *argv, VALUE self)
|
32
|
+
{
|
33
|
+
VALUE cancellable;
|
34
|
+
GError *error = NULL;
|
35
|
+
gint fd;
|
36
|
+
|
37
|
+
rb_scan_args(argc, argv, "01", &cancellable);
|
38
|
+
fd = g_unix_connection_receive_fd(_SELF(self),
|
39
|
+
RVAL2GCANCELLABLE(cancellable),
|
40
|
+
&error);
|
41
|
+
if (fd == -1)
|
42
|
+
rbgio_raise_error(error);
|
43
|
+
|
44
|
+
return FD2RVAL(fd);
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rg_send_fd(int argc, VALUE *argv, VALUE self)
|
49
|
+
{
|
50
|
+
VALUE fd, cancellable;
|
51
|
+
GError *error = NULL;
|
52
|
+
|
53
|
+
rb_scan_args(argc, argv, "11", &fd, &cancellable);
|
54
|
+
if (!g_unix_connection_send_fd(_SELF(self), RVAL2FD(fd),
|
55
|
+
RVAL2GCANCELLABLE(cancellable), &error))
|
56
|
+
rbgio_raise_error(error);
|
57
|
+
|
58
|
+
return self;
|
59
|
+
}
|
60
|
+
#endif
|
61
|
+
|
62
|
+
void
|
63
|
+
Init_gunixconnection(G_GNUC_UNUSED VALUE mGio)
|
64
|
+
{
|
65
|
+
#ifdef HAVE_GIO_UNIX
|
66
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_CONNECTION, "UnixConnection", mGio);
|
67
|
+
|
68
|
+
RG_DEF_METHOD(receive_fd, -1);
|
69
|
+
RG_DEF_METHOD(send_fd, -1);
|
70
|
+
#endif
|
71
|
+
}
|