gio2 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +26 -9
  3. data/ext/gio2/extconf.rb +38 -28
  4. data/ext/gio2/rb-gio2-pollable-source.c +59 -0
  5. data/ext/gio2/{rbgiofilteroutputstream.c → rb-gio2.c} +9 -5
  6. data/ext/gio2/{gio2.c → rb-gio2.h} +5 -10
  7. data/extconf.rb +22 -6
  8. data/lib/1.9/gio2.so +0 -0
  9. data/lib/2.0/gio2.so +0 -0
  10. data/lib/2.1/gio2.so +0 -0
  11. data/lib/gio2/deprecated.rb +16 -0
  12. data/lib/gio2/inet-address.rb +33 -0
  13. data/lib/gio2/input-stream.rb +39 -0
  14. data/lib/gio2/loader.rb +244 -0
  15. data/lib/gio2/output-stream.rb +24 -0
  16. data/lib/gio2/pollable-input-stream.rb +51 -0
  17. data/lib/gio2/pollable-output-stream.rb +32 -0
  18. data/lib/gio2/resources.rb +62 -0
  19. data/lib/gio2.rb +38 -143
  20. data/test/fixture/content-type/x-content/unix-software/autorun.sh +1 -0
  21. data/test/fixture/resource/Rakefile +32 -0
  22. data/test/fixture/resource/logo.png +0 -0
  23. data/test/fixture/resource/ruby-gio2.gresource +0 -0
  24. data/test/fixture/resource/ruby-gio2.gresource.xml +6 -0
  25. data/test/gio2-test-utils/fixture.rb +24 -0
  26. data/test/gio2-test-utils/socket-client.rb +59 -0
  27. data/test/gio2-test-utils.rb +21 -0
  28. data/test/run-test.rb +45 -9
  29. data/test/test-buffered-input-stream.rb +23 -0
  30. data/test/test-charset-converter.rb +23 -0
  31. data/test/test-content-type.rb +31 -0
  32. data/test/test-data-input-stream.rb +21 -0
  33. data/test/test-file-enumerator.rb +26 -0
  34. data/test/test-file-monitor.rb +33 -0
  35. data/test/test-file.rb +28 -0
  36. data/test/test-inet-address.rb +34 -0
  37. data/test/test-input-stream.rb +36 -0
  38. data/test/test-output-stream.rb +39 -0
  39. data/test/test-pollable-input-stream.rb +54 -0
  40. data/test/test-pollable-output-stream.rb +53 -0
  41. data/test/test-resources.rb +58 -0
  42. metadata +49 -107
  43. data/README +0 -34
  44. data/ext/gio2/depend +0 -11
  45. data/ext/gio2/gio2.def +0 -2
  46. data/ext/gio2/gio2.h +0 -30
  47. data/ext/gio2/rbgio.c +0 -133
  48. data/ext/gio2/rbgio2.h +0 -158
  49. data/ext/gio2/rbgio2conversions.h +0 -154
  50. data/ext/gio2/rbgio2private.h +0 -148
  51. data/ext/gio2/rbgioappinfo.c +0 -317
  52. data/ext/gio2/rbgioapplaunchcontext.c +0 -81
  53. data/ext/gio2/rbgioasyncinitable.c +0 -246
  54. data/ext/gio2/rbgioasyncresult.c +0 -41
  55. data/ext/gio2/rbgiobufferedinputstream.c +0 -167
  56. data/ext/gio2/rbgiobufferedoutputstream.c +0 -50
  57. data/ext/gio2/rbgiocancellable.c +0 -180
  58. data/ext/gio2/rbgiocharsetconverter.c +0 -57
  59. data/ext/gio2/rbgiocontenttype.c +0 -131
  60. data/ext/gio2/rbgioconverter.c +0 -113
  61. data/ext/gio2/rbgioconverterinputstream.c +0 -43
  62. data/ext/gio2/rbgioconverteroutputstream.c +0 -43
  63. data/ext/gio2/rbgiodatainputstream.c +0 -309
  64. data/ext/gio2/rbgiodataoutputstream.c +0 -186
  65. data/ext/gio2/rbgiodesktopappinfo.c +0 -87
  66. data/ext/gio2/rbgiodrive.c +0 -266
  67. data/ext/gio2/rbgioemblem.c +0 -52
  68. data/ext/gio2/rbgioemblemedicon.c +0 -65
  69. data/ext/gio2/rbgiofile.c +0 -2045
  70. data/ext/gio2/rbgiofileattribute.c +0 -114
  71. data/ext/gio2/rbgiofileattributeinfo.c +0 -86
  72. data/ext/gio2/rbgiofileattributeinfolist.c +0 -108
  73. data/ext/gio2/rbgiofileattributematcher.c +0 -95
  74. data/ext/gio2/rbgiofiledescriptorbased.c +0 -45
  75. data/ext/gio2/rbgiofileenumerator.c +0 -166
  76. data/ext/gio2/rbgiofileicon.c +0 -41
  77. data/ext/gio2/rbgiofileinfo.c +0 -617
  78. data/ext/gio2/rbgiofileinputstream.c +0 -91
  79. data/ext/gio2/rbgiofileiostream.c +0 -98
  80. data/ext/gio2/rbgiofilemonitor.c +0 -46
  81. data/ext/gio2/rbgiofilenamecompleter.c +0 -73
  82. data/ext/gio2/rbgiofileoutputstream.c +0 -98
  83. data/ext/gio2/rbgiofilterinputstream.c +0 -28
  84. data/ext/gio2/rbgioicon.c +0 -69
  85. data/ext/gio2/rbgioinetaddress.c +0 -118
  86. data/ext/gio2/rbgioinetsocketaddress.c +0 -41
  87. data/ext/gio2/rbgioinitable.c +0 -199
  88. data/ext/gio2/rbgioinputstream.c +0 -341
  89. data/ext/gio2/rbgioio.c +0 -73
  90. data/ext/gio2/rbgioiomodule.c +0 -45
  91. data/ext/gio2/rbgioiomodules.c +0 -47
  92. data/ext/gio2/rbgioioscheduler.c +0 -102
  93. data/ext/gio2/rbgioioschedulerjob.c +0 -121
  94. data/ext/gio2/rbgioiostream.c +0 -107
  95. data/ext/gio2/rbgioloadableicon.c +0 -92
  96. data/ext/gio2/rbgiomemoryinputstream.c +0 -67
  97. data/ext/gio2/rbgiomemoryoutputstream.c +0 -44
  98. data/ext/gio2/rbgiomount.c +0 -286
  99. data/ext/gio2/rbgiomountoperation.c +0 -53
  100. data/ext/gio2/rbgionetworkaddress.c +0 -59
  101. data/ext/gio2/rbgionetworkservice.c +0 -45
  102. data/ext/gio2/rbgiooutputstream.c +0 -331
  103. data/ext/gio2/rbgioresolver.c +0 -230
  104. data/ext/gio2/rbgioseekable.c +0 -91
  105. data/ext/gio2/rbgiosimpleasyncresult.c +0 -152
  106. data/ext/gio2/rbgiosocket.c +0 -390
  107. data/ext/gio2/rbgiosocketaddress.c +0 -34
  108. data/ext/gio2/rbgiosocketaddressenumerator.c +0 -83
  109. data/ext/gio2/rbgiosocketclient.c +0 -207
  110. data/ext/gio2/rbgiosocketconnectable.c +0 -41
  111. data/ext/gio2/rbgiosocketconnection.c +0 -66
  112. data/ext/gio2/rbgiosocketconnectionfactory.c +0 -39
  113. data/ext/gio2/rbgiosocketcontrolmessage.c +0 -82
  114. data/ext/gio2/rbgiosocketlistener.c +0 -246
  115. data/ext/gio2/rbgiosocketservice.c +0 -66
  116. data/ext/gio2/rbgiosrvtarget.c +0 -76
  117. data/ext/gio2/rbgiotcpconnection.c +0 -28
  118. data/ext/gio2/rbgiothemedicon.c +0 -83
  119. data/ext/gio2/rbgiothreadedsocketservice.c +0 -43
  120. data/ext/gio2/rbgiotlscertificate.c +0 -89
  121. data/ext/gio2/rbgiounixconnection.c +0 -71
  122. data/ext/gio2/rbgiounixfdlist.c +0 -115
  123. data/ext/gio2/rbgiounixfdmessage.c +0 -74
  124. data/ext/gio2/rbgiounixinputstream.c +0 -51
  125. data/ext/gio2/rbgiounixmount.c +0 -164
  126. data/ext/gio2/rbgiounixmountmonitor.c +0 -65
  127. data/ext/gio2/rbgiounixmountpoint.c +0 -136
  128. data/ext/gio2/rbgiounixmountpoints.c +0 -58
  129. data/ext/gio2/rbgiounixmounts.c +0 -58
  130. data/ext/gio2/rbgiounixoutputstream.c +0 -51
  131. data/ext/gio2/rbgiounixsocketaddress.c +0 -69
  132. data/ext/gio2/rbgiovfs.c +0 -84
  133. data/ext/gio2/rbgiovolume.c +0 -193
  134. data/ext/gio2/rbgiovolumemonitor.c +0 -77
  135. data/ext/gio2/rbgiozlibcompressor.c +0 -52
  136. data/ext/gio2/rbgiozlibdecompressor.c +0 -45
  137. data/ext/gio2/util.c +0 -303
  138. data/test/test_bufferedinputstream.rb +0 -9
  139. data/test/test_charsetconverter.rb +0 -9
  140. data/test/test_datainputstream.rb +0 -7
  141. data/test/test_fileenumerator.rb +0 -8
  142. data/test/test_filemonitor.rb +0 -17
  143. data/test/test_inetaddress.rb +0 -8
@@ -1,164 +0,0 @@
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/gunixmounts.h>
26
-
27
- #define RG_TARGET_NAMESPACE cUnixMount
28
-
29
- static GUnixMountEntry *
30
- unixmount_copy(const GUnixMountEntry *mount)
31
- {
32
- return (GUnixMountEntry *)mount;
33
- }
34
-
35
- static GType
36
- g_unix_mount_entry_get_type(void)
37
- {
38
- static GType our_type = 0;
39
-
40
- if (our_type == 0)
41
- our_type = g_boxed_type_register_static("GUnixMountEntry",
42
- (GBoxedCopyFunc)unixmount_copy,
43
- (GBoxedFreeFunc)g_unix_mount_free);
44
-
45
- return our_type;
46
- }
47
-
48
- #define G_TYPE_UNIX_MOUNT_ENTRY (g_unix_mount_entry_get_type())
49
-
50
- #define _SELF(value) \
51
- ((GUnixMountEntry *)(RVAL2BOXED((value), G_TYPE_UNIX_MOUNT_ENTRY)))
52
-
53
- #define GUNIXMOUNTENTRY2RVAL(value) BOXED2RVAL((value), G_TYPE_UNIX_MOUNT_ENTRY)
54
-
55
- static VALUE
56
- rg_compare(VALUE self, VALUE other)
57
- {
58
- return INT2FIX(g_unix_mount_compare(_SELF(self), _SELF(other)));
59
- }
60
-
61
- static VALUE
62
- rg_mount_path(VALUE self)
63
- {
64
- return CSTR2RVAL(g_unix_mount_get_mount_path(_SELF(self)));
65
- }
66
-
67
- static VALUE
68
- rg_device_path(VALUE self)
69
- {
70
- return CSTR2RVAL(g_unix_mount_get_device_path(_SELF(self)));
71
- }
72
-
73
- static VALUE
74
- rg_fs_type(VALUE self)
75
- {
76
- return CSTR2RVAL(g_unix_mount_get_fs_type(_SELF(self)));
77
- }
78
-
79
- static VALUE
80
- rg_readonly_p(VALUE self)
81
- {
82
- return CBOOL2RVAL(g_unix_mount_is_readonly(_SELF(self)));
83
- }
84
-
85
- static VALUE
86
- rg_system_internal_p(VALUE self)
87
- {
88
- return CBOOL2RVAL(g_unix_mount_is_system_internal(_SELF(self)));
89
- }
90
-
91
- static VALUE
92
- rg_guess_icon(VALUE self)
93
- {
94
- return GOBJ2RVAL_UNREF(g_unix_mount_guess_icon(_SELF(self)));
95
- }
96
-
97
- static VALUE
98
- rg_guess_name(VALUE self)
99
- {
100
- return CSTR2RVAL_FREE(g_unix_mount_guess_name(_SELF(self)));
101
- }
102
-
103
- static VALUE
104
- rg_guess_can_eject_p(VALUE self)
105
- {
106
- return CBOOL2RVAL(g_unix_mount_guess_can_eject(_SELF(self)));
107
- }
108
-
109
- static VALUE
110
- rg_guess_should_display_p(VALUE self)
111
- {
112
- return CBOOL2RVAL(g_unix_mount_guess_should_display(_SELF(self)));
113
- }
114
-
115
- static VALUE
116
- rg_s_at(G_GNUC_UNUSED VALUE self, VALUE mount_path)
117
- {
118
- guint64 time_read;
119
- GUnixMountEntry *mount;
120
-
121
- mount = g_unix_mount_at(RVAL2CSTR(mount_path), &time_read);
122
-
123
- return rb_assoc_new(GUNIXMOUNTENTRY2RVAL(mount),
124
- GUINT642RVAL(time_read));
125
- }
126
-
127
- static VALUE
128
- rg_s_mount_path_system_internal_p(G_GNUC_UNUSED VALUE self, VALUE mount_path)
129
- {
130
- return CBOOL2RVAL(g_unix_is_mount_path_system_internal(RVAL2CSTR(mount_path)));
131
- }
132
-
133
- #endif
134
-
135
- void
136
- Init_gunixmount(G_GNUC_UNUSED VALUE mGio)
137
- {
138
- #ifdef HAVE_GIO_UNIX
139
- VALUE RG_TARGET_NAMESPACE;
140
-
141
- RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_ENTRY, "UnixMount", mGio);
142
-
143
- rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable);
144
-
145
- /* TODO: This doesn't follow the naming conventions, but it seems
146
- * overkill to have GLib::Unix just for mount_path_system_internal?. */
147
- RG_DEF_SMETHOD_P(mount_path_system_internal, 1);
148
- RG_DEF_SMETHOD(at, 1);
149
-
150
- rbgobj_boxed_not_copy_obj(G_TYPE_UNIX_MOUNT_ENTRY);
151
-
152
- RG_DEF_METHOD(compare, 1);
153
- RG_DEF_ALIAS("<=>", "compare");
154
- RG_DEF_METHOD(mount_path, 0);
155
- RG_DEF_METHOD(device_path, 0);
156
- RG_DEF_METHOD(fs_type, 0);
157
- RG_DEF_METHOD_P(readonly, 0);
158
- RG_DEF_METHOD_P(system_internal, 0);
159
- RG_DEF_METHOD(guess_icon, 0);
160
- RG_DEF_METHOD(guess_name, 0);
161
- RG_DEF_METHOD_P(guess_can_eject, 0);
162
- RG_DEF_METHOD_P(guess_should_display, 0);
163
- #endif
164
- }
@@ -1,65 +0,0 @@
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/gunixmounts.h>
26
-
27
- #define RG_TARGET_NAMESPACE cUnixMountMonitor
28
- #define _SELF(value) RVAL2GUNIXMOUNTMONITOR(value)
29
-
30
- static VALUE
31
- rg_initialize(int argc, VALUE *argv, VALUE self)
32
- {
33
- VALUE limit_msec;
34
- GUnixMountMonitor *monitor;
35
-
36
- rb_scan_args(argc, argv, "01", &limit_msec);
37
- monitor = g_unix_mount_monitor_new();
38
- if (!NIL_P(limit_msec))
39
- g_unix_mount_monitor_set_rate_limit(monitor,
40
- FIX2INT(limit_msec));
41
- G_INITIALIZE(self, monitor);
42
-
43
- return Qnil;
44
- }
45
-
46
- static VALUE
47
- rg_set_rate_limit(VALUE self, VALUE limit_msec)
48
- {
49
- g_unix_mount_monitor_set_rate_limit(_SELF(self), FIX2INT(limit_msec));
50
-
51
- return self;
52
- }
53
-
54
- #endif
55
-
56
- void
57
- Init_gunixmountmonitor(G_GNUC_UNUSED VALUE mGio)
58
- {
59
- #ifdef HAVE_GIO_UNIX
60
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_MONITOR, "UnixMountMonitor", mGio);
61
-
62
- RG_DEF_METHOD(initialize, -1);
63
- RG_DEF_METHOD(set_rate_limit, 1);
64
- #endif
65
- }
@@ -1,136 +0,0 @@
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/gunixmounts.h>
26
-
27
- #define G_TYPE_UNIX_MOUNT_POINT (g_unix_mount_point_get_type())
28
-
29
- #define RG_TARGET_NAMESPACE cUnixMountPoint
30
- #define _SELF(value) \
31
- ((GUnixMountPoint *)(RVAL2BOXED((value), G_TYPE_UNIX_MOUNT_POINT)))
32
-
33
- static GUnixMountPoint *
34
- unixmountpoint_copy(const GUnixMountPoint *mount_point)
35
- {
36
- return (GUnixMountPoint *)mount_point;
37
- }
38
-
39
- static GType
40
- g_unix_mount_point_get_type(void)
41
- {
42
- static GType our_type = 0;
43
-
44
- if (our_type == 0)
45
- our_type = g_boxed_type_register_static("GUnixMountPoint",
46
- (GBoxedCopyFunc)unixmountpoint_copy,
47
- (GBoxedFreeFunc)g_unix_mount_point_free);
48
-
49
- return our_type;
50
- }
51
-
52
- static VALUE
53
- rg_compare(VALUE self, VALUE other)
54
- {
55
- return INT2FIX(g_unix_mount_point_compare(_SELF(self), _SELF(other)));
56
- }
57
-
58
- static VALUE
59
- rg_mount_path(VALUE self)
60
- {
61
- return CSTR2RVAL(g_unix_mount_point_get_mount_path(_SELF(self)));
62
- }
63
-
64
- static VALUE
65
- rg_device_path(VALUE self)
66
- {
67
- return CSTR2RVAL(g_unix_mount_point_get_device_path(_SELF(self)));
68
- }
69
-
70
- static VALUE
71
- rg_fs_type(VALUE self)
72
- {
73
- return CSTR2RVAL(g_unix_mount_point_get_fs_type(_SELF(self)));
74
- }
75
-
76
- static VALUE
77
- rg_readonly_p(VALUE self)
78
- {
79
- return CBOOL2RVAL(g_unix_mount_point_is_readonly(_SELF(self)));
80
- }
81
-
82
- static VALUE
83
- rg_user_mountable_p(VALUE self)
84
- {
85
- return CBOOL2RVAL(g_unix_mount_point_is_user_mountable(_SELF(self)));
86
- }
87
-
88
- static VALUE
89
- rg_loopback_p(VALUE self)
90
- {
91
- return CBOOL2RVAL(g_unix_mount_point_is_loopback(_SELF(self)));
92
- }
93
-
94
- static VALUE
95
- rg_guess_icon(VALUE self)
96
- {
97
- return GOBJ2RVAL_UNREF(g_unix_mount_point_guess_icon(_SELF(self)));
98
- }
99
-
100
- static VALUE
101
- rg_guess_name(VALUE self)
102
- {
103
- return CSTR2RVAL_FREE(g_unix_mount_point_guess_name(_SELF(self)));
104
- }
105
-
106
- static VALUE
107
- rg_guess_can_eject_p(VALUE self)
108
- {
109
- return CBOOL2RVAL(g_unix_mount_point_guess_can_eject(_SELF(self)));
110
- }
111
-
112
- #endif
113
-
114
- void
115
- Init_gunixmountpoint(G_GNUC_UNUSED VALUE mGio)
116
- {
117
- #ifdef HAVE_GIO_UNIX
118
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_POINT, "UnixMountPoint", mGio);
119
-
120
- rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable);
121
-
122
- rbgobj_boxed_not_copy_obj(G_TYPE_UNIX_MOUNT_POINT);
123
-
124
- RG_DEF_METHOD(compare, 1);
125
- RG_DEF_ALIAS("<=>", "compare");
126
- RG_DEF_METHOD(mount_path, 0);
127
- RG_DEF_METHOD(device_path, 0);
128
- RG_DEF_METHOD(fs_type, 0);
129
- RG_DEF_METHOD_P(readonly, 0);
130
- RG_DEF_METHOD_P(user_mountable, 0);
131
- RG_DEF_METHOD_P(loopback, 0);
132
- RG_DEF_METHOD(guess_icon, 0);
133
- RG_DEF_METHOD(guess_name, 0);
134
- RG_DEF_METHOD_P(guess_can_eject, 0);
135
- #endif
136
- }
@@ -1,58 +0,0 @@
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/gunixmounts.h>
26
-
27
- #define RG_TARGET_NAMESPACE mUnixMountPoints
28
-
29
- static VALUE
30
- rg_s_get(G_GNUC_UNUSED VALUE self)
31
- {
32
- guint64 time_read;
33
- GList *mount_points;
34
-
35
- mount_points = g_unix_mount_points_get(&time_read);
36
-
37
- return rb_assoc_new(GLIST2ARY_STR_FREE(mount_points),
38
- GUINT642RVAL(time_read));
39
- }
40
-
41
- static VALUE
42
- rg_s_changed_since_p(G_GNUC_UNUSED VALUE self, VALUE time_read)
43
- {
44
- return CBOOL2RVAL(g_unix_mount_points_changed_since(RVAL2GUINT64(time_read)));
45
- }
46
-
47
- #endif
48
-
49
- void
50
- Init_gunixmountpoints(G_GNUC_UNUSED VALUE mGio)
51
- {
52
- #ifdef HAVE_GIO_UNIX
53
- VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "UnixMountPoints");
54
-
55
- RG_DEF_SMETHOD(get, 0);
56
- RG_DEF_SMETHOD_P(changed_since, 1);
57
- #endif
58
- }
@@ -1,58 +0,0 @@
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/gunixmounts.h>
26
-
27
- #define RG_TARGET_NAMESPACE mUnixMounts
28
-
29
- static VALUE
30
- rg_s_get(G_GNUC_UNUSED VALUE self)
31
- {
32
- guint64 time_read;
33
- GList *mounts;
34
-
35
- mounts = g_unix_mounts_get(&time_read);
36
-
37
- return rb_assoc_new(GLIST2ARY_STR_FREE(mounts),
38
- GUINT642RVAL(time_read));
39
- }
40
-
41
- static VALUE
42
- rg_s_changed_since_p(G_GNUC_UNUSED VALUE self, VALUE time_read)
43
- {
44
- return CBOOL2RVAL(g_unix_mounts_changed_since(RVAL2GUINT64(time_read)));
45
- }
46
-
47
- #endif
48
-
49
- void
50
- Init_gunixmounts(G_GNUC_UNUSED VALUE mGio)
51
- {
52
- #ifdef HAVE_GIO_UNIX
53
- VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "UnixMounts");
54
-
55
- RG_DEF_SMETHOD(get, 0);
56
- RG_DEF_SMETHOD_P(changed_since, 1);
57
- #endif
58
- }
@@ -1,51 +0,0 @@
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/gunixoutputstream.h>
26
-
27
- #define RG_TARGET_NAMESPACE cUnixOutputStream
28
- #define _SELF(value) RVAL2GUNIXOUTPUTSTREAM(value)
29
-
30
- static VALUE
31
- rg_initialize(int argc, VALUE *argv, VALUE self)
32
- {
33
- VALUE fd, close_fd;
34
-
35
- rb_scan_args(argc, argv, "11", &fd, &close_fd);
36
- G_INITIALIZE(self, g_unix_output_stream_new(RVAL2FD(fd),
37
- RVAL2CBOOL(close_fd)));
38
-
39
- return Qnil;
40
- }
41
- #endif
42
-
43
- void
44
- Init_gunixoutputstream(G_GNUC_UNUSED VALUE mGio)
45
- {
46
- #ifdef HAVE_GIO_UNIX
47
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_OUTPUT_STREAM, "UnixOutputStream", mGio);
48
-
49
- RG_DEF_METHOD(initialize, -1);
50
- #endif
51
- }
@@ -1,69 +0,0 @@
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/gunixsocketaddress.h>
26
-
27
- #define RG_TARGET_NAMESPACE cUnixSocketAddress
28
- #define _SELF(value) RVAL2GUNIXSOCKETADDRESS(value)
29
-
30
- static VALUE
31
- rg_initialize(VALUE self, VALUE path)
32
- {
33
- G_INITIALIZE(self, g_unix_socket_address_new(RVAL2CSTR(path)));
34
-
35
- return Qnil;
36
- }
37
-
38
- static VALUE
39
- rg_s_new_abstract(G_GNUC_UNUSED VALUE self, VALUE path)
40
- {
41
- StringValue(path);
42
- return GOBJ2RVAL_UNREF(g_unix_socket_address_new_abstract(RSTRING_PTR(path),
43
- RSTRING_LEN(path)));
44
- }
45
-
46
- static VALUE
47
- rg_s_abstract_names_supported_p(G_GNUC_UNUSED VALUE self)
48
- {
49
- return CBOOL2RVAL(g_unix_socket_address_abstract_names_supported());
50
- }
51
- #endif
52
-
53
- void
54
- Init_gunixsocketaddress(G_GNUC_UNUSED VALUE mGio)
55
- {
56
- #ifdef HAVE_GIO_UNIX
57
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_SOCKET_ADDRESS, "UnixSocketAddress", mGio);
58
-
59
- # if GLIB_CHECK_VERSION(2, 26, 0)
60
- G_DEF_CLASS(G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, "Type", RG_TARGET_NAMESPACE);
61
- G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, "G_UNIX_SOCKET_ADDRESS_");
62
- # endif
63
-
64
- RG_DEF_SMETHOD(new_abstract, 1);
65
- RG_DEF_SMETHOD_P(abstract_names_supported, 0);
66
-
67
- RG_DEF_METHOD(initialize, 1);
68
- #endif
69
- }
data/ext/gio2/rbgiovfs.c DELETED
@@ -1,84 +0,0 @@
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 cVfs
25
- #define _SELF(value) RVAL2GVFS(value)
26
-
27
- static VALUE
28
- rg_file_for_path(VALUE self, VALUE path)
29
- {
30
- return GOBJ2RVAL_UNREF(g_vfs_get_file_for_path(_SELF(self), RVAL2CSTR(path)));
31
- }
32
-
33
- static VALUE
34
- rg_file_for_uri(VALUE self, VALUE uri)
35
- {
36
- return GOBJ2RVAL_UNREF(g_vfs_get_file_for_uri(_SELF(self), RVAL2CSTR(uri)));
37
- }
38
-
39
- static VALUE
40
- rg_parse_name(VALUE self, VALUE parse_name)
41
- {
42
- return GOBJ2RVAL_UNREF(g_vfs_parse_name(_SELF(self), RVAL2CSTR(parse_name)));
43
- }
44
-
45
- static VALUE
46
- rg_s_default(G_GNUC_UNUSED VALUE self)
47
- {
48
- return GOBJ2RVAL(g_vfs_get_default());
49
- }
50
-
51
- static VALUE
52
- rg_s_local(G_GNUC_UNUSED VALUE self)
53
- {
54
- return GOBJ2RVAL(g_vfs_get_local());
55
- }
56
-
57
- static VALUE
58
- rg_active_p(VALUE self)
59
- {
60
- return CBOOL2RVAL(g_vfs_is_active(_SELF(self)));
61
- }
62
-
63
- static VALUE
64
- rg_supported_uri_schemes(VALUE self)
65
- {
66
- return STRV2RVAL((const gchar **)g_vfs_get_supported_uri_schemes(_SELF(self)));
67
- }
68
-
69
- void
70
- Init_gvfs(VALUE mGio)
71
- {
72
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VFS, "Vfs", mGio);
73
-
74
- rb_define_const(RG_TARGET_NAMESPACE, "EXTENSION_POINT_NAME", CSTR2RVAL(G_VFS_EXTENSION_POINT_NAME));
75
-
76
- RG_DEF_SMETHOD(default, 0);
77
- RG_DEF_SMETHOD(local, 0);
78
-
79
- RG_DEF_METHOD(file_for_path, 1);
80
- RG_DEF_METHOD(file_for_uri, 1);
81
- RG_DEF_METHOD(parse_name, 1);
82
- RG_DEF_METHOD_P(active, 0);
83
- RG_DEF_METHOD(supported_uri_schemes, 0);
84
- }