gio2 2.1.0-x86-mingw32 → 2.2.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 (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,98 +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 cFileIOStream
25
- #define _SELF(value) RVAL2GFILEIOSTREAM(value)
26
-
27
- static VALUE
28
- rg_etag(VALUE self)
29
- {
30
- return CSTR2RVAL(g_file_io_stream_get_etag(_SELF(self)));
31
- }
32
-
33
- static VALUE
34
- rg_query_info(int argc, VALUE *argv, VALUE self)
35
- {
36
- VALUE attributes, cancellable;
37
- GError *error = NULL;
38
- GFileInfo *info;
39
-
40
- rb_scan_args(argc, argv, "02", &attributes, &cancellable);
41
- info = g_file_io_stream_query_info(_SELF(self),
42
- RVAL2ATTRIBUTESDEFAULT(attributes),
43
- RVAL2GCANCELLABLE(cancellable),
44
- &error);
45
- if (info == NULL)
46
- rbgio_raise_error(error);
47
-
48
- return GOBJ2RVAL_UNREF(info);
49
- }
50
-
51
- static VALUE
52
- rg_query_info_async(int argc, VALUE *argv, VALUE self)
53
- {
54
- VALUE rbattributes, rbio_priority, rbcancellable, block;
55
- const char *attributes;
56
- int io_priority;
57
- GCancellable *cancellable;
58
-
59
- rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block);
60
- attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes);
61
- io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
62
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
63
- SAVE_BLOCK(block);
64
- g_file_io_stream_query_info_async(_SELF(self),
65
- attributes,
66
- io_priority,
67
- cancellable,
68
- rbgio_async_ready_callback,
69
- (gpointer)block);
70
-
71
- return self;
72
- }
73
-
74
- static VALUE
75
- rg_query_info_finish(VALUE self, VALUE result)
76
- {
77
- GError *error = NULL;
78
- GFileInfo *info;
79
-
80
- info = g_file_io_stream_query_info_finish(_SELF(self),
81
- RVAL2GASYNCRESULT(result),
82
- &error);
83
- if (info == NULL)
84
- rbgio_raise_error(error);
85
-
86
- return GOBJ2RVAL_UNREF(info);
87
- }
88
-
89
- void
90
- Init_gfileiostream(VALUE mGio)
91
- {
92
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", mGio);
93
-
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);
98
- }
@@ -1,46 +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 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
- }
@@ -1,73 +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 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
- }
@@ -1,98 +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 cFileOutputStream
25
- #define _SELF(value) RVAL2GFILEOUTPUTSTREAM(value)
26
-
27
- static VALUE
28
- rg_query_info(int argc, VALUE *argv, VALUE self)
29
- {
30
- VALUE attributes, cancellable;
31
- GError *error = NULL;
32
- GFileInfo *info;
33
-
34
- rb_scan_args(argc, argv, "02", &attributes, &cancellable);
35
- info = g_file_output_stream_query_info(_SELF(self),
36
- RVAL2ATTRIBUTESDEFAULT(attributes),
37
- RVAL2GCANCELLABLE(cancellable),
38
- &error);
39
- if (info == NULL)
40
- rbgio_raise_error(error);
41
-
42
- return GOBJ2RVAL_UNREF(info);
43
- }
44
-
45
- static VALUE
46
- rg_query_info_async(int argc, VALUE *argv, VALUE self)
47
- {
48
- VALUE rbattributes, rbio_priority, rbcancellable, block;
49
- const char *attributes;
50
- int io_priority;
51
- GCancellable *cancellable;
52
-
53
- rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block);
54
- attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes);
55
- io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
56
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
57
- SAVE_BLOCK(block);
58
- g_file_output_stream_query_info_async(_SELF(self),
59
- attributes,
60
- io_priority,
61
- cancellable,
62
- rbgio_async_ready_callback,
63
- (gpointer)block);
64
-
65
- return self;
66
- }
67
-
68
- static VALUE
69
- rg_query_info_finish(VALUE self, VALUE result)
70
- {
71
- GError *error = NULL;
72
- GFileInfo *info;
73
-
74
- info = g_file_output_stream_query_info_finish(_SELF(self),
75
- RVAL2GASYNCRESULT(result),
76
- &error);
77
- if (info == NULL)
78
- rbgio_raise_error(error);
79
-
80
- return GOBJ2RVAL_UNREF(info);
81
- }
82
-
83
- static VALUE
84
- rg_etag(VALUE self)
85
- {
86
- return CSTR2RVAL(g_file_output_stream_get_etag(_SELF(self)));
87
- }
88
-
89
- void
90
- Init_gfileoutputstream(VALUE mGio)
91
- {
92
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", mGio);
93
-
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);
98
- }
@@ -1,28 +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
- void
25
- Init_gfilterinputstream(VALUE mGio)
26
- {
27
- (void)G_DEF_CLASS(G_TYPE_FILTER_INPUT_STREAM, "FilterInputStream", mGio);
28
- }
data/ext/gio2/rbgioicon.c DELETED
@@ -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
- #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
- }
@@ -1,118 +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 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
- }
@@ -1,41 +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 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
- }