gio2 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
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,193 +0,0 @@
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
- static GIOSchedulerJob *
24
- ioschedulerjob_copy(const GIOSchedulerJob *job)
25
- {
26
- return (GIOSchedulerJob *)job;
27
- }
28
-
29
- static void
30
- ioschedulerjob_free(G_GNUC_UNUSED GIOSchedulerJob *job)
31
- {
32
- return;
33
- }
34
-
35
- static GType
36
- g_io_scheduler_job_get_type(void)
37
- {
38
- static GType our_type = 0;
39
-
40
- if (our_type == 0)
41
- our_type = g_boxed_type_register_static("GIOSchedulerJob",
42
- (GBoxedCopyFunc)ioschedulerjob_copy,
43
- (GBoxedFreeFunc)ioschedulerjob_free);
44
-
45
- return our_type;
46
- }
47
-
48
- #define G_TYPE_IO_SCHEDULER_JOB (g_io_scheduler_job_get_type())
49
-
50
- #define RVAL2GIOSCHEDULERJOB(object) \
51
- ((GIOSchedulerJob *)(RVAL2BOXED(object, G_TYPE_IO_SCHEDULER_JOB)))
52
-
53
- #define GIOSCHEDULERJOB2RVAL(object) \
54
- BOXED2RVAL(object, G_TYPE_IO_SCHEDULER_JOB)
55
-
56
- #define _SELF(value) RVAL2GIOSCHEDULERJOB(value)
57
-
58
- struct ioscheduler_job_callback_data
59
- {
60
- GIOSchedulerJob *job;
61
- GCancellable *cancellable;
62
- gpointer data;
63
- };
64
-
65
- static VALUE
66
- ioscheduler_job_callback_call(VALUE data)
67
- {
68
- static VALUE s_id_call;
69
- struct ioscheduler_job_callback_data *real;
70
-
71
- if (s_id_call == 0)
72
- s_id_call = rb_intern("call");
73
-
74
- real = (struct ioscheduler_job_callback_data *)data;
75
-
76
- /* TODO: Totally unsure if _UNREF is correct here or not. */
77
- return rb_funcall(USE_BLOCK_AND_SAVE(real->data), s_id_call, 2,
78
- GOBJ2RVAL_UNREF(real->job),
79
- GOBJ2RVAL_UNREF(real->cancellable));
80
- }
81
-
82
- static gboolean
83
- ioscheduler_job_callback(GIOSchedulerJob *job,
84
- GCancellable *cancellable,
85
- gpointer data)
86
- {
87
- struct ioscheduler_job_callback_data real = { job, cancellable, data };
88
-
89
- return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_job_callback_call,
90
- &real));
91
- }
92
-
93
- static void
94
- ioscheduler_job_callback_free(gpointer data)
95
- {
96
- USE_BLOCK((VALUE)data);
97
- }
98
-
99
- static VALUE
100
- ioscheduler_push_job(int argc, VALUE *argv, VALUE self)
101
- {
102
- VALUE rbio_priority, rbcancellable, block;
103
- gint io_priority;
104
- GCancellable *cancellable;
105
-
106
- rb_scan_args(argc, argv, "02", &rbio_priority, &rbcancellable);
107
- io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
108
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
109
- block = rb_block_proc();
110
- SAVE_BLOCK(block);
111
- g_io_scheduler_push_job(ioscheduler_job_callback,
112
- (gpointer)block,
113
- ioscheduler_job_callback_free,
114
- io_priority,
115
- cancellable);
116
-
117
- return self;
118
- }
119
-
120
- static VALUE
121
- ioscheduler_cancel_all_jobs(VALUE self)
122
- {
123
- g_io_scheduler_cancel_all_jobs();
124
-
125
- return self;
126
- }
127
-
128
- static VALUE
129
- ioscheduler_source_callback_call(VALUE data)
130
- {
131
- static VALUE s_id_call;
132
-
133
- if (s_id_call == 0)
134
- s_id_call = rb_intern("call");
135
-
136
- return rb_funcall(USE_BLOCK_AND_SAVE(data), s_id_call, 0);
137
- }
138
-
139
- static gboolean
140
- ioscheduler_source_callback(gpointer data)
141
- {
142
- return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_source_callback_call,
143
- data));
144
- }
145
-
146
- static void
147
- ioscheduler_source_callback_free(gpointer data)
148
- {
149
- USE_BLOCK(data);
150
- }
151
-
152
- static VALUE
153
- ioschedulerjob_send_to_mainloop(VALUE self)
154
- {
155
- VALUE block;
156
-
157
- block = rb_block_proc();
158
- SAVE_BLOCK(block);
159
-
160
- return CBOOL2RVAL(g_io_scheduler_job_send_to_mainloop(_SELF(self),
161
- ioscheduler_source_callback,
162
- (gpointer)block,
163
- ioscheduler_source_callback_free));
164
- }
165
-
166
- static VALUE
167
- ioschedulerjob_send_to_mainloop_async(VALUE self)
168
- {
169
- VALUE block;
170
-
171
- block = rb_block_proc();
172
- SAVE_BLOCK(block);
173
-
174
- g_io_scheduler_job_send_to_mainloop_async(_SELF(self),
175
- ioscheduler_source_callback,
176
- (gpointer)block,
177
- ioscheduler_source_callback_free);
178
-
179
- return self;
180
- }
181
-
182
- void
183
- Init_gioscheduler(VALUE glib)
184
- {
185
- VALUE ioschedulerjob = G_DEF_CLASS(G_TYPE_IO_SCHEDULER_JOB, "IOSchedulerJob", glib);
186
-
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);
190
-
191
- rb_define_method(ioschedulerjob, "send_to_mainloop", ioschedulerjob_send_to_mainloop, 0);
192
- rb_define_method(ioschedulerjob, "send_to_mainloop_async", ioschedulerjob_send_to_mainloop_async, 0);
193
- }
data/ext/gio2/giostream.c DELETED
@@ -1,106 +0,0 @@
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 _SELF(value) G_IO_STREAM(RVAL2GOBJ(value))
24
-
25
- static VALUE
26
- iostream_close(VALUE self, VALUE cancellable)
27
- {
28
- GError *error = NULL;
29
-
30
- if (!g_io_stream_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
31
- rbgio_raise_error(error);
32
-
33
- return self;
34
- }
35
-
36
- static VALUE
37
- iostream_close_async(int argc, VALUE *argv, VALUE self)
38
- {
39
- VALUE rbio_priority, rbcancellable, block;
40
- int io_priority;
41
- GCancellable *cancellable;
42
-
43
- rb_scan_args(argc, argv, "01&", &rbio_priority, &rbcancellable, &block);
44
- io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
45
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
46
- SAVE_BLOCK(block);
47
- g_io_stream_close_async(_SELF(self),
48
- io_priority,
49
- cancellable,
50
- rbgio_async_ready_callback,
51
- (gpointer)block);
52
-
53
- return self;
54
- }
55
-
56
- static VALUE
57
- iostream_close_finish(VALUE self, VALUE result)
58
- {
59
- GError *error = NULL;
60
-
61
- if (!g_io_stream_close_finish(_SELF(self),
62
- RVAL2GASYNCRESULT(result),
63
- &error))
64
- rbgio_raise_error(error);
65
-
66
- return self;
67
- }
68
-
69
- static VALUE
70
- iostream_has_pending(VALUE self)
71
- {
72
- return CBOOL2RVAL(g_io_stream_has_pending(_SELF(self)));
73
- }
74
-
75
- static VALUE
76
- iostream_set_pending(VALUE self)
77
- {
78
- GError *error = NULL;
79
-
80
- if (!g_io_stream_set_pending(_SELF(self), &error))
81
- rbgio_raise_error(error);
82
-
83
- return self;
84
- }
85
-
86
- static VALUE
87
- iostream_clear_pending(VALUE self)
88
- {
89
- g_io_stream_clear_pending(_SELF(self));
90
-
91
- return self;
92
- }
93
-
94
- void
95
- Init_giostream(VALUE glib)
96
- {
97
- VALUE iostream = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", glib);
98
-
99
- rb_define_method(iostream, "close", iostream_close, 1);
100
- rb_define_method(iostream, "close_async", iostream_close_async, -1);
101
- rb_define_method(iostream, "close_finish", iostream_close_finish, 1);
102
- rb_define_method(iostream, "has_pending?", iostream_has_pending, 0);
103
- rb_define_method(iostream, "set_pending", iostream_set_pending, 0);
104
- G_DEF_SETTER(iostream, "pending");
105
- rb_define_method(iostream, "clear_pending", iostream_clear_pending, 0);
106
- }
@@ -1,65 +0,0 @@
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 _SELF(value) G_MEMORY_INPUT_STREAM(RVAL2GOBJ(value))
24
-
25
- static VALUE
26
- memoryinputstream_initialize(int argc, VALUE *argv, VALUE self)
27
- {
28
- VALUE data;
29
-
30
- rb_scan_args(argc, argv, "01", &data);
31
- if (NIL_P(data)) {
32
- G_INITIALIZE(self, g_memory_input_stream_new());
33
- return Qnil;
34
- }
35
-
36
- StringValue(data);
37
- G_RELATIVE(self, data);
38
- G_INITIALIZE(self, g_memory_input_stream_new_from_data(RSTRING_PTR(data),
39
- RSTRING_LEN(data),
40
- NULL));
41
-
42
- return Qnil;
43
- }
44
-
45
- static VALUE
46
- memoryinputstream_add_data(VALUE self, VALUE data)
47
- {
48
- StringValue(data);
49
- G_RELATIVE(self, data);
50
- g_memory_input_stream_add_data(_SELF(self),
51
- RSTRING_PTR(data),
52
- RSTRING_LEN(data),
53
- NULL);
54
-
55
- return self;
56
- }
57
-
58
- void
59
- Init_gmemoryinputstream(VALUE glib)
60
- {
61
- VALUE memoryinputstream = G_DEF_CLASS(G_TYPE_MEMORY_INPUT_STREAM, "MemoryInputStream", glib);
62
-
63
- rb_define_method(memoryinputstream, "initialize", memoryinputstream_initialize, -1);
64
- rb_define_method(memoryinputstream, "add_data", memoryinputstream_add_data, 1);
65
- }
@@ -1,41 +0,0 @@
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
- /* TODO: Take string argument? */
24
- static VALUE
25
- memoryoutputstream_initialize(VALUE self)
26
- {
27
- G_INITIALIZE(self, g_memory_output_stream_new(NULL,
28
- 0,
29
- g_realloc,
30
- g_free));
31
-
32
- return Qnil;
33
- }
34
-
35
- void
36
- Init_gmemoryoutputstream(VALUE glib)
37
- {
38
- VALUE memoryoutputstream = G_DEF_CLASS(G_TYPE_MEMORY_OUTPUT_STREAM, "MemoryOutputStream", glib);
39
-
40
- rb_define_method(memoryoutputstream, "initialize", memoryoutputstream_initialize, 0);
41
- }
@@ -1,66 +0,0 @@
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 _SELF(value) RVAL2GMOUNTOPERATION(value)
24
-
25
- #define GPASSWORDSAVE2RVAL(value) \
26
- GENUM2RVAL((value), G_TYPE_PASSWORD_SAVE)
27
-
28
- #define RVAL2GPASSWORDSAVE(value) \
29
- RVAL2GENUM((value), G_TYPE_PASSWORD_SAVE)
30
-
31
- #define RVAL2GMOUNTOPERATIONRESULT(value) \
32
- RVAL2GENUM((value), G_TYPE_MOUNT_OPERATION_RESULT)
33
-
34
- static VALUE
35
- mountoperation_initialize(VALUE self)
36
- {
37
- G_INITIALIZE(self, g_mount_operation_new());
38
-
39
- return Qnil;
40
- }
41
-
42
- static VALUE
43
- mountoperation_reply(VALUE self, VALUE value)
44
- {
45
- g_mount_operation_reply(_SELF(self), RVAL2GMOUNTOPERATIONRESULT(value));
46
-
47
- return self;
48
- }
49
-
50
- void
51
- Init_gmountoperation(VALUE glib)
52
- {
53
- VALUE mountoperation = G_DEF_CLASS(G_TYPE_MOUNT_OPERATION, "MountOperation", glib);
54
-
55
- G_DEF_CLASS(G_TYPE_MOUNT_OPERATION_RESULT, "Result", mountoperation);
56
- G_DEF_CONSTANTS(mountoperation, G_TYPE_MOUNT_OPERATION_RESULT, "G_MOUNT_OPERATION_");
57
-
58
- G_DEF_CLASS(G_TYPE_ASK_PASSWORD_FLAGS, "AskPasswordFlags", glib);
59
- G_DEF_CONSTANTS(glib, G_TYPE_ASK_PASSWORD_FLAGS, "G_");
60
-
61
- G_DEF_CLASS(G_TYPE_PASSWORD_SAVE, "PasswordSave", glib);
62
- G_DEF_CONSTANTS(glib, G_TYPE_PASSWORD_SAVE, "G_");
63
-
64
- rb_define_method(mountoperation, "initialize", mountoperation_initialize, 0);
65
- rb_define_method(mountoperation, "reply", mountoperation_reply, 1);
66
- }
@@ -1,57 +0,0 @@
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 _SELF(value) G_NETWORK_ADDRESS(RVAL2GOBJ(value))
24
-
25
- static VALUE
26
- networkaddress_initialize(VALUE self, VALUE hostname, VALUE port)
27
- {
28
- G_INITIALIZE(self, g_network_address_new(RVAL2CSTR(hostname),
29
- RVAL2GUINT16(port)));
30
-
31
- return Qnil;
32
- }
33
-
34
- static VALUE
35
- networkaddress_parse(G_GNUC_UNUSED VALUE self, VALUE host_and_port, VALUE default_port)
36
- {
37
- GError *error = NULL;
38
- GSocketConnectable *connectable;
39
-
40
- connectable = g_network_address_parse(RVAL2CSTR(host_and_port),
41
- RVAL2GUINT16(default_port),
42
- &error);
43
- if (connectable == NULL)
44
- rbgio_raise_error(error);
45
-
46
- return GOBJ2RVAL_UNREF(connectable);
47
- }
48
-
49
- void
50
- Init_gnetworkaddress(VALUE glib)
51
- {
52
- VALUE networkaddress = G_DEF_CLASS(G_TYPE_NETWORK_ADDRESS, "NetworkAddress", glib);
53
-
54
- rb_define_singleton_method(networkaddress, "parse", networkaddress_parse, 2);
55
-
56
- rb_define_method(networkaddress, "initialize", networkaddress_initialize, 2);
57
- }
@@ -1,43 +0,0 @@
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 _SELF(value) G_NETWORK_SERVICE(RVAL2GOBJ(value))
24
-
25
- static VALUE
26
- networkservice_initialize(VALUE self, VALUE service, VALUE protocol, VALUE domain)
27
- {
28
- /* TODO: If these are infected, so should they be when returned. How
29
- * do we deal with that? */
30
- G_INITIALIZE(self, g_network_service_new(RVAL2CSTR(service),
31
- RVAL2CSTR(protocol),
32
- RVAL2CSTR(domain)));
33
-
34
- return Qnil;
35
- }
36
-
37
- void
38
- Init_gnetworkservice(VALUE glib)
39
- {
40
- VALUE networkservice = G_DEF_CLASS(G_TYPE_NETWORK_SERVICE, "NetworkService", glib);
41
-
42
- rb_define_method(networkservice, "initialize", networkservice_initialize, 3);
43
- }
data/ext/gio2/gseekable.c DELETED
@@ -1,89 +0,0 @@
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 _SELF(value) G_SEEKABLE(RVAL2GOBJ(value))
24
-
25
- #define RVAL2GSEEKTYPEDEFAULT(value) \
26
- RVAL2TYPE_WITH_DEFAULT((value), NUM2INT, G_SEEK_CUR)
27
-
28
- static VALUE
29
- seekable_tell(VALUE self)
30
- {
31
- return GOFFSET2RVAL(g_seekable_tell(_SELF(self)));
32
- }
33
-
34
- static VALUE
35
- seekable_can_seek(VALUE self)
36
- {
37
- return CBOOL2RVAL(g_seekable_can_seek(_SELF(self)));
38
- }
39
-
40
- static VALUE
41
- seekable_seek(int argc, VALUE *argv, VALUE self)
42
- {
43
- VALUE offset, type, cancellable;
44
- GError *error = NULL;
45
-
46
- rb_scan_args(argc, argv, "12", &offset, &type, &cancellable);
47
- if (!g_seekable_seek(_SELF(self),
48
- RVAL2GOFFSET(offset),
49
- RVAL2GSEEKTYPEDEFAULT(type),
50
- RVAL2GCANCELLABLE(cancellable),
51
- &error))
52
- rbgio_raise_error(error);
53
-
54
- return self;
55
- }
56
-
57
- static VALUE
58
- seekable_can_truncate(VALUE self)
59
- {
60
- return CBOOL2RVAL(g_seekable_can_truncate(_SELF(self)));
61
- }
62
-
63
- static VALUE
64
- seekable_truncate(int argc, VALUE *argv, VALUE self)
65
- {
66
- VALUE offset, cancellable;
67
- GError *error = NULL;
68
-
69
- rb_scan_args(argc, argv, "11", &offset, &cancellable);
70
- if (!g_seekable_truncate(_SELF(self),
71
- RVAL2GOFFSET(offset),
72
- RVAL2GCANCELLABLE(cancellable),
73
- &error))
74
- rbgio_raise_error(error);
75
-
76
- return self;
77
- }
78
-
79
- void
80
- Init_gseekable(VALUE glib)
81
- {
82
- VALUE seekable = G_DEF_INTERFACE(G_TYPE_SEEKABLE, "Seekable", glib);
83
-
84
- rb_define_method(seekable, "tell", seekable_tell, 0);
85
- rb_define_method(seekable, "can_seek?", seekable_can_seek, 0);
86
- rb_define_method(seekable, "seek", seekable_seek, -1);
87
- rb_define_method(seekable, "can_truncate?", seekable_can_truncate, 0);
88
- rb_define_method(seekable, "truncate", seekable_truncate, -1);
89
- }