gir_ffi 0.13.0 → 0.13.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 +10 -0
- data/lib/ffi-glib/array.rb +2 -2
- data/lib/ffi-glib/array_methods.rb +1 -0
- data/lib/ffi-glib/list_methods.rb +3 -2
- data/lib/ffi-glib/main_loop.rb +2 -0
- data/lib/ffi-glib/ptr_array.rb +2 -2
- data/lib/ffi-gobject.rb +3 -11
- data/lib/ffi-gobject/closure.rb +1 -0
- data/lib/ffi-gobject/object.rb +30 -16
- data/lib/ffi-gobject/object_class.rb +2 -2
- data/lib/ffi-gobject/ruby_closure.rb +2 -2
- data/lib/ffi-gobject/value.rb +2 -1
- data/lib/ffi-gobject_introspection/i_arg_info.rb +11 -11
- data/lib/ffi-gobject_introspection/i_base_info.rb +12 -10
- data/lib/ffi-gobject_introspection/i_callable_info.rb +8 -8
- data/lib/ffi-gobject_introspection/i_enum_info.rb +5 -5
- data/lib/ffi-gobject_introspection/i_field_info.rb +4 -4
- data/lib/ffi-gobject_introspection/i_function_info.rb +2 -2
- data/lib/ffi-gobject_introspection/i_interface_info.rb +15 -15
- data/lib/ffi-gobject_introspection/i_object_info.rb +22 -22
- data/lib/ffi-gobject_introspection/i_property_info.rb +2 -2
- data/lib/ffi-gobject_introspection/i_registered_type_info.rb +3 -3
- data/lib/ffi-gobject_introspection/i_repository.rb +16 -10
- data/lib/ffi-gobject_introspection/i_struct_info.rb +11 -7
- data/lib/ffi-gobject_introspection/i_type_info.rb +8 -8
- data/lib/ffi-gobject_introspection/i_union_info.rb +7 -7
- data/lib/ffi-gobject_introspection/i_value_info.rb +1 -1
- data/lib/ffi-gobject_introspection/strv.rb +1 -0
- data/lib/gir_ffi-base/gobject.rb +5 -0
- data/lib/gir_ffi-base/gobject/lib.rb +4 -0
- data/lib/gir_ffi/boolean.rb +2 -2
- data/lib/gir_ffi/builders/argument_builder.rb +41 -14
- data/lib/gir_ffi/builders/argument_builder_collection.rb +17 -4
- data/lib/gir_ffi/builders/base_argument_builder.rb +12 -16
- data/lib/gir_ffi/builders/callback_argument_builder.rb +1 -1
- data/lib/gir_ffi/builders/callback_builder.rb +1 -1
- data/lib/gir_ffi/builders/closure_to_pointer_convertor.rb +2 -9
- data/lib/gir_ffi/builders/field_builder.rb +11 -9
- data/lib/gir_ffi/builders/module_builder.rb +2 -1
- data/lib/gir_ffi/builders/object_builder.rb +21 -12
- data/lib/gir_ffi/builders/pointer_value_convertor.rb +8 -6
- data/lib/gir_ffi/builders/property_builder.rb +4 -2
- data/lib/gir_ffi/builders/registered_type_builder.rb +30 -19
- data/lib/gir_ffi/builders/return_value_builder.rb +2 -2
- data/lib/gir_ffi/builders/ruby_to_c_convertor.rb +2 -0
- data/lib/gir_ffi/builders/signal_closure_builder.rb +1 -1
- data/lib/gir_ffi/builders/struct_builder.rb +7 -8
- data/lib/gir_ffi/builders/unintrospectable_builder.rb +4 -1
- data/lib/gir_ffi/builders/user_defined_builder.rb +31 -95
- data/lib/gir_ffi/builders/vfunc_builder.rb +1 -1
- data/lib/gir_ffi/builders/with_layout.rb +3 -1
- data/lib/gir_ffi/callback_base.rb +3 -2
- data/lib/gir_ffi/class_base.rb +5 -0
- data/lib/gir_ffi/enum_like_base.rb +9 -5
- data/lib/gir_ffi/error_argument_info.rb +1 -1
- data/lib/gir_ffi/ffi_ext/pointer.rb +1 -4
- data/lib/gir_ffi/field_argument_info.rb +1 -1
- data/lib/gir_ffi/in_pointer.rb +36 -23
- data/lib/gir_ffi/info_ext/i_arg_info.rb +2 -0
- data/lib/gir_ffi/info_ext/i_callback_info.rb +4 -0
- data/lib/gir_ffi/info_ext/i_registered_type_info.rb +4 -0
- data/lib/gir_ffi/info_ext/i_type_info.rb +3 -27
- data/lib/gir_ffi/info_ext/safe_function_name.rb +1 -0
- data/lib/gir_ffi/interface_base.rb +5 -0
- data/lib/gir_ffi/module_base.rb +1 -0
- data/lib/gir_ffi/object_base.rb +10 -0
- data/lib/gir_ffi/object_store.rb +2 -0
- data/lib/gir_ffi/receiver_argument_info.rb +1 -1
- data/lib/gir_ffi/return_value_info.rb +1 -1
- data/lib/gir_ffi/sized_array.rb +7 -14
- data/lib/gir_ffi/struct_like_base.rb +3 -0
- data/lib/gir_ffi/type_map.rb +21 -0
- data/lib/gir_ffi/user_defined_object_info.rb +6 -2
- data/lib/gir_ffi/user_defined_property_info.rb +113 -71
- data/lib/gir_ffi/version.rb +1 -1
- data/lib/gir_ffi/zero_terminated.rb +26 -1
- data/tasks/test.rake +1 -0
- data/test/ffi-gobject_introspection/i_repository_test.rb +1 -2
- data/test/gir_ffi/builder_test.rb +13 -7
- data/test/gir_ffi/builders/argument_builder_test.rb +1 -5
- data/test/gir_ffi/builders/callback_return_value_builder_test.rb +1 -1
- data/test/gir_ffi/builders/field_builder_test.rb +20 -20
- data/test/gir_ffi/builders/return_value_builder_test.rb +1 -1
- data/test/gir_ffi/builders/signal_closure_builder_test.rb +1 -1
- data/test/gir_ffi/builders/unintrospectable_boxed_builder_test.rb +1 -1
- data/test/gir_ffi/builders/unintrospectable_builder_test.rb +2 -2
- data/test/gir_ffi/builders/vfunc_builder_test.rb +1 -1
- data/test/gir_ffi/enum_base_test.rb +43 -0
- data/test/gir_ffi/info_ext/i_type_info_test.rb +3 -9
- data/test/gir_ffi/object_base_test.rb +30 -0
- data/test/gir_ffi/sized_array_test.rb +0 -9
- data/test/gir_ffi/user_defined_object_info_test.rb +4 -6
- data/test/gir_ffi/user_defined_property_info_test.rb +6 -5
- data/test/gir_ffi/zero_terminated_test.rb +22 -0
- data/test/gir_ffi_test_helper.rb +2 -0
- data/test/integration/generated_gimarshallingtests_test.rb +1 -0
- data/test/integration/generated_gio_test.rb +5 -6
- data/test/integration/generated_gobject_test.rb +1 -1
- data/test/integration/generated_gtop_test.rb +3 -1
- data/test/integration/generated_regress_test.rb +3 -4
- metadata +3 -2
@@ -9,37 +9,37 @@ module GObjectIntrospection
|
|
9
9
|
# IFunctionInfo, ICallbackInfo or IVFuncInfo.
|
10
10
|
class ICallableInfo < IBaseInfo
|
11
11
|
def return_type
|
12
|
-
ITypeInfo.wrap Lib.g_callable_info_get_return_type(
|
12
|
+
ITypeInfo.wrap Lib.g_callable_info_get_return_type(self)
|
13
13
|
end
|
14
14
|
|
15
15
|
def caller_owns
|
16
|
-
Lib.g_callable_info_get_caller_owns
|
16
|
+
Lib.g_callable_info_get_caller_owns self
|
17
17
|
end
|
18
18
|
|
19
19
|
def may_return_null?
|
20
|
-
Lib.g_callable_info_may_return_null
|
20
|
+
Lib.g_callable_info_may_return_null self
|
21
21
|
end
|
22
22
|
|
23
23
|
def can_throw_gerror?
|
24
|
-
Lib.g_callable_info_can_throw_gerror
|
24
|
+
Lib.g_callable_info_can_throw_gerror self
|
25
25
|
end
|
26
26
|
|
27
27
|
def n_args
|
28
|
-
Lib.g_callable_info_get_n_args
|
28
|
+
Lib.g_callable_info_get_n_args self
|
29
29
|
end
|
30
30
|
|
31
31
|
def arg(index)
|
32
|
-
IArgInfo.wrap Lib.g_callable_info_get_arg(
|
32
|
+
IArgInfo.wrap Lib.g_callable_info_get_arg(self, index)
|
33
33
|
end
|
34
34
|
##
|
35
35
|
build_array_method :args
|
36
36
|
|
37
37
|
def skip_return?
|
38
|
-
Lib.g_callable_info_skip_return
|
38
|
+
Lib.g_callable_info_skip_return self
|
39
39
|
end
|
40
40
|
|
41
41
|
def instance_ownership_transfer
|
42
|
-
Lib.g_callable_info_get_instance_ownership_transfer
|
42
|
+
Lib.g_callable_info_get_instance_ownership_transfer self
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -5,21 +5,21 @@ module GObjectIntrospection
|
|
5
5
|
# If it represents a flag, an IFlagsInfo object is used instead.
|
6
6
|
class IEnumInfo < IRegisteredTypeInfo
|
7
7
|
def n_values
|
8
|
-
Lib.g_enum_info_get_n_values
|
8
|
+
Lib.g_enum_info_get_n_values self
|
9
9
|
end
|
10
10
|
|
11
11
|
def value(index)
|
12
|
-
IValueInfo.wrap Lib.g_enum_info_get_value(
|
12
|
+
IValueInfo.wrap Lib.g_enum_info_get_value(self, index)
|
13
13
|
end
|
14
14
|
##
|
15
15
|
build_array_method :values
|
16
16
|
|
17
17
|
def get_n_methods
|
18
|
-
Lib.g_enum_info_get_n_methods
|
18
|
+
Lib.g_enum_info_get_n_methods self
|
19
19
|
end
|
20
20
|
|
21
21
|
def get_method(index)
|
22
|
-
IFunctionInfo.wrap Lib.g_enum_info_get_method(
|
22
|
+
IFunctionInfo.wrap Lib.g_enum_info_get_method(self, index)
|
23
23
|
end
|
24
24
|
|
25
25
|
##
|
@@ -27,7 +27,7 @@ module GObjectIntrospection
|
|
27
27
|
build_finder_method :find_method, :get_n_methods, :get_method
|
28
28
|
|
29
29
|
def storage_type
|
30
|
-
Lib.g_enum_info_get_storage_type
|
30
|
+
Lib.g_enum_info_get_storage_type self
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -5,19 +5,19 @@ module GObjectIntrospection
|
|
5
5
|
# Represents a field of an IStructInfo or an IUnionInfo.
|
6
6
|
class IFieldInfo < IBaseInfo
|
7
7
|
def flags
|
8
|
-
Lib.g_field_info_get_flags
|
8
|
+
Lib.g_field_info_get_flags self
|
9
9
|
end
|
10
10
|
|
11
11
|
def size
|
12
|
-
Lib.g_field_info_get_size
|
12
|
+
Lib.g_field_info_get_size self
|
13
13
|
end
|
14
14
|
|
15
15
|
def offset
|
16
|
-
Lib.g_field_info_get_offset
|
16
|
+
Lib.g_field_info_get_offset self
|
17
17
|
end
|
18
18
|
|
19
19
|
def field_type
|
20
|
-
ITypeInfo.wrap Lib.g_field_info_get_type(
|
20
|
+
ITypeInfo.wrap Lib.g_field_info_get_type(self)
|
21
21
|
end
|
22
22
|
|
23
23
|
def readable?
|
@@ -5,11 +5,11 @@ module GObjectIntrospection
|
|
5
5
|
# Represents a function or method.
|
6
6
|
class IFunctionInfo < ICallableInfo
|
7
7
|
def symbol
|
8
|
-
Lib.g_function_info_get_symbol
|
8
|
+
Lib.g_function_info_get_symbol self
|
9
9
|
end
|
10
10
|
|
11
11
|
def flags
|
12
|
-
Lib.g_function_info_get_flags
|
12
|
+
Lib.g_function_info_get_flags self
|
13
13
|
end
|
14
14
|
|
15
15
|
def method?
|
@@ -5,22 +5,22 @@ module GObjectIntrospection
|
|
5
5
|
# Represents an interface.
|
6
6
|
class IInterfaceInfo < IRegisteredTypeInfo
|
7
7
|
def n_prerequisites
|
8
|
-
Lib.g_interface_info_get_n_prerequisites
|
8
|
+
Lib.g_interface_info_get_n_prerequisites self
|
9
9
|
end
|
10
10
|
|
11
11
|
def prerequisite(index)
|
12
|
-
IBaseInfo.wrap Lib.g_interface_info_get_prerequisite(
|
12
|
+
IBaseInfo.wrap Lib.g_interface_info_get_prerequisite(self, index)
|
13
13
|
end
|
14
14
|
|
15
15
|
##
|
16
16
|
build_array_method :prerequisites
|
17
17
|
|
18
18
|
def n_properties
|
19
|
-
Lib.g_interface_info_get_n_properties
|
19
|
+
Lib.g_interface_info_get_n_properties self
|
20
20
|
end
|
21
21
|
|
22
22
|
def property(index)
|
23
|
-
IPropertyInfo.wrap Lib.g_interface_info_get_property(
|
23
|
+
IPropertyInfo.wrap Lib.g_interface_info_get_property(self, index)
|
24
24
|
end
|
25
25
|
|
26
26
|
##
|
@@ -28,26 +28,26 @@ module GObjectIntrospection
|
|
28
28
|
build_finder_method :find_property, :n_properties
|
29
29
|
|
30
30
|
def get_n_methods
|
31
|
-
Lib.g_interface_info_get_n_methods
|
31
|
+
Lib.g_interface_info_get_n_methods self
|
32
32
|
end
|
33
33
|
|
34
34
|
def get_method(index)
|
35
|
-
IFunctionInfo.wrap Lib.g_interface_info_get_method(
|
35
|
+
IFunctionInfo.wrap Lib.g_interface_info_get_method(self, index)
|
36
36
|
end
|
37
37
|
|
38
38
|
##
|
39
39
|
build_array_method :get_methods
|
40
40
|
|
41
41
|
def find_method(name)
|
42
|
-
IFunctionInfo.wrap Lib.g_interface_info_find_method(
|
42
|
+
IFunctionInfo.wrap Lib.g_interface_info_find_method(self, name.to_s)
|
43
43
|
end
|
44
44
|
|
45
45
|
def n_signals
|
46
|
-
Lib.g_interface_info_get_n_signals
|
46
|
+
Lib.g_interface_info_get_n_signals self
|
47
47
|
end
|
48
48
|
|
49
49
|
def signal(index)
|
50
|
-
ISignalInfo.wrap Lib.g_interface_info_get_signal(
|
50
|
+
ISignalInfo.wrap Lib.g_interface_info_get_signal(self, index)
|
51
51
|
end
|
52
52
|
|
53
53
|
##
|
@@ -55,33 +55,33 @@ module GObjectIntrospection
|
|
55
55
|
build_finder_method :find_signal
|
56
56
|
|
57
57
|
def n_vfuncs
|
58
|
-
Lib.g_interface_info_get_n_vfuncs
|
58
|
+
Lib.g_interface_info_get_n_vfuncs self
|
59
59
|
end
|
60
60
|
|
61
61
|
def vfunc(index)
|
62
|
-
IVFuncInfo.wrap Lib.g_interface_info_get_vfunc(
|
62
|
+
IVFuncInfo.wrap Lib.g_interface_info_get_vfunc(self, index)
|
63
63
|
end
|
64
64
|
|
65
65
|
##
|
66
66
|
build_array_method :vfuncs
|
67
67
|
|
68
68
|
def find_vfunc(name)
|
69
|
-
IVFuncInfo.wrap Lib.g_interface_info_find_vfunc(
|
69
|
+
IVFuncInfo.wrap Lib.g_interface_info_find_vfunc(self, name)
|
70
70
|
end
|
71
71
|
|
72
72
|
def n_constants
|
73
|
-
Lib.g_interface_info_get_n_constants
|
73
|
+
Lib.g_interface_info_get_n_constants self
|
74
74
|
end
|
75
75
|
|
76
76
|
def constant(index)
|
77
|
-
IConstantInfo.wrap Lib.g_interface_info_get_constant(
|
77
|
+
IConstantInfo.wrap Lib.g_interface_info_get_constant(self, index)
|
78
78
|
end
|
79
79
|
|
80
80
|
##
|
81
81
|
build_array_method :constants
|
82
82
|
|
83
83
|
def iface_struct
|
84
|
-
IStructInfo.wrap Lib.g_interface_info_get_iface_struct(
|
84
|
+
IStructInfo.wrap Lib.g_interface_info_get_iface_struct(self)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -5,53 +5,53 @@ module GObjectIntrospection
|
|
5
5
|
# Represents an object.
|
6
6
|
class IObjectInfo < IRegisteredTypeInfo
|
7
7
|
def type_name
|
8
|
-
Lib.g_object_info_get_type_name
|
8
|
+
Lib.g_object_info_get_type_name self
|
9
9
|
end
|
10
10
|
|
11
11
|
def type_init
|
12
|
-
Lib.g_object_info_get_type_init
|
12
|
+
Lib.g_object_info_get_type_init self
|
13
13
|
end
|
14
14
|
|
15
15
|
def abstract?
|
16
|
-
Lib.g_object_info_get_abstract
|
16
|
+
Lib.g_object_info_get_abstract self
|
17
17
|
end
|
18
18
|
|
19
19
|
def fundamental?
|
20
|
-
Lib.g_object_info_get_fundamental
|
20
|
+
Lib.g_object_info_get_fundamental self
|
21
21
|
end
|
22
22
|
|
23
23
|
def parent
|
24
|
-
IObjectInfo.wrap Lib.g_object_info_get_parent(
|
24
|
+
IObjectInfo.wrap Lib.g_object_info_get_parent(self)
|
25
25
|
end
|
26
26
|
|
27
27
|
def n_interfaces
|
28
|
-
Lib.g_object_info_get_n_interfaces
|
28
|
+
Lib.g_object_info_get_n_interfaces self
|
29
29
|
end
|
30
30
|
|
31
31
|
def interface(index)
|
32
|
-
IInterfaceInfo.wrap Lib.g_object_info_get_interface(
|
32
|
+
IInterfaceInfo.wrap Lib.g_object_info_get_interface(self, index)
|
33
33
|
end
|
34
34
|
|
35
35
|
##
|
36
36
|
build_array_method :interfaces
|
37
37
|
|
38
38
|
def n_fields
|
39
|
-
Lib.g_object_info_get_n_fields
|
39
|
+
Lib.g_object_info_get_n_fields self
|
40
40
|
end
|
41
41
|
|
42
42
|
def field(index)
|
43
|
-
IFieldInfo.wrap Lib.g_object_info_get_field(
|
43
|
+
IFieldInfo.wrap Lib.g_object_info_get_field(self, index)
|
44
44
|
end
|
45
45
|
|
46
46
|
##
|
47
47
|
build_array_method :fields
|
48
48
|
|
49
49
|
def n_properties
|
50
|
-
Lib.g_object_info_get_n_properties
|
50
|
+
Lib.g_object_info_get_n_properties self
|
51
51
|
end
|
52
52
|
|
53
53
|
def property(index)
|
54
|
-
IPropertyInfo.wrap Lib.g_object_info_get_property(
|
54
|
+
IPropertyInfo.wrap Lib.g_object_info_get_property(self, index)
|
55
55
|
end
|
56
56
|
|
57
57
|
def properties
|
@@ -64,26 +64,26 @@ module GObjectIntrospection
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def get_n_methods
|
67
|
-
Lib.g_object_info_get_n_methods
|
67
|
+
Lib.g_object_info_get_n_methods self
|
68
68
|
end
|
69
69
|
|
70
70
|
def get_method(index)
|
71
|
-
IFunctionInfo.wrap Lib.g_object_info_get_method(
|
71
|
+
IFunctionInfo.wrap Lib.g_object_info_get_method(self, index)
|
72
72
|
end
|
73
73
|
|
74
74
|
##
|
75
75
|
build_array_method :get_methods
|
76
76
|
|
77
77
|
def find_method(name)
|
78
|
-
IFunctionInfo.wrap Lib.g_object_info_find_method(
|
78
|
+
IFunctionInfo.wrap Lib.g_object_info_find_method(self, name.to_s)
|
79
79
|
end
|
80
80
|
|
81
81
|
def n_signals
|
82
|
-
Lib.g_object_info_get_n_signals
|
82
|
+
Lib.g_object_info_get_n_signals self
|
83
83
|
end
|
84
84
|
|
85
85
|
def signal(index)
|
86
|
-
ISignalInfo.wrap Lib.g_object_info_get_signal(
|
86
|
+
ISignalInfo.wrap Lib.g_object_info_get_signal(self, index)
|
87
87
|
end
|
88
88
|
|
89
89
|
##
|
@@ -91,31 +91,31 @@ module GObjectIntrospection
|
|
91
91
|
build_finder_method :find_signal
|
92
92
|
|
93
93
|
def n_vfuncs
|
94
|
-
Lib.g_object_info_get_n_vfuncs
|
94
|
+
Lib.g_object_info_get_n_vfuncs self
|
95
95
|
end
|
96
96
|
|
97
97
|
def vfunc(index)
|
98
|
-
IVFuncInfo.wrap Lib.g_object_info_get_vfunc(
|
98
|
+
IVFuncInfo.wrap Lib.g_object_info_get_vfunc(self, index)
|
99
99
|
end
|
100
100
|
|
101
101
|
def find_vfunc(name)
|
102
|
-
IVFuncInfo.wrap Lib.g_object_info_find_vfunc(
|
102
|
+
IVFuncInfo.wrap Lib.g_object_info_find_vfunc(self, name.to_s)
|
103
103
|
end
|
104
104
|
##
|
105
105
|
build_array_method :vfuncs
|
106
106
|
|
107
107
|
def n_constants
|
108
|
-
Lib.g_object_info_get_n_constants
|
108
|
+
Lib.g_object_info_get_n_constants self
|
109
109
|
end
|
110
110
|
|
111
111
|
def constant(index)
|
112
|
-
IConstantInfo.wrap Lib.g_object_info_get_constant(
|
112
|
+
IConstantInfo.wrap Lib.g_object_info_get_constant(self, index)
|
113
113
|
end
|
114
114
|
##
|
115
115
|
build_array_method :constants
|
116
116
|
|
117
117
|
def class_struct
|
118
|
-
IStructInfo.wrap Lib.g_object_info_get_class_struct(
|
118
|
+
IStructInfo.wrap Lib.g_object_info_get_class_struct(self)
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
@@ -5,11 +5,11 @@ module GObjectIntrospection
|
|
5
5
|
# Represents a property of an IObjectInfo or an IInterfaceInfo.
|
6
6
|
class IPropertyInfo < IBaseInfo
|
7
7
|
def property_type
|
8
|
-
ITypeInfo.wrap Lib.g_property_info_get_type(
|
8
|
+
ITypeInfo.wrap Lib.g_property_info_get_type(self)
|
9
9
|
end
|
10
10
|
|
11
11
|
def flags
|
12
|
-
Lib.g_property_info_get_flags
|
12
|
+
Lib.g_property_info_get_flags self
|
13
13
|
end
|
14
14
|
|
15
15
|
def readable?
|
@@ -5,15 +5,15 @@ module GObjectIntrospection
|
|
5
5
|
# Represents a registered type.
|
6
6
|
class IRegisteredTypeInfo < IBaseInfo
|
7
7
|
def type_name
|
8
|
-
Lib.g_registered_type_info_get_type_name
|
8
|
+
Lib.g_registered_type_info_get_type_name self
|
9
9
|
end
|
10
10
|
|
11
11
|
def type_init
|
12
|
-
Lib.g_registered_type_info_get_type_init
|
12
|
+
Lib.g_registered_type_info_get_type_init self
|
13
13
|
end
|
14
14
|
|
15
15
|
def g_type
|
16
|
-
Lib.g_registered_type_info_get_g_type
|
16
|
+
Lib.g_registered_type_info_get_g_type self
|
17
17
|
end
|
18
18
|
|
19
19
|
alias gtype g_type
|
@@ -12,7 +12,11 @@ module GObjectIntrospection
|
|
12
12
|
# This class wraps the GIRepository struct.
|
13
13
|
class IRepository
|
14
14
|
def initialize
|
15
|
-
@
|
15
|
+
@pointer = Lib.g_irepository_get_default
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_ptr
|
19
|
+
@pointer
|
16
20
|
end
|
17
21
|
|
18
22
|
include Singleton
|
@@ -32,18 +36,18 @@ module GObjectIntrospection
|
|
32
36
|
def require(namespace, version = nil, flags = 0)
|
33
37
|
errpp = FFI::MemoryPointer.new(:pointer).write_pointer nil
|
34
38
|
|
35
|
-
Lib.g_irepository_require
|
39
|
+
Lib.g_irepository_require self, namespace, version, flags, errpp
|
36
40
|
|
37
41
|
errp = errpp.read_pointer
|
38
42
|
raise GError.new(errp).message unless errp.null?
|
39
43
|
end
|
40
44
|
|
41
45
|
def n_infos(namespace)
|
42
|
-
Lib.g_irepository_get_n_infos
|
46
|
+
Lib.g_irepository_get_n_infos self, namespace
|
43
47
|
end
|
44
48
|
|
45
49
|
def info(namespace, index)
|
46
|
-
wrap_info Lib.g_irepository_get_info(
|
50
|
+
wrap_info Lib.g_irepository_get_info(self, namespace, index)
|
47
51
|
end
|
48
52
|
|
49
53
|
# Utility method
|
@@ -54,30 +58,32 @@ module GObjectIntrospection
|
|
54
58
|
end
|
55
59
|
|
56
60
|
def find_by_name(namespace, name)
|
57
|
-
wrap_info Lib.g_irepository_find_by_name(
|
61
|
+
wrap_info Lib.g_irepository_find_by_name(self, namespace, name)
|
58
62
|
end
|
59
63
|
|
60
64
|
def find_by_gtype(gtype)
|
61
|
-
raise ArgumentError, "Type #{gtype} is not a valid type" if gtype
|
62
|
-
|
65
|
+
raise ArgumentError, "Type #{gtype} is not a valid type" if gtype == 0
|
66
|
+
|
67
|
+
wrap_info Lib.g_irepository_find_by_gtype(self, gtype)
|
63
68
|
end
|
64
69
|
|
65
70
|
def dependencies(namespace)
|
66
|
-
strv_p = Lib.g_irepository_get_dependencies(
|
71
|
+
strv_p = Lib.g_irepository_get_dependencies(self, namespace)
|
67
72
|
strv = Strv.new strv_p
|
68
73
|
strv.to_a
|
69
74
|
end
|
70
75
|
|
71
76
|
def shared_library(namespace)
|
72
|
-
Lib.g_irepository_get_shared_library
|
77
|
+
Lib.g_irepository_get_shared_library self, namespace
|
73
78
|
end
|
74
79
|
|
75
80
|
def version(namespace)
|
76
|
-
Lib.g_irepository_get_version
|
81
|
+
Lib.g_irepository_get_version self, namespace
|
77
82
|
end
|
78
83
|
|
79
84
|
def self.wrap_ibaseinfo_pointer(ptr)
|
80
85
|
return nil if ptr.null?
|
86
|
+
|
81
87
|
type = Lib.g_base_info_get_type ptr
|
82
88
|
klass = TYPEMAP[type]
|
83
89
|
klass.wrap ptr
|