gir_ffi 0.15.5 → 0.15.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +8 -1
- data/README.md +1 -1
- data/lib/ffi-gobject.rb +1 -1
- data/lib/ffi-gobject/object.rb +7 -1
- data/lib/ffi-gobject/ruby_closure.rb +1 -1
- data/lib/ffi-gobject/value.rb +0 -10
- data/lib/ffi-gobject_introspection/i_base_info.rb +12 -5
- data/lib/gir_ffi/array_element_convertor.rb +1 -1
- data/lib/gir_ffi/boxed_base.rb +12 -6
- data/lib/gir_ffi/builders/user_defined_builder.rb +1 -1
- data/lib/gir_ffi/callback_base.rb +1 -0
- data/lib/gir_ffi/type_map.rb +1 -0
- data/lib/gir_ffi/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 666da2b23f02fadc3172e473ea267f3d81280e6377943426c8f89e7258391ed4
|
4
|
+
data.tar.gz: f19dd857e24269b43109ea8ffa407de64d47531acf00f1104971db171c64bcf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f711ebd41bfedb31e496268b125bf3079f373582b5ac0acbe25938701ceeb42ec98cdbe118a735119f6fafc43357b5d0ba2e52ed8e957e65090669d18d2f692
|
7
|
+
data.tar.gz: e415f33719d96705bfba9e6181123facec99131685613ee8cb753178c9ce3af655e6978e55e55b3435e71c12c744a94200468df9b606bb27f1feac67990cf3a0
|
data/Changelog.md
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.15.6 / 2021-01-10
|
4
|
+
|
5
|
+
* Officially support Ruby 3.0
|
6
|
+
* Rely on `GObject.boxed_free` to free GValue objects
|
7
|
+
* Require 'set' in `callback_base.rb`, which needs it (thanks, Jordan Webb!)
|
8
|
+
* Make SizedArray handle `:filename` elements
|
9
|
+
|
3
10
|
## 0.15.5 / 2020-11-13
|
4
11
|
|
5
|
-
* Make building and finding metaclasses via Builder.build_class work again
|
12
|
+
* Make building and finding metaclasses via `Builder.build_class` work again
|
6
13
|
|
7
14
|
## 0.15.4 / 2020-11-01
|
8
15
|
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ examples can be found in `gir_ffi-gtk` and `gir_ffi-gst`.
|
|
52
52
|
|
53
53
|
## Requirements
|
54
54
|
|
55
|
-
GirFFI is supported on CRuby 2.5, 2.6 and
|
55
|
+
GirFFI is supported on CRuby 2.5, 2.6, 2.7 and 3.0, and JRuby 9.2.
|
56
56
|
|
57
57
|
You will also need gobject-introspection installed with some
|
58
58
|
introspection data.
|
data/lib/ffi-gobject.rb
CHANGED
@@ -63,7 +63,7 @@ module GObject
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.signal_connect(object, detailed_signal, data = nil, after = false, &block)
|
66
|
-
raise ArgumentError, "Block needed"
|
66
|
+
block or raise ArgumentError, "Block needed"
|
67
67
|
|
68
68
|
signal_name, = detailed_signal.split("::")
|
69
69
|
sig_info = object.class.find_signal signal_name
|
data/lib/ffi-gobject/object.rb
CHANGED
@@ -75,7 +75,13 @@ module GObject
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def self.make_finalizer(ptr)
|
78
|
-
proc
|
78
|
+
proc { finalize ptr }
|
79
|
+
end
|
80
|
+
|
81
|
+
class << self
|
82
|
+
protected
|
83
|
+
|
84
|
+
def finalize(ptr)
|
79
85
|
rc = GObject::Object::Struct.new(ptr)[:ref_count]
|
80
86
|
if rc == 0
|
81
87
|
warn "not unreffing #{name}:#{ptr} (#{rc})"
|
data/lib/ffi-gobject/value.rb
CHANGED
@@ -7,16 +7,6 @@ module GObject
|
|
7
7
|
class Value
|
8
8
|
setup_instance_method! :init
|
9
9
|
|
10
|
-
def self.make_finalizer(struct)
|
11
|
-
proc do
|
12
|
-
if struct.owned?
|
13
|
-
ptr = struct.to_ptr
|
14
|
-
Lib.g_value_unset ptr unless struct[:g_type] == TYPE_INVALID
|
15
|
-
GObject.boxed_free gtype, ptr
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
10
|
METHOD_MAP = {
|
21
11
|
TYPE_INVALID => [:get_none, :set_none],
|
22
12
|
# TYPE_NONE is skipped
|
@@ -4,19 +4,26 @@ module GObjectIntrospection
|
|
4
4
|
# Wraps GIBaseInfo struct, the base \type for all info types.
|
5
5
|
# Decendant types will be implemented as needed.
|
6
6
|
class IBaseInfo
|
7
|
-
def initialize(ptr
|
7
|
+
def initialize(ptr)
|
8
8
|
raise ArgumentError, "ptr must not be null" if ptr.null?
|
9
9
|
|
10
|
-
ObjectSpace.define_finalizer self, self.class.make_finalizer(
|
10
|
+
ObjectSpace.define_finalizer self, self.class.make_finalizer(ptr)
|
11
11
|
|
12
12
|
@pointer = ptr
|
13
|
-
@lib = lib
|
14
13
|
end
|
15
14
|
|
16
15
|
attr_reader :pointer
|
17
16
|
|
18
|
-
def self.make_finalizer(
|
19
|
-
proc {
|
17
|
+
def self.make_finalizer(ptr)
|
18
|
+
proc { finalize ptr }
|
19
|
+
end
|
20
|
+
|
21
|
+
class << self
|
22
|
+
protected
|
23
|
+
|
24
|
+
def finalize(ptr)
|
25
|
+
Lib.g_base_info_unref ptr
|
26
|
+
end
|
20
27
|
end
|
21
28
|
|
22
29
|
def to_ptr
|
data/lib/gir_ffi/boxed_base.rb
CHANGED
@@ -6,12 +6,7 @@ module GirFFI
|
|
6
6
|
# Base class for generated classes representing boxed types.
|
7
7
|
class BoxedBase < StructLikeBase
|
8
8
|
def self.make_finalizer(struct)
|
9
|
-
proc
|
10
|
-
if struct.owned?
|
11
|
-
struct.owned = nil
|
12
|
-
GObject.boxed_free gtype, struct.to_ptr
|
13
|
-
end
|
14
|
-
end
|
9
|
+
proc { finalize(struct) }
|
15
10
|
end
|
16
11
|
|
17
12
|
def self.copy(val)
|
@@ -19,6 +14,17 @@ module GirFFI
|
|
19
14
|
wrap(ptr)
|
20
15
|
end
|
21
16
|
|
17
|
+
class << self
|
18
|
+
protected
|
19
|
+
|
20
|
+
def finalize(struct)
|
21
|
+
struct.owned? or return
|
22
|
+
|
23
|
+
struct.owned = nil
|
24
|
+
GObject.boxed_free gtype, struct.to_ptr
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
22
28
|
private
|
23
29
|
|
24
30
|
def store_pointer(*)
|
data/lib/gir_ffi/type_map.rb
CHANGED
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.2.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.2.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rexml
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.8.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.8.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rubocop-minitest
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,28 +170,28 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
173
|
+
version: 1.9.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
180
|
+
version: 1.9.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: simplecov
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.
|
187
|
+
version: 0.21.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.
|
194
|
+
version: 0.21.0
|
195
195
|
description: |
|
196
196
|
GirFFI creates bindings for GObject-based libraries at runtime based on introspection
|
197
197
|
data provided by the GObject Introspection Repository (GIR) system. Bindings are created
|
@@ -396,7 +396,7 @@ metadata:
|
|
396
396
|
homepage_uri: http://www.github.com/mvz/ruby-gir-ffi
|
397
397
|
source_code_uri: https://github.com/mvz/gir_ffi
|
398
398
|
changelog_uri: https://github.com/mvz/gir_ffi/blob/master/Changelog.md
|
399
|
-
post_install_message:
|
399
|
+
post_install_message:
|
400
400
|
rdoc_options:
|
401
401
|
- "--main"
|
402
402
|
- README.md
|
@@ -413,8 +413,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
413
413
|
- !ruby/object:Gem::Version
|
414
414
|
version: '0'
|
415
415
|
requirements: []
|
416
|
-
rubygems_version: 3.
|
417
|
-
signing_key:
|
416
|
+
rubygems_version: 3.2.3
|
417
|
+
signing_key:
|
418
418
|
specification_version: 4
|
419
419
|
summary: FFI-based GObject binding using the GObject Introspection Repository
|
420
420
|
test_files: []
|