gir_ffi 0.6.7 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/{History.txt → Changelog.md} +93 -61
  3. data/{DESIGN.rdoc → DESIGN.md} +7 -7
  4. data/README.md +5 -7
  5. data/TODO.md +90 -0
  6. data/lib/ffi-glib.rb +0 -1
  7. data/lib/ffi-glib/array.rb +13 -29
  8. data/lib/ffi-glib/array_methods.rb +13 -0
  9. data/lib/ffi-glib/container_class_methods.rb +6 -1
  10. data/lib/ffi-glib/hash_table.rb +3 -2
  11. data/lib/ffi-glib/list.rb +3 -17
  12. data/lib/ffi-glib/list_methods.rb +22 -3
  13. data/lib/ffi-glib/ptr_array.rb +19 -19
  14. data/lib/ffi-glib/s_list.rb +3 -17
  15. data/lib/ffi-gobject.rb +10 -17
  16. data/lib/ffi-gobject/object.rb +19 -9
  17. data/lib/ffi-gobject/object_class.rb +14 -0
  18. data/lib/ffi-gobject/ruby_closure.rb +4 -5
  19. data/lib/ffi-gobject/value.rb +7 -5
  20. data/lib/ffi-gobject_introspection/i_vfunc_info.rb +1 -1
  21. data/lib/gir_ffi-base.rb +0 -2
  22. data/lib/gir_ffi-base/gobject.rb +1 -0
  23. data/lib/gir_ffi-base/gobject/lib.rb +1 -1
  24. data/lib/gir_ffi.rb +2 -0
  25. data/lib/gir_ffi/arg_helper.rb +18 -8
  26. data/lib/gir_ffi/builders/argument_builder.rb +62 -55
  27. data/lib/gir_ffi/builders/base_argument_builder.rb +52 -106
  28. data/lib/gir_ffi/builders/base_type_builder.rb +3 -3
  29. data/lib/gir_ffi/builders/c_to_ruby_convertor.rb +34 -0
  30. data/lib/gir_ffi/builders/callback_argument_builder.rb +73 -0
  31. data/lib/gir_ffi/builders/callback_builder.rb +19 -9
  32. data/lib/gir_ffi/builders/callback_return_value_builder.rb +54 -0
  33. data/lib/gir_ffi/builders/closure_convertor.rb +9 -0
  34. data/lib/gir_ffi/builders/closure_to_pointer_convertor.rb +9 -0
  35. data/lib/gir_ffi/builders/constructor_result_convertor.rb +9 -0
  36. data/lib/gir_ffi/builders/enum_builder.rb +16 -16
  37. data/lib/gir_ffi/builders/field_builder.rb +36 -15
  38. data/lib/gir_ffi/builders/function_builder.rb +32 -27
  39. data/lib/gir_ffi/builders/interface_builder.rb +14 -4
  40. data/lib/gir_ffi/builders/mapping_method_builder.rb +95 -43
  41. data/lib/gir_ffi/builders/module_builder.rb +22 -35
  42. data/lib/gir_ffi/builders/null_convertor.rb +9 -0
  43. data/lib/gir_ffi/builders/object_builder.rb +11 -14
  44. data/lib/gir_ffi/builders/property_builder.rb +107 -9
  45. data/lib/gir_ffi/builders/registered_type_builder.rb +2 -2
  46. data/lib/gir_ffi/builders/return_value_builder.rb +42 -33
  47. data/lib/gir_ffi/builders/ruby_to_c_convertor.rb +15 -0
  48. data/lib/gir_ffi/builders/signal_builder.rb +18 -58
  49. data/lib/gir_ffi/builders/struct_builder.rb +1 -2
  50. data/lib/gir_ffi/builders/type_builder.rb +1 -0
  51. data/lib/gir_ffi/builders/unintrospectable_builder.rb +4 -4
  52. data/lib/gir_ffi/builders/user_defined_builder.rb +151 -26
  53. data/lib/gir_ffi/builders/vfunc_builder.rb +57 -0
  54. data/lib/gir_ffi/builders/with_layout.rb +10 -8
  55. data/lib/gir_ffi/builders/with_methods.rb +1 -1
  56. data/lib/gir_ffi/callback_base.rb +42 -8
  57. data/lib/gir_ffi/class_base.rb +1 -2
  58. data/lib/gir_ffi/enum_base.rb +26 -4
  59. data/lib/gir_ffi/error_argument_info.rb +21 -0
  60. data/lib/gir_ffi/{setter_argument_info.rb → field_argument_info.rb} +2 -1
  61. data/lib/gir_ffi/g_type.rb +25 -0
  62. data/lib/gir_ffi/in_out_pointer.rb +3 -14
  63. data/lib/gir_ffi/in_pointer.rb +20 -21
  64. data/lib/gir_ffi/info_ext.rb +2 -0
  65. data/lib/gir_ffi/info_ext/i_callable_info.rb +0 -9
  66. data/lib/gir_ffi/info_ext/i_callback_info.rb +17 -0
  67. data/lib/gir_ffi/info_ext/i_function_info.rb +4 -0
  68. data/lib/gir_ffi/info_ext/i_property_info.rb +4 -0
  69. data/lib/gir_ffi/info_ext/i_registered_type_info.rb +1 -0
  70. data/lib/gir_ffi/info_ext/i_signal_info.rb +14 -16
  71. data/lib/gir_ffi/info_ext/i_type_info.rb +72 -34
  72. data/lib/gir_ffi/info_ext/i_vfunc_info.rb +12 -0
  73. data/lib/gir_ffi/info_ext/safe_constant_name.rb +3 -2
  74. data/lib/gir_ffi/interface_base.rb +8 -3
  75. data/lib/gir_ffi/module_base.rb +3 -5
  76. data/lib/gir_ffi/object_base.rb +8 -0
  77. data/lib/gir_ffi/receiver_argument_info.rb +21 -0
  78. data/lib/gir_ffi/receiver_type_info.rb +27 -0
  79. data/lib/gir_ffi/return_value_info.rb +23 -0
  80. data/lib/gir_ffi/signal_base.rb +1 -1
  81. data/lib/{ffi-glib → gir_ffi}/sized_array.rb +10 -6
  82. data/lib/gir_ffi/struct_base.rb +10 -9
  83. data/lib/gir_ffi/type_base.rb +1 -0
  84. data/lib/gir_ffi/type_map.rb +3 -0
  85. data/lib/gir_ffi/unintrospectable_type_info.rb +4 -1
  86. data/lib/gir_ffi/union_base.rb +4 -21
  87. data/lib/gir_ffi/user_data_argument_info.rb +21 -0
  88. data/lib/gir_ffi/user_data_type_info.rb +17 -0
  89. data/lib/gir_ffi/user_defined_type_info.rb +18 -4
  90. data/lib/gir_ffi/version.rb +1 -1
  91. data/lib/gir_ffi/vfunc_base.rb +8 -0
  92. data/lib/gir_ffi/vfunc_implementation.rb +11 -0
  93. data/lib/gir_ffi/zero_terminated.rb +18 -24
  94. data/test/base_test_helper.rb +2 -3
  95. data/test/ffi-glib/array_test.rb +3 -3
  96. data/test/ffi-glib/ruby_closure_test.rb +3 -3
  97. data/test/ffi-gobject/value_test.rb +15 -1
  98. data/test/ffi-gobject_test.rb +2 -1
  99. data/test/gir_ffi/arg_helper_test.rb +21 -2
  100. data/test/gir_ffi/builders/argument_builder_test.rb +213 -287
  101. data/test/gir_ffi/builders/base_argument_builder_test.rb +1 -1
  102. data/test/gir_ffi/builders/callback_builder_test.rb +26 -8
  103. data/test/gir_ffi/builders/field_builder_test.rb +18 -3
  104. data/test/gir_ffi/builders/function_builder_test.rb +30 -12
  105. data/test/gir_ffi/builders/interface_builder_test.rb +9 -0
  106. data/test/gir_ffi/builders/module_builder_test.rb +0 -39
  107. data/test/gir_ffi/builders/object_builder_test.rb +27 -27
  108. data/test/gir_ffi/builders/property_builder_test.rb +110 -0
  109. data/test/gir_ffi/builders/return_value_builder_test.rb +168 -200
  110. data/test/gir_ffi/builders/signal_builder_test.rb +58 -14
  111. data/test/gir_ffi/builders/struct_builder_test.rb +2 -41
  112. data/test/gir_ffi/builders/user_defined_builder_test.rb +88 -20
  113. data/test/gir_ffi/builders/vfunc_builder_test.rb +44 -0
  114. data/test/gir_ffi/g_type_test.rb +29 -0
  115. data/test/gir_ffi/in_pointer_test.rb +28 -9
  116. data/test/gir_ffi/info_ext/i_callable_info_test.rb +0 -9
  117. data/test/gir_ffi/info_ext/i_callback_info_test.rb +19 -0
  118. data/test/gir_ffi/info_ext/i_function_info_test.rb +9 -0
  119. data/test/gir_ffi/info_ext/i_signal_info_test.rb +8 -11
  120. data/test/gir_ffi/info_ext/i_type_info_test.rb +140 -16
  121. data/test/gir_ffi/interface_base_test.rb +9 -3
  122. data/test/gir_ffi/object_base_test.rb +1 -2
  123. data/test/{ffi-glib → gir_ffi}/sized_array_test.rb +28 -28
  124. data/test/gir_ffi/type_map_test.rb +1 -1
  125. data/test/gir_ffi/user_defined_type_info_test.rb +36 -4
  126. data/test/gir_ffi_test.rb +5 -5
  127. data/test/gir_ffi_test_helper.rb +4 -0
  128. data/test/integration/generated_gimarshallingtests_test.rb +163 -59
  129. data/test/integration/generated_gobject_test.rb +21 -8
  130. data/test/integration/generated_pango_test.rb +2 -2
  131. data/test/integration/generated_regress_test.rb +361 -101
  132. data/test/lib/autogen.sh +5 -1
  133. metadata +51 -35
  134. data/TODO.rdoc +0 -63
  135. data/lib/gir_ffi-base/gir_ffi/library.rb +0 -17
  136. data/lib/gir_ffi-base/gir_ffi/struct.rb +0 -27
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4030d6c4cfb00268801490cc1bb1ea0fcecfd533
4
+ data.tar.gz: 36be619abbb6889c67c7ab2726c6eaa3708f7946
5
+ SHA512:
6
+ metadata.gz: ae9124773e81ce3c8ce21882fa164296f40c06d14c3032f57b121a4026967fb0e6e210d60dacaa171f21997f34a19855e407ed425c7fba0d1d2dbc47fa47e4e9
7
+ data.tar.gz: 0b647b4e8bec822e25f96a249efc0ea0ce4b9177b17de87d18d3f17f384d5f70480f7986ff920697a6e06709b752d0407ed3d88f485b43a290081e2ffecee01e
@@ -1,4 +1,36 @@
1
- == 0.6.7 / 2013-09-28
1
+ # Changelog
2
+
3
+ ## 0.7.0 / 2014-01-11
4
+
5
+ * Type handling:
6
+ * Handle c arrays with separate length argument for signals
7
+ * Handle GHashTable values of type :gint8 and :guint32
8
+ * Handle signals with int64, Strv, uint64 arguments
9
+ * Handle arrays of integers cast as pointers
10
+ * Handle fields of callback type
11
+ * Handle nested GHashTable
12
+ * Argument handling:
13
+ * Refactor argument builder system
14
+ * Improve handling of user data arguments
15
+ * Handle signal and callback arguments with direction :out
16
+ * Handle aliases of container types by making the element type optional
17
+ * Handle signal and callback return values that need conversion
18
+ * User defined types:
19
+ * Pass explicit receiver to initialization block for UserDefinedTypeInfo
20
+ * Allow user defined types that are anonymous Ruby classes
21
+ * Register defined properties in a subclass
22
+ * Support setting virtual function implementations in a subclass
23
+ * Support adding an interface to a subclass
24
+ * Support implementing an interface's virtual functions in a subclass
25
+ * Use FFI's DataConvertor system to handle enums and callbacks
26
+ * Stop using deprecated GValueArray to construct argument array for signal_emit
27
+ * Make ITypeInfo#g_type return correct value for c arrays
28
+ * Make get_property and set_property less smart, moving conversion into the
29
+ property accessor definitions
30
+ * Make GObject::Value#get_value handle enums and flags
31
+ * Clean up deprecated methods
32
+
33
+ ## 0.6.7 / 2013-09-28
2
34
 
3
35
  * Uniform handling of callback, signal and method arguments
4
36
  * Automatically convert array elements to GValue
@@ -12,18 +44,18 @@
12
44
  * Deprecate several methods
13
45
  * Lots of refactoring
14
46
 
15
- == 0.6.6 / 2013-08-05
47
+ ## 0.6.6 / 2013-08-05
16
48
 
17
49
  * Handle GArrays of booleans and structs
18
50
  * Improve handling of gbooleans
19
51
 
20
- == 0.6.5 / 2013-08-03
52
+ ## 0.6.5 / 2013-08-03
21
53
 
22
54
  * Handle inline arrays of structs
23
55
  * Implement equality operator for container types
24
56
  * Fix element size calculation for GArray
25
57
 
26
- == 0.6.4 / 2013-06-30
58
+ ## 0.6.4 / 2013-06-30
27
59
 
28
60
  * Represent enum types by modules wrapping FFI::Enum
29
61
  * Support functions on enums
@@ -34,25 +66,25 @@
34
66
  * Handle caller-allocated arguments of type GArray
35
67
  * Deprecate GObject::Value#ruby_value, replacing it with #get_value
36
68
 
37
- == 0.6.3 / 2013-06-15
69
+ ## 0.6.3 / 2013-06-15
38
70
 
39
71
  * Make use of enums as element type for GHashTable and other containers
40
- work
72
+ work
41
73
 
42
- == 0.6.2 / 2013-06-14
74
+ ## 0.6.2 / 2013-06-14
43
75
 
44
76
  * Handle introspectable types with introspectable parent types
45
77
 
46
- == 0.6.1 / 2013-06-09
78
+ ## 0.6.1 / 2013-06-09
47
79
 
48
80
  * Handle SizedArray containing enums
49
81
 
50
- == 0.6.0 / 2013-06-07
82
+ ## 0.6.0 / 2013-06-07
51
83
 
52
84
  * Support Rubinius
53
85
  * Lots of refactoring
54
86
 
55
- == 0.5.2 / 2013-04-23
87
+ ## 0.5.2 / 2013-04-23
56
88
 
57
89
  * Handle signal details in GObject.signal_connect and .signal_emit
58
90
  * Make GValue#set_value check object GType compatibility
@@ -60,12 +92,12 @@
60
92
  * Handle more argument types
61
93
  * Support Ruby 2.0.0
62
94
 
63
- == 0.5.1 / 2013-02-01
95
+ ## 0.5.1 / 2013-02-01
64
96
 
65
97
  * Properly handle zero-terminated arrays of :filename
66
98
  * Loosen dependencies on ffi and minitest
67
99
 
68
- == 0.5.0 / 2013-01-19
100
+ ## 0.5.0 / 2013-01-19
69
101
 
70
102
  * Update ffi dependency
71
103
  * Add finalizer to release memory for IBaseInfo and descendents
@@ -73,38 +105,38 @@
73
105
  * Remove pretty-printing functionality
74
106
  * Refactor argument handling
75
107
 
76
- == 0.4.3 / 2012-11-02
108
+ ## 0.4.3 / 2012-11-02
77
109
 
78
110
  * Remove gobject-introspection version check
79
111
  * Make tests pass with gobject-introspection 1.34
80
112
  * Ongoing refactoring
81
113
 
82
- == 0.4.2 / 2012-09-22
114
+ ## 0.4.2 / 2012-09-22
83
115
 
84
116
  * Make objects and interfaces wrap poiners in the class that matches
85
- their GType.
117
+ their GType.
86
118
 
87
- == 0.4.1 / 2012-09-18
119
+ ## 0.4.1 / 2012-09-18
88
120
 
89
121
  * Remove workarounds for older versions of gobject-introspection
90
122
  * Mark certain methods as deprecated. These will be removed in 0.5.0
91
123
  * Handle :filename type arguments in InPointer
92
124
  * Refactoring
93
125
 
94
- == 0.4.0 / 2012-08-24
126
+ ## 0.4.0 / 2012-08-24
95
127
 
96
128
  * Move Gtk+ bindings to their own gem (gir_ffi-gtk).
97
129
 
98
- == 0.3.2 / 2012-08-24
130
+ ## 0.3.2 / 2012-08-24
99
131
 
100
132
  * Correctly set FFI return type when callbacks that return GObjects have
101
- incomplete type specification.
133
+ incomplete type specification.
102
134
 
103
- == 0.3.1 / 2012-05-13
135
+ ## 0.3.1 / 2012-05-13
104
136
 
105
137
  * Correctly map Interface types in callbacks.
106
138
 
107
- == 0.3.0 / 2012-04-09
139
+ ## 0.3.0 / 2012-04-09
108
140
 
109
141
  * Improve process of defining initializers in derived classes.
110
142
  * Make interfaces know their GType.
@@ -116,68 +148,68 @@
116
148
  * Improve unintrospectable type handling.
117
149
  * Bug fixes and refactorings.
118
150
  * Start implementing #define_type, for creating descendent types that
119
- the GObject system knows about.
151
+ the GObject system knows about.
120
152
 
121
- == 0.2.3 / 2011-12-31
153
+ ## 0.2.3 / 2011-12-31
122
154
 
123
155
  * Fix issue #7: methods that take GValues will autoconvert other values.
124
156
  * Fix method lookup when include'ing a module that is an Interface.
125
157
  * Various refactorings.
126
158
 
127
- == 0.2.2 / 2011-12-07
159
+ ## 0.2.2 / 2011-12-07
128
160
 
129
161
  * Fix issue #19: Check if a GLib::PtrArray.add method was generated
130
- before attempting to remove it.
162
+ before attempting to remove it.
131
163
  * Fix two issues with pretty printing that made output for GLib have syntax
132
- errors.
164
+ errors.
133
165
 
134
- == 0.2.1 / 2011-11-20
166
+ ## 0.2.1 / 2011-11-20
135
167
 
136
168
  * Fix handling of output parameters that are arrays of pointers to
137
- structures (i.e., of type Foo***).
169
+ structures (i.e., of type Foo***).
138
170
 
139
- == 0.2.0 / 2011-11-19
171
+ ## 0.2.0 / 2011-11-19
140
172
 
141
173
  * Add support for properties, with #get_property and #set_property.
142
174
  * Add support for fields.
143
- - Create field accessor methods.
144
- - Get rid of #[] and #[]=.
175
+ - Create field accessor methods.
176
+ - Get rid of #[] and #[]=.
145
177
  * Explicitely load libgirepository with ABI version 1.
146
178
  * Improve implementation of GLib container classes (GList etc.):
147
- - Real constructors.
148
- - #append and friends are instance methods now.
149
- - Conversion methods to cast Ruby containers to GLib containers.
179
+ - Real constructors.
180
+ - #append and friends are instance methods now.
181
+ - Conversion methods to cast Ruby containers to GLib containers.
150
182
  * Start implementing pretty printing.
151
183
  * Various refactorings.
152
184
 
153
- == 0.1.0 / 2011-10-28
185
+ ## 0.1.0 / 2011-10-28
154
186
 
155
187
  * Put bindings for GObjectIntrospection in their own namespace.
156
188
  * GirFFI.setup no longer loads overrides.
157
189
  * Add ffi-gtk2 and ffi-gtk3 files for loading Gtk+ overrides.
158
190
 
159
- == 0.0.14 / 2011-10-28
191
+ ## 0.0.14 / 2011-10-28
160
192
 
161
193
  * Support GObject Introspection version 1.30:
162
- - Add support for layouts with fixed-length arrays.
163
- - Handle type names starting with underscores.
164
- - Call g_signal_emitv directly to avoid conflict in introspection info
165
- with earlier versions of GObject Introspection.
194
+ - Add support for layouts with fixed-length arrays.
195
+ - Handle type names starting with underscores.
196
+ - Call g_signal_emitv directly to avoid conflict in introspection info
197
+ with earlier versions of GObject Introspection.
166
198
 
167
- == 0.0.13 / 2011-09-09
199
+ ## 0.0.13 / 2011-09-09
168
200
 
169
201
  * Remove IErrorDomain related code. This functinality was removed from
170
- GObject Introspection in version 1.29.17
202
+ GObject Introspection in version 1.29.17
171
203
 
172
- == 0.0.12 / 2011-09-04
204
+ ## 0.0.12 / 2011-09-04
173
205
 
174
- * No longer use _id2ref to locate objects past as user data pointers.
206
+ * No longer use `_id2ref` to locate objects past as user data pointers.
175
207
  * Fix failing tests on JRuby.
176
208
 
177
- == 0.0.11 / 2011-08-22
209
+ ## 0.0.11 / 2011-08-22
178
210
 
179
211
  * Change interface to the underlying builder in generated modules and
180
- classes.
212
+ classes.
181
213
  * Handle string, enum, union, flags signal arguments.
182
214
  * Handle string arguments in GObject.signal_emit.
183
215
  * Handle enum signal arguments.
@@ -185,13 +217,13 @@
185
217
  * Fix method setup in non-introspectable types.
186
218
  * Refactoring.
187
219
 
188
- == 0.0.10 / 2011-05-18
220
+ ## 0.0.10 / 2011-05-18
189
221
 
190
222
  * Handle GObject interfaces properly.
191
223
  * Create types only defined by the GType system.
192
224
  * Support GType array return values.
193
225
 
194
- == 0.0.9 / 2011-05-02
226
+ ## 0.0.9 / 2011-05-02
195
227
 
196
228
  * More complete support for the basic types.
197
229
  * Improved support for GList, GSList, GStrv, and GValue.
@@ -202,28 +234,28 @@
202
234
  * Use minitest/spec for testing.
203
235
  * Various bug fixes and internal improvements.
204
236
 
205
- == 0.0.8 / 2011-04-08
237
+ ## 0.0.8 / 2011-04-08
206
238
 
207
239
  * Generate modules with names starting with a lowercase letter (like
208
- cairo).
240
+ cairo).
209
241
  * Allow specifying the typelib version on setup.
210
242
  * Rename methods #methods and #type of the introspection classes to avoid
211
- clashing with standard Ruby methods.
243
+ clashing with standard Ruby methods.
212
244
  * Refactoring.
213
245
 
214
- == 0.0.7 / 2011-04-01
246
+ ## 0.0.7 / 2011-04-01
215
247
 
216
248
  * Support gobject-introspection 0.10, drop support for earlier versions.
217
- - Use Regress, not Everything, for testing.
218
- - Deal with functions that are no longer introspectable.
249
+ - Use Regress, not Everything, for testing.
250
+ - Deal with functions that are no longer introspectable.
219
251
  * Correctly handle constructors that declare their return type different
220
- from their class.
252
+ from their class.
221
253
  * Implement RubyClosure, a GObject::Closure for handling ruby callbacks.
222
254
  * Handle GLib's singly and doubly linked lists.
223
255
  * Handle callback types defined in-place (like Closure's marshal).
224
256
  * Refactoring.
225
257
 
226
- == 0.0.6 / 2011-03-01
258
+ ## 0.0.6 / 2011-03-01
227
259
 
228
260
  * Cast returned GObjects to their actual type.
229
261
  * Properly cast callback arguments.
@@ -231,7 +263,7 @@
231
263
  * Make sure Gtk::Window has the correct number of references after creation.
232
264
  * Refactoring and some small fixes.
233
265
 
234
- == 0.0.5 / 2010-12-30
266
+ ## 0.0.5 / 2010-12-30
235
267
 
236
268
  * Don't create instance methods out of functions and vice versa.
237
269
  * Find signals on interfaces, too.
@@ -240,7 +272,7 @@
240
272
  * Handle most other argument types.
241
273
  * Various internal changes and other fixes.
242
274
 
243
- == 0.0.4 / 2010-12-14
275
+ ## 0.0.4 / 2010-12-14
244
276
 
245
277
  * Lots of changes to the internals.
246
278
  * Handle out-only arguments.
@@ -251,16 +283,16 @@
251
283
  * Implement Union type.
252
284
  * Many small bug fixes.
253
285
 
254
- == 0.0.3 / 2010-11-19
286
+ ## 0.0.3 / 2010-11-19
255
287
 
256
288
  * Update to restore Ruby 1.9 support.
257
289
  * Handle functions with the 'throws' property set.
258
290
  * Handle classes without specified fields.
259
291
 
260
- == 0.0.2 / 2010-11-14
292
+ ## 0.0.2 / 2010-11-14
261
293
 
262
294
  * Several fixes to method creation.
263
295
 
264
- == 0.0.1 / 2010-10-25
296
+ ## 0.0.1 / 2010-10-25
265
297
 
266
298
  * Initial release.
@@ -1,11 +1,11 @@
1
- = Design of Gir-FFI
1
+ # Design of Gir-FFI
2
2
 
3
- == Basic Idea
3
+ ## Basic Idea
4
4
 
5
5
  Gir-FFI uses FFI to read information from the GObject Introspection
6
6
  Repository. Based on that it creates bindings for the information read.
7
7
 
8
- == Class and method creation
8
+ ## Class and method creation
9
9
 
10
10
  GirFFI::Builder creates classes and modules at runtime and adds appropriate
11
11
  method_missing methods to them to generate methods and perhaps other
@@ -22,7 +22,7 @@ The following options were discarded, at least for now.
22
22
  still in interesting idea, but off-line source code generation is not
23
23
  really the Ruby way.
24
24
 
25
- == Method Naming
25
+ ## Method Naming
26
26
 
27
27
  Probably, get_x/set_x pairs should become x and x= to be more Ruby-like.
28
28
  This should be done either by defining them as such directly, or by
@@ -35,7 +35,7 @@ Boolean-valued methods could get a ? at the end.
35
35
  This requires a lot more thought. For now, the full method names as
36
36
  defined in the GIR are used.
37
37
 
38
- == Ruby-GNOME Compatibility
38
+ ## Ruby-GNOME Compatibility
39
39
 
40
40
  Full Ruby-GNOME compatibility cannot be achieved automatically, since its
41
41
  object hierarchy differs from that of standard GObject: It puts Object in
@@ -45,7 +45,7 @@ GLib::Instantiable; In standard GObject they are functions.
45
45
  Possibly, compatibility enhancing code can be added for these specific
46
46
  exceptions.
47
47
 
48
- == Reference Counting
48
+ ## Reference Counting
49
49
 
50
50
  Because we can always make sure GObjects are unref'd when the Ruby object
51
51
  is GC'd, the mechanism of floating references actually gets in the way a
@@ -54,7 +54,7 @@ them. All GObjects can then safely be unref'd using a Ruby finalizer.
54
54
  GObjects obtained through other mechanisms than with a constructor will be
55
55
  ref'd once when wrapping them in a ruby object.
56
56
 
57
- == Bootstrapping Class Design
57
+ ## Bootstrapping Class Design
58
58
 
59
59
  The interface to the GObject Introspection Repository itself is also
60
60
  introspectable. The interface is specified in terms of structs and
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  by Matijs van Zuijlen
4
4
 
5
- [![Build Status](https://secure.travis-ci.org/mvz/ruby-gir-ffi.png)](http://travis-ci.org/mvz/ruby-gir-ffi)
6
-
7
5
  ## Description
8
6
 
9
7
  Ruby bindings for GNOME using the GObject Introspection Repository.
@@ -13,7 +11,7 @@ Ruby bindings for GNOME using the GObject Introspection Repository.
13
11
  * Create bindings to any GObject-based library.
14
12
  * Bindings generated at runtime.
15
13
  * Provides overridden bindings for selected methods.
16
- * Install 'gir_ffi-gtk' and require 'gir_ffi-gtk2' or 'gir_ffi-gtk3' to
14
+ * Install `gir_ffi-gtk` and require `gir_ffi-gtk2` or `gir_ffi-gtk3` to
17
15
  load overrides for Gtk2 or Gtk3.
18
16
 
19
17
  ## Usage
@@ -39,8 +37,8 @@ Ruby bindings for GNOME using the GObject Introspection Repository.
39
37
 
40
38
  ## Requirements
41
39
 
42
- GirFFI should work on MRI 1.8, 1.9 and 2.0, JRuby in both 1.8 and 1.9
43
- modes, and on Rubinius in both 1.8 and 1.9 modes.
40
+ GirFFI should work on MRI 1.8, 1.9, 2.0, and 2.1, JRuby in both 1.8 and 1.9
41
+ modes, and on Rubinius.
44
42
 
45
43
  You will also need gobject-introspection installed with some
46
44
  introspection data.
@@ -73,7 +71,7 @@ already exist:
73
71
 
74
72
  ## Hacking and contributing
75
73
 
76
- If you want to help out, have a look at TODO.rdoc, and check the notes
74
+ If you want to help out, have a look at TODO.md, and check the notes
77
75
  in the code (e.g., using `dnote`). Feel free to file bugs or send pull
78
76
  requests.
79
77
 
@@ -90,7 +88,7 @@ If you want to send pull requests or patches, please:
90
88
 
91
89
  ## License
92
90
 
93
- Copyright © 2009–2013 [Matijs van Zuijlen](http://www.matijs.net)
91
+ Copyright © 2009–2014 [Matijs van Zuijlen](http://www.matijs.net)
94
92
 
95
93
  GirFFI is free software, distributed under the terms of the GNU Lesser
96
94
  General Public License, version 2.1 or later. See the file COPYING.LIB for
data/TODO.md ADDED
@@ -0,0 +1,90 @@
1
+ # TODO
2
+
3
+ ## Memory managment
4
+
5
+ GirFFI does not attempt to free any memory at the moment, or lower the
6
+ reference count of any objects it gets from GObject. This task therefore involves two parts:
7
+
8
+ - Free non-GObject pointers as needed (at garbage-collection time)
9
+ - Lower reference count of GObjects (at garbage-collection time)
10
+
11
+ ## Refactorings
12
+
13
+ These in the order they occured to me, and may therefore be fixed in any order.
14
+
15
+ - Create Type objects for all FFI types, including the ones currently
16
+ represented by a single symbol, so we can always do stuff like
17
+
18
+ > `GirFFI::Types::UInt8.get_value_from_pointer(ptr)`
19
+
20
+ rather than having awkward dynamic method dispatch inside GirFFI::InOutPointer.
21
+
22
+ - Move to a single Pointer class, rather than InPointer, InOutPointer and
23
+ Pointer monkeypatching.
24
+
25
+ - Move special types like SizedArray to sane namespaces. Types (like
26
+ GLib::List) that have actual GLib implementations go to the GLib namespace.
27
+ Other types go to the GirFFI namespace.
28
+
29
+ ## Derived types
30
+
31
+ Derived classes can now be registered with GObject, but the way to do this is
32
+ not very nice:
33
+
34
+ class Derived < Base
35
+ end
36
+
37
+ GirFFI.define_type Derived do |info|
38
+ info.install_property GObject.param_spec_int("foo", "foo bar",
39
+ "The Foo Bar Property",
40
+ 10, 20, 15, 3)
41
+ # assume Base defines a virtual function called 'some_vfunc'
42
+ info.install_vfunc_implementation :some_vfunc, proc {|obj|
43
+ #implementation goes here
44
+ }
45
+ end
46
+
47
+ It would be good to replace this with something that's easier to use:
48
+ * Perhaps auto-register types, like Gtk# does
49
+ * Perhaps automagically find vfunc implementations, like PyGObject and
50
+ Ruby-GNOME do
51
+ * What about properties?
52
+
53
+ ## Persistent Ruby GObject identity
54
+
55
+ GirFFI should make sure that if it gets a pointer to a GObject for which a Ruby
56
+ object already exists, the existing object is returned. This involves the use
57
+ of WeakRef, no doubt.
58
+
59
+ ## Handle fundamental objects that are not GObject.
60
+
61
+ This is a big one. See commit 1e9822c7817062a9b853269b9418fd78782090b5 in
62
+ gobject-introspection, and TestFundamentalObject in Regress.
63
+
64
+ The tests for TestFundamentalObject accidentally pass, but there may be
65
+ hidden issues.
66
+
67
+ ## Check binding of GObject:
68
+
69
+ (11:37:03 PM) walters: the basic story is that GObject should be manually bound
70
+ (11:47:02 PM) ebassi: the really necessary bits are: GObject/GInitiallyUnowned memory management; properties accessors; GSignal connection API
71
+ (11:47:15 PM) ebassi: the rest is "nice to have"
72
+ (11:47:37 PM) ebassi: oh, and probably GBinding - but that's just because I wrote it ;-)
73
+
74
+ ## Use FFI::DataConverter to automatically convert GObject types
75
+
76
+ GirFFI now generates loads of Something.wrap(ptr) calls; Perhaps these can be
77
+ replace by implementing to_native and from_native in ClassBase and including
78
+ FFI::DataConverter.
79
+
80
+ ## Handle Variants more nicely
81
+
82
+ Currently, GirFFI requires the user to create GVariant objects by hand, and
83
+ retrieve values from them by hand as well. Ideally, we would have `.from_ruby` and
84
+ `#to_ruby` methods or somesuch that do this for us. Some classes, like GAction,
85
+ require a specifice VariantType to be used consistently. Special logic will have
86
+ to be put in place for that.
87
+
88
+ ## See Also
89
+
90
+ dnote