gir_ffi 0.9.0 → 0.9.1
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/Gemfile +2 -0
- data/README.md +2 -2
- data/Rakefile +3 -1
- data/TODO.md +7 -19
- data/lib/ffi-glib/byte_array.rb +1 -1
- data/lib/ffi-glib/list.rb +1 -1
- data/lib/ffi-glib/main_loop.rb +8 -8
- data/lib/ffi-glib/s_list.rb +1 -1
- data/lib/ffi-gobject/object.rb +8 -6
- data/lib/ffi-gobject/value.rb +2 -2
- data/lib/ffi-gobject.rb +5 -1
- data/lib/ffi-gobject_introspection/i_arg_info.rb +1 -1
- data/lib/ffi-gobject_introspection/i_base_info.rb +1 -1
- data/lib/ffi-gobject_introspection/i_callable_info.rb +2 -2
- data/lib/ffi-gobject_introspection/i_constant_info.rb +2 -2
- data/lib/ffi-gobject_introspection/i_enum_info.rb +2 -2
- data/lib/ffi-gobject_introspection/i_field_info.rb +1 -1
- data/lib/ffi-gobject_introspection/i_interface_info.rb +9 -9
- data/lib/ffi-gobject_introspection/i_object_info.rb +19 -14
- data/lib/ffi-gobject_introspection/i_property_info.rb +1 -1
- data/lib/ffi-gobject_introspection/i_repository.rb +1 -1
- data/lib/ffi-gobject_introspection/i_struct_info.rb +2 -2
- data/lib/ffi-gobject_introspection/i_type_info.rb +1 -1
- data/lib/ffi-gobject_introspection/i_union_info.rb +3 -3
- data/lib/ffi-gobject_introspection/i_vfunc_info.rb +2 -2
- data/lib/gir_ffi/builders/argument_builder.rb +2 -1
- data/lib/gir_ffi/builders/base_argument_builder.rb +1 -1
- data/lib/gir_ffi/builders/boxed_builder.rb +6 -0
- data/lib/gir_ffi/builders/closure_to_pointer_convertor.rb +7 -1
- data/lib/gir_ffi/builders/field_builder.rb +2 -4
- data/lib/gir_ffi/builders/object_builder.rb +20 -9
- data/lib/gir_ffi/builders/type_builder.rb +1 -1
- data/lib/gir_ffi/builders/unintrospectable_builder.rb +8 -0
- data/lib/gir_ffi/builders/with_layout.rb +0 -6
- data/lib/gir_ffi/core.rb +2 -1
- data/lib/gir_ffi/ffi_ext/pointer.rb +1 -1
- data/lib/gir_ffi/info_ext/i_type_info.rb +10 -12
- data/lib/gir_ffi/object_base.rb +4 -2
- data/lib/gir_ffi/property_not_found_error.rb +12 -0
- data/lib/gir_ffi/signal_not_found_error.rb +12 -0
- data/lib/gir_ffi/sized_array.rb +4 -4
- data/lib/gir_ffi/type_map.rb +1 -1
- data/lib/gir_ffi/unintrospectable_boxed_info.rb +2 -1
- data/lib/gir_ffi/unintrospectable_signal_info.rb +39 -0
- data/lib/gir_ffi/version.rb +2 -1
- data/lib/gir_ffi-base/gobject/lib.rb +1 -1
- data/tasks/rubocop.rake +5 -0
- data/tasks/test.rake +7 -0
- data/test/ffi-gobject/object_test.rb +29 -1
- data/test/ffi-gobject_introspection/i_object_info_test.rb +16 -0
- data/test/ffi-gobject_test.rb +3 -6
- data/test/gir_ffi/builders/argument_builder_test.rb +2 -2
- data/test/gir_ffi/builders/object_builder_test.rb +25 -12
- data/test/gir_ffi/builders/unintrospectable_builder_test.rb +21 -15
- data/test/integration/generated_gimarshallingtests_test.rb +16 -13
- data/test/integration/generated_gio_test.rb +2 -1
- data/test/integration/generated_gobject_test.rb +11 -1
- data/test/integration/generated_gst_test.rb +18 -0
- data/test/integration/generated_regress_test.rb +6 -8
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a091e4dbd8360e158b2fb09d53f34fa6913dda07
|
4
|
+
data.tar.gz: 98c7a541d76f2e6217dca26d8cfd2ed5d7b32c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1aaf7d901357faa26299c194deedb7a6cd42dafd62bb50e5f30c0c364ce4ef25349381deac8a4da8e42aa0d26d6d6bb2f0d1019884bf9c92a55fa03770df6485
|
7
|
+
data.tar.gz: cfd6c0d21b4f674c1fd637f4d8d963158f29264e046204021fb539594a1015f0807c279047c998b71fca4bc8f53ca2d750edd433af3800fab01e6727ec548ccd
|
data/Changelog.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.9.1 / 2016-02-04
|
4
|
+
|
5
|
+
* Add field accessors for Object types for fields that don't have corresponding
|
6
|
+
properties or getter methods
|
7
|
+
* Improve error handling for signals and properties that are not found
|
8
|
+
* Handle signals without GIR data
|
9
|
+
* Add interrupt handler to break out of main loops
|
10
|
+
|
3
11
|
## 0.9.0 / 2016-01-21
|
4
12
|
|
5
13
|
* Propagate exceptions from callbacks during event loops
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -64,8 +64,8 @@ GirFFI is developed on Debian sid, and tested through Travis CI on Ubuntu
|
|
64
64
|
are therefore not officially supported (although they may work).
|
65
65
|
|
66
66
|
On Debian and Ubuntu, installing `libgirepository1.0-dev`,
|
67
|
-
`gobject-introspection` and `gir1.2-
|
68
|
-
`rake test` working.
|
67
|
+
`gobject-introspection`, `gir1.2-gtop-2.0` and `gir1.2-gstreamer-1.0` should be
|
68
|
+
enough to get `rake test` working.
|
69
69
|
|
70
70
|
GirFFI has not been tested on Mac OS X or Microsoft Windows. YMMV.
|
71
71
|
|
data/Rakefile
CHANGED
data/TODO.md
CHANGED
@@ -1,25 +1,12 @@
|
|
1
1
|
# TODO
|
2
2
|
|
3
|
-
## Miscellaneous
|
4
|
-
|
5
|
-
* MAKE CONSTRUCTOR_WRAP CHECK TYPES? This would allow GObject::Object.new to
|
6
|
-
work and create the correct subtype for classes that don't define their own
|
7
|
-
default constructor.
|
8
|
-
* Add tests for the other test files in gobject-introspection. Currently, only
|
9
|
-
regress.c and gimarshallingtests.c are used, but there are 6 other files
|
10
|
-
available.
|
11
|
-
* Move GObjectIntrospection to GIRepository, and allow generating its own
|
12
|
-
members.
|
13
|
-
* Do not remove ClassBase.new. We now remove it and then add it back for the
|
14
|
-
default constructor, which is kind of silly.
|
15
|
-
|
16
3
|
## Memory managment
|
17
4
|
|
18
|
-
GirFFI does not attempt to free any memory at the moment, or lower the
|
5
|
+
GirFFI does not ~~attempt to free any memory at the moment, or~~ lower the
|
19
6
|
reference count of any objects it gets from GObject. This task therefore involves two parts:
|
20
7
|
|
21
8
|
- Free non-GObject pointers as needed (at garbage-collection time)
|
22
|
-
- Lower reference count of GObjects (at garbage-collection time)
|
9
|
+
- [Done!] Lower reference count of GObjects (at garbage-collection time)
|
23
10
|
|
24
11
|
**Use memory_profiler to check memory use (https://github.com/SamSaffron/memory_profiler)**
|
25
12
|
|
@@ -37,10 +24,6 @@ These in the order they occured to me, and may therefore be fixed in any order.
|
|
37
24
|
- Move to a single Pointer class, rather than InPointer, InOutPointer and
|
38
25
|
Pointer monkeypatching.
|
39
26
|
|
40
|
-
- Move special types like SizedArray to sane namespaces. Types (like
|
41
|
-
GLib::List) that have actual GLib implementations go to the GLib namespace.
|
42
|
-
Other types go to the GirFFI namespace.
|
43
|
-
|
44
27
|
## Derived types
|
45
28
|
|
46
29
|
Derived classes can now be registered with GObject, but the way to do this is
|
@@ -117,6 +100,11 @@ to be put in place for that.
|
|
117
100
|
|
118
101
|
For how to handle objects, see https://bugzilla.gnome.org/show_bug.cgi?id=657202#c1
|
119
102
|
|
103
|
+
## Miscellaneous
|
104
|
+
|
105
|
+
* Move GObjectIntrospection to GIRepository, and allow generating its own
|
106
|
+
members.
|
107
|
+
|
120
108
|
## External dependencies
|
121
109
|
|
122
110
|
Things that I think GirFFI cannot fix:
|
data/lib/ffi-glib/byte_array.rb
CHANGED
data/lib/ffi-glib/list.rb
CHANGED
data/lib/ffi-glib/main_loop.rb
CHANGED
@@ -26,7 +26,7 @@ module GLib
|
|
26
26
|
|
27
27
|
def handler_proc
|
28
28
|
proc do
|
29
|
-
Thread.pass
|
29
|
+
::Thread.pass
|
30
30
|
true
|
31
31
|
end
|
32
32
|
end
|
@@ -53,16 +53,16 @@ module GLib
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.handle_exception(ex)
|
56
|
-
current_loop = RUNNING_LOOPS.last
|
57
|
-
|
58
|
-
|
59
|
-
current_loop.quit
|
60
|
-
else
|
61
|
-
raise ex
|
62
|
-
end
|
56
|
+
raise ex unless (current_loop = RUNNING_LOOPS.last)
|
57
|
+
EXCEPTIONS << ex
|
58
|
+
current_loop.quit
|
63
59
|
end
|
64
60
|
|
65
61
|
alias_method :run_without_thread_enabler, :run
|
66
62
|
alias_method :run, :run_with_thread_enabler
|
67
63
|
end
|
68
64
|
end
|
65
|
+
|
66
|
+
Signal.trap 'INT' do
|
67
|
+
GLib::MainLoop.handle_exception(Interrupt.new)
|
68
|
+
end
|
data/lib/ffi-glib/s_list.rb
CHANGED
data/lib/ffi-gobject/object.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'gir_ffi/property_not_found_error'
|
2
|
+
|
1
3
|
GObject.load_class :Object
|
2
4
|
|
3
5
|
module GObject
|
@@ -8,9 +10,7 @@ module GObject
|
|
8
10
|
def initialize_with_automatic_gtype(properties = {})
|
9
11
|
gparameters = properties.map do |name, value|
|
10
12
|
name = name.to_s
|
11
|
-
|
12
|
-
raise ArgumentError, "Property '#{name}' not found in class #{self.class}"
|
13
|
-
end
|
13
|
+
property_param_spec(name)
|
14
14
|
GObject::Parameter.new.tap do |gparam|
|
15
15
|
gparam.name = name
|
16
16
|
gparam.value = value
|
@@ -106,7 +106,7 @@ module GObject
|
|
106
106
|
private
|
107
107
|
|
108
108
|
def get_property_type(property_name)
|
109
|
-
prop = self.class.find_property
|
109
|
+
prop = self.class.find_property(property_name)
|
110
110
|
prop.property_type
|
111
111
|
end
|
112
112
|
|
@@ -116,11 +116,13 @@ module GObject
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def property_gtype(property_name)
|
119
|
-
property_param_spec(property_name)
|
119
|
+
pspec = property_param_spec(property_name)
|
120
|
+
pspec.value_type
|
120
121
|
end
|
121
122
|
|
122
123
|
def property_param_spec(property_name)
|
123
|
-
object_class.find_property property_name
|
124
|
+
object_class.find_property property_name or
|
125
|
+
raise GirFFI::PropertyNotFoundError.new(property_name, self.class)
|
124
126
|
end
|
125
127
|
|
126
128
|
# TODO: Move to ITypeInfo
|
data/lib/ffi-gobject/value.rb
CHANGED
@@ -45,7 +45,7 @@ module GObject
|
|
45
45
|
TYPE_OBJECT => [:get_object, :set_instance_enhanced],
|
46
46
|
TYPE_GTYPE => [:get_gtype, :set_gtype],
|
47
47
|
TYPE_VARIANT => [:get_variant, :set_variant]
|
48
|
-
}
|
48
|
+
}.freeze
|
49
49
|
|
50
50
|
def set_value(val)
|
51
51
|
send set_method, val
|
@@ -119,7 +119,7 @@ module GObject
|
|
119
119
|
FalseClass => TYPE_BOOLEAN,
|
120
120
|
Integer => TYPE_INT,
|
121
121
|
String => TYPE_STRING
|
122
|
-
}
|
122
|
+
}.freeze
|
123
123
|
|
124
124
|
def init_for_ruby_value(val)
|
125
125
|
if val.class.respond_to? :gtype
|
data/lib/ffi-gobject.rb
CHANGED
@@ -10,7 +10,7 @@ require 'ffi-gobject/closure'
|
|
10
10
|
require 'ffi-gobject/object'
|
11
11
|
require 'ffi-gobject/object_class'
|
12
12
|
require 'ffi-gobject/ruby_closure'
|
13
|
-
require 'gir_ffi/
|
13
|
+
require 'gir_ffi/signal_not_found_error'
|
14
14
|
|
15
15
|
# Module representing GLib's GObject namespace.
|
16
16
|
module GObject
|
@@ -24,6 +24,10 @@ module GObject
|
|
24
24
|
type_from_instance_pointer instance.to_ptr
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.type_name_from_instance(instance)
|
28
|
+
type_name type_from_instance instance
|
29
|
+
end
|
30
|
+
|
27
31
|
def self.object_class_from_instance(instance)
|
28
32
|
object_class_from_instance_pointer instance.to_ptr
|
29
33
|
end
|
@@ -7,7 +7,7 @@ module GObjectIntrospection
|
|
7
7
|
# IFunctionInfo, ICallbackInfo or IVFuncInfo.
|
8
8
|
class ICallableInfo < IBaseInfo
|
9
9
|
def return_type
|
10
|
-
ITypeInfo.wrap
|
10
|
+
ITypeInfo.wrap Lib.g_callable_info_get_return_type(@gobj)
|
11
11
|
end
|
12
12
|
|
13
13
|
def caller_owns
|
@@ -23,7 +23,7 @@ module GObjectIntrospection
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def arg(index)
|
26
|
-
IArgInfo.wrap
|
26
|
+
IArgInfo.wrap Lib.g_callable_info_get_arg(@gobj, index)
|
27
27
|
end
|
28
28
|
##
|
29
29
|
build_array_method :args
|
@@ -13,7 +13,7 @@ module GObjectIntrospection
|
|
13
13
|
guint64: :v_uint64,
|
14
14
|
gdouble: :v_double,
|
15
15
|
utf8: :v_string
|
16
|
-
}
|
16
|
+
}.freeze
|
17
17
|
|
18
18
|
def value
|
19
19
|
case type_tag
|
@@ -27,7 +27,7 @@ module GObjectIntrospection
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def constant_type
|
30
|
-
ITypeInfo.wrap
|
30
|
+
ITypeInfo.wrap Lib.g_constant_info_get_type(@gobj)
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
@@ -7,7 +7,7 @@ module GObjectIntrospection
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def value(index)
|
10
|
-
IValueInfo.wrap
|
10
|
+
IValueInfo.wrap Lib.g_enum_info_get_value(@gobj, index)
|
11
11
|
end
|
12
12
|
##
|
13
13
|
build_array_method :values
|
@@ -17,7 +17,7 @@ module GObjectIntrospection
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def get_method(index)
|
20
|
-
IFunctionInfo.wrap
|
20
|
+
IFunctionInfo.wrap Lib.g_enum_info_get_method(@gobj, index)
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -7,7 +7,7 @@ module GObjectIntrospection
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def prerequisite(index)
|
10
|
-
IBaseInfo.wrap
|
10
|
+
IBaseInfo.wrap Lib.g_interface_info_get_prerequisite(@gobj, index)
|
11
11
|
end
|
12
12
|
|
13
13
|
##
|
@@ -18,7 +18,7 @@ module GObjectIntrospection
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def property(index)
|
21
|
-
IPropertyInfo.wrap
|
21
|
+
IPropertyInfo.wrap Lib.g_interface_info_get_property(@gobj, index)
|
22
22
|
end
|
23
23
|
|
24
24
|
##
|
@@ -30,14 +30,14 @@ module GObjectIntrospection
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def get_method(index)
|
33
|
-
IFunctionInfo.wrap
|
33
|
+
IFunctionInfo.wrap Lib.g_interface_info_get_method(@gobj, index)
|
34
34
|
end
|
35
35
|
|
36
36
|
##
|
37
37
|
build_array_method :get_methods
|
38
38
|
|
39
39
|
def find_method(name)
|
40
|
-
IFunctionInfo.wrap
|
40
|
+
IFunctionInfo.wrap Lib.g_interface_info_find_method(@gobj, name.to_s)
|
41
41
|
end
|
42
42
|
|
43
43
|
def n_signals
|
@@ -45,7 +45,7 @@ module GObjectIntrospection
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def signal(index)
|
48
|
-
ISignalInfo.wrap
|
48
|
+
ISignalInfo.wrap Lib.g_interface_info_get_signal(@gobj, index)
|
49
49
|
end
|
50
50
|
|
51
51
|
##
|
@@ -57,14 +57,14 @@ module GObjectIntrospection
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def vfunc(index)
|
60
|
-
IVFuncInfo.wrap
|
60
|
+
IVFuncInfo.wrap Lib.g_interface_info_get_vfunc(@gobj, index)
|
61
61
|
end
|
62
62
|
|
63
63
|
##
|
64
64
|
build_array_method :vfuncs
|
65
65
|
|
66
66
|
def find_vfunc(name)
|
67
|
-
IVFuncInfo.wrap
|
67
|
+
IVFuncInfo.wrap Lib.g_interface_info_find_vfunc(@gobj, name)
|
68
68
|
end
|
69
69
|
|
70
70
|
def n_constants
|
@@ -72,14 +72,14 @@ module GObjectIntrospection
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def constant(index)
|
75
|
-
IConstantInfo.wrap
|
75
|
+
IConstantInfo.wrap Lib.g_interface_info_get_constant(@gobj, index)
|
76
76
|
end
|
77
77
|
|
78
78
|
##
|
79
79
|
build_array_method :constants
|
80
80
|
|
81
81
|
def iface_struct
|
82
|
-
IStructInfo.wrap
|
82
|
+
IStructInfo.wrap Lib.g_interface_info_get_iface_struct(@gobj)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
@@ -19,7 +19,7 @@ module GObjectIntrospection
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def parent
|
22
|
-
IObjectInfo.wrap
|
22
|
+
IObjectInfo.wrap Lib.g_object_info_get_parent(@gobj)
|
23
23
|
end
|
24
24
|
|
25
25
|
def n_interfaces
|
@@ -27,7 +27,7 @@ module GObjectIntrospection
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def interface(index)
|
30
|
-
IInterfaceInfo.wrap
|
30
|
+
IInterfaceInfo.wrap Lib.g_object_info_get_interface(@gobj, index)
|
31
31
|
end
|
32
32
|
|
33
33
|
##
|
@@ -38,7 +38,7 @@ module GObjectIntrospection
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def field(index)
|
41
|
-
IFieldInfo.wrap
|
41
|
+
IFieldInfo.wrap Lib.g_object_info_get_field(@gobj, index)
|
42
42
|
end
|
43
43
|
|
44
44
|
##
|
@@ -49,26 +49,31 @@ module GObjectIntrospection
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def property(index)
|
52
|
-
IPropertyInfo.wrap
|
52
|
+
IPropertyInfo.wrap Lib.g_object_info_get_property(@gobj, index)
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
def properties
|
56
|
+
@properties ||= Array.new(n_properties) { |idx| property(idx) }
|
57
|
+
end
|
58
|
+
|
59
|
+
def find_property(name)
|
60
|
+
name = name.to_s.tr('_', '-')
|
61
|
+
properties.find { |prop| prop.name == name }
|
62
|
+
end
|
58
63
|
|
59
64
|
def get_n_methods
|
60
65
|
Lib.g_object_info_get_n_methods @gobj
|
61
66
|
end
|
62
67
|
|
63
68
|
def get_method(index)
|
64
|
-
IFunctionInfo.wrap
|
69
|
+
IFunctionInfo.wrap Lib.g_object_info_get_method(@gobj, index)
|
65
70
|
end
|
66
71
|
|
67
72
|
##
|
68
73
|
build_array_method :get_methods
|
69
74
|
|
70
75
|
def find_method(name)
|
71
|
-
IFunctionInfo.wrap
|
76
|
+
IFunctionInfo.wrap Lib.g_object_info_find_method(@gobj, name.to_s)
|
72
77
|
end
|
73
78
|
|
74
79
|
def n_signals
|
@@ -76,7 +81,7 @@ module GObjectIntrospection
|
|
76
81
|
end
|
77
82
|
|
78
83
|
def signal(index)
|
79
|
-
ISignalInfo.wrap
|
84
|
+
ISignalInfo.wrap Lib.g_object_info_get_signal(@gobj, index)
|
80
85
|
end
|
81
86
|
|
82
87
|
##
|
@@ -88,11 +93,11 @@ module GObjectIntrospection
|
|
88
93
|
end
|
89
94
|
|
90
95
|
def vfunc(index)
|
91
|
-
IVFuncInfo.wrap
|
96
|
+
IVFuncInfo.wrap Lib.g_object_info_get_vfunc(@gobj, index)
|
92
97
|
end
|
93
98
|
|
94
99
|
def find_vfunc(name)
|
95
|
-
IVFuncInfo.wrap
|
100
|
+
IVFuncInfo.wrap Lib.g_object_info_find_vfunc(@gobj, name.to_s)
|
96
101
|
end
|
97
102
|
##
|
98
103
|
build_array_method :vfuncs
|
@@ -102,13 +107,13 @@ module GObjectIntrospection
|
|
102
107
|
end
|
103
108
|
|
104
109
|
def constant(index)
|
105
|
-
IConstantInfo.wrap
|
110
|
+
IConstantInfo.wrap Lib.g_object_info_get_constant(@gobj, index)
|
106
111
|
end
|
107
112
|
##
|
108
113
|
build_array_method :constants
|
109
114
|
|
110
115
|
def class_struct
|
111
|
-
IStructInfo.wrap
|
116
|
+
IStructInfo.wrap Lib.g_object_info_get_class_struct(@gobj)
|
112
117
|
end
|
113
118
|
end
|
114
119
|
end
|
@@ -3,7 +3,7 @@ module GObjectIntrospection
|
|
3
3
|
# Represents a property of an IObjectInfo or an IInterfaceInfo.
|
4
4
|
class IPropertyInfo < IBaseInfo
|
5
5
|
def property_type
|
6
|
-
ITypeInfo.wrap
|
6
|
+
ITypeInfo.wrap Lib.g_property_info_get_type(@gobj)
|
7
7
|
end
|
8
8
|
|
9
9
|
def flags
|
@@ -7,7 +7,7 @@ module GObjectIntrospection
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def field(index)
|
10
|
-
IFieldInfo.wrap
|
10
|
+
IFieldInfo.wrap Lib.g_struct_info_get_field(@gobj, index)
|
11
11
|
end
|
12
12
|
|
13
13
|
##
|
@@ -19,7 +19,7 @@ module GObjectIntrospection
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def get_method(index)
|
22
|
-
IFunctionInfo.wrap
|
22
|
+
IFunctionInfo.wrap Lib.g_struct_info_get_method(@gobj, index)
|
23
23
|
end
|
24
24
|
|
25
25
|
##
|
@@ -7,7 +7,7 @@ module GObjectIntrospection
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def field(index)
|
10
|
-
IFieldInfo.wrap
|
10
|
+
IFieldInfo.wrap Lib.g_union_info_get_field(@gobj, index)
|
11
11
|
end
|
12
12
|
|
13
13
|
##
|
@@ -18,14 +18,14 @@ module GObjectIntrospection
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def get_method(index)
|
21
|
-
IFunctionInfo.wrap
|
21
|
+
IFunctionInfo.wrap Lib.g_union_info_get_method(@gobj, index)
|
22
22
|
end
|
23
23
|
|
24
24
|
##
|
25
25
|
build_array_method :get_methods
|
26
26
|
|
27
27
|
def find_method(name)
|
28
|
-
IFunctionInfo.wrap
|
28
|
+
IFunctionInfo.wrap Lib.g_union_info_find_method(@gobj, name.to_s)
|
29
29
|
end
|
30
30
|
|
31
31
|
def size
|
@@ -15,11 +15,11 @@ module GObjectIntrospection
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def signal
|
18
|
-
ISignalInfo.wrap
|
18
|
+
ISignalInfo.wrap Lib.g_vfunc_info_get_signal(@gobj)
|
19
19
|
end
|
20
20
|
|
21
21
|
def invoker
|
22
|
-
IFunctionInfo.wrap
|
22
|
+
IFunctionInfo.wrap Lib.g_vfunc_info_get_invoker(@gobj)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'gir_ffi/builders/base_argument_builder'
|
2
3
|
require 'gir_ffi/builders/closure_to_pointer_convertor'
|
3
4
|
require 'gir_ffi/builders/full_c_to_ruby_convertor'
|
@@ -147,7 +148,7 @@ module GirFFI
|
|
147
148
|
@arginfo.caller_allocates?
|
148
149
|
end
|
149
150
|
|
150
|
-
DESTROY_NOTIFIER = 'GLib::DestroyNotify.default'
|
151
|
+
DESTROY_NOTIFIER = 'GLib::DestroyNotify.default'.freeze
|
151
152
|
|
152
153
|
def ingoing_convertor
|
153
154
|
if skipped?
|
@@ -9,7 +9,13 @@ module GirFFI
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def conversion
|
12
|
-
"GirFFI::InPointer.from_closure_data(#{
|
12
|
+
"GirFFI::InPointer.from_closure_data(#{callback_argument_name}.object_id)"
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def callback_argument_name
|
18
|
+
@callback_argument.call_argument_name
|
13
19
|
end
|
14
20
|
end
|
15
21
|
end
|