glib2 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,13 +27,13 @@
27
27
  #define RG_TARGET_NAMESPACE mWin32
28
28
 
29
29
  static VALUE
30
- rg_m_error_message(VALUE self, VALUE error)
30
+ rg_s_error_message(VALUE self, VALUE error)
31
31
  {
32
32
  return CSTR2RVAL_FREE(g_win32_error_message(NUM2INT(error)));
33
33
  }
34
34
 
35
35
  static VALUE
36
- rg_m_locale(VALUE self)
36
+ rg_s_locale(VALUE self)
37
37
  {
38
38
  return CSTR2RVAL_FREE(g_win32_getlocale());
39
39
  }
@@ -42,18 +42,18 @@ static VALUE
42
42
  rbglib_m_win32_locale_deprecated(VALUE self)
43
43
  {
44
44
  rb_warn("GLib.win32_locale() is deprecated. Use GLib::Win32.locale instead");
45
- return rg_m_locale(self);
45
+ return rg_s_locale(self);
46
46
  }
47
47
 
48
48
  static VALUE
49
- rg_m_get_package_installation_directory(VALUE self, VALUE package, VALUE dll_name)
49
+ rg_s_get_package_installation_directory(VALUE self, VALUE package, VALUE dll_name)
50
50
  {
51
51
  return CSTR2RVAL_FREE(g_win32_get_package_installation_directory(RVAL2CSTR(package),
52
52
  RVAL2CSTR(dll_name)));
53
53
  }
54
54
 
55
55
  static VALUE
56
- rg_m_get_package_installation_subdirectory(VALUE self, VALUE package, VALUE dll_name, VALUE subdir)
56
+ rg_s_get_package_installation_subdirectory(VALUE self, VALUE package, VALUE dll_name, VALUE subdir)
57
57
  {
58
58
  return CSTR2RVAL_FREE(g_win32_get_package_installation_subdirectory(RVAL2CSTR(package),
59
59
  RVAL2CSTR(dll_name),
@@ -62,7 +62,7 @@ rg_m_get_package_installation_subdirectory(VALUE self, VALUE package, VALUE dll_
62
62
 
63
63
  #if GLIB_CHECK_VERSION(2,6,0)
64
64
  static VALUE
65
- rg_m_version(VALUE self)
65
+ rg_s_version(VALUE self)
66
66
  {
67
67
  return UINT2NUM(g_win32_get_windows_version());
68
68
  }
@@ -70,7 +70,7 @@ rg_m_version(VALUE self)
70
70
 
71
71
  #if GLIB_CHECK_VERSION(2,8,0)
72
72
  static VALUE
73
- rg_m_locale_filename_from_utf8(VALUE self, VALUE utf8_filename)
73
+ rg_s_locale_filename_from_utf8(VALUE self, VALUE utf8_filename)
74
74
  {
75
75
  return CSTR2RVAL_FREE(g_win32_locale_filename_from_utf8(RVAL2CSTR(utf8_filename)));
76
76
  }
@@ -80,14 +80,14 @@ rbglib_m_win32_locale_filename_from_utf8_deprecated(VALUE self,
80
80
  VALUE utf8_filename)
81
81
  {
82
82
  rb_warn("GLib.win32_locale_filename_from_utf8() is deprecated. Use GLib::Win32.locale_filename_from_utf8 instead");
83
- return rg_m_locale_filename_from_utf8(self, utf8_filename);
83
+ return rg_s_locale_filename_from_utf8(self, utf8_filename);
84
84
  }
85
85
 
86
86
  #endif
87
87
 
88
88
  # if GLIB_CHECK_VERSION(2, 16, 0)
89
89
  static VALUE
90
- rg_m_get_package_installation_directory_of_module(int argc,
90
+ rg_s_get_package_installation_directory_of_module(int argc,
91
91
  VALUE *argv,
92
92
  VALUE self)
93
93
  {
@@ -114,23 +114,23 @@ Init_glib_win32(void)
114
114
  /* glib/gwin32.h */
115
115
  VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "Win32");
116
116
 
117
- RG_DEF_MODFUNC(error_message, 1);
118
- RG_DEF_MODFUNC(locale, 0);
119
- RG_DEF_MODFUNC(get_package_installation_directory, 2);
120
- RG_DEF_MODFUNC(get_package_installation_subdirectory, 3);
121
- RG_DEF_MODFUNC(version, 0);
117
+ RG_DEF_SMETHOD(error_message, 1);
118
+ RG_DEF_SMETHOD(locale, 0);
119
+ RG_DEF_SMETHOD(get_package_installation_directory, 2);
120
+ RG_DEF_SMETHOD(get_package_installation_subdirectory, 3);
121
+ RG_DEF_SMETHOD(version, 0);
122
122
  /* Deprecated */
123
- rb_define_module_function(mGLib, "win32_locale", rbglib_m_win32_locale_deprecated, 0);
123
+ rbg_define_singleton_method(mGLib, "win32_locale", rbglib_m_win32_locale_deprecated, 0);
124
124
 
125
125
  # if GLIB_CHECK_VERSION(2,8,0)
126
- RG_DEF_MODFUNC(locale_filename_from_utf8, 1);
126
+ RG_DEF_SMETHOD(locale_filename_from_utf8, 1);
127
127
  /* Deprecated */
128
- rb_define_module_function(mGLib, "win32_locale_filename_from_utf8",
128
+ rbg_define_singleton_method(mGLib, "win32_locale_filename_from_utf8",
129
129
  rbglib_m_win32_locale_filename_from_utf8_deprecated, 1);
130
130
  # endif
131
131
 
132
132
  # if GLIB_CHECK_VERSION(2, 16, 0)
133
- RG_DEF_MODFUNC(get_package_installation_directory_of_module, -1);
133
+ RG_DEF_SMETHOD(get_package_installation_directory_of_module, -1);
134
134
  # endif
135
135
  #endif
136
136
  }
@@ -237,10 +237,10 @@ Init_gobject_gboxed(void)
237
237
  rbgobj_register_r2g_func(G_TYPE_BOXED, boxed_from_ruby);
238
238
 
239
239
  rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))rbgobj_boxed_s_allocate);
240
- rb_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
241
- rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
240
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
241
+ rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
242
242
  RG_DEF_METHOD(initialize, 0);
243
243
  RG_DEF_METHOD(inspect, 0);
244
244
  RG_DEF_METHOD(initialize_copy, 1);
245
245
  RG_DEF_ALIAS("copy", "dup");
246
- }
246
+ }
@@ -377,8 +377,8 @@ Init_gobject_genums(void)
377
377
 
378
378
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ENUM, "Enum", mGLib);
379
379
 
380
- rb_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
381
- rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
380
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
381
+ rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
382
382
 
383
383
  RG_DEF_SMETHOD(range, 0);
384
384
  RG_DEF_SMETHOD(values, 0);
@@ -479,8 +479,8 @@ Init_gobject_gflags(void)
479
479
 
480
480
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FLAGS, "Flags", mGLib);
481
481
 
482
- rb_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
483
- rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
482
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
483
+ rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
484
484
 
485
485
  RG_DEF_SMETHOD(mask, 0);
486
486
  RG_DEF_SMETHOD(values, 0);
@@ -495,7 +495,7 @@ Init_gobject_gflags(void)
495
495
  RG_DEF_METHOD(nick, 0);
496
496
 
497
497
  /*
498
- rb_define_method(RG_TARGET_NAMESPACE, "inspect", flags_inspect, 0);
498
+ rbg_define_method(RG_TARGET_NAMESPACE, "inspect", flags_inspect, 0);
499
499
  */
500
500
 
501
501
  RG_DEF_METHOD_OPERATOR("<=>", flags_compare, 1);
@@ -505,9 +505,9 @@ Init_gobject_gflags(void)
505
505
  RG_DEF_METHOD_OPERATOR(">", flags_gt, 1);
506
506
  RG_DEF_METHOD_OPERATOR("<", flags_lt, 1);
507
507
  RG_DEF_METHOD_OPERATOR("~", flags_not, 0);
508
- rb_define_method(RG_TARGET_NAMESPACE, "&", flags_and, 1);
509
- rb_define_method(RG_TARGET_NAMESPACE, "|", flags_or, 1);
510
- rb_define_method(RG_TARGET_NAMESPACE, "^", flags_xor, 1);
508
+ rbg_define_method(RG_TARGET_NAMESPACE, "&", flags_and, 1);
509
+ rbg_define_method(RG_TARGET_NAMESPACE, "|", flags_or, 1);
510
+ rbg_define_method(RG_TARGET_NAMESPACE, "^", flags_xor, 1);
511
511
  RG_DEF_METHOD_OPERATOR("-", flags_minus, 1);
512
512
 
513
513
  RG_DEF_METHOD_P(empty, 0);
@@ -171,7 +171,7 @@ rbgobj_init_object_class(VALUE klass)
171
171
  {
172
172
  rbgobj_define_property_accessors(klass);
173
173
  if (G_TYPE_IS_ABSTRACT(CLASS2GTYPE(klass)))
174
- rb_define_method(klass, "initialize", dummy_init, -1);
174
+ rbg_define_method(klass, "initialize", dummy_init, -1);
175
175
  }
176
176
 
177
177
  /**********************************************************************/
@@ -803,7 +803,7 @@ rg_s_type_register(int argc, VALUE* argv, VALUE self)
803
803
  VALUE m = rb_define_module_under(self, RubyGObjectHookModule);
804
804
 
805
805
  if (! (cinfo->flags & RBGOBJ_DEFINED_BY_RUBY)) {
806
- rb_define_method(m, "initialize", rg_initialize, -1);
806
+ rbg_define_method(m, "initialize", rg_initialize, -1);
807
807
  }
808
808
 
809
809
  rb_include_module(self, m);
@@ -830,8 +830,8 @@ Init_gobject_gobject(void)
830
830
  rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))gobj_s_allocate);
831
831
  RG_DEF_SMETHOD_BANG(new, -1);
832
832
 
833
- rb_define_singleton_method(RG_TARGET_NAMESPACE, "property", &gobj_s_property, 1);
834
- rb_define_singleton_method(RG_TARGET_NAMESPACE, "properties", &gobj_s_properties, -1);
833
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "property", &gobj_s_property, 1);
834
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "properties", &gobj_s_properties, -1);
835
835
  RG_DEF_SMETHOD(install_property, -1);
836
836
  q_ruby_getter = g_quark_from_static_string("__ruby_getter");
837
837
  q_ruby_setter = g_quark_from_static_string("__ruby_setter");
@@ -845,7 +845,7 @@ Init_gobject_gobject(void)
845
845
  RG_DEF_METHOD_P(destroyed, 0);
846
846
 
847
847
  RG_DEF_METHOD(initialize, -1);
848
- rb_define_method(RG_TARGET_NAMESPACE, "ref_count", gobj_ref_count, 0); /* for debugging */
848
+ rbg_define_method(RG_TARGET_NAMESPACE, "ref_count", gobj_ref_count, 0); /* for debugging */
849
849
  RG_DEF_METHOD(inspect, 0);
850
850
  RG_DEF_METHOD(type_name, 0);
851
851
 
@@ -368,11 +368,11 @@ Init_gobject_gparam(void)
368
368
  /* for debugging */
369
369
  RG_DEF_METHOD(ref_count, 0);
370
370
 
371
- rb_define_method(RG_TARGET_NAMESPACE, "readable?", param_is_G_PARAM_READABLE, 0);
372
- rb_define_method(RG_TARGET_NAMESPACE, "writable?", param_is_G_PARAM_WRITABLE, 0);
373
- rb_define_method(RG_TARGET_NAMESPACE, "construct?", param_is_G_PARAM_CONSTRUCT, 0);
374
- rb_define_method(RG_TARGET_NAMESPACE, "construct_only?", param_is_G_PARAM_CONSTRUCT_ONLY, 0);
375
- rb_define_method(RG_TARGET_NAMESPACE, "lax_validation?", param_is_G_PARAM_LAX_VALIDATION, 0);
376
- rb_define_method(RG_TARGET_NAMESPACE, "private?", param_is_G_PARAM_PRIVATE, 0);
377
- rb_define_method(RG_TARGET_NAMESPACE, "readwrite?", param_is_G_PARAM_READWRITE, 0);
371
+ rbg_define_method(RG_TARGET_NAMESPACE, "readable?", param_is_G_PARAM_READABLE, 0);
372
+ rbg_define_method(RG_TARGET_NAMESPACE, "writable?", param_is_G_PARAM_WRITABLE, 0);
373
+ rbg_define_method(RG_TARGET_NAMESPACE, "construct?", param_is_G_PARAM_CONSTRUCT, 0);
374
+ rbg_define_method(RG_TARGET_NAMESPACE, "construct_only?", param_is_G_PARAM_CONSTRUCT_ONLY, 0);
375
+ rbg_define_method(RG_TARGET_NAMESPACE, "lax_validation?", param_is_G_PARAM_LAX_VALIDATION, 0);
376
+ rbg_define_method(RG_TARGET_NAMESPACE, "private?", param_is_G_PARAM_PRIVATE, 0);
377
+ rbg_define_method(RG_TARGET_NAMESPACE, "readwrite?", param_is_G_PARAM_READWRITE, 0);
378
378
  }
@@ -235,14 +235,14 @@ Init_gobject_gparamspecs(void)
235
235
 
236
236
  #define DEF_NUMERIC_PSPEC_METHODS(c, typename) \
237
237
  G_STMT_START {\
238
- rb_define_method(c, "initialize", typename##_initialize, 7); \
239
- rb_define_method(c, "minimum", typename##_minimum, 0); \
240
- rb_define_method(c, "maximum", typename##_maximum, 0); \
241
- rb_define_method(c, "range", typename##_range, 0); \
238
+ rbg_define_method(c, "initialize", typename##_initialize, 7); \
239
+ rbg_define_method(c, "minimum", typename##_minimum, 0); \
240
+ rbg_define_method(c, "maximum", typename##_maximum, 0); \
241
+ rbg_define_method(c, "range", typename##_range, 0); \
242
242
  } G_STMT_END
243
243
 
244
244
  #if 0
245
- rb_define_method(c, "default_value", typename##_default_value, 0); \
245
+ rbg_define_method(c, "default_value", typename##_default_value, 0); \
246
246
  rb_define_alias(c, "default", "default_value"); \
247
247
 
248
248
  #endif
@@ -273,39 +273,39 @@ Init_gobject_gparamspecs(void)
273
273
 
274
274
  c = G_DEF_CLASS(G_TYPE_PARAM_FLOAT, "Float", cParamSpec);
275
275
  DEF_NUMERIC_PSPEC_METHODS(c, float);
276
- rb_define_method(c, "epsilon", float_epsilon, 0);
276
+ rbg_define_method(c, "epsilon", float_epsilon, 0);
277
277
 
278
278
  c = G_DEF_CLASS(G_TYPE_PARAM_DOUBLE, "Double", cParamSpec);
279
279
  DEF_NUMERIC_PSPEC_METHODS(c, double);
280
- rb_define_method(c, "epsilon", double_epsilon, 0);
280
+ rbg_define_method(c, "epsilon", double_epsilon, 0);
281
281
 
282
282
  c = G_DEF_CLASS(G_TYPE_PARAM_BOOLEAN, "Boolean", cParamSpec);
283
- rb_define_method(c, "initialize", boolean_initialize, 5);
283
+ rbg_define_method(c, "initialize", boolean_initialize, 5);
284
284
 
285
285
  c = G_DEF_CLASS(G_TYPE_PARAM_UNICHAR, "UniChar", cParamSpec);
286
- rb_define_method(c, "initialize", unichar_initialize, 5);
286
+ rbg_define_method(c, "initialize", unichar_initialize, 5);
287
287
 
288
288
  c = G_DEF_CLASS(G_TYPE_PARAM_ENUM, "Enum", cParamSpec);
289
- rb_define_method(c, "initialize", enum_initialize, 6);
289
+ rbg_define_method(c, "initialize", enum_initialize, 6);
290
290
 
291
291
  c = G_DEF_CLASS(G_TYPE_PARAM_FLAGS, "Flags", cParamSpec);
292
- rb_define_method(c, "initialize", flags_initialize, 6);
292
+ rbg_define_method(c, "initialize", flags_initialize, 6);
293
293
 
294
294
  c = G_DEF_CLASS(G_TYPE_PARAM_STRING, "String", cParamSpec);
295
- rb_define_method(c, "initialize", string_initialize, 5);
295
+ rbg_define_method(c, "initialize", string_initialize, 5);
296
296
 
297
297
  c = G_DEF_CLASS(G_TYPE_PARAM_PARAM, "Param", cParamSpec);
298
- rb_define_method(c, "initialize", param_initialize, 5);
298
+ rbg_define_method(c, "initialize", param_initialize, 5);
299
299
 
300
300
  c = G_DEF_CLASS(G_TYPE_PARAM_BOXED, "Boxed", cParamSpec);
301
- rb_define_method(c, "initialize", boxed_initialize, 5);
301
+ rbg_define_method(c, "initialize", boxed_initialize, 5);
302
302
 
303
303
  c = G_DEF_CLASS(G_TYPE_PARAM_POINTER, "Pointer", cParamSpec);
304
- rb_define_method(c, "initialize", pointer_initialize, 4);
304
+ rbg_define_method(c, "initialize", pointer_initialize, 4);
305
305
 
306
306
  c = G_DEF_CLASS(G_TYPE_PARAM_VALUE_ARRAY, "ValueArray", cParamSpec);
307
- rb_define_method(c, "initialize", value_array_initialize, 5);
307
+ rbg_define_method(c, "initialize", value_array_initialize, 5);
308
308
 
309
309
  c = G_DEF_CLASS(G_TYPE_PARAM_OBJECT, "Object", cParamSpec);
310
- rb_define_method(c, "initialize", object_initialize, 5);
310
+ rbg_define_method(c, "initialize", object_initialize, 5);
311
311
  }
@@ -294,7 +294,7 @@ static VALUE
294
294
  gobj_sig_connect_impl(gboolean after, int argc, VALUE *argv, VALUE self)
295
295
  {
296
296
  VALUE sig, rest;
297
- int i;
297
+ gulong handler_id;
298
298
  GClosure* rclosure;
299
299
  const char* sig_name;
300
300
  guint signal_id;
@@ -325,9 +325,10 @@ gobj_sig_connect_impl(gboolean after, int argc, VALUE *argv, VALUE self)
325
325
  sig_name);
326
326
  g_rclosure_set_tag((GClosure *)rclosure, tag);
327
327
  g_free(tag);
328
- i = g_signal_connect_closure_by_id(g_object, signal_id, detail, rclosure, after);
328
+ handler_id = g_signal_connect_closure_by_id(g_object, signal_id, detail,
329
+ rclosure, after);
329
330
 
330
- return INT2FIX(i);
331
+ return ULONG2NUM(handler_id);
331
332
  }
332
333
 
333
334
  static VALUE
@@ -644,7 +645,7 @@ gobj_s_method_added(VALUE klass, VALUE id)
644
645
  {
645
646
  VALUE mod = rb_define_module_under(klass, RubyGObjectHookModule);
646
647
  rb_include_module(klass, mod);
647
- rb_define_method(mod, name, gobj_sig_chain_from_overridden, -1);
648
+ rbg_define_method(mod, name, gobj_sig_chain_from_overridden, -1);
648
649
  }
649
650
 
650
651
  return Qnil;
@@ -917,13 +918,13 @@ Init_gobject_gsignal(void)
917
918
  rb_define_const(cSignalFlags, "MASK", INT2NUM(G_SIGNAL_FLAGS_MASK));
918
919
  rb_define_const(RG_TARGET_NAMESPACE, "FLAGS_MASK", INT2NUM(G_SIGNAL_FLAGS_MASK));
919
920
 
920
- rb_define_method(RG_TARGET_NAMESPACE, "run_first?", query_is_G_SIGNAL_RUN_FIRST, 0);
921
- rb_define_method(RG_TARGET_NAMESPACE, "run_last?", query_is_G_SIGNAL_RUN_LAST, 0);
922
- rb_define_method(RG_TARGET_NAMESPACE, "run_cleanup?", query_is_G_SIGNAL_RUN_CLEANUP, 0);
923
- rb_define_method(RG_TARGET_NAMESPACE, "no_recurse?", query_is_G_SIGNAL_NO_RECURSE, 0);
924
- rb_define_method(RG_TARGET_NAMESPACE, "detailed?", query_is_G_SIGNAL_DETAILED, 0);
925
- rb_define_method(RG_TARGET_NAMESPACE, "action?", query_is_G_SIGNAL_ACTION, 0);
926
- rb_define_method(RG_TARGET_NAMESPACE, "no_hooks?", query_is_G_SIGNAL_NO_HOOKS, 0);
921
+ rbg_define_method(RG_TARGET_NAMESPACE, "run_first?", query_is_G_SIGNAL_RUN_FIRST, 0);
922
+ rbg_define_method(RG_TARGET_NAMESPACE, "run_last?", query_is_G_SIGNAL_RUN_LAST, 0);
923
+ rbg_define_method(RG_TARGET_NAMESPACE, "run_cleanup?", query_is_G_SIGNAL_RUN_CLEANUP, 0);
924
+ rbg_define_method(RG_TARGET_NAMESPACE, "no_recurse?", query_is_G_SIGNAL_NO_RECURSE, 0);
925
+ rbg_define_method(RG_TARGET_NAMESPACE, "detailed?", query_is_G_SIGNAL_DETAILED, 0);
926
+ rbg_define_method(RG_TARGET_NAMESPACE, "action?", query_is_G_SIGNAL_ACTION, 0);
927
+ rbg_define_method(RG_TARGET_NAMESPACE, "no_hooks?", query_is_G_SIGNAL_NO_HOOKS, 0);
927
928
 
928
929
  /* GConnectFlags */
929
930
  G_DEF_CLASS(G_TYPE_CONNECT_FLAGS, "ConnectFlags", mGLib);
@@ -943,35 +944,35 @@ Init_gobject_gsignal(void)
943
944
  signal_func_table = rb_hash_new();
944
945
  rb_global_variable(&signal_func_table);
945
946
 
946
- rb_define_method(mMetaInterface, "signal_new", gobj_s_signal_new, -1);
947
- rb_define_method(mMetaInterface, "signals", gobj_s_signals, -1);
948
- rb_define_method(mMetaInterface, "signal", gobj_s_signal, 1);
947
+ rbg_define_method(mMetaInterface, "signal_new", gobj_s_signal_new, -1);
948
+ rbg_define_method(mMetaInterface, "signals", gobj_s_signals, -1);
949
+ rbg_define_method(mMetaInterface, "signal", gobj_s_signal, 1);
949
950
 
950
- rb_define_method(cInstantiatable, "signal_has_handler_pending?",
951
+ rbg_define_method(cInstantiatable, "signal_has_handler_pending?",
951
952
  gobj_sig_has_handler_pending, -1);
952
- rb_define_method(cInstantiatable, "signal_connect", gobj_sig_connect, -1);
953
- rb_define_method(cInstantiatable, "signal_connect_after",
953
+ rbg_define_method(cInstantiatable, "signal_connect", gobj_sig_connect, -1);
954
+ rbg_define_method(cInstantiatable, "signal_connect_after",
954
955
  gobj_sig_connect_after, -1);
955
956
 
956
957
  #if 0
957
- rb_define_method(cInstantiatable, "signal_invocation_hint",
958
+ rbg_define_method(cInstantiatable, "signal_invocation_hint",
958
959
  gobj_sig_get_invocation_hint, 0);
959
960
  #endif
960
961
 
961
- rb_define_method(cInstantiatable, "signal_emit",
962
+ rbg_define_method(cInstantiatable, "signal_emit",
962
963
  gobj_sig_emit, -1);
963
- rb_define_method(cInstantiatable, "signal_emit_stop",
964
+ rbg_define_method(cInstantiatable, "signal_emit_stop",
964
965
  gobj_sig_emit_stop, 1);
965
- rb_define_method(cInstantiatable, "signal_handler_block",
966
+ rbg_define_method(cInstantiatable, "signal_handler_block",
966
967
  gobj_sig_handler_block, 1);
967
- rb_define_method(cInstantiatable, "signal_handler_unblock",
968
+ rbg_define_method(cInstantiatable, "signal_handler_unblock",
968
969
  gobj_sig_handler_unblock, 1);
969
- rb_define_method(cInstantiatable, "signal_handler_disconnect",
970
+ rbg_define_method(cInstantiatable, "signal_handler_disconnect",
970
971
  gobj_sig_handler_disconnect, 1);
971
972
 
972
- rb_define_method(cInstantiatable, "signal_handler_is_connected?",
973
+ rbg_define_method(cInstantiatable, "signal_handler_is_connected?",
973
974
  gobj_sig_handler_is_connected, 1);
974
975
 
975
- rb_define_singleton_method(cInstantiatable, "method_added",
976
+ rbg_define_singleton_method(cInstantiatable, "method_added",
976
977
  gobj_s_method_added, 1);
977
- }
978
+ }
@@ -143,7 +143,7 @@ void
143
143
  Init_gobject_typeinterface(void)
144
144
  {
145
145
  RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "MetaInterface");
146
- rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
146
+ rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
147
147
  RG_DEF_METHOD(append_features, 1);
148
148
  #if GLIB_CHECK_VERSION(2,4,0)
149
149
  RG_DEF_METHOD(install_property, 1);
@@ -152,4 +152,4 @@ Init_gobject_typeinterface(void)
152
152
  #endif
153
153
 
154
154
  rbgobj_mInterface = G_DEF_INTERFACE(G_TYPE_INTERFACE, "Interface", mGLib);
155
- }
155
+ }
@@ -111,13 +111,13 @@ static void
111
111
  Init_gtype_pointer(void)
112
112
  {
113
113
  VALUE cPtr = G_DEF_CLASS(G_TYPE_POINTER, "Pointer", mGLib);
114
- rb_define_singleton_method(cPtr, "gtype", ptr_s_gtype, 1);
115
- rb_define_method(cPtr, "gtype", ptr_gtype, 1);
114
+ rbg_define_singleton_method(cPtr, "gtype", ptr_s_gtype, 1);
115
+ rbg_define_method(cPtr, "gtype", ptr_gtype, 1);
116
116
  #ifndef RBGOBJ_USE_DLPTR
117
- rb_define_method(cPtr, "inspect", ptr_inspect, 0);
118
- rb_define_method(cPtr, "==", ptr_eql, 1);
119
- rb_define_method(cPtr, "eql?", ptr_eql, 1);
120
- rb_define_method(cPtr, "hash", ptr_hash, 0);
117
+ rbg_define_method(cPtr, "inspect", ptr_inspect, 0);
118
+ rbg_define_method(cPtr, "==", ptr_eql, 1);
119
+ rbg_define_method(cPtr, "eql?", ptr_eql, 1);
120
+ rbg_define_method(cPtr, "hash", ptr_hash, 0);
121
121
  #endif
122
122
  }
123
123
 
@@ -42,7 +42,7 @@ extern "C" {
42
42
  #define RG_DEF_MODFUNC_OPERATOR(ope, func, argc) \
43
43
  rb_define_module_function(RG_TARGET_NAMESPACE, ope, rg_m_operator_ ## func, argc)
44
44
  #define RG_DEF_SMETHOD(method, argc) \
45
- rb_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc)
45
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc)
46
46
  #define RG_DEF_SMETHOD_P(method, argc) \
47
47
  rb_define_singleton_method(RG_TARGET_NAMESPACE, #method"?", rg_s_ ## method ## _p, argc)
48
48
  #define RG_DEF_SMETHOD_BANG(method, argc) \
@@ -50,7 +50,7 @@ extern "C" {
50
50
  #define RG_DEF_SMETHOD_OPERATOR(ope, func, argc) \
51
51
  rb_define_singleton_method(RG_TARGET_NAMESPACE, ope, rg_s_operator_ ## func, argc)
52
52
  #define RG_DEF_METHOD(method, argc) \
53
- rb_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc)
53
+ rbg_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc)
54
54
  #define RG_DEF_METHOD_P(method, argc) \
55
55
  rb_define_method(RG_TARGET_NAMESPACE, #method"?", rg_ ## method ## _p, argc)
56
56
  #define RG_DEF_METHOD_BANG(method, argc) \
@@ -40,7 +40,7 @@ module GLib
40
40
  end
41
41
  constants = []
42
42
  const_lines.scan(/^\s*([^\s,]*).*\n/) do |name|
43
- constants << name[0] unless name[0] =~ /(^[\/\*]|^$)/
43
+ constants << name[0] unless name[0] =~ /(^[\/\*]|^#|^$)/
44
44
  end
45
45
  @prefix = extract_prefix(constants)
46
46
  constants.each do |name|