gir_ffi 0.1.0 → 0.2.0
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 +10 -5
- data/lib/ffi-glib.rb +7 -73
- data/lib/ffi-glib/array.rb +29 -4
- data/lib/ffi-glib/byte_array.rb +15 -1
- data/lib/ffi-glib/hash_table.rb +31 -24
- data/lib/ffi-glib/list.rb +28 -0
- data/lib/ffi-glib/list_methods.rb +10 -2
- data/lib/ffi-glib/ptr_array.rb +39 -0
- data/lib/ffi-glib/s_list.rb +29 -0
- data/lib/ffi-gobject.rb +49 -22
- data/lib/ffi-gobject/closure.rb +4 -3
- data/lib/ffi-gobject/helper.rb +20 -43
- data/lib/ffi-gobject/initially_unowned.rb +2 -0
- data/lib/ffi-gobject/object.rb +54 -0
- data/lib/ffi-gobject/ruby_closure.rb +22 -16
- data/lib/ffi-gobject/value.rb +54 -19
- data/lib/ffi-gobject_introspection/i_constant_info.rb +17 -1
- data/lib/ffi-gobject_introspection/i_field_info.rb +8 -0
- data/lib/ffi-gobject_introspection/i_property_info.rb +3 -1
- data/lib/ffi-gobject_introspection/lib.rb +19 -2
- data/lib/gir_ffi/arg_helper.rb +7 -45
- data/lib/gir_ffi/builder.rb +1 -1
- data/lib/gir_ffi/builder/argument.rb +148 -107
- data/lib/gir_ffi/builder/argument/base.rb +5 -5
- data/lib/gir_ffi/builder/argument/in_base.rb +2 -2
- data/lib/gir_ffi/builder/argument/in_out_base.rb +2 -3
- data/lib/gir_ffi/builder/argument/out_base.rb +2 -3
- data/lib/gir_ffi/builder/function.rb +11 -17
- data/lib/gir_ffi/builder/module.rb +26 -0
- data/lib/gir_ffi/builder/type.rb +5 -0
- data/lib/gir_ffi/builder/type/base.rb +2 -0
- data/lib/gir_ffi/builder/type/callback.rb +18 -3
- data/lib/gir_ffi/builder/type/constant.rb +4 -12
- data/lib/gir_ffi/builder/type/enum.rb +15 -6
- data/lib/gir_ffi/builder/type/interface.rb +4 -0
- data/lib/gir_ffi/builder/type/object.rb +11 -0
- data/lib/gir_ffi/builder/type/struct_based.rb +14 -4
- data/lib/gir_ffi/builder/type/union.rb +13 -7
- data/lib/gir_ffi/builder/type/with_layout.rb +59 -8
- data/lib/gir_ffi/class_base.rb +8 -1
- data/lib/gir_ffi/in_out_pointer.rb +17 -18
- data/lib/gir_ffi/in_pointer.rb +8 -1
- data/lib/gir_ffi/type_map.rb +12 -0
- data/lib/gir_ffi/variable_name_generator.rb +12 -0
- data/lib/gir_ffi/version.rb +1 -1
- data/test/ffi-glib/array_test.rb +54 -0
- data/test/ffi-glib/byte_array_test.rb +21 -0
- data/test/ffi-glib/glib_overrides_test.rb +1 -46
- data/test/ffi-glib/hash_table_test.rb +24 -0
- data/test/ffi-glib/list_test.rb +46 -0
- data/test/ffi-glib/ptr_array_test.rb +51 -0
- data/test/ffi-glib/s_list_test.rb +46 -0
- data/test/ffi-gobject/g_object_overrides_test.rb +8 -8
- data/test/ffi-gobject/gobject_test.rb +26 -0
- data/test/ffi-gobject/object_test.rb +12 -0
- data/test/ffi-gobject_introspection/i_constant_info_test.rb +5 -1
- data/test/ffi-gobject_introspection/lib_test.rb +56 -0
- data/test/integration/generated_gimarshallingtests_test.rb +118 -76
- data/test/integration/generated_regress_test.rb +220 -62
- data/test/integration/pretty_print_test.rb +11 -0
- data/test/type_builder_test.rb +0 -48
- data/test/unintrospectable_type_builder_test.rb +8 -2
- data/test/unit/builder_test.rb +1 -1
- data/test/unit/callback_builder_test.rb +19 -0
- data/test/unit/constant_builder_test.rb +11 -0
- data/test/unit/enum_builder_test.rb +25 -0
- data/test/unit/function_builder_test.rb +17 -0
- data/test/unit/in_out_pointer_test.rb +11 -0
- data/test/unit/in_pointer_test.rb +6 -2
- data/test/unit/interface_builder_test.rb +17 -0
- data/test/unit/module_builder_test.rb +95 -0
- data/test/unit/object_type_builder_test.rb +24 -0
- data/test/unit/struct_builder_test.rb +106 -0
- data/test/unit/union_builder_test.rb +17 -0
- data/test/unit/variable_name_generator_test.rb +16 -0
- metadata +102 -75
- data/test/module_builder_test.rb +0 -53
data/test/module_builder_test.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require File.expand_path('gir_ffi_test_helper.rb', File.dirname(__FILE__))
|
2
|
-
|
3
|
-
class ModuleBuilderTest < MiniTest::Spec
|
4
|
-
context "The Builder::Module object" do
|
5
|
-
context "for Gtk" do
|
6
|
-
setup do
|
7
|
-
@mbuilder = GirFFI::Builder::Module.new('Gtk')
|
8
|
-
end
|
9
|
-
|
10
|
-
context "looking at Gtk.main" do
|
11
|
-
setup do
|
12
|
-
@go = get_introspection_data 'Gtk', 'main'
|
13
|
-
end
|
14
|
-
|
15
|
-
should "build correct definition of Gtk.main" do
|
16
|
-
code = @mbuilder.send :function_definition, @go, Lib
|
17
|
-
expected = "def main\n::Lib.gtk_main\nend"
|
18
|
-
assert_equal cws(expected), cws(code)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
context "looking at Gtk.init" do
|
23
|
-
setup do
|
24
|
-
@go = get_introspection_data 'Gtk', 'init'
|
25
|
-
end
|
26
|
-
|
27
|
-
should "delegate definition to Builder::Function" do
|
28
|
-
code = @mbuilder.send :function_definition, @go, Lib
|
29
|
-
expected = GirFFI::Builder::Function.new(@go, Lib).generate
|
30
|
-
assert_equal cws(expected), cws(code)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context "for Regress" do
|
36
|
-
setup do
|
37
|
-
@mbuilder = GirFFI::Builder::Module.new('Regress')
|
38
|
-
end
|
39
|
-
|
40
|
-
context "looking at Regress.test_callback_destroy_notify" do
|
41
|
-
setup do
|
42
|
-
@go = get_introspection_data 'Regress', 'test_callback_destroy_notify'
|
43
|
-
end
|
44
|
-
|
45
|
-
should "delegate definition to Builder::Function" do
|
46
|
-
code = @mbuilder.send :function_definition, @go, Lib
|
47
|
-
expected = GirFFI::Builder::Function.new(@go, Lib).generate
|
48
|
-
assert_equal cws(expected), cws(code)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|