gobject-introspection 4.1.2 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gobject-introspection/loader.rb +30 -14
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ad7749030322309d66cdd613d61540c2ac1e5b749c6b3df462c190648ec5a23
|
4
|
+
data.tar.gz: 11925d808602b94209daeaee2e4779575ec9e06f012e266b0dd62ba692f9ba1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c61f9795ce3570ae8d351a64936ad3c8e141b6d2d1e3980f8074258f1ff1c149908793146d3bba48778d5b82863a872871b44e28087d2809b29f6cec2bfd9e3b
|
7
|
+
data.tar.gz: 15a4468d50ae854f71d1d442041c78687010c8bf0e580e5627e9aceb1499e973828f1f9136b8828599f32af6ad2f012caa91d6a5192b74ef284d9e5973b802b7
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2023 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
|
@@ -82,14 +82,14 @@ module GObjectIntrospection
|
|
82
82
|
|
83
83
|
def load_function_info(info)
|
84
84
|
name = rubyish_method_name(info)
|
85
|
-
define_singleton_method(@base_module, name
|
85
|
+
define_singleton_method(info, @base_module, name)
|
86
86
|
end
|
87
87
|
|
88
88
|
def load_function_info_singleton_method(info, klass, method_name)
|
89
|
-
define_singleton_method(klass, method_name
|
89
|
+
define_singleton_method(info, klass, method_name)
|
90
90
|
end
|
91
91
|
|
92
|
-
def define_module_function(target_module, name
|
92
|
+
def define_module_function(function_info, target_module, name)
|
93
93
|
prepare_function_info_lock_gvl(function_info, target_module)
|
94
94
|
full_method_name = "#{target_module}\#.#{name}"
|
95
95
|
invoker = Invoker.new(function_info, name, full_method_name)
|
@@ -102,7 +102,7 @@ module GObjectIntrospection
|
|
102
102
|
DEFINE_METHOD
|
103
103
|
end
|
104
104
|
|
105
|
-
def define_singleton_method(klass, name
|
105
|
+
def define_singleton_method(info, klass, name)
|
106
106
|
prepare_function_info_lock_gvl(info, klass)
|
107
107
|
invoker = Invoker.new(info, name, "#{klass}.#{name}")
|
108
108
|
singleton_class = klass.singleton_class
|
@@ -142,11 +142,12 @@ module GObjectIntrospection
|
|
142
142
|
unless method_infos.empty?
|
143
143
|
base_class = @base_module.const_get(base_class_name)
|
144
144
|
singleton_class = base_class.singleton_class
|
145
|
-
invokers = singleton_class
|
145
|
+
invokers = singleton_class.const_get(:INVOKERS).dup
|
146
146
|
singleton_class.__send__(:remove_const, :INVOKERS)
|
147
147
|
singleton_class.const_set(:INVOKERS, invokers)
|
148
148
|
load_methods_method(method_infos, singleton_class)
|
149
149
|
Ractor.make_shareable(singleton_class::INVOKERS) if defined?(Ractor)
|
150
|
+
singleton_class.private_constant(:INVOKERS)
|
150
151
|
end
|
151
152
|
else
|
152
153
|
return if info.gtype_struct?
|
@@ -177,9 +178,12 @@ module GObjectIntrospection
|
|
177
178
|
def define_enum(info)
|
178
179
|
# TODO: Can we do the same things for flags on NONE GType?
|
179
180
|
return if info.gtype == GLib::Type::NONE
|
180
|
-
self.class.define_class(info.gtype,
|
181
|
-
|
182
|
-
|
181
|
+
klass = self.class.define_class(info.gtype,
|
182
|
+
rubyish_class_name(info),
|
183
|
+
@base_module)
|
184
|
+
prepare_class(klass) do
|
185
|
+
load_methods(info, klass)
|
186
|
+
end
|
183
187
|
end
|
184
188
|
|
185
189
|
def define_error(info)
|
@@ -222,7 +226,12 @@ module GObjectIntrospection
|
|
222
226
|
end
|
223
227
|
@base_module.const_set(rubyish_class_name(info), flags_module)
|
224
228
|
else
|
225
|
-
self.class.define_class(info.gtype,
|
229
|
+
klass = self.class.define_class(info.gtype,
|
230
|
+
flags_class_name(info),
|
231
|
+
@base_module)
|
232
|
+
prepare_class(klass) do
|
233
|
+
load_methods(info, klass)
|
234
|
+
end
|
226
235
|
end
|
227
236
|
end
|
228
237
|
|
@@ -479,7 +488,11 @@ module GObjectIntrospection
|
|
479
488
|
name
|
480
489
|
end
|
481
490
|
when "to_string"
|
482
|
-
|
491
|
+
if n_in_args.zero?
|
492
|
+
"to_s"
|
493
|
+
else
|
494
|
+
name
|
495
|
+
end
|
483
496
|
when "to_integer"
|
484
497
|
"to_i"
|
485
498
|
when "foreach"
|
@@ -633,6 +646,8 @@ module GObjectIntrospection
|
|
633
646
|
return unless defined?(Ractor)
|
634
647
|
Ractor.make_shareable(klass::INVOKERS)
|
635
648
|
Ractor.make_shareable(klass.singleton_class::INVOKERS)
|
649
|
+
klass.private_constant(:INVOKERS)
|
650
|
+
klass.singleton_class.private_constant(:INVOKERS)
|
636
651
|
end
|
637
652
|
|
638
653
|
def define_methods_module(name)
|
@@ -650,6 +665,7 @@ module GObjectIntrospection
|
|
650
665
|
def post_methods_module(mod)
|
651
666
|
return unless defined?(Ractor)
|
652
667
|
Ractor.make_shareable(mod::INVOKERS)
|
668
|
+
mod.private_constant(:INVOKERS)
|
653
669
|
end
|
654
670
|
|
655
671
|
class Invoker
|
@@ -756,9 +772,9 @@ module GObjectIntrospection
|
|
756
772
|
end
|
757
773
|
|
758
774
|
n_missing_arguments = @n_in_args - arguments.size
|
759
|
-
|
760
|
-
|
761
|
-
|
775
|
+
n_in_arg_nil_indexes = @in_arg_nil_indexes.size
|
776
|
+
if 0 < n_missing_arguments and n_missing_arguments < n_in_arg_nil_indexes
|
777
|
+
@in_arg_nil_indexes[-n_missing_arguments..-1].each do |nil_index|
|
762
778
|
arguments.insert(nil_index, nil)
|
763
779
|
end
|
764
780
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gobject-introspection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.1.
|
19
|
+
version: 4.1.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.1.
|
26
|
+
version: 4.1.4
|
27
27
|
description: Ruby/GObjectIntrospection provides bindings of GObject Introspection
|
28
28
|
and a loader module that can generate dynamically Ruby bindings of any GObject C
|
29
29
|
libraries
|