gir_ffi 0.15.7 → 0.15.8
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/Changelog.md +8 -0
- data/README.md +8 -23
- data/lib/ffi-glib/hash_table.rb +1 -1
- data/lib/ffi-gobject/object.rb +29 -49
- data/lib/ffi-gobject.rb +1 -1
- data/lib/ffi-gobject_introspection/i_base_info.rb +1 -1
- data/lib/gir_ffi/builders/argument_builder_collection.rb +5 -1
- data/lib/gir_ffi/builders/module_builder.rb +1 -1
- data/lib/gir_ffi/core.rb +1 -1
- data/lib/gir_ffi/info_ext/i_type_info.rb +2 -1
- data/lib/gir_ffi/version.rb +1 -1
- metadata +27 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7c0566bc2fcd7e7b5ab1381448f4738fdebd617743c524ea18c343e1d3fbce5
|
4
|
+
data.tar.gz: 5008632e7cd2fa2190c12f056257f68a94b03fa4a8f225df54fae006b6127db1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a0f1e2330171a92b26a1c476e0c5b7beaeb2e38e6e0e81d9bb47247b74b02ed7e0e5261c2e7adf33f93860b284e2eddf61a938c584c5cccaab69b2b85d5109c
|
7
|
+
data.tar.gz: ddb889010ccc55495ffb306e3996fa6ce37367bbc65ff78f0024df244b3663691879be7f78c53c9543f90b4360dfca35b47bf35a9acf7382271a685aea542cbe
|
data/Changelog.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.15.8 / 2021-11-20
|
4
|
+
|
5
|
+
* Drop support for Ruby 2.5
|
6
|
+
* Bump minimum supported version of gobject-introspection to 1.56.0
|
7
|
+
* Bump minimum supported version of glib to 2.56.0
|
8
|
+
* Handle functions that have swapped closure annotation
|
9
|
+
* Handle GPtrArray arguments in signal handlers
|
10
|
+
|
3
11
|
## 0.15.7 / 2021-01-15
|
4
12
|
|
5
13
|
* Handle sized arrays with interface element types
|
data/README.md
CHANGED
@@ -9,10 +9,9 @@ Ruby bindings for GNOME using the GObject Introspection Repository.
|
|
9
9
|
## Status
|
10
10
|
|
11
11
|
[](http://badge.fury.io/rb/gir_ffi)
|
12
|
-
[](https://travis-ci.org/mvz/gir_ffi)
|
12
|
+
[](https://github.com/mvz/gir_ffi/actions/workflows/ruby.yml)
|
14
13
|
[](https://codeclimate.com/github/mvz/gir_ffi)
|
15
|
-
[](https://inch-ci.org/github/mvz/gir_ffi
|
14
|
+
[](https://inch-ci.org/github/mvz/gir_ffi)
|
16
15
|
|
17
16
|
## Features
|
18
17
|
|
@@ -52,7 +51,7 @@ examples can be found in `gir_ffi-gtk` and `gir_ffi-gst`.
|
|
52
51
|
|
53
52
|
## Requirements
|
54
53
|
|
55
|
-
GirFFI is supported on CRuby 2.
|
54
|
+
GirFFI is supported on CRuby 2.6, 2.7 and 3.0, and JRuby 9.3.
|
56
55
|
|
57
56
|
You will also need gobject-introspection installed with some
|
58
57
|
introspection data.
|
@@ -62,7 +61,8 @@ available under the name ending in plain `.so`. If GirFFI complains that it
|
|
62
61
|
cannot find the library, try installing development packages for those
|
63
62
|
libraries.
|
64
63
|
|
65
|
-
GirFFI should work with gobject-introspection 1.
|
64
|
+
GirFFI should work with gobject-introspection 1.56.0 and up, and glib 2.56.0
|
65
|
+
and up.
|
66
66
|
|
67
67
|
On Debian and Ubuntu, installing `libgirepository-1.0-1` and `gir1.2-glib-2.0`
|
68
68
|
should be enough to use GirFFI in your application.
|
@@ -89,24 +89,9 @@ already exist:
|
|
89
89
|
* `gir_ffi-tracker`: overrides for Tracker
|
90
90
|
* `gir_ffi-gst`: overrides for GStreamer
|
91
91
|
|
92
|
-
##
|
92
|
+
## Contributing
|
93
93
|
|
94
|
-
Please
|
95
|
-
|
96
|
-
If you just want to help out but don't know where to start, have a look at
|
97
|
-
TODO.md, and check the notes in the code (e.g., using `dnote`).
|
98
|
-
|
99
|
-
If you want to send pull requests or patches, try to follow the instructions
|
100
|
-
below. **If you get stuck, please make a pull request anyway and I'll try to
|
101
|
-
help out.**
|
102
|
-
|
103
|
-
* Make sure `rake test` runs without reporting any failures.
|
104
|
-
* Add tests for your feature. Otherwise, I can't see if it works or if I
|
105
|
-
break it later.
|
106
|
-
* Make sure latest master merges cleanly with your branch. Things might
|
107
|
-
have moved around since you forked.
|
108
|
-
* Try not to include changes that are irrelevant to your feature in the
|
109
|
-
same commit.
|
94
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
|
110
95
|
|
111
96
|
## Contributors
|
112
97
|
|
@@ -119,7 +104,7 @@ The following people have contributed to GirFFI over the years:
|
|
119
104
|
|
120
105
|
## License
|
121
106
|
|
122
|
-
Copyright © 2009–
|
107
|
+
Copyright © 2009–2021 [Matijs van Zuijlen](http://www.matijs.net)
|
123
108
|
|
124
109
|
GirFFI is free software, distributed under the terms of the GNU Lesser
|
125
110
|
General Public License, version 2.1 or later. See the file COPYING.LIB for
|
data/lib/ffi-glib/hash_table.rb
CHANGED
data/lib/ffi-gobject/object.rb
CHANGED
@@ -7,60 +7,40 @@ GObject.load_class :Object
|
|
7
7
|
module GObject
|
8
8
|
# Overrides for GObject, GObject's generic base class.
|
9
9
|
class Object
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
gparam.name = name
|
20
|
-
gparam.value = value
|
21
|
-
end
|
22
|
-
end
|
23
|
-
initialize_without_automatic_gtype(self.class.gtype, gparameters)
|
24
|
-
end
|
25
|
-
|
26
|
-
alias initialize_without_automatic_gtype initialize
|
27
|
-
alias initialize initialize_with_automatic_gtype
|
28
|
-
else
|
29
|
-
GObject::Lib.attach_function(:g_object_new_with_properties,
|
30
|
-
[:size_t, :uint32, :pointer, :pointer],
|
31
|
-
:pointer)
|
32
|
-
|
33
|
-
def self.new_with_properties(*args, &block)
|
34
|
-
obj = allocate
|
35
|
-
obj.__send__ :initialize_with_properties, *args, &block
|
36
|
-
obj
|
37
|
-
end
|
10
|
+
GObject::Lib.attach_function(:g_object_new_with_properties,
|
11
|
+
[:size_t, :uint32, :pointer, :pointer],
|
12
|
+
:pointer)
|
13
|
+
|
14
|
+
def self.new_with_properties(*args, &block)
|
15
|
+
obj = allocate
|
16
|
+
obj.__send__ :initialize_with_properties, *args, &block
|
17
|
+
obj
|
18
|
+
end
|
38
19
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
20
|
+
# Starting with GLib 2.54.0, use g_object_new_with_properties, which
|
21
|
+
# takes an array of names and an array of values.
|
22
|
+
def initialize_with_properties(properties = {})
|
23
|
+
names, gvalues = names_and_gvalues_for_properties(properties)
|
43
24
|
|
44
|
-
|
45
|
-
|
46
|
-
|
25
|
+
n_properties = names.length
|
26
|
+
names_arr = GirFFI::SizedArray.from(:utf8, -1, names)
|
27
|
+
gvalues_arr = GirFFI::SizedArray.from(GObject::Value, -1, gvalues)
|
47
28
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
29
|
+
ptr = GObject::Lib.g_object_new_with_properties(self.class.gtype,
|
30
|
+
n_properties,
|
31
|
+
names_arr,
|
32
|
+
gvalues_arr)
|
33
|
+
store_pointer ptr
|
34
|
+
end
|
54
35
|
|
55
|
-
|
56
|
-
|
57
|
-
|
36
|
+
alias old_initialze initialize
|
37
|
+
alias initialize initialize_with_properties
|
38
|
+
remove_method :old_initialze
|
58
39
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
40
|
+
def self.new(*args, &block)
|
41
|
+
obj = allocate
|
42
|
+
obj.__send__ :initialize, *args, &block
|
43
|
+
obj
|
64
44
|
end
|
65
45
|
|
66
46
|
alias base_initialize initialize
|
data/lib/ffi-gobject.rb
CHANGED
@@ -49,7 +49,7 @@ module GObjectIntrospection
|
|
49
49
|
method = method.to_s
|
50
50
|
cache_ivar = "@#{method}_cache"
|
51
51
|
single ||= method[0..-2]
|
52
|
-
count = method.sub(/^(get_)?/,
|
52
|
+
count = method.sub(/^(get_)?/, "\\1n_")
|
53
53
|
class_eval <<-CODE, __FILE__, __LINE__ + 1
|
54
54
|
def #{method} # def fields
|
55
55
|
#{cache_ivar} ||= # @fields_cache ||=
|
@@ -75,7 +75,11 @@ module GirFFI
|
|
75
75
|
def set_up_user_data_relations
|
76
76
|
@base_argument_builders.each do |bldr|
|
77
77
|
if (idx = bldr.closure_idx) >= 0
|
78
|
-
@base_argument_builders[idx]
|
78
|
+
target_bldr = @base_argument_builders[idx]
|
79
|
+
unless target_bldr.specialized_type_tag == :void
|
80
|
+
target_bldr, bldr = bldr, target_bldr
|
81
|
+
end
|
82
|
+
target_bldr.mark_as_user_data bldr
|
79
83
|
end
|
80
84
|
end
|
81
85
|
end
|
data/lib/gir_ffi/core.rb
CHANGED
@@ -42,7 +42,7 @@ module GirFFI
|
|
42
42
|
|
43
43
|
if block_given?
|
44
44
|
warn "Using define_type with a block is deprecated." \
|
45
|
-
|
45
|
+
" Call the relevant functions inside the class definition instead."
|
46
46
|
yield info
|
47
47
|
end
|
48
48
|
Builders::UserDefinedBuilder.new(info).build_class
|
@@ -166,7 +166,8 @@ module GirFFI
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def needs_c_to_ruby_conversion_for_closures?
|
169
|
-
[:array, :c, :error, :ghash, :glist, :struct, :strv]
|
169
|
+
[:array, :c, :error, :ghash, :glist, :ptr_array, :struct, :strv]
|
170
|
+
.include?(flattened_tag)
|
170
171
|
end
|
171
172
|
|
172
173
|
def needs_ruby_to_c_conversion_for_closures?
|
data/lib/gir_ffi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gir_ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 2.0.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 2.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest-focus
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.3.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.3.1
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rake
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,28 +142,28 @@ dependencies:
|
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
145
|
+
version: 1.23.0
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
152
|
+
version: 1.23.0
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: rubocop-minitest
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
159
|
+
version: 0.16.0
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
166
|
+
version: 0.16.0
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: rubocop-packaging
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +184,14 @@ dependencies:
|
|
170
184
|
requirements:
|
171
185
|
- - "~>"
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
187
|
+
version: 1.12.0
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
194
|
+
version: 1.12.0
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: simplecov
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -396,6 +410,7 @@ metadata:
|
|
396
410
|
homepage_uri: http://www.github.com/mvz/ruby-gir-ffi
|
397
411
|
source_code_uri: https://github.com/mvz/gir_ffi
|
398
412
|
changelog_uri: https://github.com/mvz/gir_ffi/blob/master/Changelog.md
|
413
|
+
rubygems_mfa_required: 'true'
|
399
414
|
post_install_message:
|
400
415
|
rdoc_options:
|
401
416
|
- "--main"
|
@@ -406,14 +421,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
406
421
|
requirements:
|
407
422
|
- - ">="
|
408
423
|
- !ruby/object:Gem::Version
|
409
|
-
version: 2.
|
424
|
+
version: 2.6.0
|
410
425
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
411
426
|
requirements:
|
412
427
|
- - ">="
|
413
428
|
- !ruby/object:Gem::Version
|
414
429
|
version: '0'
|
415
430
|
requirements: []
|
416
|
-
rubygems_version: 3.2.
|
431
|
+
rubygems_version: 3.2.22
|
417
432
|
signing_key:
|
418
433
|
specification_version: 4
|
419
434
|
summary: FFI-based GObject binding using the GObject Introspection Repository
|