glib2 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 (78) hide show
  1. data/ext/glib2/extconf.rb +1 -0
  2. data/ext/glib2/glib2.def +23 -0
  3. data/ext/glib2/rbgcompat.h +19 -5
  4. data/ext/glib2/rbglib.c +607 -160
  5. data/ext/glib2/rbglib.h +81 -26
  6. data/ext/glib2/rbglib2conversions.h +57 -0
  7. data/ext/glib2/rbglib_bookmarkfile.c +117 -107
  8. data/ext/glib2/rbglib_completion.c +37 -26
  9. data/ext/glib2/rbglib_convert.c +42 -30
  10. data/ext/glib2/rbglib_error.c +20 -10
  11. data/ext/glib2/rbglib_fileutils.c +48 -37
  12. data/ext/glib2/rbglib_i18n.c +24 -14
  13. data/ext/glib2/rbglib_int64.c +24 -16
  14. data/ext/glib2/rbglib_iochannel.c +146 -204
  15. data/ext/glib2/rbglib_iochannel_win32_socket.c +56 -0
  16. data/ext/glib2/rbglib_iochannelerror.c +49 -0
  17. data/ext/glib2/rbglib_keyfile.c +171 -182
  18. data/ext/glib2/rbglib_maincontext.c +107 -92
  19. data/ext/glib2/rbglib_mainloop.c +34 -21
  20. data/ext/glib2/rbglib_messages.c +53 -44
  21. data/ext/glib2/rbglib_pollfd.c +37 -26
  22. data/ext/glib2/rbglib_shell.c +29 -22
  23. data/ext/glib2/rbglib_shellerror.c +34 -0
  24. data/ext/glib2/rbglib_source.c +49 -36
  25. data/ext/glib2/rbglib_spawn.c +50 -61
  26. data/ext/glib2/rbglib_spawnerror.c +53 -0
  27. data/ext/glib2/rbglib_threads.c +28 -16
  28. data/ext/glib2/rbglib_timer.c +35 -24
  29. data/ext/glib2/rbglib_ucs4.c +79 -0
  30. data/ext/glib2/rbglib_unichar.c +209 -0
  31. data/ext/glib2/rbglib_unicode.c +34 -584
  32. data/ext/glib2/rbglib_utf16.c +78 -0
  33. data/ext/glib2/rbglib_utf8.c +259 -0
  34. data/ext/glib2/rbglib_utils.c +95 -91
  35. data/ext/glib2/rbglib_win32.c +52 -45
  36. data/ext/glib2/rbglibdeprecated.c +56 -0
  37. data/ext/glib2/rbglibdeprecated.h +34 -0
  38. data/ext/glib2/rbgobj_boxed.c +40 -33
  39. data/ext/glib2/rbgobj_closure.c +45 -34
  40. data/ext/glib2/rbgobj_convert.c +19 -9
  41. data/ext/glib2/rbgobj_enumflags.c +109 -0
  42. data/ext/glib2/rbgobj_enums.c +67 -646
  43. data/ext/glib2/rbgobj_flags.c +522 -0
  44. data/ext/glib2/rbgobj_fundamental.c +19 -6
  45. data/ext/glib2/rbgobj_object.c +90 -81
  46. data/ext/glib2/rbgobj_param.c +78 -83
  47. data/ext/glib2/rbgobj_paramspecs.c +20 -12
  48. data/ext/glib2/rbgobj_signal.c +248 -193
  49. data/ext/glib2/rbgobj_strv.c +20 -10
  50. data/ext/glib2/rbgobj_type.c +153 -149
  51. data/ext/glib2/rbgobj_typeinstance.c +49 -39
  52. data/ext/glib2/rbgobj_typeinterface.c +37 -27
  53. data/ext/glib2/rbgobj_typemodule.c +39 -29
  54. data/ext/glib2/rbgobj_typeplugin.c +36 -26
  55. data/ext/glib2/rbgobj_value.c +41 -11
  56. data/ext/glib2/rbgobj_valuearray.c +59 -23
  57. data/ext/glib2/rbgobj_valuetypes.c +27 -17
  58. data/ext/glib2/rbgobject.c +26 -40
  59. data/ext/glib2/rbgobject.h +38 -20
  60. data/ext/glib2/rbgprivate.h +87 -5
  61. data/ext/glib2/rbgutil.c +52 -238
  62. data/ext/glib2/rbgutil.h +55 -42
  63. data/ext/glib2/rbgutil_callback.c +47 -12
  64. data/ext/glib2/rbgutil_list.c +173 -0
  65. data/ext/glib2/rbgutil_list.h +85 -0
  66. data/ext/glib2/rbgutildeprecated.c +252 -0
  67. data/ext/glib2/rbgutildeprecated.h +63 -0
  68. data/lib/glib-mkenums.rb +2 -2
  69. data/lib/glib2.rb +2 -25
  70. data/lib/glib2/deprecatable.rb +149 -0
  71. data/lib/gnome2-raketask.rb +45 -15
  72. data/lib/gnome2-win32-binary-downloader.rb +1 -1
  73. data/lib/mkmf-gnome2.rb +37 -18
  74. data/test/test_flags.rb +129 -0
  75. data/test/test_key_file.rb +6 -2
  76. data/test/test_spawn.rb +33 -0
  77. metadata +26 -7
  78. data/ChangeLog +0 -3513
@@ -0,0 +1,56 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2005 Masao Mutoh
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 "rbgprivate.h"
23
+
24
+ #ifdef G_OS_WIN32
25
+
26
+ #define RG_TARGET_NAMESPACE cIOChannelWin32Socket
27
+
28
+ static VALUE
29
+ rg_initialize(VALUE self, VALUE socket)
30
+ {
31
+ GIOChannel *io = NULL;
32
+ int fd;
33
+
34
+ rb_secure(4);
35
+ /* TODO: support IO object */
36
+ fd = NUM2INT(socket);
37
+ io = g_io_channel_win32_new_socket(rb_w32_get_osfhandle(fd));
38
+ G_INITIALIZE(self, io);
39
+
40
+ return Qnil;
41
+ }
42
+ #endif
43
+
44
+ void
45
+ Init_glib_io_channel_win32_socket(void)
46
+ {
47
+ #ifdef G_OS_WIN32
48
+ /* GIOWin32Channel */
49
+ VALUE RG_TARGET_NAMESPACE;
50
+ RG_TARGET_NAMESPACE =
51
+ rb_define_class_under(mGLib,
52
+ "IOChannelWin32Socket",
53
+ RG_TARGET_NAMESPACE);
54
+ RG_DEF_METHOD(initialize, 1);
55
+ #endif
56
+ }
@@ -0,0 +1,49 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2005 Masao Mutoh
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 "rbgprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cIOChannelError
25
+
26
+ static VALUE
27
+ rg_s_from_errno(G_GNUC_UNUSED VALUE self, VALUE errno_)
28
+ {
29
+ return INT2NUM(g_io_channel_error_from_errno(NUM2INT(errno_)));
30
+ }
31
+
32
+ void
33
+ Init_glib_io_channelerror(void)
34
+ {
35
+ VALUE RG_TARGET_NAMESPACE = G_DEF_ERROR2(G_IO_CHANNEL_ERROR, "IOChannelError", mGLib, rb_eIOError);
36
+
37
+ /* GIOChannelError */
38
+ RG_DEF_SMETHOD(from_errno, 1);
39
+
40
+ rb_define_const(RG_TARGET_NAMESPACE, "FBIG", INT2NUM(G_IO_CHANNEL_ERROR_FBIG));
41
+ rb_define_const(RG_TARGET_NAMESPACE, "INVAL", INT2NUM(G_IO_CHANNEL_ERROR_INVAL));
42
+ rb_define_const(RG_TARGET_NAMESPACE, "IO", INT2NUM(G_IO_CHANNEL_ERROR_IO));
43
+ rb_define_const(RG_TARGET_NAMESPACE, "ISDIR", INT2NUM(G_IO_CHANNEL_ERROR_ISDIR));
44
+ rb_define_const(RG_TARGET_NAMESPACE, "NOSPC", INT2NUM(G_IO_CHANNEL_ERROR_NOSPC));
45
+ rb_define_const(RG_TARGET_NAMESPACE, "NXIO", INT2NUM(G_IO_CHANNEL_ERROR_NXIO));
46
+ rb_define_const(RG_TARGET_NAMESPACE, "OVERFLOW", INT2NUM(G_IO_CHANNEL_ERROR_OVERFLOW));
47
+ rb_define_const(RG_TARGET_NAMESPACE, "PIPE", INT2NUM(G_IO_CHANNEL_ERROR_PIPE));
48
+ rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(G_IO_CHANNEL_ERROR_FAILED));
49
+ }
@@ -1,17 +1,28 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbglib_keyfile.c -
5
-
6
- $Author: sakai $
7
- $Date: 2007/06/16 02:46:28 $
8
-
9
- Copyright (C) 2006 Masao Mutoh
10
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2006 Masao Mutoh
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
+ */
11
21
 
12
22
  #include "rbgprivate.h"
13
23
 
14
24
  #if GLIB_CHECK_VERSION(2,6,0)
25
+ #if !GLIB_CHECK_VERSION(2,31,2)
15
26
  /************************************************/
16
27
  static GKeyFile*
17
28
  keyfile_copy(const GKeyFile* keyfile)
@@ -26,7 +37,6 @@ keyfile_copy(const GKeyFile* keyfile)
26
37
  return (GKeyFile*)keyfile;
27
38
  }
28
39
 
29
-
30
40
  GType
31
41
  g_key_file_get_type(void)
32
42
  {
@@ -38,25 +48,27 @@ g_key_file_get_type(void)
38
48
  return our_type;
39
49
  }
40
50
  /************************************************/
51
+ #endif
41
52
 
53
+ #define RG_TARGET_NAMESPACE cKeyFile
42
54
  #define _SELF(self) ((GKeyFile*)(RVAL2BOXED(self, G_TYPE_KEY_FILE)))
43
55
 
44
56
  static VALUE
45
- keyfile_initialize(VALUE self)
57
+ rg_initialize(VALUE self)
46
58
  {
47
59
  G_INITIALIZE(self, g_key_file_new());
48
60
  return Qnil;
49
61
  }
50
62
 
51
63
  static VALUE
52
- keyfile_set_list_separator(VALUE self, VALUE sep)
64
+ rg_set_list_separator(VALUE self, VALUE sep)
53
65
  {
54
66
  g_key_file_set_list_separator(_SELF(self), NUM2INT(sep));
55
67
  return self;
56
68
  }
57
69
 
58
70
  static VALUE
59
- keyfile_load_from_file(int argc, VALUE *argv, VALUE self)
71
+ rg_load_from_file(int argc, VALUE *argv, VALUE self)
60
72
  {
61
73
  VALUE file, flags;
62
74
  GError* error = NULL;
@@ -79,7 +91,7 @@ keyfile_load_from_file(int argc, VALUE *argv, VALUE self)
79
91
  }
80
92
 
81
93
  static VALUE
82
- keyfile_load_from_data(int argc, VALUE *argv, VALUE self)
94
+ rg_load_from_data(int argc, VALUE *argv, VALUE self)
83
95
  {
84
96
  VALUE data, flags;
85
97
  GError* error = NULL;
@@ -104,7 +116,7 @@ keyfile_load_from_data(int argc, VALUE *argv, VALUE self)
104
116
  }
105
117
 
106
118
  static VALUE
107
- keyfile_load_from_data_dirs(int argc, VALUE *argv, VALUE self)
119
+ rg_load_from_data_dirs(int argc, VALUE *argv, VALUE self)
108
120
  {
109
121
  VALUE file, flags;
110
122
  GError* error = NULL;
@@ -131,7 +143,7 @@ keyfile_load_from_data_dirs(int argc, VALUE *argv, VALUE self)
131
143
 
132
144
  #if GLIB_CHECK_VERSION(2, 14, 0)
133
145
  static VALUE
134
- keyfile_load_from_dirs(int argc, VALUE *argv, VALUE self)
146
+ rg_load_from_dirs(int argc, VALUE *argv, VALUE self)
135
147
  {
136
148
  VALUE rb_file, rb_search_dirs, rb_flags;
137
149
  GError* error = NULL;
@@ -150,24 +162,24 @@ keyfile_load_from_dirs(int argc, VALUE *argv, VALUE self)
150
162
  flags = RVAL2GFLAGS(rb_flags, G_TYPE_KEY_FILE_FLAGS);
151
163
 
152
164
  if (search_dirs != NULL)
153
- success = g_key_file_load_from_dirs(_SELF(self), file,
154
- search_dirs,
155
- &full_path, flags, &error);
165
+ success = g_key_file_load_from_dirs(_SELF(self), file,
166
+ search_dirs,
167
+ &full_path, flags, &error);
156
168
  else
157
- success = g_key_file_load_from_data_dirs(_SELF(self), file,
158
- &full_path, flags, &error);
169
+ success = g_key_file_load_from_data_dirs(_SELF(self), file,
170
+ &full_path, flags, &error);
159
171
 
160
172
  g_free(search_dirs);
161
173
 
162
174
  if (!success)
163
- RAISE_GERROR(error);
175
+ RAISE_GERROR(error);
164
176
 
165
177
  return CSTR2RVAL(full_path);
166
178
  }
167
179
  #endif
168
180
 
169
181
  static VALUE
170
- keyfile_to_data(VALUE self)
182
+ rg_to_data(VALUE self)
171
183
  {
172
184
  GError* error = NULL;
173
185
  gchar* data = g_key_file_to_data(_SELF(self), NULL, &error);
@@ -178,19 +190,19 @@ keyfile_to_data(VALUE self)
178
190
  }
179
191
 
180
192
  static VALUE
181
- keyfile_get_start_group(VALUE self)
193
+ rg_start_group(VALUE self)
182
194
  {
183
195
  return CSTR2RVAL(g_key_file_get_start_group(_SELF(self)));
184
196
  }
185
197
 
186
198
  static VALUE
187
- keyfile_get_groups(VALUE self)
199
+ rg_groups(VALUE self)
188
200
  {
189
201
  return STRV2RVAL_FREE(g_key_file_get_groups(_SELF(self), NULL));
190
202
  }
191
203
 
192
204
  static VALUE
193
- keyfile_get_keys(VALUE self, VALUE group_name)
205
+ rg_get_keys(VALUE self, VALUE group_name)
194
206
  {
195
207
  GError *error = NULL;
196
208
  gchar **keys = g_key_file_get_keys(_SELF(self),
@@ -204,14 +216,14 @@ keyfile_get_keys(VALUE self, VALUE group_name)
204
216
  }
205
217
 
206
218
  static VALUE
207
- keyfile_has_group(VALUE self, VALUE group_name)
219
+ rg_has_group_p(VALUE self, VALUE group_name)
208
220
  {
209
221
  return CBOOL2RVAL(g_key_file_has_group(_SELF(self),
210
222
  (const gchar*)RVAL2CSTR(group_name)));
211
223
  }
212
224
 
213
225
  static VALUE
214
- keyfile_has_key(VALUE self, VALUE group_name, VALUE key)
226
+ rg_has_key_p(VALUE self, VALUE group_name, VALUE key)
215
227
  {
216
228
  GError* error = NULL;
217
229
  gboolean ret = g_key_file_has_key(_SELF(self),
@@ -225,7 +237,7 @@ keyfile_has_key(VALUE self, VALUE group_name, VALUE key)
225
237
  }
226
238
 
227
239
  static VALUE
228
- keyfile_get_value(VALUE self, VALUE group_name, VALUE key)
240
+ rg_get_value(VALUE self, VALUE group_name, VALUE key)
229
241
  {
230
242
  GError* error = NULL;
231
243
  gchar* ret = g_key_file_get_value(_SELF(self),
@@ -239,7 +251,7 @@ keyfile_get_value(VALUE self, VALUE group_name, VALUE key)
239
251
  }
240
252
 
241
253
  static VALUE
242
- keyfile_get_string(VALUE self, VALUE group_name, VALUE key)
254
+ rg_get_string(VALUE self, VALUE group_name, VALUE key)
243
255
  {
244
256
  GError* error = NULL;
245
257
  gchar* ret = g_key_file_get_string(_SELF(self),
@@ -253,7 +265,7 @@ keyfile_get_string(VALUE self, VALUE group_name, VALUE key)
253
265
  }
254
266
 
255
267
  static VALUE
256
- keyfile_get_locale_string(int argc, VALUE *argv, VALUE self)
268
+ rg_get_locale_string(int argc, VALUE *argv, VALUE self)
257
269
  {
258
270
  VALUE group_name, key, locale;
259
271
  GError* error = NULL;
@@ -264,7 +276,7 @@ keyfile_get_locale_string(int argc, VALUE *argv, VALUE self)
264
276
  ret = g_key_file_get_locale_string(_SELF(self),
265
277
  (const gchar*)RVAL2CSTR(group_name),
266
278
  (const gchar*)RVAL2CSTR(key),
267
- (const gchar*)(NIL_P(locale) ? NULL : RVAL2CSTR(locale)),
279
+ (const gchar*)RVAL2CSTR_ACCEPT_NIL(locale),
268
280
  &error);
269
281
 
270
282
  if (error) RAISE_GERROR(error);
@@ -273,7 +285,7 @@ keyfile_get_locale_string(int argc, VALUE *argv, VALUE self)
273
285
  }
274
286
 
275
287
  static VALUE
276
- keyfile_get_boolean(VALUE self, VALUE group_name, VALUE key)
288
+ rg_get_boolean(VALUE self, VALUE group_name, VALUE key)
277
289
  {
278
290
  GError* error = NULL;
279
291
  gboolean ret = g_key_file_get_boolean(_SELF(self),
@@ -287,7 +299,7 @@ keyfile_get_boolean(VALUE self, VALUE group_name, VALUE key)
287
299
  }
288
300
 
289
301
  static VALUE
290
- keyfile_get_integer(VALUE self, VALUE group_name, VALUE key)
302
+ rg_get_integer(VALUE self, VALUE group_name, VALUE key)
291
303
  {
292
304
  GError* error = NULL;
293
305
  gint ret = g_key_file_get_integer(_SELF(self),
@@ -302,7 +314,7 @@ keyfile_get_integer(VALUE self, VALUE group_name, VALUE key)
302
314
 
303
315
  #if GLIB_CHECK_VERSION(2,12,0)
304
316
  static VALUE
305
- keyfile_get_double(VALUE self, VALUE group_name, VALUE key)
317
+ rg_get_double(VALUE self, VALUE group_name, VALUE key)
306
318
  {
307
319
  GError* error = NULL;
308
320
  gdouble ret = g_key_file_get_double(_SELF(self),
@@ -317,7 +329,7 @@ keyfile_get_double(VALUE self, VALUE group_name, VALUE key)
317
329
  #endif
318
330
 
319
331
  static VALUE
320
- keyfile_get_string_list(VALUE self, VALUE group_name, VALUE key)
332
+ rg_get_string_list(VALUE self, VALUE group_name, VALUE key)
321
333
  {
322
334
  VALUE ary;
323
335
  gsize i;
@@ -340,7 +352,7 @@ keyfile_get_string_list(VALUE self, VALUE group_name, VALUE key)
340
352
  }
341
353
 
342
354
  static VALUE
343
- keyfile_get_locale_string_list(int argc, VALUE *argv, VALUE self)
355
+ rg_get_locale_string_list(int argc, VALUE *argv, VALUE self)
344
356
  {
345
357
  VALUE group_name, key, locale;
346
358
  GError* error = NULL;
@@ -354,7 +366,7 @@ keyfile_get_locale_string_list(int argc, VALUE *argv, VALUE self)
354
366
  ret = g_key_file_get_locale_string_list(_SELF(self),
355
367
  (const gchar*)RVAL2CSTR(group_name),
356
368
  (const gchar*)RVAL2CSTR(key),
357
- (const gchar*)(NIL_P(locale) ? NULL : RVAL2CSTR(locale)),
369
+ (const gchar*)RVAL2CSTR_ACCEPT_NIL(locale),
358
370
  &length, &error);
359
371
 
360
372
  if (error) RAISE_GERROR(error);
@@ -369,7 +381,7 @@ keyfile_get_locale_string_list(int argc, VALUE *argv, VALUE self)
369
381
  }
370
382
 
371
383
  static VALUE
372
- keyfile_get_boolean_list(VALUE self, VALUE group_name, VALUE key)
384
+ rg_get_boolean_list(VALUE self, VALUE group_name, VALUE key)
373
385
  {
374
386
  VALUE ary;
375
387
  gsize i;
@@ -390,7 +402,7 @@ keyfile_get_boolean_list(VALUE self, VALUE group_name, VALUE key)
390
402
  }
391
403
 
392
404
  static VALUE
393
- keyfile_get_integer_list(VALUE self, VALUE group_name, VALUE key)
405
+ rg_get_integer_list(VALUE self, VALUE group_name, VALUE key)
394
406
  {
395
407
  VALUE ary;
396
408
  gsize i;
@@ -412,7 +424,7 @@ keyfile_get_integer_list(VALUE self, VALUE group_name, VALUE key)
412
424
 
413
425
  #if GLIB_CHECK_VERSION(2,12,0)
414
426
  static VALUE
415
- keyfile_get_double_list(VALUE self, VALUE group_name, VALUE key)
427
+ rg_get_double_list(VALUE self, VALUE group_name, VALUE key)
416
428
  {
417
429
  VALUE ary;
418
430
  gsize i;
@@ -422,7 +434,7 @@ keyfile_get_double_list(VALUE self, VALUE group_name, VALUE key)
422
434
  (const gchar*)RVAL2CSTR(group_name),
423
435
  (const gchar*)RVAL2CSTR(key),
424
436
  &length, &error);
425
-
437
+
426
438
  if (error) RAISE_GERROR(error);
427
439
 
428
440
  ary = rb_ary_new();
@@ -434,21 +446,21 @@ keyfile_get_double_list(VALUE self, VALUE group_name, VALUE key)
434
446
  #endif
435
447
 
436
448
  static VALUE
437
- keyfile_get_comment(VALUE self, VALUE group_name, VALUE key)
449
+ rg_get_comment(VALUE self, VALUE group_name, VALUE key)
438
450
  {
439
451
  GError* error = NULL;
440
452
  gchar* ret = g_key_file_get_comment(_SELF(self),
441
453
  (const gchar*)RVAL2CSTR(group_name),
442
454
  (const gchar*)RVAL2CSTR(key),
443
455
  &error);
444
-
456
+
445
457
  if (error) RAISE_GERROR(error);
446
458
 
447
459
  return CSTR2RVAL_FREE(ret);
448
460
  }
449
461
 
450
462
  static VALUE
451
- keyfile_set_value(VALUE self, VALUE group_name, VALUE key, VALUE value)
463
+ rg_set_value(VALUE self, VALUE group_name, VALUE key, VALUE value)
452
464
  {
453
465
  g_key_file_set_value(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
454
466
  (const gchar*)RVAL2CSTR(key),
@@ -457,7 +469,7 @@ keyfile_set_value(VALUE self, VALUE group_name, VALUE key, VALUE value)
457
469
  }
458
470
 
459
471
  static VALUE
460
- keyfile_set_string(VALUE self, VALUE group_name, VALUE key, VALUE string)
472
+ rg_set_string(VALUE self, VALUE group_name, VALUE key, VALUE string)
461
473
  {
462
474
  g_key_file_set_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
463
475
  (const gchar*)RVAL2CSTR(key),
@@ -466,7 +478,7 @@ keyfile_set_string(VALUE self, VALUE group_name, VALUE key, VALUE string)
466
478
  }
467
479
 
468
480
  static VALUE
469
- keyfile_set_locale_string(VALUE self, VALUE group_name, VALUE key, VALUE locale, VALUE locale_string)
481
+ rg_set_locale_string(VALUE self, VALUE group_name, VALUE key, VALUE locale, VALUE locale_string)
470
482
  {
471
483
  g_key_file_set_locale_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
472
484
  (const gchar*)RVAL2CSTR(key),
@@ -476,7 +488,7 @@ keyfile_set_locale_string(VALUE self, VALUE group_name, VALUE key, VALUE locale,
476
488
  }
477
489
 
478
490
  static VALUE
479
- keyfile_set_boolean(VALUE self, VALUE group_name, VALUE key, VALUE value)
491
+ rg_set_boolean(VALUE self, VALUE group_name, VALUE key, VALUE value)
480
492
  {
481
493
  g_key_file_set_boolean(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
482
494
  (const gchar*)RVAL2CSTR(key),
@@ -485,7 +497,7 @@ keyfile_set_boolean(VALUE self, VALUE group_name, VALUE key, VALUE value)
485
497
  }
486
498
 
487
499
  static VALUE
488
- keyfile_set_integer(VALUE self, VALUE group_name, VALUE key, VALUE value)
500
+ rg_set_integer(VALUE self, VALUE group_name, VALUE key, VALUE value)
489
501
  {
490
502
  g_key_file_set_integer(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
491
503
  (const gchar*)RVAL2CSTR(key),
@@ -495,7 +507,7 @@ keyfile_set_integer(VALUE self, VALUE group_name, VALUE key, VALUE value)
495
507
 
496
508
  #if GLIB_CHECK_VERSION(2,12,0)
497
509
  static VALUE
498
- keyfile_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value)
510
+ rg_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value)
499
511
  {
500
512
  g_key_file_set_double(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
501
513
  (const gchar*)RVAL2CSTR(key),
@@ -505,16 +517,15 @@ keyfile_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value)
505
517
  #endif
506
518
 
507
519
  static VALUE
508
- keyfile_set_string_list(VALUE self, VALUE group_name, VALUE key, VALUE rblist)
520
+ rg_set_string_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
509
521
  {
510
- VALUE ary = rb_ary_to_ary(rblist);
511
- const gchar **list = RVAL2STRV(ary);
522
+ GKeyFile *key_file = _SELF(self);
523
+ const gchar *group_name = RVAL2CSTR(rbgroup_name);
524
+ const gchar *key = RVAL2CSTR(rbkey);
525
+ long n;
526
+ const gchar **list = RVAL2STRS(rblist, n);
512
527
 
513
- g_key_file_set_string_list(_SELF(self),
514
- RVAL2CSTR(group_name),
515
- RVAL2CSTR(key),
516
- list,
517
- RARRAY_LEN(ary));
528
+ g_key_file_set_string_list(key_file, group_name, key, list, n);
518
529
 
519
530
  g_free(list);
520
531
 
@@ -522,17 +533,16 @@ keyfile_set_string_list(VALUE self, VALUE group_name, VALUE key, VALUE rblist)
522
533
  }
523
534
 
524
535
  static VALUE
525
- keyfile_set_locale_string_list(VALUE self, VALUE group_name, VALUE key, VALUE locale, VALUE rblist)
536
+ rg_set_locale_string_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblocale, VALUE rblist)
526
537
  {
527
- VALUE ary = rb_ary_to_ary(rblist);
528
- const gchar **list = RVAL2STRV(ary);
538
+ GKeyFile *key_file = _SELF(self);
539
+ const gchar *group_name = RVAL2CSTR(rbgroup_name);
540
+ const gchar *key = RVAL2CSTR(rbkey);
541
+ const gchar *locale = RVAL2CSTR(rblocale);
542
+ long n;
543
+ const gchar **list = RVAL2STRS(rblist, n);
529
544
 
530
- g_key_file_set_locale_string_list(_SELF(self),
531
- RVAL2CSTR(group_name),
532
- RVAL2CSTR(key),
533
- RVAL2CSTR(locale),
534
- list,
535
- RARRAY_LEN(ary));
545
+ g_key_file_set_locale_string_list(key_file, group_name, key, locale, list, n);
536
546
 
537
547
  g_free(list);
538
548
 
@@ -540,75 +550,55 @@ keyfile_set_locale_string_list(VALUE self, VALUE group_name, VALUE key, VALUE lo
540
550
  }
541
551
 
542
552
  static VALUE
543
- keyfile_set_boolean_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
553
+ rg_set_boolean_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
544
554
  {
545
- VALUE ary;
546
- long i, n;
547
- gboolean *booleans;
555
+ GKeyFile *key_file = _SELF(self);
556
+ const gchar *group_name = RVAL2CSTR(rbgroup_name);
557
+ const gchar *key = RVAL2CSTR(rbkey);
558
+ long n;
559
+ gboolean *list = RVAL2GBOOLEANS(rblist, n);
548
560
 
549
- ary = rb_ary_to_ary(list);
550
- n = RARRAY_LEN(ary);
551
- booleans = ALLOCA_N(gboolean, n);
552
- for (i = 0; i < n; i++)
553
- booleans[i] = RVAL2CBOOL(RARRAY_PTR(ary)[i]);
561
+ g_key_file_set_boolean_list(key_file, group_name, key, list, n);
554
562
 
555
- g_key_file_set_boolean_list(_SELF(self),
556
- RVAL2CSTR(group_name),
557
- RVAL2CSTR(key),
558
- booleans,
559
- n);
563
+ g_free(list);
560
564
 
561
565
  return self;
562
566
  }
563
567
 
564
568
  static VALUE
565
- keyfile_set_integer_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
569
+ rg_set_integer_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
566
570
  {
567
- VALUE ary;
568
- long i, n;
569
- gint *ints;
571
+ GKeyFile *key_file = _SELF(self);
572
+ const gchar *group_name = RVAL2CSTR(rbgroup_name);
573
+ const gchar *key = RVAL2CSTR(rbkey);
574
+ long n;
575
+ gint *list = RVAL2GINTS(rblist, n);
570
576
 
571
- ary = rb_ary_to_ary(list);
572
- n = RARRAY_LEN(ary);
573
- ints = ALLOCA_N(gint, n);
574
- for (i = 0; i < n; i++)
575
- ints[i] = NUM2INT(RARRAY_PTR(ary)[i]);
577
+ g_key_file_set_integer_list(key_file, group_name, key, list, n);
576
578
 
577
- g_key_file_set_integer_list(_SELF(self),
578
- RVAL2CSTR(group_name),
579
- RVAL2CSTR(key),
580
- ints,
581
- n);
579
+ g_free(list);
582
580
 
583
581
  return self;
584
582
  }
585
583
 
586
584
  #if GLIB_CHECK_VERSION(2,12,0)
587
585
  static VALUE
588
- keyfile_set_double_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
586
+ rg_set_double_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
589
587
  {
590
- VALUE ary;
591
- long i, n;
592
- gdouble *doubles;
593
-
594
- ary = rb_ary_to_ary(list);
595
- n = RARRAY_LEN(ary);
596
- doubles = ALLOCA_N(gdouble, n);
597
- for (i = 0; i < n; i++)
598
- doubles[i] = NUM2DBL(RARRAY_PTR(ary)[i]);
599
-
600
- g_key_file_set_double_list(_SELF(self),
601
- RVAL2CSTR(group_name),
602
- RVAL2CSTR(key),
603
- doubles,
604
- n);
588
+ GKeyFile *key_file = _SELF(self);
589
+ const gchar *group_name = RVAL2CSTR(rbgroup_name);
590
+ const gchar *key = RVAL2CSTR(rbkey);
591
+ long n;
592
+ gdouble *list = RVAL2GDOUBLES(rblist, n);
593
+
594
+ g_key_file_set_double_list(key_file, group_name, key, list, n);
605
595
 
606
596
  return self;
607
597
  }
608
598
  #endif
609
599
 
610
600
  static VALUE
611
- keyfile_set_comment(VALUE self, VALUE group_name, VALUE key, VALUE comment)
601
+ rg_set_comment(VALUE self, VALUE group_name, VALUE key, VALUE comment)
612
602
  {
613
603
  GError* error = NULL;
614
604
 
@@ -624,7 +614,7 @@ keyfile_set_comment(VALUE self, VALUE group_name, VALUE key, VALUE comment)
624
614
  }
625
615
 
626
616
  static VALUE
627
- keyfile_remove_group(VALUE self, VALUE group_name)
617
+ rg_remove_group(VALUE self, VALUE group_name)
628
618
  {
629
619
  GError* error = NULL;
630
620
 
@@ -637,7 +627,7 @@ keyfile_remove_group(VALUE self, VALUE group_name)
637
627
  }
638
628
 
639
629
  static VALUE
640
- keyfile_remove_key(VALUE self, VALUE group_name, VALUE key)
630
+ rg_remove_key(VALUE self, VALUE group_name, VALUE key)
641
631
  {
642
632
  GError* error = NULL;
643
633
 
@@ -652,9 +642,8 @@ keyfile_remove_key(VALUE self, VALUE group_name, VALUE key)
652
642
  return self;
653
643
  }
654
644
 
655
-
656
645
  static VALUE
657
- keyfile_remove_comment(VALUE self, VALUE group_name, VALUE key)
646
+ rg_remove_comment(VALUE self, VALUE group_name, VALUE key)
658
647
  {
659
648
  GError* error = NULL;
660
649
 
@@ -671,115 +660,115 @@ keyfile_remove_comment(VALUE self, VALUE group_name, VALUE key)
671
660
  #endif
672
661
 
673
662
  void
674
- Init_glib_keyfile()
663
+ Init_glib_keyfile(void)
675
664
  {
676
665
  #if GLIB_CHECK_VERSION(2,6,0)
677
- VALUE kf = G_DEF_CLASS(G_TYPE_KEY_FILE, "KeyFile", mGLib);
666
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_KEY_FILE, "KeyFile", mGLib);
678
667
  G_DEF_ERROR(G_KEY_FILE_ERROR, "KeyFileError", mGLib,
679
668
  rb_eRuntimeError, G_TYPE_KEY_FILE_ERROR);
680
669
 
681
- rb_define_method(kf, "initialize", keyfile_initialize, 0);
682
- rb_define_method(kf, "set_list_separator", keyfile_set_list_separator, 1);
683
- rb_define_method(kf, "load_from_file", keyfile_load_from_file, -1);
684
- rb_define_method(kf, "load_from_data", keyfile_load_from_data, -1);
685
- rb_define_method(kf, "load_from_data_dirs", keyfile_load_from_data_dirs, -1);
670
+ RG_DEF_METHOD(initialize, 0);
671
+ RG_DEF_METHOD(set_list_separator, 1);
672
+ RG_DEF_METHOD(load_from_file, -1);
673
+ RG_DEF_METHOD(load_from_data, -1);
674
+ RG_DEF_METHOD(load_from_data_dirs, -1);
686
675
  #if GLIB_CHECK_VERSION(2, 14, 0)
687
- rb_define_method(kf, "load_from_dirs", keyfile_load_from_dirs, -1);
676
+ RG_DEF_METHOD(load_from_dirs, -1);
688
677
  #endif
689
- rb_define_method(kf, "to_data", keyfile_to_data, 0);
690
- rb_define_method(kf, "start_group", keyfile_get_start_group, 0);
691
- rb_define_method(kf, "groups", keyfile_get_groups, 0);
692
- rb_define_method(kf, "get_keys", keyfile_get_keys, 1);
693
- rb_define_method(kf, "has_group?", keyfile_has_group, 1);
694
- rb_define_method(kf, "has_key?", keyfile_has_key, 2);
695
- rb_define_method(kf, "get_value", keyfile_get_value, 2);
696
- rb_define_method(kf, "get_string", keyfile_get_string, 2);
697
- rb_define_method(kf, "get_locale_string", keyfile_get_locale_string, -1);
698
- rb_define_method(kf, "get_boolean", keyfile_get_boolean, 2);
699
- rb_define_method(kf, "get_integer", keyfile_get_integer, 2);
678
+ RG_DEF_METHOD(to_data, 0);
679
+ RG_DEF_METHOD(start_group, 0);
680
+ RG_DEF_METHOD(groups, 0);
681
+ RG_DEF_METHOD(get_keys, 1);
682
+ RG_DEF_METHOD_P(has_group, 1);
683
+ RG_DEF_METHOD_P(has_key, 2);
684
+ RG_DEF_METHOD(get_value, 2);
685
+ RG_DEF_METHOD(get_string, 2);
686
+ RG_DEF_METHOD(get_locale_string, -1);
687
+ RG_DEF_METHOD(get_boolean, 2);
688
+ RG_DEF_METHOD(get_integer, 2);
700
689
  #if GLIB_CHECK_VERSION(2,12,0)
701
- rb_define_method(kf, "get_double", keyfile_get_double, 2);
690
+ RG_DEF_METHOD(get_double, 2);
702
691
  #endif
703
- rb_define_method(kf, "get_string_list", keyfile_get_string_list, 2);
704
- rb_define_method(kf, "get_locale_string_list", keyfile_get_locale_string_list, -1);
705
- rb_define_method(kf, "get_boolean_list", keyfile_get_boolean_list, 2);
706
- rb_define_method(kf, "get_integer_list", keyfile_get_integer_list, 2);
692
+ RG_DEF_METHOD(get_string_list, 2);
693
+ RG_DEF_METHOD(get_locale_string_list, -1);
694
+ RG_DEF_METHOD(get_boolean_list, 2);
695
+ RG_DEF_METHOD(get_integer_list, 2);
707
696
  #if GLIB_CHECK_VERSION(2,12,0)
708
- rb_define_method(kf, "get_double_list", keyfile_get_double_list, 2);
697
+ RG_DEF_METHOD(get_double_list, 2);
709
698
  #endif
710
- rb_define_method(kf, "get_comment", keyfile_get_comment, 2);
711
- rb_define_method(kf, "set_value", keyfile_set_value, 3);
712
- rb_define_method(kf, "set_string", keyfile_set_string, 3);
713
- rb_define_method(kf, "set_locale_string", keyfile_set_locale_string, 4);
714
- rb_define_method(kf, "set_boolean", keyfile_set_boolean, 3);
715
- rb_define_method(kf, "set_integer", keyfile_set_integer, 3);
699
+ RG_DEF_METHOD(get_comment, 2);
700
+ RG_DEF_METHOD(set_value, 3);
701
+ RG_DEF_METHOD(set_string, 3);
702
+ RG_DEF_METHOD(set_locale_string, 4);
703
+ RG_DEF_METHOD(set_boolean, 3);
704
+ RG_DEF_METHOD(set_integer, 3);
716
705
  #if GLIB_CHECK_VERSION(2,12,0)
717
- rb_define_method(kf, "set_double", keyfile_set_double, 3);
706
+ RG_DEF_METHOD(set_double, 3);
718
707
  #endif
719
- rb_define_method(kf, "set_string_list", keyfile_set_string_list, 3);
720
- rb_define_method(kf, "set_locale_string_list", keyfile_set_locale_string_list, 4);
721
- rb_define_method(kf, "set_boolean_list", keyfile_set_boolean_list, 3);
722
- rb_define_method(kf, "set_integer_list", keyfile_set_integer_list, 3);
708
+ RG_DEF_METHOD(set_string_list, 3);
709
+ RG_DEF_METHOD(set_locale_string_list, 4);
710
+ RG_DEF_METHOD(set_boolean_list, 3);
711
+ RG_DEF_METHOD(set_integer_list, 3);
723
712
  #if GLIB_CHECK_VERSION(2,12,0)
724
- rb_define_method(kf, "set_double_list", keyfile_set_double_list, 3);
713
+ RG_DEF_METHOD(set_double_list, 3);
725
714
  #endif
726
- rb_define_method(kf, "set_comment", keyfile_set_comment, 3);
727
- rb_define_method(kf, "remove_group", keyfile_remove_group, 1);
728
- rb_define_method(kf, "remove_key", keyfile_remove_key, 2);
729
- rb_define_method(kf, "remove_comment", keyfile_remove_comment, 2);
715
+ RG_DEF_METHOD(set_comment, 3);
716
+ RG_DEF_METHOD(remove_group, 1);
717
+ RG_DEF_METHOD(remove_key, 2);
718
+ RG_DEF_METHOD(remove_comment, 2);
730
719
 
731
720
  /* GKeyFileFlags */
732
- G_DEF_CLASS(G_TYPE_KEY_FILE_FLAGS, "Flags", kf);
733
- G_DEF_CONSTANTS(kf, G_TYPE_KEY_FILE_FLAGS, "G_KEY_FILE_");
721
+ G_DEF_CLASS(G_TYPE_KEY_FILE_FLAGS, "Flags", RG_TARGET_NAMESPACE);
722
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_KEY_FILE_FLAGS, "G_KEY_FILE_");
734
723
 
735
724
  #if GLIB_CHECK_VERSION(2, 14, 0)
736
725
  /* Defines for handling freedesktop.org Desktop files */
737
- rb_define_const(kf, "DESKTOP_GROUP", CSTR2RVAL(G_KEY_FILE_DESKTOP_GROUP));
726
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_GROUP", CSTR2RVAL(G_KEY_FILE_DESKTOP_GROUP));
738
727
 
739
- rb_define_const(kf, "DESKTOP_KEY_TYPE",
728
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_TYPE",
740
729
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_TYPE));
741
- rb_define_const(kf, "DESKTOP_KEY_VERSION",
730
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_VERSION",
742
731
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_VERSION));
743
- rb_define_const(kf, "DESKTOP_KEY_NAME",
732
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_NAME",
744
733
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_NAME));
745
- rb_define_const(kf, "DESKTOP_KEY_GENERIC_NAME",
734
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_GENERIC_NAME",
746
735
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME));
747
- rb_define_const(kf, "DESKTOP_KEY_NO_DISPLAY",
736
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_NO_DISPLAY",
748
737
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY));
749
- rb_define_const(kf, "DESKTOP_KEY_COMMENT",
738
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_COMMENT",
750
739
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_COMMENT));
751
- rb_define_const(kf, "DESKTOP_KEY_ICON",
740
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_ICON",
752
741
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_ICON));
753
- rb_define_const(kf, "DESKTOP_KEY_HIDDEN",
742
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_HIDDEN",
754
743
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_HIDDEN));
755
- rb_define_const(kf, "DESKTOP_KEY_ONLY_SHOW_IN",
744
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_ONLY_SHOW_IN",
756
745
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN));
757
- rb_define_const(kf, "DESKTOP_KEY_NOT_SHOW_IN",
746
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_NOT_SHOW_IN",
758
747
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN));
759
- rb_define_const(kf, "DESKTOP_KEY_TRY_EXEC",
748
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_TRY_EXEC",
760
749
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_TRY_EXEC));
761
- rb_define_const(kf, "DESKTOP_KEY_EXEC",
750
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_EXEC",
762
751
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_EXEC));
763
- rb_define_const(kf, "DESKTOP_KEY_PATH",
752
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_PATH",
764
753
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_PATH));
765
- rb_define_const(kf, "DESKTOP_KEY_TERMINAL",
754
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_TERMINAL",
766
755
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_TERMINAL));
767
- rb_define_const(kf, "DESKTOP_KEY_MIME_TYPE",
756
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_MIME_TYPE",
768
757
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_MIME_TYPE));
769
- rb_define_const(kf, "DESKTOP_KEY_CATEGORIES",
758
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_CATEGORIES",
770
759
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_CATEGORIES));
771
- rb_define_const(kf, "DESKTOP_KEY_STARTUP_NOTIFY",
760
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_STARTUP_NOTIFY",
772
761
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY));
773
- rb_define_const(kf, "DESKTOP_KEY_STARTUP_WM_CLASS",
762
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_STARTUP_WM_CLASS",
774
763
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS));
775
- rb_define_const(kf, "DESKTOP_KEY_URL",
764
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_URL",
776
765
  CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_URL));
777
766
 
778
- rb_define_const(kf, "DESKTOP_TYPE_APPLICATION",
767
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_APPLICATION",
779
768
  CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_APPLICATION));
780
- rb_define_const(kf, "DESKTOP_TYPE_LINK",
769
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_LINK",
781
770
  CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_LINK));
782
- rb_define_const(kf, "DESKTOP_TYPE_DIRECTORY",
771
+ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_DIRECTORY",
783
772
  CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_DIRECTORY));
784
773
  #endif
785
774
  #endif