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
@@ -0,0 +1,121 @@
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 G_TYPE_IO_SCHEDULER_JOB (g_io_scheduler_job_get_type())
25
+
26
+ #define RVAL2GIOSCHEDULERJOB(object) \
27
+ ((GIOSchedulerJob *)(RVAL2BOXED(object, G_TYPE_IO_SCHEDULER_JOB)))
28
+
29
+ #define GIOSCHEDULERJOB2RVAL(object) \
30
+ BOXED2RVAL(object, G_TYPE_IO_SCHEDULER_JOB)
31
+
32
+ #define RG_TARGET_NAMESPACE cIOSchedulerJob
33
+ #define _SELF(value) RVAL2GIOSCHEDULERJOB(value)
34
+
35
+ static GIOSchedulerJob *
36
+ ioschedulerjob_copy(const GIOSchedulerJob *job)
37
+ {
38
+ return (GIOSchedulerJob *)job;
39
+ }
40
+
41
+ static void
42
+ ioschedulerjob_free(G_GNUC_UNUSED GIOSchedulerJob *job)
43
+ {
44
+ return;
45
+ }
46
+
47
+ static GType
48
+ g_io_scheduler_job_get_type(void)
49
+ {
50
+ static GType our_type = 0;
51
+
52
+ if (our_type == 0)
53
+ our_type = g_boxed_type_register_static("GIOSchedulerJob",
54
+ (GBoxedCopyFunc)ioschedulerjob_copy,
55
+ (GBoxedFreeFunc)ioschedulerjob_free);
56
+
57
+ return our_type;
58
+ }
59
+
60
+ static VALUE
61
+ ioscheduler_source_callback_call(VALUE data)
62
+ {
63
+ static VALUE s_id_call;
64
+
65
+ if (s_id_call == 0)
66
+ s_id_call = rb_intern("call");
67
+
68
+ return rb_funcall(USE_BLOCK_AND_SAVE(data), s_id_call, 0);
69
+ }
70
+
71
+ static gboolean
72
+ ioscheduler_source_callback(gpointer data)
73
+ {
74
+ return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_source_callback_call,
75
+ data));
76
+ }
77
+
78
+ static void
79
+ ioscheduler_source_callback_free(gpointer data)
80
+ {
81
+ USE_BLOCK(data);
82
+ }
83
+
84
+ static VALUE
85
+ rg_send_to_mainloop(VALUE self)
86
+ {
87
+ VALUE block;
88
+
89
+ block = rb_block_proc();
90
+ SAVE_BLOCK(block);
91
+
92
+ return CBOOL2RVAL(g_io_scheduler_job_send_to_mainloop(_SELF(self),
93
+ ioscheduler_source_callback,
94
+ (gpointer)block,
95
+ ioscheduler_source_callback_free));
96
+ }
97
+
98
+ static VALUE
99
+ rg_send_to_mainloop_async(VALUE self)
100
+ {
101
+ VALUE block;
102
+
103
+ block = rb_block_proc();
104
+ SAVE_BLOCK(block);
105
+
106
+ g_io_scheduler_job_send_to_mainloop_async(_SELF(self),
107
+ ioscheduler_source_callback,
108
+ (gpointer)block,
109
+ ioscheduler_source_callback_free);
110
+
111
+ return self;
112
+ }
113
+
114
+ void
115
+ Init_gioschedulerjob(VALUE mGio)
116
+ {
117
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_SCHEDULER_JOB, "IOSchedulerJob", mGio);
118
+
119
+ RG_DEF_METHOD(send_to_mainloop, 0);
120
+ RG_DEF_METHOD(send_to_mainloop_async, 0);
121
+ }
@@ -0,0 +1,108 @@
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 cIOStream
25
+ #define _SELF(value) RVAL2GIOSTREAM(value)
26
+
27
+ static VALUE
28
+ rg_close(VALUE self, VALUE cancellable)
29
+ {
30
+ GError *error = NULL;
31
+
32
+ if (!g_io_stream_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
33
+ rbgio_raise_error(error);
34
+
35
+ return self;
36
+ }
37
+
38
+ static VALUE
39
+ rg_close_async(int argc, VALUE *argv, VALUE self)
40
+ {
41
+ VALUE rbio_priority, rbcancellable, block;
42
+ int io_priority;
43
+ GCancellable *cancellable;
44
+
45
+ rb_scan_args(argc, argv, "01&", &rbio_priority, &rbcancellable, &block);
46
+ io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
47
+ cancellable = RVAL2GCANCELLABLE(rbcancellable);
48
+ SAVE_BLOCK(block);
49
+ g_io_stream_close_async(_SELF(self),
50
+ io_priority,
51
+ cancellable,
52
+ rbgio_async_ready_callback,
53
+ (gpointer)block);
54
+
55
+ return self;
56
+ }
57
+
58
+ static VALUE
59
+ rg_close_finish(VALUE self, VALUE result)
60
+ {
61
+ GError *error = NULL;
62
+
63
+ if (!g_io_stream_close_finish(_SELF(self),
64
+ RVAL2GASYNCRESULT(result),
65
+ &error))
66
+ rbgio_raise_error(error);
67
+
68
+ return self;
69
+ }
70
+
71
+ static VALUE
72
+ rg_has_pending_p(VALUE self)
73
+ {
74
+ return CBOOL2RVAL(g_io_stream_has_pending(_SELF(self)));
75
+ }
76
+
77
+ static VALUE
78
+ rg_set_pending(VALUE self)
79
+ {
80
+ GError *error = NULL;
81
+
82
+ if (!g_io_stream_set_pending(_SELF(self), &error))
83
+ rbgio_raise_error(error);
84
+
85
+ return self;
86
+ }
87
+
88
+ static VALUE
89
+ rg_clear_pending(VALUE self)
90
+ {
91
+ g_io_stream_clear_pending(_SELF(self));
92
+
93
+ return self;
94
+ }
95
+
96
+ void
97
+ Init_giostream(VALUE mGio)
98
+ {
99
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", mGio);
100
+
101
+ RG_DEF_METHOD(close, 1);
102
+ RG_DEF_METHOD(close_async, -1);
103
+ RG_DEF_METHOD(close_finish, 1);
104
+ RG_DEF_METHOD_P(has_pending, 0);
105
+ RG_DEF_METHOD(set_pending, 0);
106
+ G_DEF_SETTER(RG_TARGET_NAMESPACE, "pending");
107
+ RG_DEF_METHOD(clear_pending, 0);
108
+ }
@@ -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_LOADABLE_ICON(RVAL2GOBJ(value))
24
+ #define RG_TARGET_NAMESPACE mLoadableIcon
25
+ #define _SELF(value) RVAL2GLOADABLEICON(value)
24
26
 
25
27
  static VALUE
26
- loadableicon_load(int argc, VALUE *argv, VALUE self)
28
+ rg_load(int argc, VALUE *argv, VALUE self)
27
29
  {
28
30
  VALUE size, cancellable;
29
31
  char *type;
@@ -43,7 +45,7 @@ loadableicon_load(int argc, VALUE *argv, VALUE self)
43
45
  }
44
46
 
45
47
  static VALUE
46
- loadableicon_load_async(int argc, VALUE *argv, VALUE self)
48
+ rg_load_async(int argc, VALUE *argv, VALUE self)
47
49
  {
48
50
  VALUE rbsize, rbcancellable, block;
49
51
  int size;
@@ -63,7 +65,7 @@ loadableicon_load_async(int argc, VALUE *argv, VALUE self)
63
65
  }
64
66
 
65
67
  static VALUE
66
- loadableicon_load_finish(VALUE self, VALUE result)
68
+ rg_load_finish(VALUE self, VALUE result)
67
69
  {
68
70
  char *type;
69
71
  GError *error = NULL;
@@ -80,11 +82,11 @@ loadableicon_load_finish(VALUE self, VALUE result)
80
82
  }
81
83
 
82
84
  void
83
- Init_gloadableicon(VALUE glib)
85
+ Init_gloadableicon(VALUE mGio)
84
86
  {
85
- VALUE loadableicon = G_DEF_INTERFACE(G_TYPE_LOADABLE_ICON, "LoadableIcon", glib);
87
+ VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_LOADABLE_ICON, "LoadableIcon", mGio);
86
88
 
87
- rb_define_method(loadableicon, "load", loadableicon_load, -1);
88
- rb_define_method(loadableicon, "load_async", loadableicon_load_async, -1);
89
- rb_define_method(loadableicon, "load_finish", loadableicon_load_finish, 1);
89
+ RG_DEF_METHOD(load, -1);
90
+ RG_DEF_METHOD(load_async, -1);
91
+ RG_DEF_METHOD(load_finish, 1);
90
92
  }
@@ -0,0 +1,67 @@
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 cMemoryInputStream
25
+ #define _SELF(value) RVAL2GMEMORYINPUTSTREAM(value)
26
+
27
+ static VALUE
28
+ rg_initialize(int argc, VALUE *argv, VALUE self)
29
+ {
30
+ VALUE data;
31
+
32
+ rb_scan_args(argc, argv, "01", &data);
33
+ if (NIL_P(data)) {
34
+ G_INITIALIZE(self, g_memory_input_stream_new());
35
+ return Qnil;
36
+ }
37
+
38
+ StringValue(data);
39
+ G_RELATIVE(self, data);
40
+ G_INITIALIZE(self, g_memory_input_stream_new_from_data(RSTRING_PTR(data),
41
+ RSTRING_LEN(data),
42
+ NULL));
43
+
44
+ return Qnil;
45
+ }
46
+
47
+ static VALUE
48
+ rg_add_data(VALUE self, VALUE data)
49
+ {
50
+ StringValue(data);
51
+ G_RELATIVE(self, data);
52
+ g_memory_input_stream_add_data(_SELF(self),
53
+ RSTRING_PTR(data),
54
+ RSTRING_LEN(data),
55
+ NULL);
56
+
57
+ return self;
58
+ }
59
+
60
+ void
61
+ Init_gmemoryinputstream(VALUE mGio)
62
+ {
63
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_INPUT_STREAM, "MemoryInputStream", mGio);
64
+
65
+ RG_DEF_METHOD(initialize, -1);
66
+ RG_DEF_METHOD(add_data, 1);
67
+ }
@@ -0,0 +1,44 @@
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 cMemoryOutputStream
25
+
26
+ /* TODO: Take string argument? */
27
+ static VALUE
28
+ rg_initialize(VALUE self)
29
+ {
30
+ G_INITIALIZE(self, g_memory_output_stream_new(NULL,
31
+ 0,
32
+ g_realloc,
33
+ g_free));
34
+
35
+ return Qnil;
36
+ }
37
+
38
+ void
39
+ Init_gmemoryoutputstream(VALUE mGio)
40
+ {
41
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_OUTPUT_STREAM, "MemoryOutputStream", mGio);
42
+
43
+ RG_DEF_METHOD(initialize, 0);
44
+ }