gio2 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) 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/gio2/deprecated.rb +102 -0
  96. data/lib/gio2.rb +14 -12
  97. metadata +100 -88
  98. data/ChangeLog +0 -129
  99. data/ext/gio2/gapplaunchcontext.c +0 -79
  100. data/ext/gio2/gasyncresult.c +0 -39
  101. data/ext/gio2/gbufferedoutputstream.c +0 -48
  102. data/ext/gio2/gcancellable.c +0 -177
  103. data/ext/gio2/gcharsetconverter.c +0 -55
  104. data/ext/gio2/gcontenttype.c +0 -128
  105. data/ext/gio2/gconverterinputstream.c +0 -41
  106. data/ext/gio2/gconverteroutputstream.c +0 -41
  107. data/ext/gio2/gdesktopappinfo.c +0 -88
  108. data/ext/gio2/gemblem.c +0 -52
  109. data/ext/gio2/gemblemedicon.c +0 -63
  110. data/ext/gio2/gfileattribute.c +0 -111
  111. data/ext/gio2/gfileattributeinfo.c +0 -89
  112. data/ext/gio2/gfileattributeinfolist.c +0 -109
  113. data/ext/gio2/gfileattributematcher.c +0 -90
  114. data/ext/gio2/gfiledescriptorbased.c +0 -42
  115. data/ext/gio2/gfileicon.c +0 -39
  116. data/ext/gio2/gfilemonitor.c +0 -44
  117. data/ext/gio2/gfilenamecompleter.c +0 -72
  118. data/ext/gio2/gfilterinputstream.c +0 -27
  119. data/ext/gio2/gfilteroutputstream.c +0 -27
  120. data/ext/gio2/gicon.c +0 -67
  121. data/ext/gio2/ginetaddress.c +0 -116
  122. data/ext/gio2/ginetsocketaddress.c +0 -38
  123. data/ext/gio2/gioerror.c +0 -70
  124. data/ext/gio2/giomodule.c +0 -63
  125. data/ext/gio2/gioscheduler.c +0 -193
  126. data/ext/gio2/giostream.c +0 -106
  127. data/ext/gio2/gmemoryinputstream.c +0 -65
  128. data/ext/gio2/gmemoryoutputstream.c +0 -41
  129. data/ext/gio2/gmountoperation.c +0 -66
  130. data/ext/gio2/gnetworkaddress.c +0 -57
  131. data/ext/gio2/gnetworkservice.c +0 -43
  132. data/ext/gio2/gseekable.c +0 -89
  133. data/ext/gio2/gsimpleasyncresult.c +0 -153
  134. data/ext/gio2/gsocketaddress.c +0 -33
  135. data/ext/gio2/gsocketconnectable.c +0 -97
  136. data/ext/gio2/gsocketconnection.c +0 -75
  137. data/ext/gio2/gsocketcontrolmessage.c +0 -80
  138. data/ext/gio2/gsocketservice.c +0 -64
  139. data/ext/gio2/gsrvtarget.c +0 -77
  140. data/ext/gio2/gtcpconnection.c +0 -27
  141. data/ext/gio2/gthemedicon.c +0 -81
  142. data/ext/gio2/gthreadedsocketservice.c +0 -40
  143. data/ext/gio2/gunixconnection.c +0 -69
  144. data/ext/gio2/gunixfdlist.c +0 -112
  145. data/ext/gio2/gunixfdmessage.c +0 -72
  146. data/ext/gio2/gunixinputstream.c +0 -49
  147. data/ext/gio2/gunixmounts.c +0 -343
  148. data/ext/gio2/gunixoutputstream.c +0 -49
  149. data/ext/gio2/gunixsocketaddress.c +0 -67
  150. data/ext/gio2/gvfs.c +0 -82
  151. data/ext/gio2/gvolume.c +0 -191
  152. data/ext/gio2/gvolumemonitor.c +0 -75
  153. data/ext/gio2/gzlibcompressor.c +0 -50
  154. data/ext/gio2/gzlibdecompressor.c +0 -43
@@ -1,92 +1,91 @@
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_DRIVE(RVAL2GOBJ(value))
24
-
25
- #define GDRIVESTARTSTOPTYPE2RVAL(value) \
26
- GENUM2RVAL((value), G_TYPE_DRIVE_START_STOP_TYPE)
24
+ #define RG_TARGET_NAMESPACE mDrive
25
+ #define _SELF(value) RVAL2GDRIVE(value)
27
26
 
28
27
  static VALUE
29
- drive_get_name(VALUE self)
28
+ rg_name(VALUE self)
30
29
  {
31
30
  return CSTR2RVAL_FREE(g_drive_get_name(_SELF(self)));
32
31
  }
33
32
 
34
33
  static VALUE
35
- drive_get_icon(VALUE self)
34
+ rg_icon(VALUE self)
36
35
  {
37
36
  return GOBJ2RVAL_UNREF(g_drive_get_icon(_SELF(self)));
38
37
  }
39
38
 
40
39
  static VALUE
41
- drive_has_volumes(VALUE self)
40
+ rg_has_volumes_p(VALUE self)
42
41
  {
43
42
  return CBOOL2RVAL(g_drive_has_volumes(_SELF(self)));
44
43
  }
45
44
 
46
45
  static VALUE
47
- drive_get_volumes(VALUE self)
46
+ rg_volumes(VALUE self)
48
47
  {
49
48
  return GLIST2ARY_FREE(g_drive_get_volumes(_SELF(self)));
50
49
  }
51
50
 
52
51
  static VALUE
53
- drive_can_eject(VALUE self)
52
+ rg_can_eject_p(VALUE self)
54
53
  {
55
54
  return CBOOL2RVAL(g_drive_can_eject(_SELF(self)));
56
55
  }
57
56
 
58
57
  static VALUE
59
- drive_get_start_stop_type(VALUE self)
58
+ rg_start_stop_type(VALUE self)
60
59
  {
61
60
  return GDRIVESTARTSTOPTYPE2RVAL(g_drive_get_start_stop_type(_SELF(self)));
62
61
  }
63
62
 
64
63
  static VALUE
65
- drive_can_start(VALUE self)
64
+ rg_can_start_p(VALUE self)
66
65
  {
67
66
  return CBOOL2RVAL(g_drive_can_start(_SELF(self)));
68
67
  }
69
68
 
70
69
  static VALUE
71
- drive_can_start_degraded(VALUE self)
70
+ rg_can_start_degraded_p(VALUE self)
72
71
  {
73
72
  return CBOOL2RVAL(g_drive_can_start_degraded(_SELF(self)));
74
73
  }
75
74
 
76
75
  static VALUE
77
- drive_can_stop(VALUE self)
76
+ rg_can_stop_p(VALUE self)
78
77
  {
79
78
  return CBOOL2RVAL(g_drive_can_stop(_SELF(self)));
80
79
  }
81
80
 
82
81
  static VALUE
83
- drive_can_poll_for_media(VALUE self)
82
+ rg_can_poll_for_media_p(VALUE self)
84
83
  {
85
84
  return CBOOL2RVAL(g_drive_can_poll_for_media(_SELF(self)));
86
85
  }
87
86
 
88
87
  static VALUE
89
- drive_poll_for_media(int argc, VALUE *argv, VALUE self)
88
+ rg_poll_for_media(int argc, VALUE *argv, VALUE self)
90
89
  {
91
90
  VALUE rbcancellable, block;
92
91
  GCancellable *cancellable;
@@ -115,25 +114,25 @@ boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
115
114
  }
116
115
 
117
116
  static VALUE
118
- drive_poll_for_media_finish(VALUE self, VALUE result)
117
+ rg_poll_for_media_finish(VALUE self, VALUE result)
119
118
  {
120
119
  return boolean_finish_method(g_drive_poll_for_media_finish, self, result);
121
120
  }
122
121
 
123
122
  static VALUE
124
- drive_has_media(VALUE self)
123
+ rg_has_media_p(VALUE self)
125
124
  {
126
125
  return CBOOL2RVAL(g_drive_has_media(_SELF(self)));
127
126
  }
128
127
 
129
128
  static VALUE
130
- drive_is_media_check_automatic(VALUE self)
129
+ rg_media_check_automatic_p(VALUE self)
131
130
  {
132
131
  return CBOOL2RVAL(g_drive_is_media_check_automatic(_SELF(self)));
133
132
  }
134
133
 
135
134
  static VALUE
136
- drive_is_media_removable(VALUE self)
135
+ rg_media_removable_p(VALUE self)
137
136
  {
138
137
  return CBOOL2RVAL(g_drive_is_media_removable(_SELF(self)));
139
138
  }
@@ -169,19 +168,19 @@ eject_stop_method(EjectStopMethod method, int argc, VALUE *argv, VALUE self)
169
168
  }
170
169
 
171
170
  static VALUE
172
- drive_eject_with_operation(int argc, VALUE *argv, VALUE self)
171
+ rg_eject_with_operation(int argc, VALUE *argv, VALUE self)
173
172
  {
174
173
  return eject_stop_method(g_drive_eject_with_operation, argc, argv, self);
175
174
  }
176
175
 
177
176
  static VALUE
178
- drive_eject_with_operation_finish(VALUE self, VALUE result)
177
+ rg_eject_with_operation_finish(VALUE self, VALUE result)
179
178
  {
180
179
  return boolean_finish_method(g_drive_eject_with_operation_finish, self, result);
181
180
  }
182
181
 
183
182
  static VALUE
184
- drive_start(int argc, VALUE *argv, VALUE self)
183
+ rg_start(int argc, VALUE *argv, VALUE self)
185
184
  {
186
185
  VALUE rbflags, rbmount_operation, rbcancellable, block;
187
186
  GDriveStartFlags flags;
@@ -200,68 +199,68 @@ drive_start(int argc, VALUE *argv, VALUE self)
200
199
  }
201
200
 
202
201
  static VALUE
203
- drive_start_finish(VALUE self, VALUE result)
202
+ rg_start_finish(VALUE self, VALUE result)
204
203
  {
205
204
  return boolean_finish_method(g_drive_start_finish, self, result);
206
205
  }
207
206
 
208
207
  static VALUE
209
- drive_stop(int argc, VALUE *argv, VALUE self)
208
+ rg_stop(int argc, VALUE *argv, VALUE self)
210
209
  {
211
210
  return eject_stop_method(g_drive_stop, argc, argv, self);
212
211
  }
213
212
 
214
213
  static VALUE
215
- drive_stop_finish(VALUE self, VALUE result)
214
+ rg_stop_finish(VALUE self, VALUE result)
216
215
  {
217
216
  return boolean_finish_method(g_drive_stop_finish, self, result);
218
217
  }
219
218
 
220
219
  static VALUE
221
- drive_enumerate_identifiers(VALUE self)
220
+ rg_enumerate_identifiers(VALUE self)
222
221
  {
223
- return STRVECTOR2ARY_FREE(g_drive_enumerate_identifiers(_SELF(self)));
222
+ return STRV2RVAL_FREE(g_drive_enumerate_identifiers(_SELF(self)));
224
223
  }
225
224
 
226
225
  static VALUE
227
- drive_get_identifier(VALUE self, VALUE kind)
226
+ rg_get_identifier(VALUE self, VALUE kind)
228
227
  {
229
228
  return CSTR2RVAL_FREE(g_drive_get_identifier(_SELF(self), RVAL2CSTR(kind)));
230
229
  }
231
230
 
232
231
  void
233
- Init_gdrive(VALUE glib)
232
+ Init_gdrive(VALUE mGio)
234
233
  {
235
- VALUE drive = G_DEF_INTERFACE(G_TYPE_DRIVE, "Drive", glib);
236
-
237
- G_DEF_CLASS(G_TYPE_DRIVE_START_FLAGS, "StartFlags", drive);
238
- G_DEF_CONSTANTS(drive, G_TYPE_DRIVE_START_FLAGS, "G_DRIVE_");
239
-
240
- G_DEF_CLASS(G_TYPE_DRIVE_START_STOP_TYPE, "StartStopType", drive);
241
- G_DEF_CONSTANTS(drive, G_TYPE_DRIVE_START_STOP_TYPE, "G_DRIVE_");
242
-
243
- rb_define_method(drive, "name", drive_get_name, 0);
244
- rb_define_method(drive, "icon", drive_get_icon, 0);
245
- rb_define_method(drive, "has_volumes?", drive_has_volumes, 0);
246
- rb_define_method(drive, "volumes", drive_get_volumes, 0);
247
- rb_define_method(drive, "can_eject?", drive_can_eject, 0);
248
- rb_define_method(drive, "start_stop_type", drive_get_start_stop_type, 0);
249
- rb_define_method(drive, "can_start?", drive_can_start, 0);
250
- rb_define_method(drive, "can_start_degraded?", drive_can_start_degraded, 0);
251
- rb_define_method(drive, "can_stop?", drive_can_stop, 0);
252
- rb_define_method(drive, "can_poll_for_media?", drive_can_poll_for_media, 0);
253
- rb_define_method(drive, "poll_for_media", drive_poll_for_media, -1);
254
- rb_define_method(drive, "poll_for_media_finish", drive_poll_for_media_finish, 1);
255
- rb_define_method(drive, "has_media?", drive_has_media, 0);
256
- rb_define_method(drive, "media_check_automatic?", drive_is_media_check_automatic, 0);
257
- rb_define_method(drive, "media_removable?", drive_is_media_removable, 0);
258
- rb_define_method(drive, "eject_with_operation", drive_eject_with_operation, -1);
259
- rb_define_method(drive, "eject_with_operation_finish", drive_eject_with_operation_finish, 1);
260
- rb_define_method(drive, "start", drive_start, -1);
261
- rb_define_method(drive, "start_finish", drive_start_finish, 1);
262
- rb_define_method(drive, "stop", drive_stop, -1);
263
- rb_define_method(drive, "stop_finish", drive_stop_finish, 1);
264
- rb_define_method(drive, "enumerate_identifiers", drive_enumerate_identifiers, -1);
265
- rb_define_alias(drive, "identifiers", "enumerate_identifiers");
266
- rb_define_method(drive, "get_identifier", drive_get_identifier, 1);
234
+ VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_DRIVE, "Drive", mGio);
235
+
236
+ G_DEF_CLASS(G_TYPE_DRIVE_START_FLAGS, "StartFlags", RG_TARGET_NAMESPACE);
237
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_FLAGS, "G_DRIVE_");
238
+
239
+ G_DEF_CLASS(G_TYPE_DRIVE_START_STOP_TYPE, "StartStopType", RG_TARGET_NAMESPACE);
240
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_STOP_TYPE, "G_DRIVE_");
241
+
242
+ RG_DEF_METHOD(name, 0);
243
+ RG_DEF_METHOD(icon, 0);
244
+ RG_DEF_METHOD_P(has_volumes, 0);
245
+ RG_DEF_METHOD(volumes, 0);
246
+ RG_DEF_METHOD_P(can_eject, 0);
247
+ RG_DEF_METHOD(start_stop_type, 0);
248
+ RG_DEF_METHOD_P(can_start, 0);
249
+ RG_DEF_METHOD_P(can_start_degraded, 0);
250
+ RG_DEF_METHOD_P(can_stop, 0);
251
+ RG_DEF_METHOD_P(can_poll_for_media, 0);
252
+ RG_DEF_METHOD(poll_for_media, -1);
253
+ RG_DEF_METHOD(poll_for_media_finish, 1);
254
+ RG_DEF_METHOD_P(has_media, 0);
255
+ RG_DEF_METHOD_P(media_check_automatic, 0);
256
+ RG_DEF_METHOD_P(media_removable, 0);
257
+ RG_DEF_METHOD(eject_with_operation, -1);
258
+ RG_DEF_METHOD(eject_with_operation_finish, 1);
259
+ RG_DEF_METHOD(start, -1);
260
+ RG_DEF_METHOD(start_finish, 1);
261
+ RG_DEF_METHOD(stop, -1);
262
+ RG_DEF_METHOD(stop_finish, 1);
263
+ RG_DEF_METHOD(enumerate_identifiers, -1);
264
+ RG_DEF_ALIAS("identifiers", "enumerate_identifiers");
265
+ RG_DEF_METHOD(get_identifier, 1);
267
266
  }
@@ -0,0 +1,52 @@
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 cEmblem
25
+
26
+ static VALUE
27
+ rg_initialize(int argc, VALUE *argv, VALUE self)
28
+ {
29
+ VALUE rbicon, origin;
30
+ GIcon *icon;
31
+ GEmblem *emblem;
32
+
33
+ rb_scan_args(argc, argv, "11", &rbicon, &origin);
34
+ icon = RVAL2GICON(rbicon);
35
+ emblem = NIL_P(origin) ?
36
+ g_emblem_new(icon) :
37
+ g_emblem_new_with_origin(icon, RVAL2GEMBLEMORIGIN(origin));
38
+ G_INITIALIZE(self, emblem);
39
+
40
+ return Qnil;
41
+ }
42
+
43
+ void
44
+ Init_gemblem(VALUE mGio)
45
+ {
46
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEM, "Emblem", mGio);
47
+
48
+ G_DEF_CLASS(G_TYPE_EMBLEM_ORIGIN, "Origin", RG_TARGET_NAMESPACE);
49
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_EMBLEM_ORIGIN, "G_EMBLEM_");
50
+
51
+ RG_DEF_METHOD(initialize, -1);
52
+ }
@@ -0,0 +1,65 @@
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 cEmblemedIcon
25
+ #define _SELF(value) RVAL2GEMBLEMEDICON(value)
26
+
27
+ static VALUE
28
+ rg_initialize(VALUE self, VALUE icon, VALUE emblem)
29
+ {
30
+ G_INITIALIZE(self, g_emblemed_icon_new(RVAL2GICON(icon), RVAL2GEMBLEM(emblem)));
31
+
32
+ return Qnil;
33
+ }
34
+
35
+ static VALUE
36
+ rg_icon(VALUE self)
37
+ {
38
+ return GOBJ2RVAL(g_emblemed_icon_get_icon(_SELF(self)));
39
+ }
40
+
41
+ static VALUE
42
+ rg_emblems(VALUE self)
43
+ {
44
+ return GLIST2ARY_FREE(g_emblemed_icon_get_emblems(_SELF(self)));
45
+ }
46
+
47
+ static VALUE
48
+ rg_add_emblem(VALUE self, VALUE emblem)
49
+ {
50
+ g_emblemed_icon_add_emblem(_SELF(self), RVAL2GEMBLEM(emblem));
51
+
52
+ return self;
53
+ }
54
+
55
+ void
56
+ Init_gemblemedicon(VALUE mGio)
57
+ {
58
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEMED_ICON, "EmblemedIcon", mGio);
59
+
60
+ RG_DEF_METHOD(initialize, 2);
61
+ RG_DEF_METHOD(icon, 0);
62
+ RG_DEF_METHOD(emblems, 0);
63
+ RG_DEF_METHOD(add_emblem, 1);
64
+ RG_DEF_ALIAS("<<", "add_emblem");
65
+ }