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.
Files changed (156) hide show
  1. data/ext/gio2/extconf.rb +4 -42
  2. data/ext/gio2/gio2.c +18 -117
  3. data/ext/gio2/gio2.h +20 -339
  4. data/ext/gio2/rbgio.c +132 -0
  5. data/ext/gio2/rbgio2.h +156 -0
  6. data/ext/gio2/rbgio2conversions.h +154 -0
  7. data/ext/gio2/rbgio2private.h +147 -0
  8. data/ext/gio2/{gappinfo.c → rbgioappinfo.c} +81 -82
  9. data/ext/gio2/rbgioapplaunchcontext.c +81 -0
  10. data/ext/gio2/{gasyncinitable.c → rbgioasyncinitable.c} +33 -30
  11. data/ext/gio2/rbgioasyncresult.c +41 -0
  12. data/ext/gio2/{gbufferedinputstream.c → rbgiobufferedinputstream.c} +37 -35
  13. data/ext/gio2/rbgiobufferedoutputstream.c +50 -0
  14. data/ext/gio2/rbgiocancellable.c +180 -0
  15. data/ext/gio2/rbgiocharsetconverter.c +57 -0
  16. data/ext/gio2/rbgiocontenttype.c +131 -0
  17. data/ext/gio2/{gconverter.c → rbgioconverter.c} +24 -28
  18. data/ext/gio2/rbgioconverterinputstream.c +43 -0
  19. data/ext/gio2/rbgioconverteroutputstream.c +43 -0
  20. data/ext/gio2/{gdatainputstream.c → rbgiodatainputstream.c} +49 -58
  21. data/ext/gio2/{gdataoutputstream.c → rbgiodataoutputstream.c} +39 -37
  22. data/ext/gio2/rbgiodesktopappinfo.c +87 -0
  23. data/ext/gio2/{gdrive.c → rbgiodrive.c} +75 -76
  24. data/ext/gio2/rbgioemblem.c +52 -0
  25. data/ext/gio2/rbgioemblemedicon.c +65 -0
  26. data/ext/gio2/{gfile.c → rbgiofile.c} +256 -266
  27. data/ext/gio2/rbgiofileattribute.c +114 -0
  28. data/ext/gio2/rbgiofileattributeinfo.c +86 -0
  29. data/ext/gio2/rbgiofileattributeinfolist.c +106 -0
  30. data/ext/gio2/rbgiofileattributematcher.c +93 -0
  31. data/ext/gio2/rbgiofiledescriptorbased.c +45 -0
  32. data/ext/gio2/{gfileenumerator.c → rbgiofileenumerator.c} +42 -40
  33. data/ext/gio2/rbgiofileicon.c +41 -0
  34. data/ext/gio2/{gfileinfo.c → rbgiofileinfo.c} +159 -163
  35. data/ext/gio2/{gfileinputstream.c → rbgiofileinputstream.c} +26 -25
  36. data/ext/gio2/{gfileiostream.c → rbgiofileiostream.c} +28 -26
  37. data/ext/gio2/rbgiofilemonitor.c +46 -0
  38. data/ext/gio2/rbgiofilenamecompleter.c +74 -0
  39. data/ext/gio2/{gfileoutputstream.c → rbgiofileoutputstream.c} +28 -26
  40. data/ext/gio2/rbgiofilterinputstream.c +28 -0
  41. data/ext/gio2/rbgiofilteroutputstream.c +28 -0
  42. data/ext/gio2/rbgioicon.c +69 -0
  43. data/ext/gio2/rbgioinetaddress.c +118 -0
  44. data/ext/gio2/rbgioinetsocketaddress.c +41 -0
  45. data/ext/gio2/{ginitable.c → rbgioinitable.c} +29 -25
  46. data/ext/gio2/{ginputstream.c → rbgioinputstream.c} +50 -48
  47. data/ext/gio2/rbgioio.c +73 -0
  48. data/ext/gio2/rbgioiomodule.c +45 -0
  49. data/ext/gio2/rbgioiomodules.c +47 -0
  50. data/ext/gio2/rbgioioscheduler.c +102 -0
  51. data/ext/gio2/rbgioioschedulerjob.c +121 -0
  52. data/ext/gio2/rbgioiostream.c +108 -0
  53. data/ext/gio2/{gloadableicon.c → rbgioloadableicon.c} +26 -24
  54. data/ext/gio2/rbgiomemoryinputstream.c +67 -0
  55. data/ext/gio2/rbgiomemoryoutputstream.c +44 -0
  56. data/ext/gio2/{gmount.c → rbgiomount.c} +70 -68
  57. data/ext/gio2/rbgiomountoperation.c +53 -0
  58. data/ext/gio2/rbgionetworkaddress.c +59 -0
  59. data/ext/gio2/rbgionetworkservice.c +45 -0
  60. data/ext/gio2/{goutputstream.c → rbgiooutputstream.c} +61 -62
  61. data/ext/gio2/{gresolver.c → rbgioresolver.c} +50 -48
  62. data/ext/gio2/rbgioseekable.c +91 -0
  63. data/ext/gio2/rbgiosimpleasyncresult.c +155 -0
  64. data/ext/gio2/{gsocket.c → rbgiosocket.c} +74 -76
  65. data/ext/gio2/rbgiosocketaddress.c +34 -0
  66. data/ext/gio2/rbgiosocketaddressenumerator.c +83 -0
  67. data/ext/gio2/{gsocketclient.c → rbgiosocketclient.c} +41 -39
  68. data/ext/gio2/rbgiosocketconnectable.c +41 -0
  69. data/ext/gio2/rbgiosocketconnection.c +66 -0
  70. data/ext/gio2/rbgiosocketconnectionfactory.c +39 -0
  71. data/ext/gio2/rbgiosocketcontrolmessage.c +82 -0
  72. data/ext/gio2/{gsocketlistener.c → rbgiosocketlistener.c} +49 -47
  73. data/ext/gio2/rbgiosocketservice.c +66 -0
  74. data/ext/gio2/rbgiosrvtarget.c +76 -0
  75. data/ext/gio2/rbgiotcpconnection.c +28 -0
  76. data/ext/gio2/rbgiothemedicon.c +83 -0
  77. data/ext/gio2/rbgiothreadedsocketservice.c +43 -0
  78. data/ext/gio2/rbgiounixconnection.c +71 -0
  79. data/ext/gio2/rbgiounixfdlist.c +115 -0
  80. data/ext/gio2/rbgiounixfdmessage.c +74 -0
  81. data/ext/gio2/rbgiounixinputstream.c +51 -0
  82. data/ext/gio2/rbgiounixmount.c +164 -0
  83. data/ext/gio2/rbgiounixmountmonitor.c +66 -0
  84. data/ext/gio2/rbgiounixmountpoint.c +136 -0
  85. data/ext/gio2/rbgiounixmountpoints.c +58 -0
  86. data/ext/gio2/rbgiounixmounts.c +58 -0
  87. data/ext/gio2/rbgiounixoutputstream.c +51 -0
  88. data/ext/gio2/rbgiounixsocketaddress.c +69 -0
  89. data/ext/gio2/rbgiovfs.c +84 -0
  90. data/ext/gio2/rbgiovolume.c +193 -0
  91. data/ext/gio2/rbgiovolumemonitor.c +77 -0
  92. data/ext/gio2/rbgiozlibcompressor.c +52 -0
  93. data/ext/gio2/rbgiozlibdecompressor.c +45 -0
  94. data/ext/gio2/util.c +57 -60
  95. data/lib/1.8/gio2.so +0 -0
  96. data/lib/1.9/gio2.so +0 -0
  97. data/lib/gio2/deprecated.rb +102 -0
  98. data/lib/gio2.rb +14 -12
  99. metadata +100 -88
  100. data/ChangeLog +0 -129
  101. data/ext/gio2/gapplaunchcontext.c +0 -79
  102. data/ext/gio2/gasyncresult.c +0 -39
  103. data/ext/gio2/gbufferedoutputstream.c +0 -48
  104. data/ext/gio2/gcancellable.c +0 -177
  105. data/ext/gio2/gcharsetconverter.c +0 -55
  106. data/ext/gio2/gcontenttype.c +0 -128
  107. data/ext/gio2/gconverterinputstream.c +0 -41
  108. data/ext/gio2/gconverteroutputstream.c +0 -41
  109. data/ext/gio2/gdesktopappinfo.c +0 -88
  110. data/ext/gio2/gemblem.c +0 -52
  111. data/ext/gio2/gemblemedicon.c +0 -63
  112. data/ext/gio2/gfileattribute.c +0 -111
  113. data/ext/gio2/gfileattributeinfo.c +0 -89
  114. data/ext/gio2/gfileattributeinfolist.c +0 -109
  115. data/ext/gio2/gfileattributematcher.c +0 -90
  116. data/ext/gio2/gfiledescriptorbased.c +0 -42
  117. data/ext/gio2/gfileicon.c +0 -39
  118. data/ext/gio2/gfilemonitor.c +0 -44
  119. data/ext/gio2/gfilenamecompleter.c +0 -72
  120. data/ext/gio2/gfilterinputstream.c +0 -27
  121. data/ext/gio2/gfilteroutputstream.c +0 -27
  122. data/ext/gio2/gicon.c +0 -67
  123. data/ext/gio2/ginetaddress.c +0 -116
  124. data/ext/gio2/ginetsocketaddress.c +0 -38
  125. data/ext/gio2/gioerror.c +0 -70
  126. data/ext/gio2/giomodule.c +0 -63
  127. data/ext/gio2/gioscheduler.c +0 -193
  128. data/ext/gio2/giostream.c +0 -106
  129. data/ext/gio2/gmemoryinputstream.c +0 -65
  130. data/ext/gio2/gmemoryoutputstream.c +0 -41
  131. data/ext/gio2/gmountoperation.c +0 -66
  132. data/ext/gio2/gnetworkaddress.c +0 -57
  133. data/ext/gio2/gnetworkservice.c +0 -43
  134. data/ext/gio2/gseekable.c +0 -89
  135. data/ext/gio2/gsimpleasyncresult.c +0 -153
  136. data/ext/gio2/gsocketaddress.c +0 -33
  137. data/ext/gio2/gsocketconnectable.c +0 -97
  138. data/ext/gio2/gsocketconnection.c +0 -75
  139. data/ext/gio2/gsocketcontrolmessage.c +0 -80
  140. data/ext/gio2/gsocketservice.c +0 -64
  141. data/ext/gio2/gsrvtarget.c +0 -77
  142. data/ext/gio2/gtcpconnection.c +0 -27
  143. data/ext/gio2/gthemedicon.c +0 -81
  144. data/ext/gio2/gthreadedsocketservice.c +0 -40
  145. data/ext/gio2/gunixconnection.c +0 -69
  146. data/ext/gio2/gunixfdlist.c +0 -112
  147. data/ext/gio2/gunixfdmessage.c +0 -72
  148. data/ext/gio2/gunixinputstream.c +0 -49
  149. data/ext/gio2/gunixmounts.c +0 -343
  150. data/ext/gio2/gunixoutputstream.c +0 -49
  151. data/ext/gio2/gunixsocketaddress.c +0 -67
  152. data/ext/gio2/gvfs.c +0 -82
  153. data/ext/gio2/gvolume.c +0 -191
  154. data/ext/gio2/gvolumemonitor.c +0 -75
  155. data/ext/gio2/gzlibcompressor.c +0 -50
  156. 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
- * Ruby/GIO: a Ruby binding of gio-2.0.x.
4
- * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
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.
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
- * 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.
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
- * 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
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 "gio2.h"
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
- fileinputstream_query_info(int argc, VALUE *argv, VALUE self)
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
- fileinputstream_query_info_async(int argc, VALUE *argv, VALUE self)
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
- fileinputstream_query_info_finish(VALUE self, VALUE result)
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 glib)
84
+ Init_gfileinputstream(VALUE mGio)
84
85
  {
85
- VALUE fileinputstream = G_DEF_CLASS(G_TYPE_FILE_INPUT_STREAM, "FileInputStream", glib);
86
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_INPUT_STREAM, "FileInputStream", mGio);
86
87
 
87
- rb_define_method(fileinputstream, "query_info", fileinputstream_query_info, -1);
88
- rb_define_method(fileinputstream, "query_info_async", fileinputstream_query_info_async, -1);
89
- rb_define_method(fileinputstream, "query_info_finish", fileinputstream_query_info_finish, 1);
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
- * Ruby/GIO: a Ruby binding of gio-2.0.x.
4
- * Copyright (C) 2010 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
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.
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
- * 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.
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
- * 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
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 "gio2.h"
22
+ #include "rbgio2private.h"
22
23
 
23
- #define _SELF(value) G_FILE_IO_STREAM(RVAL2GOBJ(value))
24
+ #define RG_TARGET_NAMESPACE cFileIOStream
25
+ #define _SELF(value) RVAL2GFILEIOSTREAM(value)
24
26
 
25
27
  static VALUE
26
- fileiostream_get_etag(VALUE self)
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
- fileiostream_query_info(int argc, VALUE *argv, VALUE self)
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
- fileiostream_query_info_async(int argc, VALUE *argv, VALUE self)
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
- fileiostream_query_info_finish(VALUE self, VALUE result)
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 glib)
90
+ Init_gfileiostream(VALUE mGio)
89
91
  {
90
- VALUE fileiostream = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", glib);
92
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", mGio);
91
93
 
92
- rb_define_method(fileiostream, "etag", fileiostream_get_etag, 0);
93
- rb_define_method(fileiostream, "query_info", fileiostream_query_info, -1);
94
- rb_define_method(fileiostream, "query_info_async", fileiostream_query_info_async, -1);
95
- rb_define_method(fileiostream, "query_info_finish", fileiostream_query_info_finish, 1);
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
- * Ruby/GIO: a Ruby binding of gio-2.0.x.
4
- * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
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.
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
- * 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.
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
- * 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
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 "gio2.h"
22
+ #include "rbgio2private.h"
22
23
 
23
- #define _SELF(value) G_FILE_OUTPUT_STREAM(RVAL2GOBJ(value))
24
+ #define RG_TARGET_NAMESPACE cFileOutputStream
25
+ #define _SELF(value) RVAL2GFILEOUTPUTSTREAM(value)
24
26
 
25
27
  static VALUE
26
- fileoutputstream_query_info(int argc, VALUE *argv, VALUE self)
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
- fileoutputstream_query_info_async(int argc, VALUE *argv, VALUE self)
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
- fileoutputstream_query_info_finish(VALUE self, VALUE result)
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
- fileoutputstream_get_etag(VALUE self)
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 glib)
90
+ Init_gfileoutputstream(VALUE mGio)
89
91
  {
90
- VALUE fileoutputstream = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", glib);
92
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", mGio);
91
93
 
92
- rb_define_method(fileoutputstream, "query_info", fileoutputstream_query_info, -1);
93
- rb_define_method(fileoutputstream, "query_info_async", fileoutputstream_query_info_async, -1);
94
- rb_define_method(fileoutputstream, "query_info_finish", fileoutputstream_query_info_finish, 1);
95
- rb_define_method(fileoutputstream, "etag", fileoutputstream_get_etag, 0);
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
+ }