gir_ffi 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +14 -0
- data/TODO.rdoc +23 -5
- data/lib/ffi-glib/array.rb +14 -15
- data/lib/ffi-glib/container_class_methods.rb +0 -1
- data/lib/ffi-glib/hash_table.rb +3 -4
- data/lib/ffi-glib/ptr_array.rb +12 -4
- data/lib/ffi-glib/sized_array.rb +27 -7
- data/lib/ffi-gobject.rb +14 -15
- data/lib/ffi-gobject/closure.rb +1 -1
- data/lib/ffi-gobject/object.rb +40 -15
- data/lib/ffi-gobject/ruby_closure.rb +0 -1
- data/lib/ffi-gobject/value.rb +45 -21
- data/lib/ffi-gobject_introspection/i_arg_info.rb +4 -0
- data/lib/ffi-gobject_introspection/i_base_info.rb +42 -2
- data/lib/ffi-gobject_introspection/i_callable_info.rb +8 -0
- data/lib/ffi-gobject_introspection/i_enum_info.rb +1 -4
- data/lib/ffi-gobject_introspection/i_interface_info.rb +1 -0
- data/lib/ffi-gobject_introspection/i_object_info.rb +2 -0
- data/lib/ffi-gobject_introspection/i_repository.rb +2 -3
- data/lib/ffi-gobject_introspection/i_struct_info.rb +3 -8
- data/lib/ffi-gobject_introspection/lib.rb +3 -0
- data/lib/gir_ffi-base.rb +3 -1
- data/lib/gir_ffi-base/gir_ffi/struct.rb +27 -0
- data/lib/gir_ffi-base/glib/boolean.rb +13 -1
- data/lib/gir_ffi-base/gobject.rb +7 -0
- data/lib/gir_ffi-base/gobject/lib.rb +0 -2
- data/lib/gir_ffi.rb +1 -3
- data/lib/gir_ffi/arg_helper.rb +4 -85
- data/lib/gir_ffi/builder.rb +5 -5
- data/lib/gir_ffi/builder_helper.rb +7 -0
- data/lib/gir_ffi/builders/argument_builder.rb +132 -0
- data/lib/gir_ffi/{base_argument_builder.rb → builders/base_argument_builder.rb} +32 -41
- data/lib/gir_ffi/builders/base_type_builder.rb +47 -0
- data/lib/gir_ffi/builders/callback_builder.rb +38 -0
- data/lib/gir_ffi/builders/constant_builder.rb +18 -0
- data/lib/gir_ffi/builders/enum_builder.rb +62 -0
- data/lib/gir_ffi/builders/error_argument_builder.rb +18 -0
- data/lib/gir_ffi/builders/field_builder.rb +94 -0
- data/lib/gir_ffi/builders/function_builder.rb +123 -0
- data/lib/gir_ffi/builders/interface_builder.rb +29 -0
- data/lib/gir_ffi/builders/mapping_method_builder.rb +88 -0
- data/lib/gir_ffi/builders/module_builder.rb +124 -0
- data/lib/gir_ffi/{null_argument_builder.rb → builders/null_argument_builder.rb} +0 -0
- data/lib/gir_ffi/builders/null_builder.rb +11 -0
- data/lib/gir_ffi/builders/object_builder.rb +123 -0
- data/lib/gir_ffi/{builder/property.rb → builders/property_builder.rb} +0 -0
- data/lib/gir_ffi/builders/registered_type_builder.rb +50 -0
- data/lib/gir_ffi/builders/return_value_builder.rb +68 -0
- data/lib/gir_ffi/builders/signal_builder.rb +91 -0
- data/lib/gir_ffi/builders/struct_builder.rb +35 -0
- data/lib/gir_ffi/builders/type_builder.rb +40 -0
- data/lib/gir_ffi/builders/unintrospectable_builder.rb +35 -0
- data/lib/gir_ffi/builders/union_builder.rb +34 -0
- data/lib/gir_ffi/builders/user_defined_builder.rb +103 -0
- data/lib/gir_ffi/builders/with_layout.rb +55 -0
- data/lib/gir_ffi/builders/with_methods.rb +44 -0
- data/lib/gir_ffi/callback_base.rb +31 -0
- data/lib/gir_ffi/class_base.rb +16 -10
- data/lib/gir_ffi/enum_base.rb +8 -4
- data/lib/gir_ffi/ffi_ext/pointer.rb +19 -2
- data/lib/gir_ffi/in_out_pointer.rb +38 -39
- data/lib/gir_ffi/in_pointer.rb +33 -18
- data/lib/gir_ffi/info_ext.rb +0 -4
- data/lib/gir_ffi/info_ext/i_arg_info.rb +0 -18
- data/lib/gir_ffi/info_ext/i_callable_info.rb +2 -1
- data/lib/gir_ffi/info_ext/i_registered_type_info.rb +6 -8
- data/lib/gir_ffi/info_ext/i_signal_info.rb +6 -21
- data/lib/gir_ffi/info_ext/i_type_info.rb +54 -29
- data/lib/gir_ffi/info_ext/safe_constant_name.rb +8 -1
- data/lib/gir_ffi/interface_base.rb +1 -1
- data/lib/gir_ffi/module_base.rb +5 -1
- data/lib/gir_ffi/object_base.rb +5 -1
- data/lib/gir_ffi/setter_argument_info.rb +4 -0
- data/lib/gir_ffi/signal_base.rb +21 -0
- data/lib/gir_ffi/struct_base.rb +24 -0
- data/lib/gir_ffi/type_base.rb +11 -0
- data/lib/gir_ffi/type_map.rb +4 -2
- data/lib/gir_ffi/union_base.rb +24 -0
- data/lib/gir_ffi/version.rb +1 -1
- data/tasks/test.rake +73 -7
- data/test/base_test_helper.rb +3 -19
- data/test/ffi-glib/array_test.rb +6 -0
- data/test/ffi-glib/ptr_array_test.rb +13 -0
- data/test/ffi-glib/ruby_closure_test.rb +7 -7
- data/test/ffi-glib/sized_array_test.rb +2 -2
- data/test/ffi-gobject/gobject_test.rb +3 -12
- data/test/ffi-gobject/object_test.rb +33 -2
- data/test/ffi-gobject/value_test.rb +114 -1
- data/test/ffi-gobject_introspection/i_enum_info_test.rb +2 -2
- data/test/ffi-gobject_introspection/i_object_info_test.rb +3 -3
- data/test/ffi-gobject_introspection/i_repository_test.rb +26 -21
- data/test/ffi-gobject_test.rb +14 -14
- data/test/gir_ffi-base/glib/boolean_test.rb +6 -0
- data/test/gir_ffi/arg_helper_test.rb +2 -122
- data/test/gir_ffi/builder_test.rb +67 -204
- data/test/gir_ffi/{argument_builder_test.rb → builders/argument_builder_test.rb} +230 -108
- data/test/gir_ffi/builders/base_argument_builder_test.rb +5 -0
- data/test/gir_ffi/builders/callback_builder_test.rb +50 -0
- data/test/gir_ffi/builders/constant_builder_test.rb +4 -0
- data/test/gir_ffi/{builder/type/enum_test.rb → builders/enum_builder_test.rb} +2 -3
- data/test/gir_ffi/builders/field_builder_test.rb +94 -0
- data/test/gir_ffi/{function_builder_test.rb → builders/function_builder_test.rb} +43 -24
- data/test/gir_ffi/{builder/type/interface_test.rb → builders/interface_builder_test.rb} +2 -2
- data/test/gir_ffi/{builder/module_test.rb → builders/module_builder_test.rb} +12 -13
- data/test/gir_ffi/{builder/type/object_test.rb → builders/object_builder_test.rb} +9 -9
- data/test/gir_ffi/{return_value_builder_test.rb → builders/return_value_builder_test.rb} +94 -58
- data/test/gir_ffi/builders/signal_builder_test.rb +62 -0
- data/test/gir_ffi/{builder/type/struct_test.rb → builders/struct_builder_test.rb} +36 -19
- data/test/gir_ffi/{builder/type/unintrospectable_test.rb → builders/unintrospectable_builder_test.rb} +3 -3
- data/test/gir_ffi/builders/union_builder_test.rb +29 -0
- data/test/gir_ffi/{builder/type/user_defined_test.rb → builders/user_defined_builder_test.rb} +2 -2
- data/test/gir_ffi/callback_base_test.rb +11 -0
- data/test/gir_ffi/class_base_test.rb +22 -22
- data/test/gir_ffi/ffi_ext/pointer_test.rb +18 -0
- data/test/gir_ffi/in_out_pointer_test.rb +0 -7
- data/test/gir_ffi/in_pointer_test.rb +27 -3
- data/test/gir_ffi/info_ext/i_signal_info_test.rb +16 -44
- data/test/gir_ffi/info_ext/i_type_info_test.rb +315 -74
- data/test/gir_ffi/info_ext/safe_constant_name_test.rb +6 -0
- data/test/gir_ffi/interface_base_test.rb +3 -5
- data/test/gir_ffi/object_base_test.rb +10 -6
- data/test/gir_ffi/type_map_test.rb +2 -2
- data/test/gir_ffi/unintrospectable_type_info_test.rb +2 -2
- data/test/gir_ffi_test_helper.rb +12 -4
- data/test/integration/generated_gimarshallingtests_test.rb +436 -76
- data/test/integration/generated_gio_test.rb +5 -11
- data/test/integration/generated_gobject_test.rb +8 -0
- data/test/integration/generated_regress_test.rb +755 -309
- data/test/integration/generated_secret_test.rb +2 -1
- metadata +73 -72
- data/lib/ffi-gobject/ruby_style.rb +0 -23
- data/lib/gir_ffi/argument_builder.rb +0 -154
- data/lib/gir_ffi/builder/field.rb +0 -60
- data/lib/gir_ffi/builder/module.rb +0 -127
- data/lib/gir_ffi/builder/type.rb +0 -39
- data/lib/gir_ffi/builder/type/base.rb +0 -48
- data/lib/gir_ffi/builder/type/callback.rb +0 -30
- data/lib/gir_ffi/builder/type/constant.rb +0 -22
- data/lib/gir_ffi/builder/type/enum.rb +0 -66
- data/lib/gir_ffi/builder/type/interface.rb +0 -33
- data/lib/gir_ffi/builder/type/object.rb +0 -134
- data/lib/gir_ffi/builder/type/registered_type.rb +0 -62
- data/lib/gir_ffi/builder/type/struct.rb +0 -34
- data/lib/gir_ffi/builder/type/unintrospectable.rb +0 -39
- data/lib/gir_ffi/builder/type/union.rb +0 -34
- data/lib/gir_ffi/builder/type/user_defined.rb +0 -107
- data/lib/gir_ffi/builder/type/with_layout.rb +0 -62
- data/lib/gir_ffi/builder/type/with_methods.rb +0 -64
- data/lib/gir_ffi/callback.rb +0 -72
- data/lib/gir_ffi/callback_helper.rb +0 -11
- data/lib/gir_ffi/error_argument_builder.rb +0 -17
- data/lib/gir_ffi/function_builder.rb +0 -112
- data/lib/gir_ffi/info_ext/i_enum_info.rb +0 -11
- data/lib/gir_ffi/info_ext/i_object_info.rb +0 -11
- data/lib/gir_ffi/info_ext/i_struct_info.rb +0 -11
- data/lib/gir_ffi/info_ext/i_union_info.rb +0 -12
- data/lib/gir_ffi/return_value_builder.rb +0 -81
- data/test/ffi-gobject/ruby_style_test.rb +0 -38
- data/test/gir_ffi/base_argument_builder_test.rb +0 -13
- data/test/gir_ffi/builder/type/callback_test.rb +0 -6
- data/test/gir_ffi/builder/type/constant_test.rb +0 -4
- data/test/gir_ffi/builder/type/union_test.rb +0 -12
- data/test/gir_ffi/callback_helper_test.rb +0 -10
- data/test/gir_ffi/callback_test.rb +0 -49
- data/test/gir_ffi/info_ext/i_arg_info_test.rb +0 -39
- data/test/gir_ffi/info_ext/i_object_info_test.rb +0 -14
@@ -8,7 +8,8 @@ describe "The generated Secret module" do
|
|
8
8
|
rescue
|
9
9
|
skip "No GIR data for Secret available"
|
10
10
|
end
|
11
|
-
Secret::Schema.new("foo", :none, "bar" => :string)
|
11
|
+
instance = Secret::Schema.new("foo", :none, "bar" => :string)
|
12
|
+
instance.must_be_instance_of Secret::Schema
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gir_ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 10.
|
85
|
+
version: '10.1'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 10.
|
93
|
+
version: '10.1'
|
94
94
|
description:
|
95
95
|
email:
|
96
96
|
- matijs@matijs.net
|
@@ -106,49 +106,56 @@ files:
|
|
106
106
|
- lib/ffi-gobject_introspection.rb
|
107
107
|
- lib/gir_ffi.rb
|
108
108
|
- lib/gir_ffi/lib_c.rb
|
109
|
-
- lib/gir_ffi/builder/type/constant.rb
|
110
|
-
- lib/gir_ffi/builder/type/union.rb
|
111
|
-
- lib/gir_ffi/builder/type/base.rb
|
112
|
-
- lib/gir_ffi/builder/type/callback.rb
|
113
|
-
- lib/gir_ffi/builder/type/user_defined.rb
|
114
|
-
- lib/gir_ffi/builder/type/unintrospectable.rb
|
115
|
-
- lib/gir_ffi/builder/type/object.rb
|
116
|
-
- lib/gir_ffi/builder/type/with_methods.rb
|
117
|
-
- lib/gir_ffi/builder/type/with_layout.rb
|
118
|
-
- lib/gir_ffi/builder/type/enum.rb
|
119
|
-
- lib/gir_ffi/builder/type/interface.rb
|
120
|
-
- lib/gir_ffi/builder/type/registered_type.rb
|
121
|
-
- lib/gir_ffi/builder/type/struct.rb
|
122
|
-
- lib/gir_ffi/builder/field.rb
|
123
|
-
- lib/gir_ffi/builder/type.rb
|
124
|
-
- lib/gir_ffi/builder/module.rb
|
125
|
-
- lib/gir_ffi/builder/property.rb
|
126
109
|
- lib/gir_ffi/method_stubber.rb
|
127
110
|
- lib/gir_ffi/arg_helper.rb
|
128
111
|
- lib/gir_ffi/info_ext.rb
|
112
|
+
- lib/gir_ffi/struct_base.rb
|
129
113
|
- lib/gir_ffi/allocation_helper.rb
|
130
114
|
- lib/gir_ffi/ffi_ext.rb
|
131
115
|
- lib/gir_ffi/type_map.rb
|
116
|
+
- lib/gir_ffi/signal_base.rb
|
132
117
|
- lib/gir_ffi/zero_terminated.rb
|
133
118
|
- lib/gir_ffi/unintrospectable_type_info.rb
|
134
|
-
- lib/gir_ffi/
|
119
|
+
- lib/gir_ffi/builders/enum_builder.rb
|
120
|
+
- lib/gir_ffi/builders/registered_type_builder.rb
|
121
|
+
- lib/gir_ffi/builders/constant_builder.rb
|
122
|
+
- lib/gir_ffi/builders/mapping_method_builder.rb
|
123
|
+
- lib/gir_ffi/builders/struct_builder.rb
|
124
|
+
- lib/gir_ffi/builders/argument_builder.rb
|
125
|
+
- lib/gir_ffi/builders/error_argument_builder.rb
|
126
|
+
- lib/gir_ffi/builders/signal_builder.rb
|
127
|
+
- lib/gir_ffi/builders/type_builder.rb
|
128
|
+
- lib/gir_ffi/builders/union_builder.rb
|
129
|
+
- lib/gir_ffi/builders/return_value_builder.rb
|
130
|
+
- lib/gir_ffi/builders/property_builder.rb
|
131
|
+
- lib/gir_ffi/builders/unintrospectable_builder.rb
|
132
|
+
- lib/gir_ffi/builders/interface_builder.rb
|
133
|
+
- lib/gir_ffi/builders/with_methods.rb
|
134
|
+
- lib/gir_ffi/builders/with_layout.rb
|
135
|
+
- lib/gir_ffi/builders/callback_builder.rb
|
136
|
+
- lib/gir_ffi/builders/null_argument_builder.rb
|
137
|
+
- lib/gir_ffi/builders/user_defined_builder.rb
|
138
|
+
- lib/gir_ffi/builders/null_builder.rb
|
139
|
+
- lib/gir_ffi/builders/field_builder.rb
|
140
|
+
- lib/gir_ffi/builders/module_builder.rb
|
141
|
+
- lib/gir_ffi/builders/base_argument_builder.rb
|
142
|
+
- lib/gir_ffi/builders/base_type_builder.rb
|
143
|
+
- lib/gir_ffi/builders/object_builder.rb
|
144
|
+
- lib/gir_ffi/builders/function_builder.rb
|
135
145
|
- lib/gir_ffi/user_defined_property_info.rb
|
136
|
-
- lib/gir_ffi/argument_builder.rb
|
137
|
-
- lib/gir_ffi/error_argument_builder.rb
|
138
146
|
- lib/gir_ffi/ffi_ext/pointer.rb
|
139
147
|
- lib/gir_ffi/setter_argument_info.rb
|
140
148
|
- lib/gir_ffi/builder_helper.rb
|
141
149
|
- lib/gir_ffi/variable_name_generator.rb
|
142
150
|
- lib/gir_ffi/in_pointer.rb
|
143
151
|
- lib/gir_ffi/enum_base.rb
|
144
|
-
- lib/gir_ffi/
|
152
|
+
- lib/gir_ffi/callback_base.rb
|
153
|
+
- lib/gir_ffi/type_base.rb
|
154
|
+
- lib/gir_ffi/union_base.rb
|
145
155
|
- lib/gir_ffi/in_out_pointer.rb
|
146
156
|
- lib/gir_ffi/version.rb
|
147
|
-
- lib/gir_ffi/null_argument_builder.rb
|
148
|
-
- lib/gir_ffi/callback_helper.rb
|
149
157
|
- lib/gir_ffi/builder.rb
|
150
158
|
- lib/gir_ffi/interface_base.rb
|
151
|
-
- lib/gir_ffi/info_ext/i_struct_info.rb
|
152
159
|
- lib/gir_ffi/info_ext/i_arg_info.rb
|
153
160
|
- lib/gir_ffi/info_ext/i_type_info.rb
|
154
161
|
- lib/gir_ffi/info_ext/i_function_info.rb
|
@@ -156,23 +163,19 @@ files:
|
|
156
163
|
- lib/gir_ffi/info_ext/i_field_info.rb
|
157
164
|
- lib/gir_ffi/info_ext/safe_constant_name.rb
|
158
165
|
- lib/gir_ffi/info_ext/i_property_info.rb
|
159
|
-
- lib/gir_ffi/info_ext/i_enum_info.rb
|
160
166
|
- lib/gir_ffi/info_ext/i_signal_info.rb
|
161
167
|
- lib/gir_ffi/info_ext/safe_function_name.rb
|
162
|
-
- lib/gir_ffi/info_ext/i_union_info.rb
|
163
|
-
- lib/gir_ffi/info_ext/i_object_info.rb
|
164
168
|
- lib/gir_ffi/info_ext/i_registered_type_info.rb
|
165
169
|
- lib/gir_ffi/module_base.rb
|
166
|
-
- lib/gir_ffi/base_argument_builder.rb
|
167
170
|
- lib/gir_ffi/user_defined_type_info.rb
|
168
171
|
- lib/gir_ffi/class_base.rb
|
169
172
|
- lib/gir_ffi/object_base.rb
|
170
|
-
- lib/gir_ffi/function_builder.rb
|
171
173
|
- lib/gir_ffi-base/gir_ffi/library.rb
|
174
|
+
- lib/gir_ffi-base/gir_ffi/struct.rb
|
172
175
|
- lib/gir_ffi-base/gobject/lib.rb
|
176
|
+
- lib/gir_ffi-base/gobject.rb
|
173
177
|
- lib/gir_ffi-base/glib/boolean.rb
|
174
178
|
- lib/gir_ffi-base/glib/strv.rb
|
175
|
-
- lib/ffi-gobject/ruby_style.rb
|
176
179
|
- lib/ffi-gobject/ruby_closure.rb
|
177
180
|
- lib/ffi-gobject/base.rb
|
178
181
|
- lib/ffi-gobject/object.rb
|
@@ -229,16 +232,7 @@ files:
|
|
229
232
|
- test/integration/generated_pango_test.rb
|
230
233
|
- test/integration/generated_secret_test.rb
|
231
234
|
- test/integration/generated_gobject_test.rb
|
232
|
-
- test/gir_ffi/
|
233
|
-
- test/gir_ffi/builder/type/enum_test.rb
|
234
|
-
- test/gir_ffi/builder/type/constant_test.rb
|
235
|
-
- test/gir_ffi/builder/type/object_test.rb
|
236
|
-
- test/gir_ffi/builder/type/struct_test.rb
|
237
|
-
- test/gir_ffi/builder/type/callback_test.rb
|
238
|
-
- test/gir_ffi/builder/type/union_test.rb
|
239
|
-
- test/gir_ffi/builder/type/unintrospectable_test.rb
|
240
|
-
- test/gir_ffi/builder/type/interface_test.rb
|
241
|
-
- test/gir_ffi/builder/module_test.rb
|
235
|
+
- test/gir_ffi/callback_base_test.rb
|
242
236
|
- test/gir_ffi/user_defined_property_info_test.rb
|
243
237
|
- test/gir_ffi/zero_terminated_test.rb
|
244
238
|
- test/gir_ffi/object_base_test.rb
|
@@ -246,24 +240,33 @@ files:
|
|
246
240
|
- test/gir_ffi/in_pointer_test.rb
|
247
241
|
- test/gir_ffi/in_out_pointer_test.rb
|
248
242
|
- test/gir_ffi/arg_helper_test.rb
|
249
|
-
- test/gir_ffi/
|
243
|
+
- test/gir_ffi/builders/field_builder_test.rb
|
244
|
+
- test/gir_ffi/builders/signal_builder_test.rb
|
245
|
+
- test/gir_ffi/builders/enum_builder_test.rb
|
246
|
+
- test/gir_ffi/builders/constant_builder_test.rb
|
247
|
+
- test/gir_ffi/builders/unintrospectable_builder_test.rb
|
248
|
+
- test/gir_ffi/builders/function_builder_test.rb
|
249
|
+
- test/gir_ffi/builders/base_argument_builder_test.rb
|
250
|
+
- test/gir_ffi/builders/struct_builder_test.rb
|
251
|
+
- test/gir_ffi/builders/union_builder_test.rb
|
252
|
+
- test/gir_ffi/builders/callback_builder_test.rb
|
253
|
+
- test/gir_ffi/builders/argument_builder_test.rb
|
254
|
+
- test/gir_ffi/builders/return_value_builder_test.rb
|
255
|
+
- test/gir_ffi/builders/interface_builder_test.rb
|
256
|
+
- test/gir_ffi/builders/object_builder_test.rb
|
257
|
+
- test/gir_ffi/builders/module_builder_test.rb
|
258
|
+
- test/gir_ffi/builders/user_defined_builder_test.rb
|
250
259
|
- test/gir_ffi/variable_name_generator_test.rb
|
251
|
-
- test/gir_ffi/
|
252
|
-
- test/gir_ffi/callback_test.rb
|
253
|
-
- test/gir_ffi/base_argument_builder_test.rb
|
260
|
+
- test/gir_ffi/ffi_ext/pointer_test.rb
|
254
261
|
- test/gir_ffi/class_base_test.rb
|
255
262
|
- test/gir_ffi/type_map_test.rb
|
256
|
-
- test/gir_ffi/argument_builder_test.rb
|
257
|
-
- test/gir_ffi/return_value_builder_test.rb
|
258
263
|
- test/gir_ffi/user_defined_type_info_test.rb
|
259
264
|
- test/gir_ffi/unintrospectable_type_info_test.rb
|
260
265
|
- test/gir_ffi/info_ext/i_callable_info_test.rb
|
261
266
|
- test/gir_ffi/info_ext/i_type_info_test.rb
|
262
|
-
- test/gir_ffi/info_ext/i_arg_info_test.rb
|
263
267
|
- test/gir_ffi/info_ext/i_signal_info_test.rb
|
264
268
|
- test/gir_ffi/info_ext/safe_constant_name_test.rb
|
265
269
|
- test/gir_ffi/info_ext/safe_function_name_test.rb
|
266
|
-
- test/gir_ffi/info_ext/i_object_info_test.rb
|
267
270
|
- test/gir_ffi/info_ext/i_field_info_test.rb
|
268
271
|
- test/gir_ffi/info_ext/i_function_info_test.rb
|
269
272
|
- test/gir_ffi/interface_base_test.rb
|
@@ -273,7 +276,6 @@ files:
|
|
273
276
|
- test/ffi-gobject/object_test.rb
|
274
277
|
- test/ffi-gobject/gobject_test.rb
|
275
278
|
- test/ffi-gobject/value_test.rb
|
276
|
-
- test/ffi-gobject/ruby_style_test.rb
|
277
279
|
- test/base_test_helper.rb
|
278
280
|
- test/ffi-glib/s_list_test.rb
|
279
281
|
- test/ffi-glib/hash_table_test.rb
|
@@ -350,7 +352,6 @@ test_files:
|
|
350
352
|
- test/ffi-gobject/gobject_test.rb
|
351
353
|
- test/ffi-gobject/object_class_test.rb
|
352
354
|
- test/ffi-gobject/object_test.rb
|
353
|
-
- test/ffi-gobject/ruby_style_test.rb
|
354
355
|
- test/ffi-gobject/value_test.rb
|
355
356
|
- test/ffi-gobject_introspection/i_base_info_test.rb
|
356
357
|
- test/ffi-gobject_introspection/i_constant_info_test.rb
|
@@ -363,37 +364,37 @@ test_files:
|
|
363
364
|
- test/gir_ffi-base/glib/boolean_test.rb
|
364
365
|
- test/gir_ffi-base/glib/strv_test.rb
|
365
366
|
- test/gir_ffi/arg_helper_test.rb
|
366
|
-
- test/gir_ffi/argument_builder_test.rb
|
367
|
-
- test/gir_ffi/base_argument_builder_test.rb
|
368
|
-
- test/gir_ffi/builder/module_test.rb
|
369
|
-
- test/gir_ffi/builder/type/callback_test.rb
|
370
|
-
- test/gir_ffi/builder/type/constant_test.rb
|
371
|
-
- test/gir_ffi/builder/type/enum_test.rb
|
372
|
-
- test/gir_ffi/builder/type/interface_test.rb
|
373
|
-
- test/gir_ffi/builder/type/object_test.rb
|
374
|
-
- test/gir_ffi/builder/type/struct_test.rb
|
375
|
-
- test/gir_ffi/builder/type/unintrospectable_test.rb
|
376
|
-
- test/gir_ffi/builder/type/union_test.rb
|
377
|
-
- test/gir_ffi/builder/type/user_defined_test.rb
|
378
367
|
- test/gir_ffi/builder_test.rb
|
379
|
-
- test/gir_ffi/
|
380
|
-
- test/gir_ffi/
|
368
|
+
- test/gir_ffi/builders/argument_builder_test.rb
|
369
|
+
- test/gir_ffi/builders/base_argument_builder_test.rb
|
370
|
+
- test/gir_ffi/builders/callback_builder_test.rb
|
371
|
+
- test/gir_ffi/builders/constant_builder_test.rb
|
372
|
+
- test/gir_ffi/builders/enum_builder_test.rb
|
373
|
+
- test/gir_ffi/builders/field_builder_test.rb
|
374
|
+
- test/gir_ffi/builders/function_builder_test.rb
|
375
|
+
- test/gir_ffi/builders/interface_builder_test.rb
|
376
|
+
- test/gir_ffi/builders/module_builder_test.rb
|
377
|
+
- test/gir_ffi/builders/object_builder_test.rb
|
378
|
+
- test/gir_ffi/builders/return_value_builder_test.rb
|
379
|
+
- test/gir_ffi/builders/signal_builder_test.rb
|
380
|
+
- test/gir_ffi/builders/struct_builder_test.rb
|
381
|
+
- test/gir_ffi/builders/unintrospectable_builder_test.rb
|
382
|
+
- test/gir_ffi/builders/union_builder_test.rb
|
383
|
+
- test/gir_ffi/builders/user_defined_builder_test.rb
|
384
|
+
- test/gir_ffi/callback_base_test.rb
|
381
385
|
- test/gir_ffi/class_base_test.rb
|
382
|
-
- test/gir_ffi/
|
386
|
+
- test/gir_ffi/ffi_ext/pointer_test.rb
|
383
387
|
- test/gir_ffi/in_out_pointer_test.rb
|
384
388
|
- test/gir_ffi/in_pointer_test.rb
|
385
|
-
- test/gir_ffi/info_ext/i_arg_info_test.rb
|
386
389
|
- test/gir_ffi/info_ext/i_callable_info_test.rb
|
387
390
|
- test/gir_ffi/info_ext/i_field_info_test.rb
|
388
391
|
- test/gir_ffi/info_ext/i_function_info_test.rb
|
389
|
-
- test/gir_ffi/info_ext/i_object_info_test.rb
|
390
392
|
- test/gir_ffi/info_ext/i_signal_info_test.rb
|
391
393
|
- test/gir_ffi/info_ext/i_type_info_test.rb
|
392
394
|
- test/gir_ffi/info_ext/safe_constant_name_test.rb
|
393
395
|
- test/gir_ffi/info_ext/safe_function_name_test.rb
|
394
396
|
- test/gir_ffi/interface_base_test.rb
|
395
397
|
- test/gir_ffi/object_base_test.rb
|
396
|
-
- test/gir_ffi/return_value_builder_test.rb
|
397
398
|
- test/gir_ffi/type_map_test.rb
|
398
399
|
- test/gir_ffi/unintrospectable_type_info_test.rb
|
399
400
|
- test/gir_ffi/user_defined_property_info_test.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module GObject
|
2
|
-
|
3
|
-
module RubyStyle
|
4
|
-
|
5
|
-
# TODO: Generate accessor methods from GIR at class definition time
|
6
|
-
def method_missing(method, *args)
|
7
|
-
if respond_to?("get_#{method}")
|
8
|
-
return send("get_#{method}", *args)
|
9
|
-
end
|
10
|
-
if method.to_s =~ /(.*)=$/ && respond_to?("set_#{$1}")
|
11
|
-
return send("set_#{$1}", *args)
|
12
|
-
end
|
13
|
-
super
|
14
|
-
end
|
15
|
-
|
16
|
-
# TODO: Move to definition of GObject::Object
|
17
|
-
def signal_connect(event, &block)
|
18
|
-
GObject.signal_connect(self, event, &block)
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
@@ -1,154 +0,0 @@
|
|
1
|
-
require 'gir_ffi/base_argument_builder'
|
2
|
-
|
3
|
-
module GirFFI
|
4
|
-
# Implements building pre- and post-processing statements for arguments.
|
5
|
-
class ArgumentBuilder < BaseArgumentBuilder
|
6
|
-
def initialize var_gen, arginfo
|
7
|
-
super var_gen, arginfo.name, arginfo.argument_type, arginfo.direction
|
8
|
-
@arginfo = arginfo
|
9
|
-
end
|
10
|
-
|
11
|
-
def inarg
|
12
|
-
if has_input_value?
|
13
|
-
@array_arg.nil? ? @name : nil
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def retname
|
18
|
-
if has_output_value?
|
19
|
-
@retname ||= @var_gen.new_var
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def pre
|
24
|
-
pr = []
|
25
|
-
if has_input_value?
|
26
|
-
pr << fixed_array_size_check if needs_size_check?
|
27
|
-
pr << array_length_assignment if is_array_length_parameter?
|
28
|
-
end
|
29
|
-
pr << set_function_call_argument
|
30
|
-
pr
|
31
|
-
end
|
32
|
-
|
33
|
-
def post
|
34
|
-
if has_output_value?
|
35
|
-
value = output_value
|
36
|
-
["#{retname} = #{value}"]
|
37
|
-
else
|
38
|
-
[]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def output_value
|
45
|
-
if is_caller_allocated_object?
|
46
|
-
callarg
|
47
|
-
elsif needs_outgoing_parameter_conversion?
|
48
|
-
case specialized_type_tag
|
49
|
-
when :enum, :flags
|
50
|
-
"#{argument_class_name}[#{output_conversion_arguments}]"
|
51
|
-
when :utf8
|
52
|
-
"ArgHelper.ptr_to_utf8 #{callarg}.to_value"
|
53
|
-
else
|
54
|
-
"#{argument_class_name}.wrap(#{output_conversion_arguments})"
|
55
|
-
end
|
56
|
-
else
|
57
|
-
"#{callarg}.to_value"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def is_array_length_parameter?
|
62
|
-
@array_arg
|
63
|
-
end
|
64
|
-
|
65
|
-
def needs_size_check?
|
66
|
-
specialized_type_tag == :c && type_info.array_fixed_size > -1
|
67
|
-
end
|
68
|
-
|
69
|
-
def fixed_array_size_check
|
70
|
-
size = type_info.array_fixed_size
|
71
|
-
"GirFFI::ArgHelper.check_fixed_array_size #{size}, #{@name}, \"#{@name}\""
|
72
|
-
end
|
73
|
-
|
74
|
-
def has_output_value?
|
75
|
-
@direction == :inout || @direction == :out
|
76
|
-
end
|
77
|
-
|
78
|
-
def has_input_value?
|
79
|
-
@direction == :inout || @direction == :in
|
80
|
-
end
|
81
|
-
|
82
|
-
def array_length_assignment
|
83
|
-
arrname = @array_arg.name
|
84
|
-
"#{@name} = #{arrname}.nil? ? 0 : #{arrname}.length"
|
85
|
-
end
|
86
|
-
|
87
|
-
def set_function_call_argument
|
88
|
-
value = if @direction == :out
|
89
|
-
if is_caller_allocated_object?
|
90
|
-
if specialized_type_tag == :array
|
91
|
-
"#{argument_class_name}.new #{elm_t}"
|
92
|
-
else
|
93
|
-
"#{argument_class_name}.new"
|
94
|
-
end
|
95
|
-
else
|
96
|
-
"GirFFI::InOutPointer.for #{specialized_type_tag.inspect}"
|
97
|
-
end
|
98
|
-
else
|
99
|
-
if needs_ingoing_parameter_conversion?
|
100
|
-
ingoing_parameter_conversion
|
101
|
-
else
|
102
|
-
@name
|
103
|
-
end
|
104
|
-
end
|
105
|
-
"#{callarg} = #{value}"
|
106
|
-
end
|
107
|
-
|
108
|
-
def is_caller_allocated_object?
|
109
|
-
[ :struct, :array ].include?(specialized_type_tag) &&
|
110
|
-
@arginfo.caller_allocates?
|
111
|
-
end
|
112
|
-
|
113
|
-
def needs_outgoing_parameter_conversion?
|
114
|
-
[ :array, :c, :enum, :error, :flags, :ghash, :glist, :gslist, :object,
|
115
|
-
:ptr_array, :struct, :strv, :utf8 ].include?(specialized_type_tag)
|
116
|
-
end
|
117
|
-
|
118
|
-
def needs_ingoing_parameter_conversion?
|
119
|
-
@direction == :inout ||
|
120
|
-
[ :array, :c, :callback, :ghash, :glist, :gslist, :object, :ptr_array,
|
121
|
-
:struct, :strv, :utf8, :void, :zero_terminated ].include?(specialized_type_tag)
|
122
|
-
end
|
123
|
-
|
124
|
-
def ingoing_parameter_conversion
|
125
|
-
case specialized_type_tag
|
126
|
-
when :enum, :flags
|
127
|
-
base = "#{argument_class_name}[#{parameter_conversion_arguments}]"
|
128
|
-
when :array, :c, :callback, :ghash, :glist, :gslist, :object, :ptr_array,
|
129
|
-
:struct, :strv, :utf8, :void, :zero_terminated
|
130
|
-
base = "#{argument_class_name}.from(#{parameter_conversion_arguments})"
|
131
|
-
else
|
132
|
-
base = "#{parameter_conversion_arguments}"
|
133
|
-
end
|
134
|
-
|
135
|
-
if has_output_value?
|
136
|
-
"GirFFI::InOutPointer.from #{specialized_type_tag.inspect}, #{base}"
|
137
|
-
else
|
138
|
-
base
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
def output_conversion_arguments
|
143
|
-
if specialized_type_tag == :c
|
144
|
-
"#{subtype_tag_or_class_name}, #{array_size}, #{callarg}.to_value"
|
145
|
-
else
|
146
|
-
conversion_arguments "#{callarg}.to_value"
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
def parameter_conversion_arguments
|
151
|
-
conversion_arguments @name
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|