gobject-introspection 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/ext/gobject-introspection/rb-gi-argument.c +599 -103
- data/ext/gobject-introspection/rb-gi-conversions.h +30 -1
- data/ext/gobject-introspection/rb-gi-enum-info.c +11 -1
- data/ext/gobject-introspection/rb-gi-function-info.c +108 -60
- data/ext/gobject-introspection/rb-gi-loader.c +42 -1
- data/ext/gobject-introspection/rb-gobject-introspection.h +6 -3
- data/lib/1.9/gobject_introspection.so +0 -0
- data/lib/2.0/gobject_introspection.so +0 -0
- data/lib/2.1/gobject_introspection.so +0 -0
- data/lib/gobject-introspection/loader.rb +76 -19
- data/test/test-enum-info.rb +6 -1
- data/test/test-interface-info.rb +3 -3
- data/test/test-repository.rb +5 -2
- data/test/test-signal-info.rb +6 -3
- data/test/test-struct-info.rb +3 -3
- data/vendor/local/bin/g-ir-compiler.exe +0 -0
- data/vendor/local/bin/g-ir-generate.exe +0 -0
- data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
- data/vendor/local/lib/libgirepository-1.0.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
- metadata +4 -4
Binary file
|
Binary file
|
Binary file
|
@@ -94,6 +94,26 @@ module GObjectIntrospection
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
+
def define_singleton_method(klass, name, info)
|
98
|
+
unlock_gvl = should_unlock_gvl?(info, klass)
|
99
|
+
validate = lambda do |arguments|
|
100
|
+
validate_arguments(info, "#{klass}.#{name}", arguments)
|
101
|
+
end
|
102
|
+
singleton_class = (class << klass; self; end)
|
103
|
+
singleton_class.__send__(:define_method, name) do |*arguments, &block|
|
104
|
+
validate.call(arguments, &block)
|
105
|
+
if block.nil? and info.require_callback?
|
106
|
+
Enumerator.new(self, name, *arguments)
|
107
|
+
else
|
108
|
+
info.invoke({
|
109
|
+
:arguments => arguments,
|
110
|
+
:unlock_gvl => unlock_gvl,
|
111
|
+
},
|
112
|
+
&block)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
97
117
|
def define_struct(info, options={})
|
98
118
|
if info.gtype == GLib::Type::NONE
|
99
119
|
klass = self.class.define_struct(info.size, info.name, @base_module,
|
@@ -127,6 +147,32 @@ module GObjectIntrospection
|
|
127
147
|
enum_module.const_set(value_info.name.upcase, value_info.value)
|
128
148
|
end
|
129
149
|
|
150
|
+
def define_enum(info)
|
151
|
+
self.class.define_class(info.gtype,
|
152
|
+
enum_class_name(info),
|
153
|
+
@base_module)
|
154
|
+
end
|
155
|
+
|
156
|
+
def enum_class_name(info)
|
157
|
+
info.name
|
158
|
+
end
|
159
|
+
|
160
|
+
def define_error(info)
|
161
|
+
self.class.define_error(info.error_domain,
|
162
|
+
error_class_name(info),
|
163
|
+
@base_module,
|
164
|
+
:parent => error_parent_class(info),
|
165
|
+
:gtype => info.gtype)
|
166
|
+
end
|
167
|
+
|
168
|
+
def error_class_name(info)
|
169
|
+
info.name
|
170
|
+
end
|
171
|
+
|
172
|
+
def error_parent_class(info)
|
173
|
+
nil
|
174
|
+
end
|
175
|
+
|
130
176
|
def load_enum_info(info)
|
131
177
|
if info.gtype == GLib::Type::NONE
|
132
178
|
enum_module = Module.new
|
@@ -135,7 +181,11 @@ module GObjectIntrospection
|
|
135
181
|
end
|
136
182
|
@base_module.const_set(info.name, enum_module)
|
137
183
|
else
|
138
|
-
|
184
|
+
if info.error_domain
|
185
|
+
define_error(info)
|
186
|
+
else
|
187
|
+
define_enum(info)
|
188
|
+
end
|
139
189
|
end
|
140
190
|
end
|
141
191
|
|
@@ -252,14 +302,27 @@ module GObjectIntrospection
|
|
252
302
|
def find_suitable_callable_info(infos, arguments)
|
253
303
|
min_n_args = nil
|
254
304
|
max_n_args = nil
|
305
|
+
candidate_infos = []
|
255
306
|
infos.each do |info|
|
256
307
|
if arguments.size == info.n_in_args
|
257
|
-
|
308
|
+
candidate_infos << info
|
258
309
|
end
|
259
310
|
n_in_args = info.n_in_args
|
260
311
|
min_n_args = [min_n_args || n_in_args, n_in_args].min
|
261
312
|
max_n_args = [max_n_args || n_in_args, n_in_args].max
|
262
313
|
end
|
314
|
+
|
315
|
+
if candidate_infos.size == 1
|
316
|
+
return candidate_infos.first
|
317
|
+
elsif candidate_infos.size > 1
|
318
|
+
candidate_info = candidate_infos.find do |info|
|
319
|
+
info.in_args.each.with_index.all? do |arg_info, i|
|
320
|
+
match_argument?(arg_info, arguments[i])
|
321
|
+
end
|
322
|
+
end
|
323
|
+
return candidate_info || candidate_infos.first
|
324
|
+
end
|
325
|
+
|
263
326
|
detail = "#{arguments.size} for #{min_n_args}"
|
264
327
|
if min_n_args < max_n_args
|
265
328
|
detail << "..#{max_n_args}"
|
@@ -267,6 +330,16 @@ module GObjectIntrospection
|
|
267
330
|
raise ArgumentError, "wrong number of arguments (#{detail})"
|
268
331
|
end
|
269
332
|
|
333
|
+
def match_argument?(arg_info, argument)
|
334
|
+
case arg_info.type.tag
|
335
|
+
when TypeTag::UTF8
|
336
|
+
argument.is_a?(String)
|
337
|
+
else
|
338
|
+
# TODO
|
339
|
+
false
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
270
343
|
def rubyish_method_name(function_info)
|
271
344
|
name = function_info.name
|
272
345
|
return_type = function_info.return_type
|
@@ -332,23 +405,7 @@ module GObjectIntrospection
|
|
332
405
|
name = rubyish_method_name(info)
|
333
406
|
next if name == "new"
|
334
407
|
next if name == "alloc"
|
335
|
-
|
336
|
-
validate = lambda do |arguments|
|
337
|
-
validate_arguments(info, "#{klass}.#{name}", arguments)
|
338
|
-
end
|
339
|
-
singleton_class = (class << klass; self; end)
|
340
|
-
singleton_class.__send__(:define_method, name) do |*arguments, &block|
|
341
|
-
validate.call(arguments, &block)
|
342
|
-
if block.nil? and info.require_callback?
|
343
|
-
Enumerator.new(self, name, *arguments)
|
344
|
-
else
|
345
|
-
info.invoke({
|
346
|
-
:arguments => arguments,
|
347
|
-
:unlock_gvl => unlock_gvl,
|
348
|
-
},
|
349
|
-
&block)
|
350
|
-
end
|
351
|
-
end
|
408
|
+
define_singleton_method(klass, name, info)
|
352
409
|
end
|
353
410
|
end
|
354
411
|
|
data/test/test-enum-info.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -53,4 +53,9 @@ class TestEnumInfo < Test::Unit::TestCase
|
|
53
53
|
assert_equal(GObjectIntrospection::TypeTag::UINT32,
|
54
54
|
@info.storage_type)
|
55
55
|
end
|
56
|
+
|
57
|
+
def test_error_domain
|
58
|
+
assert_equal("g-resource-error-quark",
|
59
|
+
@info.error_domain)
|
60
|
+
end
|
56
61
|
end
|
data/test/test-interface-info.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -67,9 +67,9 @@ class TestInterfaceInfo < Test::Unit::TestCase
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_get_signal_name
|
70
|
-
require_version(1,
|
70
|
+
require_version(1, 36, 0)
|
71
71
|
info = @repository.find("Gio", "Volume")
|
72
|
-
assert_kind_of(GObjectIntrospection::
|
72
|
+
assert_kind_of(GObjectIntrospection::SignalInfo,
|
73
73
|
info.get_signal("changed"))
|
74
74
|
end
|
75
75
|
|
data/test/test-repository.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -15,6 +15,8 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
class TestRepository < Test::Unit::TestCase
|
18
|
+
include GObjectIntrospectionTestUtils
|
19
|
+
|
18
20
|
def setup
|
19
21
|
@repository = GObjectIntrospection::Repository.default
|
20
22
|
@repository.require("GObject")
|
@@ -31,7 +33,8 @@ class TestRepository < Test::Unit::TestCase
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def test_get_dependencies
|
34
|
-
|
36
|
+
require_version(1, 36, 0)
|
37
|
+
assert_equal(["GObject-2.0"].sort,
|
35
38
|
@repository.get_dependencies("Gio").sort)
|
36
39
|
end
|
37
40
|
|
data/test/test-signal-info.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -15,15 +15,18 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
class TestSignalInfo < Test::Unit::TestCase
|
18
|
+
include GObjectIntrospectionTestUtils
|
19
|
+
|
18
20
|
def setup
|
19
21
|
@repository = GObjectIntrospection::Repository.default
|
20
22
|
@repository.require("Gio")
|
21
23
|
@object_info = @repository.find("Gio", "Application")
|
22
|
-
@info = @object_info.
|
24
|
+
@info = @object_info.signals.find {|info| info.name == "startup"}
|
23
25
|
end
|
24
26
|
|
25
27
|
def test_flags
|
26
|
-
|
28
|
+
require_version(1, 39, 0)
|
29
|
+
assert_equal(GLib::SignalFlags::RUN_LAST,
|
27
30
|
@info.flags)
|
28
31
|
end
|
29
32
|
|
data/test/test-struct-info.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -40,11 +40,11 @@ class TestStructInfo < Test::Unit::TestCase
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_size
|
43
|
-
|
43
|
+
assert_operator(@info.size, :>=, 20)
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_alignment
|
47
|
-
|
47
|
+
assert_operator(@info.alignment, :>=, 4)
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_gtype_struct?
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gobject-introspection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: test-unit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|