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
@@ -1,30 +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
|
-
|
23
|
-
#define _SELF(value) G_FILE_INPUT_STREAM(RVAL2GOBJ(value))
|
22
|
+
#include "rbgio2private.h"
|
24
23
|
|
24
|
+
#define RG_TARGET_NAMESPACE cFileInputStream
|
25
|
+
#define _SELF(value) RVAL2GFILEINPUTSTREAM(value)
|
25
26
|
|
26
27
|
static VALUE
|
27
|
-
|
28
|
+
rg_query_info(int argc, VALUE *argv, VALUE self)
|
28
29
|
{
|
29
30
|
VALUE attributes, cancellable;
|
30
31
|
GError *error = NULL;
|
@@ -42,7 +43,7 @@ fileinputstream_query_info(int argc, VALUE *argv, VALUE self)
|
|
42
43
|
}
|
43
44
|
|
44
45
|
static VALUE
|
45
|
-
|
46
|
+
rg_query_info_async(int argc, VALUE *argv, VALUE self)
|
46
47
|
{
|
47
48
|
VALUE rbattributes, rbio_priority, rbcancellable, block;
|
48
49
|
const char *attributes;
|
@@ -65,7 +66,7 @@ fileinputstream_query_info_async(int argc, VALUE *argv, VALUE self)
|
|
65
66
|
}
|
66
67
|
|
67
68
|
static VALUE
|
68
|
-
|
69
|
+
rg_query_info_finish(VALUE self, VALUE result)
|
69
70
|
{
|
70
71
|
GError *error = NULL;
|
71
72
|
GFileInfo *info;
|
@@ -80,11 +81,11 @@ fileinputstream_query_info_finish(VALUE self, VALUE result)
|
|
80
81
|
}
|
81
82
|
|
82
83
|
void
|
83
|
-
Init_gfileinputstream(VALUE
|
84
|
+
Init_gfileinputstream(VALUE mGio)
|
84
85
|
{
|
85
|
-
VALUE
|
86
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_INPUT_STREAM, "FileInputStream", mGio);
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
88
|
+
RG_DEF_METHOD(query_info, -1);
|
89
|
+
RG_DEF_METHOD(query_info_async, -1);
|
90
|
+
RG_DEF_METHOD(query_info_finish, 1);
|
90
91
|
}
|
@@ -1,35 +1,37 @@
|
|
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 cFileIOStream
|
25
|
+
#define _SELF(value) RVAL2GFILEIOSTREAM(value)
|
24
26
|
|
25
27
|
static VALUE
|
26
|
-
|
28
|
+
rg_etag(VALUE self)
|
27
29
|
{
|
28
30
|
return CSTR2RVAL(g_file_io_stream_get_etag(_SELF(self)));
|
29
31
|
}
|
30
32
|
|
31
33
|
static VALUE
|
32
|
-
|
34
|
+
rg_query_info(int argc, VALUE *argv, VALUE self)
|
33
35
|
{
|
34
36
|
VALUE attributes, cancellable;
|
35
37
|
GError *error = NULL;
|
@@ -47,7 +49,7 @@ fileiostream_query_info(int argc, VALUE *argv, VALUE self)
|
|
47
49
|
}
|
48
50
|
|
49
51
|
static VALUE
|
50
|
-
|
52
|
+
rg_query_info_async(int argc, VALUE *argv, VALUE self)
|
51
53
|
{
|
52
54
|
VALUE rbattributes, rbio_priority, rbcancellable, block;
|
53
55
|
const char *attributes;
|
@@ -70,7 +72,7 @@ fileiostream_query_info_async(int argc, VALUE *argv, VALUE self)
|
|
70
72
|
}
|
71
73
|
|
72
74
|
static VALUE
|
73
|
-
|
75
|
+
rg_query_info_finish(VALUE self, VALUE result)
|
74
76
|
{
|
75
77
|
GError *error = NULL;
|
76
78
|
GFileInfo *info;
|
@@ -85,12 +87,12 @@ fileiostream_query_info_finish(VALUE self, VALUE result)
|
|
85
87
|
}
|
86
88
|
|
87
89
|
void
|
88
|
-
Init_gfileiostream(VALUE
|
90
|
+
Init_gfileiostream(VALUE mGio)
|
89
91
|
{
|
90
|
-
VALUE
|
92
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", mGio);
|
91
93
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
94
|
+
RG_DEF_METHOD(etag, 0);
|
95
|
+
RG_DEF_METHOD(query_info, -1);
|
96
|
+
RG_DEF_METHOD(query_info_async, -1);
|
97
|
+
RG_DEF_METHOD(query_info_finish, 1);
|
96
98
|
}
|
@@ -0,0 +1,46 @@
|
|
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 cFileMonitor
|
25
|
+
#define _SELF(value) RVAL2GFILEMONITOR(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_cancel(VALUE self)
|
29
|
+
{
|
30
|
+
return CBOOL2RVAL(g_file_monitor_cancel(_SELF(self)));
|
31
|
+
}
|
32
|
+
|
33
|
+
void
|
34
|
+
Init_gfilemonitor(VALUE mGio)
|
35
|
+
{
|
36
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_MONITOR, "FileMonitor", mGio);
|
37
|
+
|
38
|
+
G_DEF_CLASS(G_TYPE_FILE_MONITOR_EVENT, "Event", RG_TARGET_NAMESPACE);
|
39
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_EVENT, "G_FILE_MONITOR_");
|
40
|
+
|
41
|
+
G_DEF_CLASS(G_TYPE_FILE_MONITOR_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
42
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_FLAGS, "G_FILE_MONITOR_");
|
43
|
+
|
44
|
+
RG_DEF_METHOD(cancel, 0);
|
45
|
+
/* TODO: Do we need #emit_event? */
|
46
|
+
}
|
@@ -0,0 +1,74 @@
|
|
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 cFilenameCompleter
|
25
|
+
#define _SELF(value) RVAL2GFILENAMECOMPLETER(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
29
|
+
{
|
30
|
+
VALUE dirs_only;
|
31
|
+
GFilenameCompleter *completer;
|
32
|
+
|
33
|
+
rb_scan_args(argc, argv, "01", &dirs_only);
|
34
|
+
completer = g_filename_completer_new();
|
35
|
+
g_filename_completer_set_dirs_only(completer, RVAL2CBOOL(dirs_only));
|
36
|
+
|
37
|
+
G_INITIALIZE(self, completer);
|
38
|
+
|
39
|
+
return Qnil;
|
40
|
+
}
|
41
|
+
|
42
|
+
static VALUE
|
43
|
+
rg_get_completion_suffix(VALUE self, VALUE initial_text)
|
44
|
+
{
|
45
|
+
return CSTR2RVAL_FREE(g_filename_completer_get_completion_suffix(_SELF(self),
|
46
|
+
RVAL2CSTR(initial_text)));
|
47
|
+
}
|
48
|
+
|
49
|
+
static VALUE
|
50
|
+
rg_get_completions(VALUE self, VALUE initial_text)
|
51
|
+
{
|
52
|
+
return STRV2RVAL_FREE(g_filename_completer_get_completions(_SELF(self),
|
53
|
+
RVAL2CSTR(initial_text)));
|
54
|
+
}
|
55
|
+
|
56
|
+
static VALUE
|
57
|
+
rg_set_dirs_only(VALUE self, VALUE dirs_only)
|
58
|
+
{
|
59
|
+
g_filename_completer_set_dirs_only(_SELF(self), RVAL2CBOOL(dirs_only));
|
60
|
+
|
61
|
+
return self;
|
62
|
+
}
|
63
|
+
|
64
|
+
void
|
65
|
+
Init_gfilenamecompleter(VALUE mGio)
|
66
|
+
{
|
67
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILENAME_COMPLETER, "FilenameCompleter", mGio);
|
68
|
+
|
69
|
+
RG_DEF_METHOD(initialize, -1);
|
70
|
+
RG_DEF_METHOD(get_completion_suffix, 1);
|
71
|
+
RG_DEF_METHOD(get_completions, 1);
|
72
|
+
RG_DEF_METHOD(set_dirs_only, 1);
|
73
|
+
G_DEF_SETTER(RG_TARGET_NAMESPACE, "dirs_only");
|
74
|
+
}
|
@@ -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 cFileOutputStream
|
25
|
+
#define _SELF(value) RVAL2GFILEOUTPUTSTREAM(value)
|
24
26
|
|
25
27
|
static VALUE
|
26
|
-
|
28
|
+
rg_query_info(int argc, VALUE *argv, VALUE self)
|
27
29
|
{
|
28
30
|
VALUE attributes, cancellable;
|
29
31
|
GError *error = NULL;
|
@@ -41,7 +43,7 @@ fileoutputstream_query_info(int argc, VALUE *argv, VALUE self)
|
|
41
43
|
}
|
42
44
|
|
43
45
|
static VALUE
|
44
|
-
|
46
|
+
rg_query_info_async(int argc, VALUE *argv, VALUE self)
|
45
47
|
{
|
46
48
|
VALUE rbattributes, rbio_priority, rbcancellable, block;
|
47
49
|
const char *attributes;
|
@@ -64,7 +66,7 @@ fileoutputstream_query_info_async(int argc, VALUE *argv, VALUE self)
|
|
64
66
|
}
|
65
67
|
|
66
68
|
static VALUE
|
67
|
-
|
69
|
+
rg_query_info_finish(VALUE self, VALUE result)
|
68
70
|
{
|
69
71
|
GError *error = NULL;
|
70
72
|
GFileInfo *info;
|
@@ -79,18 +81,18 @@ fileoutputstream_query_info_finish(VALUE self, VALUE result)
|
|
79
81
|
}
|
80
82
|
|
81
83
|
static VALUE
|
82
|
-
|
84
|
+
rg_etag(VALUE self)
|
83
85
|
{
|
84
86
|
return CSTR2RVAL(g_file_output_stream_get_etag(_SELF(self)));
|
85
87
|
}
|
86
88
|
|
87
89
|
void
|
88
|
-
Init_gfileoutputstream(VALUE
|
90
|
+
Init_gfileoutputstream(VALUE mGio)
|
89
91
|
{
|
90
|
-
VALUE
|
92
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", mGio);
|
91
93
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
94
|
+
RG_DEF_METHOD(query_info, -1);
|
95
|
+
RG_DEF_METHOD(query_info_async, -1);
|
96
|
+
RG_DEF_METHOD(query_info_finish, 1);
|
97
|
+
RG_DEF_METHOD(etag, 0);
|
96
98
|
}
|
@@ -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_gfilterinputstream(VALUE mGio)
|
26
|
+
{
|
27
|
+
(void)G_DEF_CLASS(G_TYPE_FILTER_INPUT_STREAM, "FilterInputStream", mGio);
|
28
|
+
}
|
@@ -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_gfilteroutputstream(VALUE mGio)
|
26
|
+
{
|
27
|
+
(void)G_DEF_CLASS(G_TYPE_FILTER_OUTPUT_STREAM, "FilterOutputStream", mGio);
|
28
|
+
}
|
@@ -0,0 +1,69 @@
|
|
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 mIcon
|
25
|
+
#define _SELF(value) RVAL2GICON(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_s_new_for_string(G_GNUC_UNUSED VALUE self, VALUE string)
|
29
|
+
{
|
30
|
+
GError *error = NULL;
|
31
|
+
GIcon *icon;
|
32
|
+
|
33
|
+
icon = g_icon_new_for_string(RVAL2CSTR(string), &error);
|
34
|
+
if (icon == NULL)
|
35
|
+
rbgio_raise_error(error);
|
36
|
+
|
37
|
+
return GOBJ2RVAL_UNREF(icon);
|
38
|
+
}
|
39
|
+
|
40
|
+
static VALUE
|
41
|
+
rg_hash(VALUE self)
|
42
|
+
{
|
43
|
+
return GUINT2RVAL(g_icon_hash(_SELF(self)));
|
44
|
+
}
|
45
|
+
|
46
|
+
static VALUE
|
47
|
+
rg_operator_icon_equal(VALUE self, VALUE other)
|
48
|
+
{
|
49
|
+
return CBOOL2RVAL(g_icon_equal(_SELF(self), _SELF(other)));
|
50
|
+
}
|
51
|
+
|
52
|
+
static VALUE
|
53
|
+
rg_to_string(VALUE self)
|
54
|
+
{
|
55
|
+
return CSTR2RVAL_FREE(g_icon_to_string(_SELF(self)));
|
56
|
+
}
|
57
|
+
|
58
|
+
void
|
59
|
+
Init_gicon(VALUE mGio)
|
60
|
+
{
|
61
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ICON, "Icon", mGio);
|
62
|
+
|
63
|
+
RG_DEF_SMETHOD(new_for_string, 1);
|
64
|
+
|
65
|
+
RG_DEF_METHOD(hash, 0);
|
66
|
+
RG_DEF_METHOD_OPERATOR("==", icon_equal, 1);
|
67
|
+
RG_DEF_METHOD(to_string, 0);
|
68
|
+
RG_DEF_ALIAS("to_s", "to_string");
|
69
|
+
}
|
@@ -0,0 +1,118 @@
|
|
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 mInetAddress
|
25
|
+
#define _SELF(value) RVAL2GINETADDRESS(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_s_new_from_string(G_GNUC_UNUSED VALUE self, VALUE string)
|
29
|
+
{
|
30
|
+
return GOBJ2RVAL_UNREF(g_inet_address_new_from_string(RVAL2CSTR(string)));
|
31
|
+
}
|
32
|
+
|
33
|
+
/* TODO: Should this take an array instead? */
|
34
|
+
static VALUE
|
35
|
+
rg_s_new_from_bytes(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
36
|
+
{
|
37
|
+
VALUE rbbytes, rbfamily;
|
38
|
+
guint8 *bytes;
|
39
|
+
GSocketFamily family;
|
40
|
+
|
41
|
+
rb_scan_args(argc, argv, "11", &rbbytes, &rbfamily);
|
42
|
+
bytes = (guint8 *)RVAL2CSTR(rbbytes);
|
43
|
+
family = RVAL2GSOCKETFAMILY(rbfamily);
|
44
|
+
|
45
|
+
/* TODO: Should check encoding. */
|
46
|
+
/* TODO: We can't pass bytes as such, as it will be NULL-terminated. */
|
47
|
+
/* TODO: Do we need to deal with G_SOCKET_FAMILY_UNIX? */
|
48
|
+
switch (family) {
|
49
|
+
case G_SOCKET_FAMILY_IPV4:
|
50
|
+
if (RSTRING_LEN(rbbytes) != 4)
|
51
|
+
rb_raise(rb_eArgError, "string containing 4 bytes expected");
|
52
|
+
break;
|
53
|
+
case G_SOCKET_FAMILY_IPV6:
|
54
|
+
if (RSTRING_LEN(rbbytes) != 16)
|
55
|
+
rb_raise(rb_eArgError, "string containing 16 bytes expected");
|
56
|
+
break;
|
57
|
+
case G_SOCKET_FAMILY_INVALID:
|
58
|
+
case G_SOCKET_FAMILY_UNIX:
|
59
|
+
rb_raise(rb_eArgError, "invalid family: %d", family);
|
60
|
+
default:
|
61
|
+
rb_raise(rb_eArgError, "unknown family: %d", family);
|
62
|
+
break;
|
63
|
+
}
|
64
|
+
|
65
|
+
return GOBJ2RVAL_UNREF(g_inet_address_new_from_bytes(bytes, family));
|
66
|
+
}
|
67
|
+
|
68
|
+
static VALUE
|
69
|
+
rg_s_new_any(G_GNUC_UNUSED VALUE self, VALUE family)
|
70
|
+
{
|
71
|
+
return GOBJ2RVAL_UNREF(g_inet_address_new_any(RVAL2GSOCKETFAMILY(family)));
|
72
|
+
}
|
73
|
+
|
74
|
+
static VALUE
|
75
|
+
rg_s_new_loopback(G_GNUC_UNUSED VALUE self, VALUE family)
|
76
|
+
{
|
77
|
+
return GOBJ2RVAL_UNREF(g_inet_address_new_loopback(RVAL2GSOCKETFAMILY(family)));
|
78
|
+
}
|
79
|
+
|
80
|
+
/* TODO: Return array of bytes instead? */
|
81
|
+
static VALUE
|
82
|
+
rg_to_bytes(VALUE self)
|
83
|
+
{
|
84
|
+
gsize size;
|
85
|
+
|
86
|
+
size = g_inet_address_get_native_size(_SELF(self));
|
87
|
+
return rb_str_new((const gchar *)g_inet_address_to_bytes(_SELF(self)),
|
88
|
+
size);
|
89
|
+
}
|
90
|
+
|
91
|
+
static VALUE
|
92
|
+
rg_get_native_size(VALUE self)
|
93
|
+
{
|
94
|
+
return GSIZE2RVAL(g_inet_address_get_native_size(_SELF(self)));
|
95
|
+
}
|
96
|
+
|
97
|
+
static VALUE
|
98
|
+
rg_to_string(VALUE self)
|
99
|
+
{
|
100
|
+
return CSTR2RVAL_FREE(g_inet_address_to_string(_SELF(self)));
|
101
|
+
}
|
102
|
+
|
103
|
+
void
|
104
|
+
Init_ginetaddress(VALUE mGio)
|
105
|
+
{
|
106
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_INET_ADDRESS, "InetAddress", mGio);
|
107
|
+
|
108
|
+
RG_DEF_SMETHOD(new_from_string, 1);
|
109
|
+
RG_DEF_SMETHOD(new_from_bytes, -1);
|
110
|
+
RG_DEF_SMETHOD(new_any, 1);
|
111
|
+
RG_DEF_SMETHOD(new_loopback, 1);
|
112
|
+
|
113
|
+
RG_DEF_METHOD(to_bytes, 0);
|
114
|
+
RG_DEF_METHOD(get_native_size, 0);
|
115
|
+
RG_DEF_METHOD(to_string, 0);
|
116
|
+
RG_DEF_ALIAS("to_str", "to_string");
|
117
|
+
RG_DEF_ALIAS("to_s", "to_string");
|
118
|
+
}
|
@@ -0,0 +1,41 @@
|
|
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 cInetSocketAddress
|
25
|
+
|
26
|
+
static VALUE
|
27
|
+
rg_initialize(VALUE self, VALUE address, VALUE port)
|
28
|
+
{
|
29
|
+
G_INITIALIZE(self, g_inet_socket_address_new(RVAL2GINETADDRESS(address),
|
30
|
+
RVAL2GUINT16(port)));
|
31
|
+
|
32
|
+
return Qnil;
|
33
|
+
}
|
34
|
+
|
35
|
+
void
|
36
|
+
Init_ginetsocketaddress(VALUE mGio)
|
37
|
+
{
|
38
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_INET_SOCKET_ADDRESS, "InetSocketAddress", mGio);
|
39
|
+
|
40
|
+
RG_DEF_METHOD(initialize, 2);
|
41
|
+
}
|