gio2 0.90.5 → 0.90.6

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.
Files changed (155) hide show
  1. data/ChangeLog +41 -0
  2. data/Rakefile +9 -70
  3. data/ext/gio2/Makefile +162 -0
  4. data/ext/gio2/extconf.rb +9 -9
  5. data/ext/gio2/gappinfo.o +0 -0
  6. data/ext/gio2/gapplaunchcontext.o +0 -0
  7. data/ext/gio2/gasyncinitable.c +0 -1
  8. data/ext/gio2/gasyncinitable.o +0 -0
  9. data/ext/gio2/gasyncresult.o +0 -0
  10. data/ext/gio2/gbufferedinputstream.c +0 -19
  11. data/ext/gio2/gbufferedinputstream.o +0 -0
  12. data/ext/gio2/gbufferedoutputstream.c +0 -34
  13. data/ext/gio2/gbufferedoutputstream.o +0 -0
  14. data/ext/gio2/gcancellable.o +0 -0
  15. data/ext/gio2/gcharsetconverter.c +0 -17
  16. data/ext/gio2/gcharsetconverter.o +0 -0
  17. data/ext/gio2/gcontenttype.c +1 -8
  18. data/ext/gio2/gcontenttype.o +0 -0
  19. data/ext/gio2/gconverter.o +0 -0
  20. data/ext/gio2/gconverterinputstream.c +0 -7
  21. data/ext/gio2/gconverterinputstream.o +0 -0
  22. data/ext/gio2/gconverteroutputstream.c +0 -7
  23. data/ext/gio2/gconverteroutputstream.o +0 -0
  24. data/ext/gio2/gdatainputstream.c +34 -57
  25. data/ext/gio2/gdatainputstream.o +0 -0
  26. data/ext/gio2/gdataoutputstream.c +0 -18
  27. data/ext/gio2/gdataoutputstream.o +0 -0
  28. data/ext/gio2/gdesktopappinfo.c +0 -2
  29. data/ext/gio2/gdesktopappinfo.o +0 -0
  30. data/ext/gio2/gdrive.o +0 -0
  31. data/ext/gio2/gemblem.c +0 -19
  32. data/ext/gio2/gemblem.o +0 -0
  33. data/ext/gio2/gemblemedicon.o +0 -0
  34. data/ext/gio2/gfile.c +4 -6
  35. data/ext/gio2/gfile.o +0 -0
  36. data/ext/gio2/gfileattribute.c +3 -155
  37. data/ext/gio2/gfileattribute.o +0 -0
  38. data/ext/gio2/gfileattributeinfo.c +89 -0
  39. data/ext/gio2/gfileattributeinfo.o +0 -0
  40. data/ext/gio2/gfileattributeinfolist.c +109 -0
  41. data/ext/gio2/gfileattributeinfolist.o +0 -0
  42. data/ext/gio2/gfileattributematcher.o +0 -0
  43. data/ext/gio2/gfiledescriptorbased.o +0 -0
  44. data/ext/gio2/gfileenumerator.c +0 -2
  45. data/ext/gio2/gfileenumerator.o +0 -0
  46. data/ext/gio2/gfileicon.c +0 -7
  47. data/ext/gio2/gfileicon.o +0 -0
  48. data/ext/gio2/gfileinfo.c +4 -11
  49. data/ext/gio2/gfileinfo.o +0 -0
  50. data/ext/gio2/gfileinputstream.c +0 -2
  51. data/ext/gio2/gfileinputstream.o +0 -0
  52. data/ext/gio2/gfileiostream.c +0 -2
  53. data/ext/gio2/gfileiostream.o +0 -0
  54. data/ext/gio2/gfilemonitor.c +0 -19
  55. data/ext/gio2/gfilemonitor.o +0 -0
  56. data/ext/gio2/gfilenamecompleter.o +0 -0
  57. data/ext/gio2/gfileoutputstream.c +1 -5
  58. data/ext/gio2/gfileoutputstream.o +0 -0
  59. data/ext/gio2/gfilterinputstream.c +1 -30
  60. data/ext/gio2/gfilterinputstream.o +0 -0
  61. data/ext/gio2/gfilteroutputstream.c +1 -30
  62. data/ext/gio2/gfilteroutputstream.o +0 -0
  63. data/ext/gio2/gicon.c +0 -2
  64. data/ext/gio2/gicon.o +0 -0
  65. data/ext/gio2/ginetaddress.c +0 -72
  66. data/ext/gio2/ginetaddress.o +0 -0
  67. data/ext/gio2/ginetsocketaddress.c +0 -16
  68. data/ext/gio2/ginetsocketaddress.o +0 -0
  69. data/ext/gio2/ginitable.o +0 -0
  70. data/ext/gio2/ginputstream.c +0 -2
  71. data/ext/gio2/ginputstream.o +0 -0
  72. data/ext/gio2/gio2.c +11 -1
  73. data/ext/gio2/gio2.h +9 -1
  74. data/ext/gio2/gio2.o +0 -0
  75. data/ext/gio2/gio2.so +0 -0
  76. data/ext/gio2/gioerror.c +4 -1
  77. data/ext/gio2/gioerror.o +0 -0
  78. data/ext/gio2/giomodule.c +2 -2
  79. data/ext/gio2/giomodule.o +0 -0
  80. data/ext/gio2/gioscheduler.c +4 -6
  81. data/ext/gio2/gioscheduler.o +0 -0
  82. data/ext/gio2/giostream.c +0 -23
  83. data/ext/gio2/giostream.o +0 -0
  84. data/ext/gio2/gloadableicon.c +0 -1
  85. data/ext/gio2/gloadableicon.o +0 -0
  86. data/ext/gio2/gmemoryinputstream.o +0 -0
  87. data/ext/gio2/gmemoryoutputstream.c +0 -24
  88. data/ext/gio2/gmemoryoutputstream.o +0 -0
  89. data/ext/gio2/gmount.c +1 -0
  90. data/ext/gio2/gmount.o +0 -0
  91. data/ext/gio2/gmountoperation.c +1 -103
  92. data/ext/gio2/gmountoperation.o +0 -0
  93. data/ext/gio2/gnetworkaddress.c +0 -14
  94. data/ext/gio2/gnetworkaddress.o +0 -0
  95. data/ext/gio2/gnetworkservice.c +0 -21
  96. data/ext/gio2/gnetworkservice.o +0 -0
  97. data/ext/gio2/goutputstream.c +8 -18
  98. data/ext/gio2/goutputstream.o +0 -0
  99. data/ext/gio2/gresolver.c +0 -2
  100. data/ext/gio2/gresolver.o +0 -0
  101. data/ext/gio2/gseekable.o +0 -0
  102. data/ext/gio2/gsimpleasyncresult.o +0 -0
  103. data/ext/gio2/gsocket.c +2 -80
  104. data/ext/gio2/gsocket.o +0 -0
  105. data/ext/gio2/gsocketaddress.c +1 -13
  106. data/ext/gio2/gsocketaddress.o +0 -0
  107. data/ext/gio2/gsocketclient.c +0 -68
  108. data/ext/gio2/gsocketclient.o +0 -0
  109. data/ext/gio2/gsocketconnectable.o +0 -0
  110. data/ext/gio2/gsocketconnection.c +1 -8
  111. data/ext/gio2/gsocketconnection.o +0 -0
  112. data/ext/gio2/gsocketcontrolmessage.c +0 -2
  113. data/ext/gio2/gsocketcontrolmessage.o +0 -0
  114. data/ext/gio2/gsocketlistener.c +27 -21
  115. data/ext/gio2/gsocketlistener.o +0 -0
  116. data/ext/gio2/gsocketservice.o +0 -0
  117. data/ext/gio2/gsrvtarget.o +0 -0
  118. data/ext/gio2/gtcpconnection.c +1 -22
  119. data/ext/gio2/gtcpconnection.o +0 -0
  120. data/ext/gio2/gthemedicon.o +0 -0
  121. data/ext/gio2/gthreadedsocketservice.c +6 -5
  122. data/ext/gio2/gthreadedsocketservice.o +0 -0
  123. data/ext/gio2/gunixconnection.o +0 -0
  124. data/ext/gio2/gunixfdlist.c +1 -1
  125. data/ext/gio2/gunixfdlist.o +0 -0
  126. data/ext/gio2/gunixfdmessage.c +0 -9
  127. data/ext/gio2/gunixfdmessage.o +0 -0
  128. data/ext/gio2/gunixinputstream.c +0 -24
  129. data/ext/gio2/gunixinputstream.o +0 -0
  130. data/ext/gio2/gunixmounts.c +1 -4
  131. data/ext/gio2/gunixmounts.o +0 -0
  132. data/ext/gio2/gunixoutputstream.c +0 -24
  133. data/ext/gio2/gunixoutputstream.o +0 -0
  134. data/ext/gio2/gunixsocketaddress.c +5 -17
  135. data/ext/gio2/gunixsocketaddress.o +0 -0
  136. data/ext/gio2/gvfs.c +0 -2
  137. data/ext/gio2/gvfs.o +0 -0
  138. data/ext/gio2/gvolume.o +0 -0
  139. data/ext/gio2/gvolumemonitor.c +0 -2
  140. data/ext/gio2/gvolumemonitor.o +0 -0
  141. data/ext/gio2/gzlibcompressor.c +3 -0
  142. data/ext/gio2/gzlibcompressor.o +0 -0
  143. data/ext/gio2/gzlibdecompressor.o +0 -0
  144. data/ext/gio2/ruby-gio2.pc +3 -0
  145. data/ext/gio2/util.c +3 -0
  146. data/ext/gio2/util.o +0 -0
  147. data/lib/gio2.rb +19 -1
  148. data/test/load-test.rb +14 -0
  149. data/test/test_bufferedinputstream.rb +2 -0
  150. data/test/test_charsetconverter.rb +2 -0
  151. data/test/test_datainputstream.rb +7 -0
  152. data/test/test_fileenumerator.rb +8 -0
  153. data/test/test_filemonitor.rb +2 -0
  154. data/test/test_inetaddress.rb +8 -0
  155. metadata +173 -79
@@ -0,0 +1,109 @@
1
+ /* -*- c-file-style: "ruby" -*- */
2
+ /*
3
+ * Ruby/GIO: a Ruby binding of gio-2.0.x.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
+ */
20
+
21
+ #include "gio2.h"
22
+
23
+ #define RVAL2GFILEATTRIBUTEINFOFLAGS(value) \
24
+ RVAL2GFLAGS((value), G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS)
25
+
26
+ #define RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(value) \
27
+ RVAL2TYPE_WITH_DEFAULT((value), \
28
+ RVAL2GFILEATTRIBUTEINFOFLAGS, \
29
+ G_FILE_ATTRIBUTE_INFO_NONE)
30
+
31
+ GType
32
+ g_file_attribute_info_list_get_type(void)
33
+ {
34
+ static GType our_type = 0;
35
+ if (our_type == 0)
36
+ our_type = g_boxed_type_register_static("GFileAttributeInfoList",
37
+ (GBoxedCopyFunc)g_file_attribute_info_list_ref,
38
+ (GBoxedFreeFunc)g_file_attribute_info_list_unref);
39
+ return our_type;
40
+ }
41
+
42
+ #define RVAL2GFILEATTRIBUTEINFOLIST(object) \
43
+ ((GFileAttributeInfoList *)(RVAL2BOXED(object, G_TYPE_FILE_ATTRIBUTE_INFO_LIST)))
44
+
45
+ #define _SELF(value) RVAL2GFILEATTRIBUTEINFOLIST(value)
46
+
47
+ static VALUE
48
+ fileattributeinfolist_initialize(VALUE self)
49
+ {
50
+ G_INITIALIZE(self, g_file_attribute_info_list_new());
51
+
52
+ return Qnil;
53
+ }
54
+
55
+ static VALUE
56
+ fileattributeinfolist_dup(VALUE self)
57
+ {
58
+ return GFILEATTRIBUTEINFOLIST2RVAL(g_file_attribute_info_list_dup(_SELF(self)));
59
+ }
60
+
61
+ static VALUE
62
+ fileattributeinfolist_lookup(VALUE self, VALUE name)
63
+ {
64
+ /* TODO: How do we deal with the const? */
65
+ return GFILEATTRIBUTEINFO2RVAL((GFileAttributeInfo *)g_file_attribute_info_list_lookup(_SELF(self),
66
+ RVAL2CSTR(name)));
67
+ }
68
+
69
+ static VALUE
70
+ fileattributeinfolist_add(int argc, VALUE *argv, VALUE self)
71
+ {
72
+ VALUE name, type, flags;
73
+
74
+ rb_scan_args(argc, argv, "21", &name, &type, &flags);
75
+
76
+ g_file_attribute_info_list_add(_SELF(self),
77
+ RVAL2CSTR(name),
78
+ RVAL2GFILEATTRIBUTETYPE(type),
79
+ RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(flags));
80
+
81
+ return self;
82
+ }
83
+
84
+ static VALUE
85
+ fileattributeinfolist_each(VALUE self)
86
+ {
87
+ GFileAttributeInfoList *list = RVAL2GFILEATTRIBUTEINFOLIST(self);
88
+ int i;
89
+
90
+ for (i = 0; i < list->n_infos; i++)
91
+ rb_yield(GFILEATTRIBUTEINFO2RVAL(&list->infos[i]));
92
+
93
+ return self;
94
+ }
95
+
96
+ void
97
+ Init_fileattributeinfolist(VALUE glib)
98
+ {
99
+ VALUE fileattributeinfolist = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_LIST, "FileAttributeInfoList", glib);
100
+
101
+ rb_include_module(fileattributeinfolist, rb_mEnumerable);
102
+
103
+ rb_define_method(fileattributeinfolist, "initialize", fileattributeinfolist_initialize, 0);
104
+ rb_define_method(fileattributeinfolist, "dup", fileattributeinfolist_dup, 0);
105
+ rb_define_method(fileattributeinfolist, "lookup", fileattributeinfolist_lookup, 1);
106
+ rb_define_alias(fileattributeinfolist, "[]", "lookup");
107
+ rb_define_method(fileattributeinfolist, "add", fileattributeinfolist_add, 3);
108
+ rb_define_method(fileattributeinfolist, "each", fileattributeinfolist_each, 0);
109
+ }
Binary file
Binary file
Binary file
@@ -151,8 +151,6 @@ Init_gfileenumerator(VALUE glib)
151
151
  {
152
152
  VALUE fileenumerator = G_DEF_CLASS(G_TYPE_FILE_ENUMERATOR, "FileEnumerator", glib);
153
153
 
154
- rb_undef_alloc_func(fileenumerator);
155
-
156
154
  rb_define_method(fileenumerator, "next_file", fileenumerator_next_file, -1);
157
155
  rb_define_method(fileenumerator, "close", fileenumerator_close, -1);
158
156
  rb_define_method(fileenumerator, "next_files_async", fileenumerator_next_files_async, -1);
Binary file
data/ext/gio2/gfileicon.c CHANGED
@@ -30,17 +30,10 @@ fileicon_initialize(VALUE self, VALUE file)
30
30
  return Qnil;
31
31
  }
32
32
 
33
- static VALUE
34
- fileicon_get_file(VALUE self)
35
- {
36
- return GOBJ2RVAL(g_file_icon_get_file(_SELF(self)));
37
- }
38
-
39
33
  void
40
34
  Init_gfileicon(VALUE glib)
41
35
  {
42
36
  VALUE fileicon = G_DEF_CLASS(G_TYPE_FILE_ICON, "FileIcon", glib);
43
37
 
44
38
  rb_define_method(fileicon, "initialize", fileicon_initialize, 1);
45
- rb_define_method(fileicon, "file", fileicon_get_file, 0);
46
39
  }
Binary file
data/ext/gio2/gfileinfo.c CHANGED
@@ -45,7 +45,6 @@ fileinfo_dup(VALUE self)
45
45
  return GOBJ2RVAL_UNREF(g_file_info_dup(_SELF(self)));
46
46
  }
47
47
 
48
- /* TODO: Does this make sense from the Ruby side? */
49
48
  static VALUE
50
49
  fileinfo_copy_into(VALUE self, VALUE other)
51
50
  {
@@ -172,8 +171,8 @@ fileinfo_get_attribute_string(VALUE self, VALUE attribute)
172
171
  static VALUE
173
172
  fileinfo_get_attribute_stringv(VALUE self, VALUE attribute)
174
173
  {
175
- return STRVECTOR2ARY_FREE(g_file_info_get_attribute_stringv(_SELF(self),
176
- RVAL2CSTR(attribute)));
174
+ return STRVECTOR2ARY((const gchar * const *)g_file_info_get_attribute_stringv(_SELF(self),
175
+ RVAL2CSTR(attribute)));
177
176
  }
178
177
 
179
178
  static VALUE
@@ -242,8 +241,6 @@ fileinfo_get_attribute_value(VALUE self, VALUE attribute)
242
241
  return file_attribute_to_value(type, value);
243
242
  }
244
243
 
245
- /* TODO: Do we need set_attribute? */
246
-
247
244
  static VALUE
248
245
  fileinfo_set_attribute_string(VALUE self, VALUE attribute, VALUE value)
249
246
  {
@@ -324,8 +321,6 @@ fileinfo_set_attribute_object(VALUE self, VALUE attribute, VALUE value)
324
321
  return self;
325
322
  }
326
323
 
327
- /* TODO: How do we implement set_attribute_value? */
328
-
329
324
  static VALUE
330
325
  fileinfo_clear_status(VALUE self)
331
326
  {
@@ -562,15 +557,13 @@ Init_gfileinfo(VALUE glib)
562
557
  {
563
558
  VALUE fileinfo = G_DEF_CLASS(G_TYPE_FILE_INFO, "FileInfo", glib);
564
559
 
565
- G_DEF_CLASS(G_TYPE_FILE_TYPE, "FileType", glib);
566
- G_DEF_CONSTANTS(glib, G_TYPE_FILE_TYPE, "G_FILE_");
567
-
568
560
  rb_define_method(fileinfo, "initialize", fileinfo_initialize, 0);
569
561
  rb_define_method(fileinfo, "dup", fileinfo_dup, 0);
570
562
  rb_define_method(fileinfo, "copy_into", fileinfo_copy_into, 1);
571
563
  rb_define_method(fileinfo, "has_attribute?", fileinfo_has_attribute, 1);
572
564
  rb_define_method(fileinfo, "has_namespace?", fileinfo_has_namespace, 1);
573
- rb_define_method(fileinfo, "attributes", fileinfo_list_attributes, -1);
565
+ rb_define_method(fileinfo, "list_attributes", fileinfo_list_attributes, -1);
566
+ rb_define_alias(fileinfo, "attributes", "list_attributes");
574
567
  rb_define_method(fileinfo, "get_attribute_type", fileinfo_get_attribute_type, 1);
575
568
  rb_define_method(fileinfo, "remove_attribute", fileinfo_remove_attribute, 1);
576
569
  rb_define_method(fileinfo, "get_attribute_as_string", fileinfo_get_attribute_as_string, 1);
Binary file
@@ -84,8 +84,6 @@ Init_gfileinputstream(VALUE glib)
84
84
  {
85
85
  VALUE fileinputstream = G_DEF_CLASS(G_TYPE_FILE_INPUT_STREAM, "FileInputStream", glib);
86
86
 
87
- rb_undef_alloc_func(fileinputstream);
88
-
89
87
  rb_define_method(fileinputstream, "query_info", fileinputstream_query_info, -1);
90
88
  rb_define_method(fileinputstream, "query_info_async", fileinputstream_query_info_async, -1);
91
89
  rb_define_method(fileinputstream, "query_info_finish", fileinputstream_query_info_finish, 1);
Binary file
@@ -89,8 +89,6 @@ Init_gfileiostream(VALUE glib)
89
89
  {
90
90
  VALUE fileiostream = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", glib);
91
91
 
92
- rb_undef_alloc_func(fileiostream);
93
-
94
92
  rb_define_method(fileiostream, "etag", fileiostream_get_etag, 0);
95
93
  rb_define_method(fileiostream, "query_info", fileiostream_query_info, -1);
96
94
  rb_define_method(fileiostream, "query_info_async", fileiostream_query_info_async, -1);
Binary file
@@ -28,20 +28,6 @@ filemonitor_cancel(VALUE self)
28
28
  return CBOOL2RVAL(g_file_monitor_cancel(_SELF(self)));
29
29
  }
30
30
 
31
- static VALUE
32
- filemonitor_is_cancelled(VALUE self)
33
- {
34
- return CBOOL2RVAL(g_file_monitor_is_cancelled(_SELF(self)));
35
- }
36
-
37
- static VALUE
38
- filemonitor_set_rate_limit(VALUE self, VALUE rate_limit)
39
- {
40
- g_file_monitor_set_rate_limit(_SELF(self), FIX2INT(rate_limit));
41
-
42
- return self;
43
- }
44
-
45
31
  void
46
32
  Init_gfilemonitor(VALUE glib)
47
33
  {
@@ -53,11 +39,6 @@ Init_gfilemonitor(VALUE glib)
53
39
  G_DEF_CLASS(G_TYPE_FILE_MONITOR_FLAGS, "Flags", filemonitor);
54
40
  G_DEF_CONSTANTS(filemonitor, G_TYPE_FILE_MONITOR_FLAGS, "G_FILE_MONITOR_");
55
41
 
56
- rb_undef_alloc_func(filemonitor);
57
-
58
42
  rb_define_method(filemonitor, "cancel", filemonitor_cancel, 0);
59
- rb_define_method(filemonitor, "cancelled?", filemonitor_is_cancelled, 0);
60
- rb_define_method(filemonitor, "set_rate_limit", filemonitor_set_rate_limit, 1);
61
- G_DEF_SETTER(filemonitor, "rate_limit");
62
43
  /* TODO: Do we need #emit_event? */
63
44
  }
Binary file
Binary file
@@ -87,11 +87,7 @@ fileoutputstream_get_etag(VALUE self)
87
87
  void
88
88
  Init_gfileoutputstream(VALUE glib)
89
89
  {
90
- VALUE fileoutputstream = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM,
91
- "FileOutputStream",
92
- glib);
93
-
94
- rb_undef_alloc_func(fileoutputstream);
90
+ VALUE fileoutputstream = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", glib);
95
91
 
96
92
  rb_define_method(fileoutputstream, "query_info", fileoutputstream_query_info, -1);
97
93
  rb_define_method(fileoutputstream, "query_info_async", fileoutputstream_query_info_async, -1);
Binary file
@@ -20,37 +20,8 @@
20
20
 
21
21
  #include "gio2.h"
22
22
 
23
- #define _SELF(value) G_FILTER_INPUT_STREAM(RVAL2GOBJ(value))
24
-
25
- static VALUE
26
- filterinputstream_get_base_stream(VALUE self)
27
- {
28
- return GOBJ2RVAL(g_filter_input_stream_get_base_stream(_SELF(self)));
29
- }
30
-
31
- static VALUE
32
- filterinputstream_get_close_base_stream(VALUE self)
33
- {
34
- return CBOOL2RVAL(g_filter_input_stream_get_close_base_stream(_SELF(self)));
35
- }
36
-
37
- static VALUE
38
- filterinputstream_set_close_base_stream(VALUE self, VALUE close_base)
39
- {
40
- g_filter_input_stream_set_close_base_stream(_SELF(self), RVAL2CBOOL(close_base));
41
-
42
- return self;
43
- }
44
-
45
23
  void
46
24
  Init_gfilterinputstream(VALUE glib)
47
25
  {
48
- VALUE filterinputstream = G_DEF_CLASS(G_TYPE_FILTER_INPUT_STREAM, "FilterInputStream", glib);
49
-
50
- rb_undef_alloc_func(filterinputstream);
51
-
52
- rb_define_method(filterinputstream, "base_stream", filterinputstream_get_base_stream, 0);
53
- rb_define_method(filterinputstream, "close_base_stream?", filterinputstream_get_close_base_stream, 0);
54
- rb_define_method(filterinputstream, "set_close_base_stream", filterinputstream_set_close_base_stream, 1);
55
- G_DEF_SETTER(filterinputstream, "close_base_stream");
26
+ (void)G_DEF_CLASS(G_TYPE_FILTER_INPUT_STREAM, "FilterInputStream", glib);
56
27
  }
Binary file
@@ -20,37 +20,8 @@
20
20
 
21
21
  #include "gio2.h"
22
22
 
23
- #define _SELF(value) G_FILTER_OUTPUT_STREAM(RVAL2GOBJ(value))
24
-
25
- static VALUE
26
- filteroutputstream_get_base_stream(VALUE self)
27
- {
28
- return GOBJ2RVAL(g_filter_output_stream_get_base_stream(_SELF(self)));
29
- }
30
-
31
- static VALUE
32
- filteroutputstream_get_close_base_stream(VALUE self)
33
- {
34
- return CBOOL2RVAL(g_filter_output_stream_get_close_base_stream(_SELF(self)));
35
- }
36
-
37
- static VALUE
38
- filteroutputstream_set_close_base_stream(VALUE self, VALUE close_base)
39
- {
40
- g_filter_output_stream_set_close_base_stream(_SELF(self), RVAL2CBOOL(close_base));
41
-
42
- return self;
43
- }
44
-
45
23
  void
46
24
  Init_gfilteroutputstream(VALUE glib)
47
25
  {
48
- VALUE filteroutputstream = G_DEF_CLASS(G_TYPE_FILTER_OUTPUT_STREAM, "FilterOutputStream", glib);
49
-
50
- rb_undef_alloc_func(filteroutputstream);
51
-
52
- rb_define_method(filteroutputstream, "base_stream", filteroutputstream_get_base_stream, 0);
53
- rb_define_method(filteroutputstream, "close_base_stream?", filteroutputstream_get_close_base_stream, 0);
54
- rb_define_method(filteroutputstream, "set_close_base_stream", filteroutputstream_set_close_base_stream, 1);
55
- G_DEF_SETTER(filteroutputstream, "close_base_stream");
26
+ (void)G_DEF_CLASS(G_TYPE_FILTER_OUTPUT_STREAM, "FilterOutputStream", glib);
56
27
  }
Binary file
data/ext/gio2/gicon.c CHANGED
@@ -50,7 +50,6 @@ icon_equal(VALUE self, VALUE other)
50
50
  static VALUE
51
51
  icon_to_string(VALUE self)
52
52
  {
53
- /* TODO: Should we raise if it returns NULL? */
54
53
  return CSTR2RVAL_FREE(g_icon_to_string(_SELF(self)));
55
54
  }
56
55
 
@@ -64,6 +63,5 @@ Init_gicon(VALUE glib)
64
63
  rb_define_method(icon, "hash", icon_hash, 0);
65
64
  rb_define_method(icon, "==", icon_equal, 1);
66
65
  rb_define_method(icon, "to_string", icon_to_string, 0);
67
- rb_define_alias(icon, "to_str", "to_string");
68
66
  rb_define_alias(icon, "to_s", "to_string");
69
67
  }
data/ext/gio2/gicon.o ADDED
Binary file
@@ -98,66 +98,6 @@ inetaddress_to_string(VALUE self)
98
98
  return CSTR2RVAL_FREE(g_inet_address_to_string(_SELF(self)));
99
99
  }
100
100
 
101
- static VALUE
102
- inetaddress_get_family(VALUE self)
103
- {
104
- return GSOCKETFAMILY2RVAL(g_inet_address_get_family(_SELF(self)));
105
- }
106
-
107
- static VALUE
108
- inetaddress_get_is_any(VALUE self)
109
- {
110
- return CBOOL2RVAL(g_inet_address_get_is_any(_SELF(self)));
111
- }
112
-
113
- static VALUE
114
- inetaddress_get_is_loopback(VALUE self)
115
- {
116
- return CBOOL2RVAL(g_inet_address_get_is_loopback(_SELF(self)));
117
- }
118
-
119
- static VALUE
120
- inetaddress_get_is_link_local(VALUE self)
121
- {
122
- return CBOOL2RVAL(g_inet_address_get_is_link_local(_SELF(self)));
123
- }
124
-
125
- static VALUE
126
- inetaddress_get_is_site_local(VALUE self)
127
- {
128
- return CBOOL2RVAL(g_inet_address_get_is_site_local(_SELF(self)));
129
- }
130
-
131
- static VALUE
132
- inetaddress_get_is_multicast(VALUE self)
133
- {
134
- return CBOOL2RVAL(g_inet_address_get_is_multicast(_SELF(self)));
135
- }
136
-
137
- static VALUE
138
- inetaddress_get_is_mc_link_local(VALUE self)
139
- {
140
- return CBOOL2RVAL(g_inet_address_get_is_mc_link_local(_SELF(self)));
141
- }
142
-
143
- static VALUE
144
- inetaddress_get_is_mc_node_local(VALUE self)
145
- {
146
- return CBOOL2RVAL(g_inet_address_get_is_mc_node_local(_SELF(self)));
147
- }
148
-
149
- static VALUE
150
- inetaddress_get_is_mc_site_local(VALUE self)
151
- {
152
- return CBOOL2RVAL(g_inet_address_get_is_mc_site_local(_SELF(self)));
153
- }
154
-
155
- static VALUE
156
- inetaddress_get_is_mc_global(VALUE self)
157
- {
158
- return CBOOL2RVAL(g_inet_address_get_is_mc_global(_SELF(self)));
159
- }
160
-
161
101
  void
162
102
  Init_ginetaddress(VALUE glib)
163
103
  {
@@ -168,21 +108,9 @@ Init_ginetaddress(VALUE glib)
168
108
  rb_define_singleton_method(inetaddress, "new_any", inetaddress_new_any, 1);
169
109
  rb_define_singleton_method(inetaddress, "new_loopback", inetaddress_new_loopback, 1);
170
110
 
171
- rb_undef_alloc_func(inetaddress);
172
-
173
111
  rb_define_method(inetaddress, "to_bytes", inetaddress_to_bytes, 0);
174
112
  rb_define_method(inetaddress, "get_native_size", inetaddress_get_native_size, 0);
175
113
  rb_define_method(inetaddress, "to_string", inetaddress_to_string, 0);
176
114
  rb_define_alias(inetaddress, "to_str", "to_string");
177
115
  rb_define_alias(inetaddress, "to_s", "to_string");
178
- rb_define_method(inetaddress, "family", inetaddress_get_family, 0);
179
- rb_define_method(inetaddress, "any?", inetaddress_get_is_any, 0);
180
- rb_define_method(inetaddress, "loopback?", inetaddress_get_is_loopback, 0);
181
- rb_define_method(inetaddress, "link_local?", inetaddress_get_is_link_local, 0);
182
- rb_define_method(inetaddress, "site_local?", inetaddress_get_is_site_local, 0);
183
- rb_define_method(inetaddress, "multicast?", inetaddress_get_is_multicast, 0);
184
- rb_define_method(inetaddress, "mc_link_local?", inetaddress_get_is_mc_link_local, 0);
185
- rb_define_method(inetaddress, "mc_node_local?", inetaddress_get_is_mc_node_local, 0);
186
- rb_define_method(inetaddress, "mc_site_local?", inetaddress_get_is_mc_site_local, 0);
187
- rb_define_method(inetaddress, "mc_global?", inetaddress_get_is_mc_global, 0);
188
116
  }
Binary file
@@ -20,8 +20,6 @@
20
20
 
21
21
  #include "gio2.h"
22
22
 
23
- #define _SELF(value) G_INET_SOCKET_ADDRESS(RVAL2GOBJ(value))
24
-
25
23
  static VALUE
26
24
  inetsocketaddress_initialize(VALUE self, VALUE address, VALUE port)
27
25
  {
@@ -31,24 +29,10 @@ inetsocketaddress_initialize(VALUE self, VALUE address, VALUE port)
31
29
  return Qnil;
32
30
  }
33
31
 
34
- static VALUE
35
- inetsocketaddress_get_address(VALUE self)
36
- {
37
- return GOBJ2RVAL(g_inet_socket_address_get_address(_SELF(self)));
38
- }
39
-
40
- static VALUE
41
- inetsocketaddress_get_port(VALUE self)
42
- {
43
- return GUINT162RVAL(g_inet_socket_address_get_port(_SELF(self)));
44
- }
45
-
46
32
  void
47
33
  Init_ginetsocketaddress(VALUE glib)
48
34
  {
49
35
  VALUE inetsocketaddress = G_DEF_CLASS(G_TYPE_INET_SOCKET_ADDRESS, "InetSocketAddress", glib);
50
36
 
51
37
  rb_define_method(inetsocketaddress, "initialize", inetsocketaddress_initialize, 2);
52
- rb_define_method(inetsocketaddress, "address", inetsocketaddress_get_address, 0);
53
- rb_define_method(inetsocketaddress, "port", inetsocketaddress_get_port, 0);
54
38
  }
Binary file
Binary file
@@ -322,8 +322,6 @@ Init_ginputstream(VALUE glib)
322
322
 
323
323
  s_cReadAsyncResult = rb_define_class_under(inputstream, "ReadAsyncResult", rb_cObject);
324
324
 
325
- rb_undef_alloc_func(inputstream);
326
-
327
325
  rb_define_method(inputstream, "read", inputstream_read, -1);
328
326
  rb_define_method(inputstream, "read_all", inputstream_read_all, -1);
329
327
  rb_define_method(inputstream, "skip", inputstream_skip, -1);
Binary file
data/ext/gio2/gio2.c CHANGED
@@ -37,6 +37,15 @@ Init_gio2(void)
37
37
  {
38
38
  VALUE glib = mGLib;
39
39
 
40
+ G_DEF_CLASS(G_TYPE_FILESYSTEM_PREVIEW_TYPE, "FilesystemPreviewType", glib);
41
+ G_DEF_CONSTANTS(glib, G_TYPE_FILESYSTEM_PREVIEW_TYPE, "G_");
42
+
43
+ G_DEF_CLASS(G_TYPE_DATA_STREAM_BYTE_ORDER, "DataStreamByteOrder", glib);
44
+ G_DEF_CONSTANTS(glib, G_TYPE_DATA_STREAM_BYTE_ORDER, "G_");
45
+
46
+ G_DEF_CLASS(G_TYPE_DATA_STREAM_NEWLINE_TYPE, "DataStreamNewlineType", glib);
47
+ G_DEF_CONSTANTS(glib, G_TYPE_DATA_STREAM_NEWLINE_TYPE, "G_");
48
+
40
49
  rb_define_module_function(glib, "gio_has_unix?", gio_has_unix, 0);
41
50
 
42
51
  Init_util();
@@ -55,13 +64,14 @@ Init_gio2(void)
55
64
  Init_gconverteroutputstream(glib);
56
65
  Init_gdatainputstream(glib);
57
66
  Init_gdesktopappinfo(glib);
58
- Init_gfileattributematcher(glib);
59
67
  Init_gdataoutputstream(glib);
60
68
  Init_gdrive(glib);
61
69
  Init_gemblem(glib);
62
70
  Init_gemblemedicon(glib);
63
71
  Init_gfile(glib);
64
72
  Init_gfileattribute(glib);
73
+ Init_gfileattributeinfo(glib);
74
+ Init_gfileattributematcher(glib);
65
75
  Init_gfiledescriptorbased(glib);
66
76
  Init_gfileenumerator(glib);
67
77
  Init_gfileicon(glib);
data/ext/gio2/gio2.h CHANGED
@@ -84,8 +84,14 @@ GType g_file_attribute_matcher_get_type(void);
84
84
  #define GFILEATTRIBUTETYPE2RVAL(value) \
85
85
  GENUM2RVAL((value), G_TYPE_FILE_ATTRIBUTE_TYPE)
86
86
 
87
+ #define GFILEATTRIBUTEINFO2RVAL(object) \
88
+ BOXED2RVAL(object, G_TYPE_FILE_ATTRIBUTE_INFO)
89
+
90
+ #define G_TYPE_FILE_ATTRIBUTE_INFO (g_file_attribute_info_get_type())
91
+ GType g_file_attribute_info_get_type(void);
92
+
87
93
  #define G_TYPE_FILE_ATTRIBUTE_INFO_LIST (g_file_attribute_info_list_get_type())
88
- GType g_file_attribute_info_list_get_type();
94
+ GType g_file_attribute_info_list_get_type(void);
89
95
 
90
96
  #define GFILEATTRIBUTEINFOLIST2RVAL(object) \
91
97
  BOXED2RVAL(object, G_TYPE_FILE_ATTRIBUTE_INFO_LIST)
@@ -278,6 +284,8 @@ G_GNUC_INTERNAL void Init_gemblem(VALUE glib);
278
284
  G_GNUC_INTERNAL void Init_gemblemedicon(VALUE glib);
279
285
  G_GNUC_INTERNAL void Init_gfile(VALUE glib);
280
286
  G_GNUC_INTERNAL void Init_gfileattribute(VALUE glib);
287
+ G_GNUC_INTERNAL void Init_gfileattributeinfo(VALUE glib);
288
+ G_GNUC_INTERNAL void Init_fileattributeinfolist(VALUE glib);
281
289
  G_GNUC_INTERNAL void Init_gfileattributematcher(VALUE glib);
282
290
  G_GNUC_INTERNAL void Init_gfiledescriptorbased(VALUE glib);
283
291
  G_GNUC_INTERNAL void Init_gfileenumerator(VALUE glib);
data/ext/gio2/gio2.o ADDED
Binary file
data/ext/gio2/gio2.so ADDED
Binary file
data/ext/gio2/gioerror.c CHANGED
@@ -27,7 +27,6 @@ Init_gioerror(VALUE glib)
27
27
  {
28
28
  VALUE io, error;
29
29
 
30
- /* TODO: Is this naming scheme correct/the best? */
31
30
  io = rb_define_module_under(glib, "IO");
32
31
 
33
32
  error = rbgio_define_domain_error(io, "Error", G_IO_ERROR, "GIOErrorEnum", rb_eIOError);
@@ -64,4 +63,8 @@ Init_gioerror(VALUE glib)
64
63
  rbgio_define_error(io, "WouldMergeError", G_IO_ERROR_WOULD_MERGE, error);
65
64
  rbgio_define_error(io, "FailedHandledError", G_IO_ERROR_FAILED_HANDLED, error);
66
65
  rbgio_define_error(io, "TooManyOpenFilesError", G_IO_ERROR_TOO_MANY_OPEN_FILES, error);
66
+ rbgio_define_error(io, "NotInitializedError", G_IO_ERROR_NOT_INITIALIZED, error);
67
+ rbgio_define_error(io, "AddressInUseError", G_IO_ERROR_ADDRESS_IN_USE, error);
68
+ rbgio_define_error(io, "PartialInputError", G_IO_ERROR_PARTIAL_INPUT, error);
69
+ rbgio_define_error(io, "InvalidDataError", G_IO_ERROR_INVALID_DATA, error);
67
70
  }
Binary file
data/ext/gio2/giomodule.c CHANGED
@@ -57,7 +57,7 @@ Init_giomodule(VALUE glib)
57
57
 
58
58
  iomodules = rb_define_module_under(glib, "IOModules");
59
59
 
60
- rb_define_module_function(iomodule, "load_all_in_directory", iomodule_load_all_in_directory, 1);
61
- rb_define_module_function(iomodule, "scan_all_in_directory", iomodule_scan_all_in_directory, 1);
60
+ rb_define_module_function(iomodules, "load_all_in_directory", iomodule_load_all_in_directory, 1);
61
+ rb_define_module_function(iomodules, "scan_all_in_directory", iomodule_scan_all_in_directory, 1);
62
62
 
63
63
  }
Binary file
@@ -103,7 +103,7 @@ ioscheduler_push_job(int argc, VALUE *argv, VALUE self)
103
103
  gint io_priority;
104
104
  GCancellable *cancellable;
105
105
 
106
- rb_scan_args(argc, argv, "01", &rbio_priority, &rbcancellable);
106
+ rb_scan_args(argc, argv, "02", &rbio_priority, &rbcancellable);
107
107
  io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
108
108
  cancellable = RVAL2GCANCELLABLE(rbcancellable);
109
109
  block = rb_block_proc();
@@ -184,11 +184,9 @@ Init_gioscheduler(VALUE glib)
184
184
  {
185
185
  VALUE ioschedulerjob = G_DEF_CLASS(G_TYPE_IO_SCHEDULER_JOB, "IOSchedulerJob", glib);
186
186
 
187
- /* TODO: These don’t follow naming scheme exactly, but seems redundant
188
- * to add GLib::IOScheduler. Perhaps rename them to push and
189
- * cancel_all. */
190
- rb_define_singleton_method(ioschedulerjob, "push_job", ioscheduler_push_job, -1);
191
- rb_define_singleton_method(ioschedulerjob, "cancel_all_jobs", ioscheduler_cancel_all_jobs, 0);
187
+ VALUE ioscheduler = rb_define_module_under(glib, "IOScheduler");
188
+ rb_define_singleton_method(ioscheduler, "push_job", ioscheduler_push_job, -1);
189
+ rb_define_singleton_method(ioscheduler, "cancel_all_jobs", ioscheduler_cancel_all_jobs, 0);
192
190
 
193
191
  rb_define_method(ioschedulerjob, "send_to_mainloop", ioschedulerjob_send_to_mainloop, 0);
194
192
  rb_define_method(ioschedulerjob, "send_to_mainloop_async", ioschedulerjob_send_to_mainloop_async, 0);
Binary file