glib2 3.4.0 → 3.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/Rakefile +6 -4
  4. data/ext/glib2/extconf.rb +1 -5
  5. data/ext/glib2/glib2.def +1 -0
  6. data/ext/glib2/rbglib-bytes.c +1 -5
  7. data/ext/glib2/rbglib-gc.c +98 -52
  8. data/ext/glib2/rbglib-variant-type.c +1 -5
  9. data/ext/glib2/rbglib-variant.c +3 -5
  10. data/ext/glib2/rbglib.c +4 -0
  11. data/ext/glib2/rbglib.h +13 -3
  12. data/ext/glib2/rbglib_bookmarkfile.c +4 -4
  13. data/ext/glib2/rbglib_datetime.c +1 -5
  14. data/ext/glib2/rbglib_error.c +3 -1
  15. data/ext/glib2/rbglib_fileutils.c +1 -17
  16. data/ext/glib2/rbglib_iochannel.c +4 -4
  17. data/ext/glib2/rbglib_keyfile.c +16 -41
  18. data/ext/glib2/rbglib_maincontext.c +6 -32
  19. data/ext/glib2/rbglib_mainloop.c +2 -17
  20. data/ext/glib2/rbglib_matchinfo.c +1 -5
  21. data/ext/glib2/rbglib_pollfd.c +1 -25
  22. data/ext/glib2/rbglib_regex.c +1 -13
  23. data/ext/glib2/rbglib_source.c +1 -39
  24. data/ext/glib2/rbglib_spawn.c +5 -10
  25. data/ext/glib2/rbglib_spawnerror.c +2 -2
  26. data/ext/glib2/rbglib_threads.c +2 -15
  27. data/ext/glib2/rbglib_timezone.c +1 -5
  28. data/ext/glib2/rbglib_unichar.c +46 -5
  29. data/ext/glib2/rbglib_unicode.c +1 -18
  30. data/ext/glib2/rbglib_utils.c +1 -14
  31. data/ext/glib2/rbglib_win32.c +3 -7
  32. data/ext/glib2/rbgobj_binding.c +1 -7
  33. data/ext/glib2/rbgobj_closure.c +22 -9
  34. data/ext/glib2/rbgobj_object.c +113 -104
  35. data/ext/glib2/rbgobj_param.c +2 -8
  36. data/ext/glib2/rbgobj_paramspecs.c +6 -24
  37. data/ext/glib2/rbgobj_signal.c +104 -92
  38. data/ext/glib2/rbgobj_strv.c +2 -2
  39. data/ext/glib2/rbgobj_type.c +58 -68
  40. data/ext/glib2/rbgobj_typeinterface.c +38 -2
  41. data/ext/glib2/rbgobj_value.c +3 -7
  42. data/ext/glib2/rbgobj_valuetypes.c +14 -62
  43. data/ext/glib2/rbgobject.c +4 -6
  44. data/ext/glib2/rbgobject.h +2 -27
  45. data/ext/glib2/rbgprivate.h +6 -6
  46. data/ext/glib2/rbgutil_callback.c +23 -26
  47. data/lib/glib2.rb +32 -3
  48. data/lib/glib2/deprecated.rb +22 -1
  49. data/lib/mkmf-gnome.rb +4 -4
  50. data/test/glib-test-utils.rb +18 -3
  51. data/test/run-test.rb +49 -14
  52. data/test/test-binding.rb +1 -11
  53. data/test/test-bytes.rb +1 -5
  54. data/test/test-date-time.rb +1 -3
  55. data/test/test-file-utils.rb +1 -32
  56. data/test/test-iochannel.rb +3 -5
  57. data/test/test-key-file.rb +5 -6
  58. data/test/test-match-info.rb +1 -5
  59. data/test/test-regex.rb +1 -5
  60. data/test/test-source.rb +1 -14
  61. data/test/test-spawn.rb +2 -1
  62. data/test/test-time-zone.rb +1 -5
  63. data/test/test-timeout.rb +2 -3
  64. data/test/test-unicode.rb +16 -12
  65. data/test/test-utils.rb +2 -8
  66. data/test/test-variant-type.rb +1 -3
  67. data/test/test-win32.rb +6 -6
  68. metadata +3 -7
  69. data/ext/glib2/glib-enum-types.c +0 -1233
  70. data/ext/glib2/glib-enum-types.h +0 -154
  71. data/ext/glib2/rbgobj_valuearray.c +0 -100
  72. data/test/glib-test-init.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 205c23fa8e99e5b02c1e34ca560c39ba61630df75cad92c806bd0c8f1263ec67
4
- data.tar.gz: 1a90de6e97fef0a0531aa1b5a3ae0074851f697c124db742114ca0ff469ae6aa
3
+ metadata.gz: fc9021ce7fcfcf108ddb84e10f240e64b4295fbd3ed9c9da17a2fcd1598d139e
4
+ data.tar.gz: fa8d854ce07dd819e679e5738440ba76ea0611076cfcccb6e43a4b14ce35f4ab
5
5
  SHA512:
6
- metadata.gz: 340a93388408c01dae1b7da4a0ec33cc12d62ec242df27880ba18a40a0d6638cf0ba39fba2e4b6381af636dcbdb674fb0ad104a235b9b185d2457e3d0ec9d8df
7
- data.tar.gz: 9e82a6f54c85041d88ecd05eea1db596ce753ac5574689ef15383a9f36bcae6c1a2b27393dc7c4063e3b3712836653162db681dc372676af78d93f6653a9153a
6
+ metadata.gz: b94a4faf33a5ed7eef416b4fbab7e3b1fc2af86613b6fdaac5df4ca3cfb2ab32a3023b385dece2e0e390f3671b1ae61efad58fb79884c8c886a3cc93cbf1a0cc
7
+ data.tar.gz: 45ccc2a9af969adf3224b1527fd645afdbe933e0c8da47939316d9cb1da988eb622fc0407358590eb1f4f9debcfea521f51c0ba64a0047916074e0de35fb8201
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Ruby/GLib2
2
2
 
3
- Ruby/GLib2 is a Ruby binding of GLib-2.12.x.
3
+ Ruby/GLib2 is a Ruby binding of GLib 2.48 or later.
4
4
 
5
5
  ## Requirements
6
6
 
7
- * Ruby >= 1.9.x: https://www.ruby-lang.org/
8
- * pkg-config.rb: https://github.com/rcairo/pkg-config
9
- * GLib >= 2.12.x: https://www.gtk.org/
7
+ * Ruby >= 2.5: https://www.ruby-lang.org/
8
+ * pkg-config.rb: https://github.com/ruby-gnome/pkg-config
9
+ * GLib >= 2.48: https://www.gtk.org/
10
10
 
11
11
  ## Install
12
12
 
@@ -16,7 +16,7 @@ gem install glib2
16
16
 
17
17
  ## Copying
18
18
 
19
- Copyright (c) 2002-2019 Ruby-GNOME Project Team
19
+ Copyright (c) 2002-2021 Ruby-GNOME Project Team
20
20
 
21
21
  This program is free software.
22
22
  You can distribute/modify this program under the terms of
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2011-2018 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2011-2020 Ruby-GNOME Project Team
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -16,11 +16,13 @@
16
16
  # License along with this library; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
- $LOAD_PATH.unshift("./lib")
19
+ base_dir = __dir__
20
+
21
+ $LOAD_PATH.unshift(File.join(base_dir, "lib"))
20
22
  require "gnome2/rake/package-task"
21
23
 
22
- package_name = File.basename(__dir__)
23
- spec = Gem::Specification.load("#{package_name}.gemspec")
24
+ package_name = File.basename(base_dir)
25
+ spec = Gem::Specification.load(File.join(base_dir, "#{package_name}.gemspec"))
24
26
 
25
27
  GNOME2::Rake::PackageTask.define(spec, __dir__) do |package|
26
28
  end
data/ext/glib2/extconf.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2002-2019 Ruby-GNOME Project Team
1
+ # Copyright (C) 2002-2021 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -42,10 +42,6 @@ have_header("unistd.h")
42
42
  have_header("io.h")
43
43
 
44
44
  glib_header = "glib.h"
45
- have_func("g_spawn_close_pid", glib_header)
46
- have_func("g_thread_init", glib_header)
47
- have_func("g_main_depth", glib_header)
48
- have_func("g_listenv", glib_header)
49
45
 
50
46
  ruby_header = "ruby.h"
51
47
  have_func("rb_check_array_type", ruby_header)
data/ext/glib2/glib2.def CHANGED
@@ -158,6 +158,7 @@ EXPORTS
158
158
  rbgutil_stop_callback_dispatch_thread
159
159
  rbgutil_string_set_utf8_encoding
160
160
  rbgutil_key_equal
161
+ rbgerr_ruby_error_quark
161
162
  rbgerr_define_gerror
162
163
  rbgerr_gerror2exception
163
164
  rbgobj_convert_define
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2017-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2017-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,6 @@ rbg_is_bytes(VALUE object)
32
32
  return RVAL2CBOOL(rb_obj_is_kind_of(object, RG_TARGET_NAMESPACE));
33
33
  }
34
34
 
35
- #if GLIB_CHECK_VERSION(2, 32, 0)
36
35
  static VALUE RG_TARGET_NAMESPACE;
37
36
 
38
37
  static VALUE
@@ -119,12 +118,10 @@ rg_pointer(VALUE self)
119
118
 
120
119
  return ULONG2NUM((guintptr)data);
121
120
  }
122
- #endif
123
121
 
124
122
  void
125
123
  Init_glib_bytes(void)
126
124
  {
127
- #if GLIB_CHECK_VERSION(2, 32, 0)
128
125
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BYTES, "Bytes", mGLib);
129
126
 
130
127
  RG_DEF_SMETHOD(try_convert, 1);
@@ -135,5 +132,4 @@ Init_glib_bytes(void)
135
132
  RG_DEF_METHOD(size, 0);
136
133
  RG_DEF_ALIAS("length", "size");
137
134
  RG_DEF_METHOD(pointer, 0);
138
- #endif
139
135
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2018-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2018-2020 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -20,32 +20,45 @@
20
20
 
21
21
  #include "rbgprivate.h"
22
22
 
23
- static GHashTable *rbg_objects = NULL;
23
+ typedef struct {
24
+ VALUE object;
25
+ guint ref_count;
26
+ } RBGGCMarkItem;
27
+
28
+ typedef struct {
29
+ GHashTable *items;
30
+ GMutex mutex;
31
+ } RBGGCMarker;
32
+
33
+ static RBGGCMarker *rbg_gc_marker_raw = NULL;
24
34
 
25
35
  static void
26
36
  gc_marker_mark_each(G_GNUC_UNUSED gpointer key,
27
37
  gpointer value,
28
38
  G_GNUC_UNUSED gpointer user_data)
29
39
  {
30
- VALUE rb_object = (VALUE)value;
31
- rb_gc_mark(rb_object);
40
+ RBGGCMarkItem *item = value;
41
+ rb_gc_mark(item->object);
32
42
  }
33
43
 
34
44
  static void
35
45
  gc_marker_mark(void *data)
36
46
  {
37
- GHashTable *hash_table = data;
38
- g_hash_table_foreach(hash_table, gc_marker_mark_each, NULL);
47
+ RBGGCMarker *marker = data;
48
+ g_mutex_lock(&(marker->mutex));
49
+ g_hash_table_foreach(marker->items, gc_marker_mark_each, NULL);
50
+ g_mutex_unlock(&(marker->mutex));
39
51
  }
40
52
 
41
53
  static void
42
54
  gc_marker_free(void *data)
43
55
  {
44
- GHashTable *hash_table = data;
45
- g_hash_table_unref(hash_table);
46
- if (hash_table == rbg_objects) {
47
- rbg_objects = NULL;
56
+ RBGGCMarker *marker_raw = data;
57
+ if (marker_raw == rbg_gc_marker_raw) {
58
+ rbg_gc_marker_raw = NULL;
48
59
  }
60
+ g_hash_table_unref(marker_raw->items);
61
+ g_free(marker_raw);
49
62
  }
50
63
 
51
64
  static const rb_data_type_t rbg_gc_marker_type = {
@@ -59,95 +72,128 @@ static const rb_data_type_t rbg_gc_marker_type = {
59
72
  RUBY_TYPED_FREE_IMMEDIATELY,
60
73
  };
61
74
 
62
- void
63
- rbg_gc_guard(gpointer key, VALUE rb_object)
75
+ static VALUE
76
+ rbg_gc_marker_new_raw(void)
64
77
  {
65
- if (!rbg_objects)
66
- return;
78
+ RBGGCMarker *gc_marker_raw = g_new(RBGGCMarker, 1);
79
+ gc_marker_raw->items = g_hash_table_new_full(g_direct_hash,
80
+ g_direct_equal,
81
+ NULL,
82
+ g_free);
83
+ g_mutex_init(&(gc_marker_raw->mutex));
84
+
85
+ return TypedData_Wrap_Struct(rb_cObject,
86
+ &rbg_gc_marker_type,
87
+ gc_marker_raw);
88
+ }
89
+
90
+ static void
91
+ rbg_gc_guard_raw(RBGGCMarker *gc_marker, gpointer key, VALUE rb_object)
92
+ {
93
+ g_mutex_lock(&(gc_marker->mutex));
94
+ RBGGCMarkItem *item = g_hash_table_lookup(gc_marker->items, key);
95
+ if (item) {
96
+ item->ref_count++;
97
+ } else {
98
+ item = g_new(RBGGCMarkItem, 1);
99
+ item->object = rb_object;
100
+ item->ref_count = 1;
101
+ g_hash_table_insert(gc_marker->items, key, item);
102
+ }
103
+ g_mutex_unlock(&(gc_marker->mutex));
104
+ }
67
105
 
68
- g_hash_table_insert(rbg_objects,
69
- key,
70
- (gpointer)rb_object);
106
+ static void
107
+ rbg_gc_unguard_raw(RBGGCMarker *gc_marker, gpointer key)
108
+ {
109
+ g_mutex_lock(&(gc_marker->mutex));
110
+ RBGGCMarkItem *item = g_hash_table_lookup(gc_marker->items, key);
111
+ if (item) {
112
+ item->ref_count--;
113
+ if (item->ref_count == 0) {
114
+ g_hash_table_remove(gc_marker->items, key);
115
+ }
116
+ }
117
+ g_mutex_unlock(&(gc_marker->mutex));
118
+ }
119
+
120
+ static void
121
+ rbg_gc_unguard_all_raw(RBGGCMarker *gc_marker)
122
+ {
123
+ g_mutex_lock(&(gc_marker->mutex));
124
+ g_hash_table_remove_all(gc_marker->items);
125
+ g_mutex_unlock(&(gc_marker->mutex));
71
126
  }
72
127
 
73
128
  void
74
- rbg_gc_unguard(gpointer key)
129
+ rbg_gc_guard(gpointer key, VALUE rb_object)
75
130
  {
76
- if (!rbg_objects)
131
+ if (!rbg_gc_marker_raw)
77
132
  return;
78
133
 
79
- g_hash_table_remove(rbg_objects, key);
134
+ rbg_gc_guard_raw(rbg_gc_marker_raw, key, rb_object);
80
135
  }
81
136
 
82
- static VALUE
83
- rbg_gc_marker_new_raw(GHashTable *rb_objects)
137
+ void
138
+ rbg_gc_unguard(gpointer key)
84
139
  {
85
- VALUE gc_marker;
140
+ if (!rbg_gc_marker_raw)
141
+ return;
86
142
 
87
- gc_marker = TypedData_Wrap_Struct(rb_cData,
88
- &rbg_gc_marker_type,
89
- rb_objects);
90
- return gc_marker;
143
+ rbg_gc_unguard_raw(rbg_gc_marker_raw, key);
91
144
  }
92
145
 
93
146
  VALUE
94
147
  rbg_gc_marker_new(void)
95
148
  {
96
- GHashTable *rb_objects;
97
-
98
- rb_objects = g_hash_table_new(g_direct_hash, g_direct_equal);
99
- return rbg_gc_marker_new_raw(rb_objects);
149
+ return rbg_gc_marker_new_raw();
100
150
  }
101
151
 
102
152
  void
103
153
  rbg_gc_marker_guard(VALUE rb_gc_marker, VALUE rb_object)
104
154
  {
105
- GHashTable *rb_objects;
106
-
155
+ RBGGCMarker *gc_marker;
107
156
  TypedData_Get_Struct(rb_gc_marker,
108
- GHashTable,
157
+ RBGGCMarker,
109
158
  &rbg_gc_marker_type,
110
- rb_objects);
111
- g_hash_table_insert(rb_objects,
112
- (gpointer)rb_object,
113
- (gpointer)rb_object);
159
+ gc_marker);
160
+ rbg_gc_guard_raw(gc_marker, RVAL2POINTER(rb_object), rb_object);
114
161
  }
115
162
 
116
163
  void
117
164
  rbg_gc_marker_unguard(VALUE rb_gc_marker, VALUE rb_object)
118
165
  {
119
- GHashTable *rb_objects;
120
-
121
166
  if (!RB_TYPE_P(rb_gc_marker, RUBY_T_DATA))
122
167
  return;
123
168
  if (!RTYPEDDATA_P(rb_gc_marker))
124
169
  return;
125
170
 
171
+ RBGGCMarker *gc_marker;
126
172
  TypedData_Get_Struct(rb_gc_marker,
127
- GHashTable,
173
+ RBGGCMarker,
128
174
  &rbg_gc_marker_type,
129
- rb_objects);
130
- g_hash_table_remove(rb_objects, (gpointer)rb_object);
175
+ gc_marker);
176
+ rbg_gc_unguard_raw(gc_marker, RVAL2POINTER(rb_object));
131
177
  }
132
178
 
133
179
  void
134
180
  rbg_gc_marker_unguard_all(VALUE rb_gc_marker)
135
181
  {
136
- GHashTable *rb_objects;
137
-
182
+ RBGGCMarker *gc_marker;
138
183
  TypedData_Get_Struct(rb_gc_marker,
139
- GHashTable,
184
+ RBGGCMarker,
140
185
  &rbg_gc_marker_type,
141
- rb_objects);
142
- g_hash_table_remove_all(rb_objects);
186
+ gc_marker);
187
+ rbg_gc_unguard_all_raw(gc_marker);
143
188
  }
144
189
 
145
190
  void
146
191
  Init_glib_gc(void)
147
192
  {
148
- VALUE gc_marker;
149
-
150
- rbg_objects = g_hash_table_new(g_direct_hash, g_direct_equal);
151
- gc_marker = rbg_gc_marker_new_raw(rbg_objects);
193
+ VALUE gc_marker = rbg_gc_marker_new_raw();
152
194
  rb_ivar_set(mGLib, rb_intern("gc_marker"), gc_marker);
195
+ TypedData_Get_Struct(gc_marker,
196
+ RBGGCMarker,
197
+ &rbg_gc_marker_type,
198
+ rbg_gc_marker_raw);
153
199
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2016 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -303,14 +303,10 @@ Init_glib_variant_type(void)
303
303
  DEF_TYPE(DICT_ENTRY);
304
304
  DEF_TYPE(DICTIONARY);
305
305
  DEF_TYPE(STRING_ARRAY);
306
- # if GLIB_CHECK_VERSION(2, 30, 0)
307
306
  DEF_TYPE(OBJECT_PATH_ARRAY);
308
- # endif
309
307
  DEF_TYPE(BYTESTRING);
310
308
  DEF_TYPE(BYTESTRING_ARRAY);
311
- # if GLIB_CHECK_VERSION(2, 30, 0)
312
309
  DEF_TYPE(VARDICT);
313
- # endif
314
310
 
315
311
  #undef DEF_TYPE
316
312
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2016 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -22,7 +22,7 @@
22
22
 
23
23
  #define RG_TARGET_NAMESPACE cVariant
24
24
 
25
- #define _SELF(s) (DATA_PTR(s))
25
+ #define _SELF(s) (RTYPEDDATA_DATA(s))
26
26
 
27
27
  static VALUE RG_TARGET_NAMESPACE;
28
28
 
@@ -191,7 +191,6 @@ rg_ruby_to_variant(VALUE rb_value, VALUE rb_variant_type)
191
191
  }
192
192
  }
193
193
  return g_variant_new_strv(strings, length);
194
- #if GLIB_CHECK_VERSION(2, 30, 0)
195
194
  } else if (g_variant_type_equal(variant_type,
196
195
  G_VARIANT_TYPE_OBJECT_PATH_ARRAY)) {
197
196
  const gchar **paths;
@@ -210,7 +209,6 @@ rg_ruby_to_variant(VALUE rb_value, VALUE rb_variant_type)
210
209
  }
211
210
  }
212
211
  return g_variant_new_objv(paths, length);
213
- #endif
214
212
  } else if (g_variant_type_equal(variant_type, G_VARIANT_TYPE_ARRAY)) {
215
213
  int i;
216
214
  GVariantBuilder builder;
@@ -259,7 +257,7 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
259
257
  rb_scan_args(argc, argv, "11", &rb_value, &rb_variant_type);
260
258
  variant = rg_ruby_to_variant(rb_value, rb_variant_type);
261
259
  g_variant_ref_sink(variant);
262
- DATA_PTR(self) = variant;
260
+ RTYPEDDATA_DATA(self) = variant;
263
261
 
264
262
  return Qnil;
265
263
  }
data/ext/glib2/rbglib.c CHANGED
@@ -1072,6 +1072,10 @@ extern void Init_glib2(void);
1072
1072
  void
1073
1073
  Init_glib2(void)
1074
1074
  {
1075
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
1076
+ rb_ext_ractor_safe(true);
1077
+ #endif
1078
+
1075
1079
  const gchar **filename_charsets;
1076
1080
 
1077
1081
  id_inspect = rb_intern("inspect");
data/ext/glib2/rbglib.h CHANGED
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2002-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2002-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2002,2003 Masahiro Sakai
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
33
33
 
34
34
  #define RBGLIB_MAJOR_VERSION 3
35
35
  #define RBGLIB_MINOR_VERSION 4
36
- #define RBGLIB_MICRO_VERSION 0
36
+ #define RBGLIB_MICRO_VERSION 5
37
37
 
38
38
  #ifndef RB_ZALLOC
39
39
  # ifdef ZALLOC
@@ -139,6 +139,9 @@ G_BEGIN_DECLS
139
139
  #define RVAL2GUINT32S(ary, n) rbg_rval2guint32s(&(ary), &(n))
140
140
  #define RVAL2GDOUBLES(ary, n) rbg_rval2gdoubles(&(ary), &(n))
141
141
 
142
+ #define RVAL2POINTER(value) ((gpointer)(value))
143
+ #define POINTER2RVAL(pointer) ((VALUE)(pointer))
144
+
142
145
  #define GINTS2RVAL(ary, n) rbg_gints2rval(ary, n)
143
146
  #define GINTS2RVAL_FREE(ary, n) rbg_gints2rval(ary, n)
144
147
 
@@ -154,7 +157,7 @@ G_BEGIN_DECLS
154
157
 
155
158
  #ifdef G_PLATFORM_WIN32
156
159
  # ifdef RUBY_GLIB2_COMPILATION
157
- # define RUBY_GLIB2_VAR __declspec(dllexport)
160
+ # define RUBY_GLIB2_VAR extern __declspec(dllexport)
158
161
  # else
159
162
  # define RUBY_GLIB2_VAR extern __declspec(dllimport)
160
163
  # endif
@@ -219,6 +222,13 @@ extern VALUE rbg_check_hash_type(VALUE object);
219
222
  extern void rbg_scan_options(VALUE options, ...);
220
223
 
221
224
  /* rbgerror.h */
225
+ typedef enum {
226
+ RBG_RUBY_ERROR_UNKNOWN,
227
+ } RBGRubyError;
228
+
229
+ #define RBG_RUBY_ERROR rbgerr_ruby_error_quark()
230
+ extern GQuark rbgerr_ruby_error_quark(void);
231
+
222
232
  extern VALUE rbgerr_gerror2exception(GError *error);
223
233
  extern VALUE rbgerr_define_gerror(GQuark domain, const gchar* name, VALUE module, VALUE parent, GType gtype);
224
234