glib2 0.90.7-x86-mingw32 → 0.90.8-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/ChangeLog +68 -0
  2. data/ext/glib2/rbglib.c +51 -15
  3. data/ext/glib2/rbglib.h +10 -2
  4. data/ext/glib2/rbglib_bookmarkfile.c +37 -74
  5. data/ext/glib2/rbglib_completion.c +8 -16
  6. data/ext/glib2/rbglib_convert.c +8 -18
  7. data/ext/glib2/rbglib_error.c +2 -8
  8. data/ext/glib2/rbglib_i18n.c +1 -2
  9. data/ext/glib2/rbglib_iochannel.c +81 -127
  10. data/ext/glib2/rbglib_keyfile.c +38 -86
  11. data/ext/glib2/rbglib_maincontext.c +29 -64
  12. data/ext/glib2/rbglib_mainloop.c +4 -8
  13. data/ext/glib2/rbglib_messages.c +7 -17
  14. data/ext/glib2/rbglib_pollfd.c +7 -14
  15. data/ext/glib2/rbglib_shell.c +3 -6
  16. data/ext/glib2/rbglib_source.c +14 -28
  17. data/ext/glib2/rbglib_spawn.c +7 -14
  18. data/ext/glib2/rbglib_threads.c +2 -4
  19. data/ext/glib2/rbglib_timer.c +7 -14
  20. data/ext/glib2/rbglib_unicode.c +45 -16
  21. data/ext/glib2/rbglib_utils.c +25 -50
  22. data/ext/glib2/rbglib_win32.c +10 -17
  23. data/ext/glib2/rbgobj_boxed.c +9 -21
  24. data/ext/glib2/rbgobj_closure.c +5 -11
  25. data/ext/glib2/rbgobj_enums.c +1 -2
  26. data/ext/glib2/rbgobj_object.c +23 -59
  27. data/ext/glib2/rbgobj_param.c +7 -15
  28. data/ext/glib2/rbgobj_signal.c +25 -65
  29. data/ext/glib2/rbgobj_type.c +36 -81
  30. data/ext/glib2/rbgobj_typeinstance.c +3 -6
  31. data/ext/glib2/rbgobj_typeinterface.c +3 -6
  32. data/ext/glib2/rbgobj_typemodule.c +4 -8
  33. data/ext/glib2/rbgobj_typeplugin.c +2 -4
  34. data/ext/glib2/rbgobj_valuetypes.c +7 -15
  35. data/ext/glib2/rbgobject.c +8 -18
  36. data/ext/glib2/rbgobject.h +3 -0
  37. data/ext/glib2/rbgprivate.h +0 -1
  38. data/ext/glib2/rbgutil.c +3 -6
  39. data/lib/1.8/glib2.so +0 -0
  40. data/lib/1.9/glib2.so +0 -0
  41. data/lib/gnome2-raketask.rb +1 -0
  42. data/lib/mkmf-gnome2.rb +12 -9
  43. data/test-unit/History.txt +43 -1
  44. data/test-unit/Manifest.txt +1 -1
  45. data/test-unit/html/index.html +62 -24
  46. data/test-unit/html/index.html.ja +54 -25
  47. data/test-unit/html/test-unit.css +3 -3
  48. data/test-unit/lib/test/unit/assertions.rb +489 -36
  49. data/test-unit/lib/test/unit/autorunner.rb +40 -0
  50. data/test-unit/lib/test/unit/collector.rb +6 -4
  51. data/test-unit/lib/test/unit/collector/load.rb +48 -5
  52. data/test-unit/lib/test/unit/collector/xml.rb +250 -0
  53. data/test-unit/lib/test/unit/error.rb +4 -3
  54. data/test-unit/lib/test/unit/fixture.rb +12 -3
  55. data/test-unit/lib/test/unit/runner/xml.rb +15 -0
  56. data/test-unit/lib/test/unit/testcase.rb +48 -16
  57. data/test-unit/lib/test/unit/testresult.rb +6 -2
  58. data/test-unit/lib/test/unit/testsuite.rb +24 -2
  59. data/test-unit/lib/test/unit/ui/console/testrunner.rb +65 -28
  60. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +11 -2
  61. data/test-unit/lib/test/unit/ui/xml/testrunner.rb +224 -0
  62. data/test-unit/lib/test/unit/version.rb +1 -1
  63. data/test-unit/test/run-test.rb +7 -0
  64. data/test-unit/test/{test_assertions.rb → test-assertions.rb} +708 -77
  65. data/test-unit/test/test-fixture.rb +37 -0
  66. data/test-unit/test/test-testcase.rb +24 -7
  67. data/test-unit/test/test_testsuite.rb +19 -11
  68. data/test/test_iochannel.rb +9 -9
  69. data/test/test_unicode.rb +44 -31
  70. metadata +8 -5
@@ -42,26 +42,21 @@ g_key_file_get_type(void)
42
42
  #define _SELF(self) ((GKeyFile*)(RVAL2BOXED(self, G_TYPE_KEY_FILE)))
43
43
 
44
44
  static VALUE
45
- keyfile_initialize(self)
46
- VALUE self;
45
+ keyfile_initialize(VALUE self)
47
46
  {
48
47
  G_INITIALIZE(self, g_key_file_new());
49
48
  return Qnil;
50
49
  }
51
50
 
52
51
  static VALUE
53
- keyfile_set_list_separator(self, sep)
54
- VALUE self, sep;
52
+ keyfile_set_list_separator(VALUE self, VALUE sep)
55
53
  {
56
54
  g_key_file_set_list_separator(_SELF(self), NUM2INT(sep));
57
55
  return self;
58
56
  }
59
57
 
60
58
  static VALUE
61
- keyfile_load_from_file(argc, argv, self)
62
- int argc;
63
- VALUE *argv;
64
- VALUE self;
59
+ keyfile_load_from_file(int argc, VALUE *argv, VALUE self)
65
60
  {
66
61
  VALUE file, flags;
67
62
  GError* error = NULL;
@@ -84,10 +79,7 @@ keyfile_load_from_file(argc, argv, self)
84
79
  }
85
80
 
86
81
  static VALUE
87
- keyfile_load_from_data(argc, argv, self)
88
- int argc;
89
- VALUE *argv;
90
- VALUE self;
82
+ keyfile_load_from_data(int argc, VALUE *argv, VALUE self)
91
83
  {
92
84
  VALUE data, flags;
93
85
  GError* error = NULL;
@@ -112,10 +104,7 @@ keyfile_load_from_data(argc, argv, self)
112
104
  }
113
105
 
114
106
  static VALUE
115
- keyfile_load_from_data_dirs(argc, argv, self)
116
- int argc;
117
- VALUE *argv;
118
- VALUE self;
107
+ keyfile_load_from_data_dirs(int argc, VALUE *argv, VALUE self)
119
108
  {
120
109
  VALUE file, flags;
121
110
  GError* error = NULL;
@@ -189,8 +178,7 @@ keyfile_load_from_dirs(int argc, VALUE *argv, VALUE self)
189
178
  #endif
190
179
 
191
180
  static VALUE
192
- keyfile_to_data(self)
193
- VALUE self;
181
+ keyfile_to_data(VALUE self)
194
182
  {
195
183
  GError* error = NULL;
196
184
  gchar* data = g_key_file_to_data(_SELF(self), NULL, &error);
@@ -201,15 +189,13 @@ keyfile_to_data(self)
201
189
  }
202
190
 
203
191
  static VALUE
204
- keyfile_get_start_group(self)
205
- VALUE self;
192
+ keyfile_get_start_group(VALUE self)
206
193
  {
207
194
  return CSTR2RVAL(g_key_file_get_start_group(_SELF(self)));
208
195
  }
209
196
 
210
197
  static VALUE
211
- keyfile_get_groups(self)
212
- VALUE self;
198
+ keyfile_get_groups(VALUE self)
213
199
  {
214
200
  gsize length;
215
201
  int i;
@@ -226,8 +212,7 @@ keyfile_get_groups(self)
226
212
  }
227
213
 
228
214
  static VALUE
229
- keyfile_get_keys(self, group_name)
230
- VALUE self, group_name;
215
+ keyfile_get_keys(VALUE self, VALUE group_name)
231
216
  {
232
217
  gsize length;
233
218
  int i;
@@ -249,16 +234,14 @@ keyfile_get_keys(self, group_name)
249
234
  }
250
235
 
251
236
  static VALUE
252
- keyfile_has_group(self, group_name)
253
- VALUE self, group_name;
237
+ keyfile_has_group(VALUE self, VALUE group_name)
254
238
  {
255
239
  return CBOOL2RVAL(g_key_file_has_group(_SELF(self),
256
240
  (const gchar*)RVAL2CSTR(group_name)));
257
241
  }
258
242
 
259
243
  static VALUE
260
- keyfile_has_key(self, group_name, key)
261
- VALUE self, group_name, key;
244
+ keyfile_has_key(VALUE self, VALUE group_name, VALUE key)
262
245
  {
263
246
  GError* error = NULL;
264
247
  gboolean ret = g_key_file_has_key(_SELF(self),
@@ -272,8 +255,7 @@ keyfile_has_key(self, group_name, key)
272
255
  }
273
256
 
274
257
  static VALUE
275
- keyfile_get_value(self, group_name, key)
276
- VALUE self, group_name, key;
258
+ keyfile_get_value(VALUE self, VALUE group_name, VALUE key)
277
259
  {
278
260
  GError* error = NULL;
279
261
  gchar* ret = g_key_file_get_value(_SELF(self),
@@ -287,8 +269,7 @@ keyfile_get_value(self, group_name, key)
287
269
  }
288
270
 
289
271
  static VALUE
290
- keyfile_get_string(self, group_name, key)
291
- VALUE self, group_name, key;
272
+ keyfile_get_string(VALUE self, VALUE group_name, VALUE key)
292
273
  {
293
274
  GError* error = NULL;
294
275
  gchar* ret = g_key_file_get_string(_SELF(self),
@@ -302,10 +283,7 @@ keyfile_get_string(self, group_name, key)
302
283
  }
303
284
 
304
285
  static VALUE
305
- keyfile_get_locale_string(argc, argv, self)
306
- int argc;
307
- VALUE *argv;
308
- VALUE self;
286
+ keyfile_get_locale_string(int argc, VALUE *argv, VALUE self)
309
287
  {
310
288
  VALUE group_name, key, locale;
311
289
  GError* error = NULL;
@@ -325,8 +303,7 @@ keyfile_get_locale_string(argc, argv, self)
325
303
  }
326
304
 
327
305
  static VALUE
328
- keyfile_get_boolean(self, group_name, key)
329
- VALUE self, group_name, key;
306
+ keyfile_get_boolean(VALUE self, VALUE group_name, VALUE key)
330
307
  {
331
308
  GError* error = NULL;
332
309
  gboolean ret = g_key_file_get_boolean(_SELF(self),
@@ -340,8 +317,7 @@ keyfile_get_boolean(self, group_name, key)
340
317
  }
341
318
 
342
319
  static VALUE
343
- keyfile_get_integer(self, group_name, key)
344
- VALUE self, group_name, key;
320
+ keyfile_get_integer(VALUE self, VALUE group_name, VALUE key)
345
321
  {
346
322
  GError* error = NULL;
347
323
  gint ret = g_key_file_get_integer(_SELF(self),
@@ -356,8 +332,7 @@ keyfile_get_integer(self, group_name, key)
356
332
 
357
333
  #if GLIB_CHECK_VERSION(2,12,0)
358
334
  static VALUE
359
- keyfile_get_double(self, group_name, key)
360
- VALUE self, group_name, key;
335
+ keyfile_get_double(VALUE self, VALUE group_name, VALUE key)
361
336
  {
362
337
  GError* error = NULL;
363
338
  gdouble ret = g_key_file_get_double(_SELF(self),
@@ -372,8 +347,7 @@ keyfile_get_double(self, group_name, key)
372
347
  #endif
373
348
 
374
349
  static VALUE
375
- keyfile_get_string_list(self, group_name, key)
376
- VALUE self, group_name, key;
350
+ keyfile_get_string_list(VALUE self, VALUE group_name, VALUE key)
377
351
  {
378
352
  VALUE ary;
379
353
  gint i;
@@ -396,10 +370,7 @@ keyfile_get_string_list(self, group_name, key)
396
370
  }
397
371
 
398
372
  static VALUE
399
- keyfile_get_locale_string_list(argc, argv, self)
400
- int argc;
401
- VALUE *argv;
402
- VALUE self;
373
+ keyfile_get_locale_string_list(int argc, VALUE *argv, VALUE self)
403
374
  {
404
375
  VALUE group_name, key, locale;
405
376
  GError* error = NULL;
@@ -428,8 +399,7 @@ keyfile_get_locale_string_list(argc, argv, self)
428
399
  }
429
400
 
430
401
  static VALUE
431
- keyfile_get_boolean_list(self, group_name, key)
432
- VALUE self, group_name, key;
402
+ keyfile_get_boolean_list(VALUE self, VALUE group_name, VALUE key)
433
403
  {
434
404
  VALUE ary;
435
405
  gint i;
@@ -450,8 +420,7 @@ keyfile_get_boolean_list(self, group_name, key)
450
420
  }
451
421
 
452
422
  static VALUE
453
- keyfile_get_integer_list(self, group_name, key)
454
- VALUE self, group_name, key;
423
+ keyfile_get_integer_list(VALUE self, VALUE group_name, VALUE key)
455
424
  {
456
425
  VALUE ary;
457
426
  gint i;
@@ -473,8 +442,7 @@ keyfile_get_integer_list(self, group_name, key)
473
442
 
474
443
  #if GLIB_CHECK_VERSION(2,12,0)
475
444
  static VALUE
476
- keyfile_get_double_list(self, group_name, key)
477
- VALUE self, group_name, key;
445
+ keyfile_get_double_list(VALUE self, VALUE group_name, VALUE key)
478
446
  {
479
447
  VALUE ary;
480
448
  gint i;
@@ -496,8 +464,7 @@ keyfile_get_double_list(self, group_name, key)
496
464
  #endif
497
465
 
498
466
  static VALUE
499
- keyfile_get_comment(self, group_name, key)
500
- VALUE self, group_name, key;
467
+ keyfile_get_comment(VALUE self, VALUE group_name, VALUE key)
501
468
  {
502
469
  GError* error = NULL;
503
470
  gchar* ret = g_key_file_get_comment(_SELF(self),
@@ -511,8 +478,7 @@ keyfile_get_comment(self, group_name, key)
511
478
  }
512
479
 
513
480
  static VALUE
514
- keyfile_set_value(self, group_name, key, value)
515
- VALUE self, group_name, key, value;
481
+ keyfile_set_value(VALUE self, VALUE group_name, VALUE key, VALUE value)
516
482
  {
517
483
  g_key_file_set_value(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
518
484
  (const gchar*)RVAL2CSTR(key),
@@ -521,8 +487,7 @@ keyfile_set_value(self, group_name, key, value)
521
487
  }
522
488
 
523
489
  static VALUE
524
- keyfile_set_string(self, group_name, key, string)
525
- VALUE self, group_name, key, string;
490
+ keyfile_set_string(VALUE self, VALUE group_name, VALUE key, VALUE string)
526
491
  {
527
492
  g_key_file_set_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
528
493
  (const gchar*)RVAL2CSTR(key),
@@ -531,8 +496,7 @@ keyfile_set_string(self, group_name, key, string)
531
496
  }
532
497
 
533
498
  static VALUE
534
- keyfile_set_locale_string(self, group_name, key, locale, locale_string)
535
- VALUE self, group_name, key, locale, locale_string;
499
+ keyfile_set_locale_string(VALUE self, VALUE group_name, VALUE key, VALUE locale, VALUE locale_string)
536
500
  {
537
501
  g_key_file_set_locale_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
538
502
  (const gchar*)RVAL2CSTR(key),
@@ -542,8 +506,7 @@ keyfile_set_locale_string(self, group_name, key, locale, locale_string)
542
506
  }
543
507
 
544
508
  static VALUE
545
- keyfile_set_boolean(self, group_name, key, value)
546
- VALUE self, group_name, key, value;
509
+ keyfile_set_boolean(VALUE self, VALUE group_name, VALUE key, VALUE value)
547
510
  {
548
511
  g_key_file_set_boolean(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
549
512
  (const gchar*)RVAL2CSTR(key),
@@ -552,8 +515,7 @@ keyfile_set_boolean(self, group_name, key, value)
552
515
  }
553
516
 
554
517
  static VALUE
555
- keyfile_set_integer(self, group_name, key, value)
556
- VALUE self, group_name, key, value;
518
+ keyfile_set_integer(VALUE self, VALUE group_name, VALUE key, VALUE value)
557
519
  {
558
520
  g_key_file_set_integer(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
559
521
  (const gchar*)RVAL2CSTR(key),
@@ -563,8 +525,7 @@ keyfile_set_integer(self, group_name, key, value)
563
525
 
564
526
  #if GLIB_CHECK_VERSION(2,12,0)
565
527
  static VALUE
566
- keyfile_set_double(self, group_name, key, value)
567
- VALUE self, group_name, key, value;
528
+ keyfile_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value)
568
529
  {
569
530
  g_key_file_set_double(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
570
531
  (const gchar*)RVAL2CSTR(key),
@@ -574,8 +535,7 @@ keyfile_set_double(self, group_name, key, value)
574
535
  #endif
575
536
 
576
537
  static VALUE
577
- keyfile_set_string_list(self, group_name, key, list)
578
- VALUE self, group_name, key, list;
538
+ keyfile_set_string_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
579
539
  {
580
540
  gint len = RARRAY_LEN(list);
581
541
  gchar** glist = ALLOCA_N(gchar*, len);
@@ -593,8 +553,7 @@ keyfile_set_string_list(self, group_name, key, list)
593
553
  }
594
554
 
595
555
  static VALUE
596
- keyfile_set_locale_string_list(self, group_name, key, locale, list)
597
- VALUE self, group_name, key, locale, list;
556
+ keyfile_set_locale_string_list(VALUE self, VALUE group_name, VALUE key, VALUE locale, VALUE list)
598
557
  {
599
558
  gint len = RARRAY_LEN(list);
600
559
  gchar** glist = ALLOCA_N(gchar*, len);
@@ -613,8 +572,7 @@ keyfile_set_locale_string_list(self, group_name, key, locale, list)
613
572
  }
614
573
 
615
574
  static VALUE
616
- keyfile_set_boolean_list(self, group_name, key, list)
617
- VALUE self, group_name, key, list;
575
+ keyfile_set_boolean_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
618
576
  {
619
577
  gint len = RARRAY_LEN(list);
620
578
  gboolean* glist = ALLOCA_N(gboolean, len);
@@ -632,8 +590,7 @@ keyfile_set_boolean_list(self, group_name, key, list)
632
590
  }
633
591
 
634
592
  static VALUE
635
- keyfile_set_integer_list(self, group_name, key, list)
636
- VALUE self, group_name, key, list;
593
+ keyfile_set_integer_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
637
594
  {
638
595
  gint len = RARRAY_LEN(list);
639
596
  gint* glist = ALLOCA_N(gint, len);
@@ -652,8 +609,7 @@ keyfile_set_integer_list(self, group_name, key, list)
652
609
 
653
610
  #if GLIB_CHECK_VERSION(2,12,0)
654
611
  static VALUE
655
- keyfile_set_double_list(self, group_name, key, list)
656
- VALUE self, group_name, key, list;
612
+ keyfile_set_double_list(VALUE self, VALUE group_name, VALUE key, VALUE list)
657
613
  {
658
614
  gint len = RARRAY_LEN(list);
659
615
  gdouble* glist = ALLOCA_N(gdouble, len);
@@ -672,8 +628,7 @@ keyfile_set_double_list(self, group_name, key, list)
672
628
  #endif
673
629
 
674
630
  static VALUE
675
- keyfile_set_comment(self, group_name, key, comment)
676
- VALUE self, group_name, key, comment;
631
+ keyfile_set_comment(VALUE self, VALUE group_name, VALUE key, VALUE comment)
677
632
  {
678
633
  GError* error = NULL;
679
634
  g_key_file_set_comment(_SELF(self), (const gchar*)RVAL2CSTR(group_name),
@@ -686,8 +641,7 @@ keyfile_set_comment(self, group_name, key, comment)
686
641
  }
687
642
 
688
643
  static VALUE
689
- keyfile_remove_group(self, group_name)
690
- VALUE self, group_name;
644
+ keyfile_remove_group(VALUE self, VALUE group_name)
691
645
  {
692
646
  GError* error = NULL;
693
647
  g_key_file_remove_group(_SELF(self), (const gchar*)RVAL2CSTR(group_name), &error);
@@ -698,8 +652,7 @@ keyfile_remove_group(self, group_name)
698
652
  }
699
653
 
700
654
  static VALUE
701
- keyfile_remove_key(self, group_name, key)
702
- VALUE self, group_name, key;
655
+ keyfile_remove_key(VALUE self, VALUE group_name, VALUE key)
703
656
  {
704
657
  GError* error = NULL;
705
658
  g_key_file_remove_key(_SELF(self),
@@ -714,8 +667,7 @@ keyfile_remove_key(self, group_name, key)
714
667
 
715
668
 
716
669
  static VALUE
717
- keyfile_remove_comment(self, group_name, key)
718
- VALUE self, group_name, key;
670
+ keyfile_remove_comment(VALUE self, VALUE group_name, VALUE key)
719
671
  {
720
672
  GError* error = NULL;
721
673
  g_key_file_remove_comment(_SELF(self),
@@ -393,8 +393,7 @@ ruby_source_set_priority (VALUE self, VALUE priority)
393
393
  #endif
394
394
 
395
395
  static VALUE
396
- source_remove(self, tag)
397
- VALUE self, tag;
396
+ source_remove(VALUE self, VALUE tag)
398
397
  {
399
398
  VALUE callback;
400
399
  callback = G_GET_RELATIVE(mGLibSource, id__callbacks__, tag);
@@ -405,16 +404,14 @@ source_remove(self, tag)
405
404
 
406
405
  #if GLIB_CHECK_VERSION(2,12,0)
407
406
  static VALUE
408
- source_current_source(self)
409
- VALUE self;
407
+ source_current_source(VALUE self)
410
408
  {
411
409
  return BOXED2RVAL(g_main_current_source, G_TYPE_SOURCE);
412
410
  }
413
411
  #endif
414
412
 
415
413
  static gboolean
416
- invoke_source_func(data)
417
- gpointer data;
414
+ invoke_source_func(gpointer data)
418
415
  {
419
416
  callback_info_t *info = (callback_info_t *)data;
420
417
  gboolean ret;
@@ -442,8 +439,7 @@ g_main_context_get_type(void)
442
439
  #define _SELF(s) ((GMainContext*)RVAL2BOXED(s, G_TYPE_MAIN_CONTEXT))
443
440
 
444
441
  static VALUE
445
- mc_initialize(self)
446
- VALUE self;
442
+ mc_initialize(VALUE self)
447
443
  {
448
444
  GMainContext *context;
449
445
 
@@ -464,29 +460,25 @@ mc_initialize(self)
464
460
  }
465
461
 
466
462
  static VALUE
467
- mc_s_default(self)
468
- VALUE self;
463
+ mc_s_default(VALUE self)
469
464
  {
470
465
  return BOXED2RVAL(g_main_context_default(), G_TYPE_MAIN_CONTEXT);
471
466
  }
472
467
 
473
468
  static VALUE
474
- mc_iteration(self, may_block)
475
- VALUE self, may_block;
469
+ mc_iteration(VALUE self, VALUE may_block)
476
470
  {
477
471
  return CBOOL2RVAL(g_main_context_iteration(_SELF(self), RVAL2CBOOL(may_block)));
478
472
  }
479
473
 
480
474
  static VALUE
481
- mc_pending(self)
482
- VALUE self;
475
+ mc_pending(VALUE self)
483
476
  {
484
477
  return CBOOL2RVAL(g_main_context_pending(_SELF(self)));
485
478
  }
486
479
 
487
480
  static VALUE
488
- mc_find_source(self, source_id)
489
- VALUE self, source_id;
481
+ mc_find_source(VALUE self, VALUE source_id)
490
482
  {
491
483
  GSource* src = g_main_context_find_source_by_id(_SELF(self), NUM2UINT(source_id));
492
484
  return BOXED2RVAL(src, G_TYPE_SOURCE);
@@ -503,23 +495,20 @@ GSource* g_main_context_find_source_by_funcs_user_data
503
495
  */
504
496
 
505
497
  static VALUE
506
- mc_wakeup(self)
507
- VALUE self;
498
+ mc_wakeup(VALUE self)
508
499
  {
509
500
  g_main_context_wakeup(_SELF(self));
510
501
  return self;
511
502
  }
512
503
 
513
504
  static VALUE
514
- mc_acquire(self)
515
- VALUE self;
505
+ mc_acquire(VALUE self)
516
506
  {
517
507
  return CBOOL2RVAL(g_main_context_acquire(_SELF(self)));
518
508
  }
519
509
 
520
510
  static VALUE
521
- mc_release(self)
522
- VALUE self;
511
+ mc_release(VALUE self)
523
512
  {
524
513
  g_main_context_release(_SELF(self));
525
514
  return self;
@@ -527,8 +516,7 @@ mc_release(self)
527
516
 
528
517
  #if GLIB_CHECK_VERSION(2,10,0)
529
518
  static VALUE
530
- mc_is_owner(self)
531
- VALUE self;
519
+ mc_is_owner(VALUE self)
532
520
  {
533
521
  return CBOOL2RVAL(g_main_context_is_owner(_SELF(self)));
534
522
  }
@@ -541,8 +529,7 @@ gboolean g_main_context_wait (GMainContext *context,
541
529
  */
542
530
 
543
531
  static VALUE
544
- mc_prepare(self)
545
- VALUE self;
532
+ mc_prepare(VALUE self)
546
533
  {
547
534
  gint priority;
548
535
  gboolean ret = g_main_context_prepare(_SELF(self), &priority);
@@ -551,8 +538,7 @@ mc_prepare(self)
551
538
  }
552
539
 
553
540
  static VALUE
554
- mc_query(self, max_priority)
555
- VALUE self, max_priority;
541
+ mc_query(VALUE self, VALUE max_priority)
556
542
  {
557
543
  gint i, timeout_;
558
544
  VALUE ary;
@@ -577,8 +563,7 @@ mc_query(self, max_priority)
577
563
 
578
564
  /* How can I implement this?
579
565
  static VALUE
580
- mc_check(self, max_priority)
581
- VALUE self, max_priority;
566
+ mc_check(VALUE self, VALUE max_priority)
582
567
  {
583
568
  gint i, timeout_;
584
569
  VALUE ary;
@@ -607,8 +592,7 @@ mc_check(self, max_priority)
607
592
  */
608
593
 
609
594
  static VALUE
610
- mc_dispatch(self)
611
- VALUE self;
595
+ mc_dispatch(VALUE self)
612
596
  {
613
597
  g_main_context_dispatch(_SELF(self));
614
598
  return self;
@@ -616,10 +600,7 @@ mc_dispatch(self)
616
600
 
617
601
  /* How can I get "self" or something like it as key ....
618
602
  static gint
619
- poll_func(ufds, nfsd, timeout_)
620
- GPollFD* ufds;
621
- guint nfsd;
622
- gint timeout_;
603
+ poll_func(GPollFD *ufds, guint nfsd, gint timeout_)
623
604
  {
624
605
  VALUE func = rb_ivar_get(self, id_poll_func);
625
606
  if NIL_P(func) return -1;
@@ -629,8 +610,7 @@ poll_func(ufds, nfsd, timeout_)
629
610
  }
630
611
 
631
612
  static VALUE
632
- mc_set_poll_func(self)
633
- VALUE self;
613
+ mc_set_poll_func(VALUE self)
634
614
  {
635
615
  rb_ivar_set(self, id_poll_func, rb_block_proc());
636
616
  g_main_context_set_poll_func(_SELF(self), (GPollFunc)poll_func);
@@ -644,8 +624,7 @@ GPollFunc g_main_context_get_poll_func (GMainContext *context);
644
624
  */
645
625
 
646
626
  static VALUE
647
- mc_add_poll(self, fd, priority)
648
- VALUE self, fd, priority;
627
+ mc_add_poll(VALUE self, VALUE fd, VALUE priority)
649
628
  {
650
629
  g_main_context_add_poll(_SELF(self), RVAL2BOXED(fd, G_TYPE_POLL_FD),
651
630
  NUM2INT(priority));
@@ -653,8 +632,7 @@ mc_add_poll(self, fd, priority)
653
632
  }
654
633
 
655
634
  static VALUE
656
- mc_remove_poll(self, fd)
657
- VALUE self, fd;
635
+ mc_remove_poll(VALUE self, VALUE fd)
658
636
  {
659
637
  g_main_context_remove_poll(_SELF(self), RVAL2BOXED(fd, G_TYPE_POLL_FD));
660
638
  return self;
@@ -662,8 +640,7 @@ mc_remove_poll(self, fd)
662
640
 
663
641
  #ifdef HAVE_G_MAIN_DEPTH
664
642
  static VALUE
665
- mc_s_depth(self)
666
- VALUE self;
643
+ mc_s_depth(VALUE self)
667
644
  {
668
645
  return INT2NUM(g_main_depth());
669
646
  }
@@ -671,15 +648,13 @@ mc_s_depth(self)
671
648
 
672
649
 
673
650
  static VALUE
674
- timeout_source_new(self, interval)
675
- VALUE self, interval;
651
+ timeout_source_new(VALUE self, VALUE interval)
676
652
  {
677
653
  return BOXED2RVAL(g_timeout_source_new(NUM2UINT(interval)), G_TYPE_SOURCE);
678
654
  }
679
655
  #if GLIB_CHECK_VERSION(2,14,0)
680
656
  static VALUE
681
- timeout_source_new_seconds(self, interval)
682
- VALUE self, interval;
657
+ timeout_source_new_seconds(VALUE self, VALUE interval)
683
658
  {
684
659
  return BOXED2RVAL(g_timeout_source_new_seconds(NUM2UINT(interval)), G_TYPE_SOURCE);
685
660
  }
@@ -736,17 +711,13 @@ timeout_add_seconds(int argc, VALUE *argv, VALUE self)
736
711
  #endif
737
712
 
738
713
  static VALUE
739
- idle_source_new(self)
740
- VALUE self;
714
+ idle_source_new(VALUE self)
741
715
  {
742
716
  return BOXED2RVAL(g_idle_source_new(), G_TYPE_SOURCE);
743
717
  }
744
718
 
745
719
  static VALUE
746
- idle_add(argc, argv, self)
747
- gint argc;
748
- VALUE* argv;
749
- VALUE self;
720
+ idle_add(gint argc, VALUE *argv, VALUE self)
750
721
  {
751
722
  VALUE arg1, arg2, func, rb_id;
752
723
  callback_info_t *info;
@@ -776,8 +747,7 @@ idle_add(argc, argv, self)
776
747
  }
777
748
 
778
749
  static VALUE
779
- idle_remove(self, func)
780
- VALUE self, func;
750
+ idle_remove(VALUE self, VALUE func)
781
751
  {
782
752
  callback_info_t *info;
783
753
 
@@ -789,24 +759,19 @@ idle_remove(self, func)
789
759
 
790
760
  #if GLIB_CHECK_VERSION(2,4,0)
791
761
  static VALUE
792
- child_watch_source_new(self, pid)
793
- VALUE self, pid;
762
+ child_watch_source_new(VALUE self, VALUE pid)
794
763
  {
795
764
  return BOXED2RVAL(g_child_watch_source_new((GPid)NUM2INT(pid)), G_TYPE_SOURCE);
796
765
  }
797
766
 
798
767
  static void
799
- child_watch_func(pid, status, func)
800
- GPid pid;
801
- gint status;
802
- gpointer func;
768
+ child_watch_func(GPid pid, gint status, gpointer func)
803
769
  {
804
770
  rb_funcall((VALUE)func, id_call, 2, INT2NUM((long)pid), INT2NUM(status));
805
771
  }
806
772
 
807
773
  static VALUE
808
- child_watch_add(self, pid)
809
- VALUE self, pid;
774
+ child_watch_add(VALUE self, VALUE pid)
810
775
  {
811
776
  VALUE func = rb_block_proc();
812
777
  G_RELATIVE(self, func);