gobject-introspection 3.3.8 → 3.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gobject-introspection/extconf.rb +4 -4
  3. data/ext/gobject-introspection/gobject_introspection.def +2 -1
  4. data/ext/gobject-introspection/rb-gi-arg-info.c +33 -1
  5. data/ext/gobject-introspection/rb-gi-argument.c +384 -3291
  6. data/ext/gobject-introspection/rb-gi-arguments-in.c +2229 -0
  7. data/ext/gobject-introspection/rb-gi-arguments-out.c +929 -0
  8. data/ext/gobject-introspection/rb-gi-arguments.c +850 -0
  9. data/ext/gobject-introspection/rb-gi-array-type.c +54 -0
  10. data/ext/gobject-introspection/rb-gi-callback.c +242 -0
  11. data/ext/gobject-introspection/rb-gi-conversions.h +0 -43
  12. data/ext/gobject-introspection/rb-gi-direction.c +36 -0
  13. data/ext/gobject-introspection/rb-gi-field-info.c +172 -81
  14. data/ext/gobject-introspection/rb-gi-function-info.c +15 -1404
  15. data/ext/gobject-introspection/rb-gi-private-arg-info.h +24 -0
  16. data/ext/gobject-introspection/rb-gi-private-arguments-in.h +26 -0
  17. data/ext/gobject-introspection/rb-gi-private-arguments-out.h +28 -0
  18. data/ext/gobject-introspection/rb-gi-private-arguments.h +107 -0
  19. data/ext/gobject-introspection/rb-gi-private-array-type.h +26 -0
  20. data/ext/gobject-introspection/rb-gi-private-callback.h +41 -0
  21. data/ext/gobject-introspection/rb-gi-private-direction.h +24 -0
  22. data/ext/gobject-introspection/rb-gi-private-transfer.h +24 -0
  23. data/ext/gobject-introspection/rb-gi-private.h +11 -5
  24. data/ext/gobject-introspection/rb-gi-struct-info.c +2 -0
  25. data/ext/gobject-introspection/rb-gi-transfer.c +36 -0
  26. data/ext/gobject-introspection/rb-gi-type-info.c +1 -13
  27. data/ext/gobject-introspection/rb-gobject-introspection.c +4 -1
  28. data/ext/gobject-introspection/rb-gobject-introspection.h +5 -23
  29. data/lib/gobject-introspection/arg-info.rb +2 -0
  30. data/lib/gobject-introspection/callable-info.rb +1 -1
  31. data/lib/gobject-introspection/loader.rb +0 -39
  32. data/lib/gobject-introspection/type-tag.rb +39 -2
  33. metadata +21 -5
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2012-2018 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2012-2019 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -28,36 +28,18 @@
28
28
 
29
29
  typedef gpointer (*RBGICallbackFinderFunc)(GIArgInfo *info);
30
30
 
31
- typedef struct
32
- {
33
- GICallableInfo *callable_info;
34
- GIArgInfo arg_info;
35
- GIScopeType scope_type;
36
- GIDirection direction;
37
- gboolean callback_p;
38
- gboolean closure_p;
39
- gboolean destroy_p;
40
- gboolean array_p;
41
- gboolean array_length_p;
42
- gint in_arg_index;
43
- gint closure_in_arg_index;
44
- gint destroy_in_arg_index;
45
- gint array_in_arg_index;
46
- gint array_length_in_arg_index;
47
- gint array_length_arg_index;
48
- gint rb_arg_index;
49
- gint out_arg_index;
50
- } RBGIArgMetadata;
51
-
52
31
  typedef struct RBGICallbackData_ RBGICallbackData;
32
+ typedef struct RBGIArgMetadata_ RBGIArgMetadata;
53
33
 
54
- void rb_gi_callback_register_finder (RBGICallbackFinderFunc finder);
55
34
  void rb_gi_callback_data_free (RBGICallbackData *callback_data);
56
35
  RBGIArgMetadata *
57
36
  rb_gi_callback_data_get_metadata(RBGICallbackData *callback_data);
58
37
  VALUE
59
38
  rb_gi_callback_data_get_rb_callback(RBGICallbackData *callback_data);
60
39
 
40
+ void
41
+ rb_gi_callback_register_finder(RBGICallbackFinderFunc finder);
42
+
61
43
  VALUE rb_gi_struct_new_raw(VALUE klass,
62
44
  gpointer instance,
63
45
  gboolean is_owned);
@@ -26,6 +26,7 @@ module GObjectIntrospection
26
26
  sig = "#{name}:"
27
27
  sig << " (optional)" if optional?
28
28
  sig << " (may be null)" if may_be_null?
29
+ sig << " (caller allocates)" if caller_allocates?
29
30
  sig << " #{type.description}"
30
31
  sig
31
32
  end
@@ -35,6 +36,7 @@ module GObjectIntrospection
35
36
  " name=#{name.inspect}" +
36
37
  " optional?=#{optional?.inspect}" +
37
38
  " may_be_null?=#{may_be_null?.inspect}" +
39
+ " caller_allocates?=#{caller_allocates?.inspect}" +
38
40
  " type=#{type.inspect}>"
39
41
  end
40
42
  end
@@ -120,7 +120,7 @@ module GObjectIntrospection
120
120
  true
121
121
  end
122
122
  else
123
- false
123
+ arg.output_buffer?
124
124
  end
125
125
  end
126
126
  end
@@ -341,45 +341,6 @@ module GObjectIntrospection
341
341
  def initialize_post(object)
342
342
  end
343
343
 
344
- def find_suitable_callable_info(infos, arguments)
345
- min_n_args = nil
346
- max_n_args = nil
347
- candidate_infos = []
348
- infos.each do |info|
349
- n_in_args = info.n_in_args
350
- n_required_in_args = info.n_required_in_args
351
- if (n_required_in_args..n_in_args).cover?(arguments.size)
352
- candidate_infos << info
353
- end
354
- min_n_args = [min_n_args || n_required_in_args, n_required_in_args].min
355
- max_n_args = [max_n_args || n_in_args, n_in_args].max
356
- end
357
-
358
- if candidate_infos.size == 1
359
- return candidate_infos.first
360
- elsif candidate_infos.size > 1
361
- candidate_info = candidate_infos.find do |info|
362
- in_arg_infos = info.in_args
363
- arguments.each.with_index.all? do |argument, i|
364
- match_argument?(in_arg_infos[i], argument)
365
- end
366
- end
367
- return candidate_info || candidate_infos.first
368
- end
369
-
370
- detail = "#{arguments.size} for #{min_n_args}"
371
- if min_n_args < max_n_args
372
- detail << "..#{max_n_args}"
373
- end
374
- raise ArgumentError, "wrong number of arguments (#{detail})"
375
- end
376
-
377
- def match_argument?(arg_info, argument)
378
- return true if argument.nil? and arg_info.may_be_null?
379
-
380
- arg_info.type.match?(argument)
381
- end
382
-
383
344
  def rubyish_method_name(function_info, options={})
384
345
  name = function_info.name
385
346
  if options[:prefix]
@@ -115,7 +115,7 @@ module GObjectIntrospection
115
115
  def try_convert(type_info, value)
116
116
  value = Array.try_convert(value)
117
117
  return nil if value.nil?
118
- element_type_info = type_info.get_param_type(0)
118
+ element_type_info = get_element_type_info(type_info)
119
119
  value.collect do |v|
120
120
  unless v.nil?
121
121
  v = element_type_info.try_convert(v)
@@ -129,12 +129,49 @@ module GObjectIntrospection
129
129
  element_type_info = type_info.get_param_type(0)
130
130
  "#{super}(#{element_type_info.description})"
131
131
  end
132
+
133
+ def get_element_type_info(type_info)
134
+ type_info.get_param_type(0)
135
+ end
136
+ end
137
+
138
+ class << ARRAY
139
+ include ArrayTypeTag
140
+
141
+ def try_convert(type_info, value)
142
+ case get_element_type_info(type_info).tag
143
+ when INT8, UINT8
144
+ case value
145
+ when String
146
+ return value
147
+ when GLib::Bytes
148
+ return value.to_s
149
+ end
150
+ end
151
+ super
152
+ end
132
153
  end
133
154
 
134
- ARRAY.extend(ArrayTypeTag)
135
155
  GLIST.extend(ArrayTypeTag)
136
156
  GSLIST.extend(ArrayTypeTag)
137
157
 
158
+ class << GHASH
159
+ def try_convert(type_info, value)
160
+ case value
161
+ when Hash
162
+ value
163
+ else
164
+ nil
165
+ end
166
+ end
167
+
168
+ def description(type_info)
169
+ key_type = type_info.get_param_type(0)
170
+ value_type = type_info.get_param_type(1)
171
+ "#{super}(#{key_type.description}->#{value_type.description})"
172
+ end
173
+ end
174
+
138
175
  class << INTERFACE
139
176
  def try_convert(type_info, value)
140
177
  type_info.interface.try_convert(value)
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: 3.3.8
4
+ version: 3.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-09 00:00:00.000000000 Z
11
+ date: 2019-10-10 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: 3.3.8
19
+ version: 3.3.9
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: 3.3.8
26
+ version: 3.3.9
27
27
  description: Ruby/GObjectIntrospection provides bindings of GObject Introspection
28
28
  and a loader module that can generate dynamically Ruby bindings of any GObject C
29
29
  libraries
@@ -43,13 +43,19 @@ files:
43
43
  - ext/gobject-introspection/gobject_introspection.def
44
44
  - ext/gobject-introspection/rb-gi-arg-info.c
45
45
  - ext/gobject-introspection/rb-gi-argument.c
46
+ - ext/gobject-introspection/rb-gi-arguments-in.c
47
+ - ext/gobject-introspection/rb-gi-arguments-out.c
48
+ - ext/gobject-introspection/rb-gi-arguments.c
49
+ - ext/gobject-introspection/rb-gi-array-type.c
46
50
  - ext/gobject-introspection/rb-gi-base-info.c
47
51
  - ext/gobject-introspection/rb-gi-boxed-info.c
48
52
  - ext/gobject-introspection/rb-gi-callable-info.c
49
53
  - ext/gobject-introspection/rb-gi-callback-info.c
54
+ - ext/gobject-introspection/rb-gi-callback.c
50
55
  - ext/gobject-introspection/rb-gi-constant-info.c
51
56
  - ext/gobject-introspection/rb-gi-constructor-info.c
52
57
  - ext/gobject-introspection/rb-gi-conversions.h
58
+ - ext/gobject-introspection/rb-gi-direction.c
53
59
  - ext/gobject-introspection/rb-gi-enum-info.c
54
60
  - ext/gobject-introspection/rb-gi-field-info.c
55
61
  - ext/gobject-introspection/rb-gi-flags-info.c
@@ -58,12 +64,21 @@ files:
58
64
  - ext/gobject-introspection/rb-gi-loader.c
59
65
  - ext/gobject-introspection/rb-gi-method-info.c
60
66
  - ext/gobject-introspection/rb-gi-object-info.c
67
+ - ext/gobject-introspection/rb-gi-private-arg-info.h
68
+ - ext/gobject-introspection/rb-gi-private-arguments-in.h
69
+ - ext/gobject-introspection/rb-gi-private-arguments-out.h
70
+ - ext/gobject-introspection/rb-gi-private-arguments.h
71
+ - ext/gobject-introspection/rb-gi-private-array-type.h
72
+ - ext/gobject-introspection/rb-gi-private-callback.h
73
+ - ext/gobject-introspection/rb-gi-private-direction.h
74
+ - ext/gobject-introspection/rb-gi-private-transfer.h
61
75
  - ext/gobject-introspection/rb-gi-private.h
62
76
  - ext/gobject-introspection/rb-gi-property-info.c
63
77
  - ext/gobject-introspection/rb-gi-registered-type-info.c
64
78
  - ext/gobject-introspection/rb-gi-repository.c
65
79
  - ext/gobject-introspection/rb-gi-signal-info.c
66
80
  - ext/gobject-introspection/rb-gi-struct-info.c
81
+ - ext/gobject-introspection/rb-gi-transfer.c
67
82
  - ext/gobject-introspection/rb-gi-type-info.c
68
83
  - ext/gobject-introspection/rb-gi-type-tag.c
69
84
  - ext/gobject-introspection/rb-gi-types.h
@@ -139,7 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
154
  - !ruby/object:Gem::Version
140
155
  version: '0'
141
156
  requirements: []
142
- rubygems_version: 3.1.0.pre1
157
+ rubyforge_project:
158
+ rubygems_version: 2.7.6.2
143
159
  signing_key:
144
160
  specification_version: 4
145
161
  summary: Ruby/GObjectIntrospection is a Ruby binding of GObject Introspection.