glib2 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -127,6 +127,7 @@ EXPORTS
127
127
  rbgutil_start_callback_dispatch_thread
128
128
  rbgutil_stop_callback_dispatch_thread
129
129
  rbgutil_string_set_utf8_encoding
130
+ rbgutil_key_equal
130
131
  rbgerr_define_gerror
131
132
  rbgerr_gerror2exception
132
133
  rbgobj_convert_define
@@ -35,7 +35,7 @@ extern "C" {
35
35
 
36
36
  #define RBGLIB_MAJOR_VERSION 2
37
37
  #define RBGLIB_MINOR_VERSION 0
38
- #define RBGLIB_MICRO_VERSION 1
38
+ #define RBGLIB_MICRO_VERSION 2
39
39
 
40
40
  #ifndef RSTRING_PTR
41
41
  # define RSTRING_PTR(s) (RSTRING(s)->ptr)
@@ -63,19 +63,6 @@ typedef int GPid;
63
63
  # define G_SOURCE_CONTINUE TRUE
64
64
  #endif
65
65
 
66
- /* For suppressing a warning:
67
- * warning: format '%p' expects argument of type 'void *', but argument 3 has type 'VALUE' [-Wformat]
68
- *
69
- * Ruby's printf format that is used in rb_raise() uses '%p" for
70
- * argument.inspect instead of formatting pointer address that is used
71
- * in printf(3).
72
- */
73
- #ifdef __GNUC__
74
- # define RBG_PRINTF_INSPECT_VALUE(rb_object) GUINT_TO_POINTER(rb_object)
75
- #else
76
- # define RBG_PRINTF_INSPECT_VALUE(rb_object) (rb_object)
77
- #endif
78
-
79
66
  #define RBG_INSPECT(object) (rbg_rval_inspect(object))
80
67
 
81
68
  #define RVAL2CSTR(v) (rbg_rval2cstr(&(v)))
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002-2004 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@ static ID id_add_one_arg_setter;
27
27
  static ID id_set_property;
28
28
  static ID id_to_a;
29
29
  static ID id_allocate;
30
+ static ID id_equal;
30
31
 
31
32
  void
32
33
  rbg_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
@@ -116,6 +117,22 @@ rbgutil_string_set_utf8_encoding(VALUE string)
116
117
  return string;
117
118
  }
118
119
 
120
+ gboolean
121
+ rbgutil_key_equal(VALUE rb_key, const char *key)
122
+ {
123
+ switch (TYPE(rb_key)) {
124
+ case RUBY_T_STRING:
125
+ return RVAL2CBOOL(rb_funcall(rb_key, id_equal, 1, rb_str_new_cstr(key)));
126
+ break;
127
+ case RUBY_T_SYMBOL:
128
+ return SYM2ID(rb_key) == rb_intern(key);
129
+ break;
130
+ default:
131
+ return FALSE;
132
+ break;
133
+ }
134
+ }
135
+
119
136
  void
120
137
  Init_gutil(void)
121
138
  {
@@ -124,4 +141,5 @@ Init_gutil(void)
124
141
  id_to_a = rb_intern("to_a");
125
142
  id_add_one_arg_setter = rb_intern("__add_one_arg_setter");
126
143
  id_allocate = rb_intern("allocate");
144
+ id_equal = rb_intern("==");
127
145
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002,2003 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -96,6 +96,7 @@ extern void rbgutil_start_callback_dispatch_thread(void);
96
96
  extern void rbgutil_stop_callback_dispatch_thread(void);
97
97
 
98
98
  extern VALUE rbgutil_string_set_utf8_encoding(VALUE string);
99
+ extern gboolean rbgutil_key_equal(VALUE rb_string, const char *key);
99
100
 
100
101
  /*< protected >*/
101
102
  RUBY_GLIB2_VAR ID rbgutil_id_module_eval;
@@ -61,6 +61,10 @@ module GNOME2
61
61
  @dependency_configuration
62
62
  end
63
63
 
64
+ def package
65
+ @package
66
+ end
67
+
64
68
  def windows
65
69
  @package.windows
66
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-25 00:00:00.000000000 Z
12
+ date: 2013-05-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pkg-config