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.
Files changed (166) hide show
  1. data/History.txt +14 -0
  2. data/TODO.rdoc +23 -5
  3. data/lib/ffi-glib/array.rb +14 -15
  4. data/lib/ffi-glib/container_class_methods.rb +0 -1
  5. data/lib/ffi-glib/hash_table.rb +3 -4
  6. data/lib/ffi-glib/ptr_array.rb +12 -4
  7. data/lib/ffi-glib/sized_array.rb +27 -7
  8. data/lib/ffi-gobject.rb +14 -15
  9. data/lib/ffi-gobject/closure.rb +1 -1
  10. data/lib/ffi-gobject/object.rb +40 -15
  11. data/lib/ffi-gobject/ruby_closure.rb +0 -1
  12. data/lib/ffi-gobject/value.rb +45 -21
  13. data/lib/ffi-gobject_introspection/i_arg_info.rb +4 -0
  14. data/lib/ffi-gobject_introspection/i_base_info.rb +42 -2
  15. data/lib/ffi-gobject_introspection/i_callable_info.rb +8 -0
  16. data/lib/ffi-gobject_introspection/i_enum_info.rb +1 -4
  17. data/lib/ffi-gobject_introspection/i_interface_info.rb +1 -0
  18. data/lib/ffi-gobject_introspection/i_object_info.rb +2 -0
  19. data/lib/ffi-gobject_introspection/i_repository.rb +2 -3
  20. data/lib/ffi-gobject_introspection/i_struct_info.rb +3 -8
  21. data/lib/ffi-gobject_introspection/lib.rb +3 -0
  22. data/lib/gir_ffi-base.rb +3 -1
  23. data/lib/gir_ffi-base/gir_ffi/struct.rb +27 -0
  24. data/lib/gir_ffi-base/glib/boolean.rb +13 -1
  25. data/lib/gir_ffi-base/gobject.rb +7 -0
  26. data/lib/gir_ffi-base/gobject/lib.rb +0 -2
  27. data/lib/gir_ffi.rb +1 -3
  28. data/lib/gir_ffi/arg_helper.rb +4 -85
  29. data/lib/gir_ffi/builder.rb +5 -5
  30. data/lib/gir_ffi/builder_helper.rb +7 -0
  31. data/lib/gir_ffi/builders/argument_builder.rb +132 -0
  32. data/lib/gir_ffi/{base_argument_builder.rb → builders/base_argument_builder.rb} +32 -41
  33. data/lib/gir_ffi/builders/base_type_builder.rb +47 -0
  34. data/lib/gir_ffi/builders/callback_builder.rb +38 -0
  35. data/lib/gir_ffi/builders/constant_builder.rb +18 -0
  36. data/lib/gir_ffi/builders/enum_builder.rb +62 -0
  37. data/lib/gir_ffi/builders/error_argument_builder.rb +18 -0
  38. data/lib/gir_ffi/builders/field_builder.rb +94 -0
  39. data/lib/gir_ffi/builders/function_builder.rb +123 -0
  40. data/lib/gir_ffi/builders/interface_builder.rb +29 -0
  41. data/lib/gir_ffi/builders/mapping_method_builder.rb +88 -0
  42. data/lib/gir_ffi/builders/module_builder.rb +124 -0
  43. data/lib/gir_ffi/{null_argument_builder.rb → builders/null_argument_builder.rb} +0 -0
  44. data/lib/gir_ffi/builders/null_builder.rb +11 -0
  45. data/lib/gir_ffi/builders/object_builder.rb +123 -0
  46. data/lib/gir_ffi/{builder/property.rb → builders/property_builder.rb} +0 -0
  47. data/lib/gir_ffi/builders/registered_type_builder.rb +50 -0
  48. data/lib/gir_ffi/builders/return_value_builder.rb +68 -0
  49. data/lib/gir_ffi/builders/signal_builder.rb +91 -0
  50. data/lib/gir_ffi/builders/struct_builder.rb +35 -0
  51. data/lib/gir_ffi/builders/type_builder.rb +40 -0
  52. data/lib/gir_ffi/builders/unintrospectable_builder.rb +35 -0
  53. data/lib/gir_ffi/builders/union_builder.rb +34 -0
  54. data/lib/gir_ffi/builders/user_defined_builder.rb +103 -0
  55. data/lib/gir_ffi/builders/with_layout.rb +55 -0
  56. data/lib/gir_ffi/builders/with_methods.rb +44 -0
  57. data/lib/gir_ffi/callback_base.rb +31 -0
  58. data/lib/gir_ffi/class_base.rb +16 -10
  59. data/lib/gir_ffi/enum_base.rb +8 -4
  60. data/lib/gir_ffi/ffi_ext/pointer.rb +19 -2
  61. data/lib/gir_ffi/in_out_pointer.rb +38 -39
  62. data/lib/gir_ffi/in_pointer.rb +33 -18
  63. data/lib/gir_ffi/info_ext.rb +0 -4
  64. data/lib/gir_ffi/info_ext/i_arg_info.rb +0 -18
  65. data/lib/gir_ffi/info_ext/i_callable_info.rb +2 -1
  66. data/lib/gir_ffi/info_ext/i_registered_type_info.rb +6 -8
  67. data/lib/gir_ffi/info_ext/i_signal_info.rb +6 -21
  68. data/lib/gir_ffi/info_ext/i_type_info.rb +54 -29
  69. data/lib/gir_ffi/info_ext/safe_constant_name.rb +8 -1
  70. data/lib/gir_ffi/interface_base.rb +1 -1
  71. data/lib/gir_ffi/module_base.rb +5 -1
  72. data/lib/gir_ffi/object_base.rb +5 -1
  73. data/lib/gir_ffi/setter_argument_info.rb +4 -0
  74. data/lib/gir_ffi/signal_base.rb +21 -0
  75. data/lib/gir_ffi/struct_base.rb +24 -0
  76. data/lib/gir_ffi/type_base.rb +11 -0
  77. data/lib/gir_ffi/type_map.rb +4 -2
  78. data/lib/gir_ffi/union_base.rb +24 -0
  79. data/lib/gir_ffi/version.rb +1 -1
  80. data/tasks/test.rake +73 -7
  81. data/test/base_test_helper.rb +3 -19
  82. data/test/ffi-glib/array_test.rb +6 -0
  83. data/test/ffi-glib/ptr_array_test.rb +13 -0
  84. data/test/ffi-glib/ruby_closure_test.rb +7 -7
  85. data/test/ffi-glib/sized_array_test.rb +2 -2
  86. data/test/ffi-gobject/gobject_test.rb +3 -12
  87. data/test/ffi-gobject/object_test.rb +33 -2
  88. data/test/ffi-gobject/value_test.rb +114 -1
  89. data/test/ffi-gobject_introspection/i_enum_info_test.rb +2 -2
  90. data/test/ffi-gobject_introspection/i_object_info_test.rb +3 -3
  91. data/test/ffi-gobject_introspection/i_repository_test.rb +26 -21
  92. data/test/ffi-gobject_test.rb +14 -14
  93. data/test/gir_ffi-base/glib/boolean_test.rb +6 -0
  94. data/test/gir_ffi/arg_helper_test.rb +2 -122
  95. data/test/gir_ffi/builder_test.rb +67 -204
  96. data/test/gir_ffi/{argument_builder_test.rb → builders/argument_builder_test.rb} +230 -108
  97. data/test/gir_ffi/builders/base_argument_builder_test.rb +5 -0
  98. data/test/gir_ffi/builders/callback_builder_test.rb +50 -0
  99. data/test/gir_ffi/builders/constant_builder_test.rb +4 -0
  100. data/test/gir_ffi/{builder/type/enum_test.rb → builders/enum_builder_test.rb} +2 -3
  101. data/test/gir_ffi/builders/field_builder_test.rb +94 -0
  102. data/test/gir_ffi/{function_builder_test.rb → builders/function_builder_test.rb} +43 -24
  103. data/test/gir_ffi/{builder/type/interface_test.rb → builders/interface_builder_test.rb} +2 -2
  104. data/test/gir_ffi/{builder/module_test.rb → builders/module_builder_test.rb} +12 -13
  105. data/test/gir_ffi/{builder/type/object_test.rb → builders/object_builder_test.rb} +9 -9
  106. data/test/gir_ffi/{return_value_builder_test.rb → builders/return_value_builder_test.rb} +94 -58
  107. data/test/gir_ffi/builders/signal_builder_test.rb +62 -0
  108. data/test/gir_ffi/{builder/type/struct_test.rb → builders/struct_builder_test.rb} +36 -19
  109. data/test/gir_ffi/{builder/type/unintrospectable_test.rb → builders/unintrospectable_builder_test.rb} +3 -3
  110. data/test/gir_ffi/builders/union_builder_test.rb +29 -0
  111. data/test/gir_ffi/{builder/type/user_defined_test.rb → builders/user_defined_builder_test.rb} +2 -2
  112. data/test/gir_ffi/callback_base_test.rb +11 -0
  113. data/test/gir_ffi/class_base_test.rb +22 -22
  114. data/test/gir_ffi/ffi_ext/pointer_test.rb +18 -0
  115. data/test/gir_ffi/in_out_pointer_test.rb +0 -7
  116. data/test/gir_ffi/in_pointer_test.rb +27 -3
  117. data/test/gir_ffi/info_ext/i_signal_info_test.rb +16 -44
  118. data/test/gir_ffi/info_ext/i_type_info_test.rb +315 -74
  119. data/test/gir_ffi/info_ext/safe_constant_name_test.rb +6 -0
  120. data/test/gir_ffi/interface_base_test.rb +3 -5
  121. data/test/gir_ffi/object_base_test.rb +10 -6
  122. data/test/gir_ffi/type_map_test.rb +2 -2
  123. data/test/gir_ffi/unintrospectable_type_info_test.rb +2 -2
  124. data/test/gir_ffi_test_helper.rb +12 -4
  125. data/test/integration/generated_gimarshallingtests_test.rb +436 -76
  126. data/test/integration/generated_gio_test.rb +5 -11
  127. data/test/integration/generated_gobject_test.rb +8 -0
  128. data/test/integration/generated_regress_test.rb +755 -309
  129. data/test/integration/generated_secret_test.rb +2 -1
  130. metadata +73 -72
  131. data/lib/ffi-gobject/ruby_style.rb +0 -23
  132. data/lib/gir_ffi/argument_builder.rb +0 -154
  133. data/lib/gir_ffi/builder/field.rb +0 -60
  134. data/lib/gir_ffi/builder/module.rb +0 -127
  135. data/lib/gir_ffi/builder/type.rb +0 -39
  136. data/lib/gir_ffi/builder/type/base.rb +0 -48
  137. data/lib/gir_ffi/builder/type/callback.rb +0 -30
  138. data/lib/gir_ffi/builder/type/constant.rb +0 -22
  139. data/lib/gir_ffi/builder/type/enum.rb +0 -66
  140. data/lib/gir_ffi/builder/type/interface.rb +0 -33
  141. data/lib/gir_ffi/builder/type/object.rb +0 -134
  142. data/lib/gir_ffi/builder/type/registered_type.rb +0 -62
  143. data/lib/gir_ffi/builder/type/struct.rb +0 -34
  144. data/lib/gir_ffi/builder/type/unintrospectable.rb +0 -39
  145. data/lib/gir_ffi/builder/type/union.rb +0 -34
  146. data/lib/gir_ffi/builder/type/user_defined.rb +0 -107
  147. data/lib/gir_ffi/builder/type/with_layout.rb +0 -62
  148. data/lib/gir_ffi/builder/type/with_methods.rb +0 -64
  149. data/lib/gir_ffi/callback.rb +0 -72
  150. data/lib/gir_ffi/callback_helper.rb +0 -11
  151. data/lib/gir_ffi/error_argument_builder.rb +0 -17
  152. data/lib/gir_ffi/function_builder.rb +0 -112
  153. data/lib/gir_ffi/info_ext/i_enum_info.rb +0 -11
  154. data/lib/gir_ffi/info_ext/i_object_info.rb +0 -11
  155. data/lib/gir_ffi/info_ext/i_struct_info.rb +0 -11
  156. data/lib/gir_ffi/info_ext/i_union_info.rb +0 -12
  157. data/lib/gir_ffi/return_value_builder.rb +0 -81
  158. data/test/ffi-gobject/ruby_style_test.rb +0 -38
  159. data/test/gir_ffi/base_argument_builder_test.rb +0 -13
  160. data/test/gir_ffi/builder/type/callback_test.rb +0 -6
  161. data/test/gir_ffi/builder/type/constant_test.rb +0 -4
  162. data/test/gir_ffi/builder/type/union_test.rb +0 -12
  163. data/test/gir_ffi/callback_helper_test.rb +0 -10
  164. data/test/gir_ffi/callback_test.rb +0 -49
  165. data/test/gir_ffi/info_ext/i_arg_info_test.rb +0 -39
  166. 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.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-08-05 00:00:00.000000000 Z
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.0.3
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.0.3
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/callback.rb
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/return_value_builder.rb
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/builder/type/user_defined_test.rb
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/function_builder_test.rb
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/callback_helper_test.rb
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/callback_helper_test.rb
380
- - test/gir_ffi/callback_test.rb
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/function_builder_test.rb
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