gobject-introspection 3.0.9-x64-mingw32 → 3.1.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/ext/gobject-introspection/rb-gi-argument.c +205 -47
  4. data/ext/gobject-introspection/rb-gi-constructor-info.c +9 -15
  5. data/ext/gobject-introspection/rb-gi-function-info.c +147 -46
  6. data/ext/gobject-introspection/rb-gi-method-info.c +5 -3
  7. data/ext/gobject-introspection/rb-gi-private.h +3 -1
  8. data/lib/2.2/gobject_introspection.so +0 -0
  9. data/lib/2.3/gobject_introspection.so +0 -0
  10. data/lib/gi.rb +19 -0
  11. data/lib/gobject-introspection.rb +10 -0
  12. data/lib/gobject-introspection/callable-info.rb +19 -5
  13. data/lib/gobject-introspection/loader.rb +113 -82
  14. data/vendor/local/bin/g-ir-compiler.exe +0 -0
  15. data/vendor/local/bin/g-ir-generate.exe +0 -0
  16. data/vendor/local/bin/g-ir-inspect.exe +0 -0
  17. data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
  18. data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
  19. data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
  20. data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
  21. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
  22. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
  23. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
  24. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
  25. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
  26. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
  27. data/vendor/local/lib/gobject-introspection/giscanner/ast.py +2 -1
  28. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
  29. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
  30. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
  31. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
  32. data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyc +0 -0
  33. data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyo +0 -0
  34. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
  35. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
  36. data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyc +0 -0
  37. data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyo +0 -0
  38. data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyc +0 -0
  39. data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyo +0 -0
  40. data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyc +0 -0
  41. data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyo +0 -0
  42. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
  43. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
  44. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
  45. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
  46. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
  47. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
  48. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
  49. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
  50. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
  51. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
  52. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
  53. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
  54. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
  55. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
  56. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
  57. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
  58. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
  59. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
  60. data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
  61. data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
  62. data/vendor/local/lib/gobject-introspection/giscanner/msvccompiler.pyc +0 -0
  63. data/vendor/local/lib/gobject-introspection/giscanner/msvccompiler.pyo +0 -0
  64. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
  65. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
  66. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
  67. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
  68. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
  69. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
  70. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
  71. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
  72. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
  73. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
  74. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
  75. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
  76. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
  77. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
  78. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
  79. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
  80. data/vendor/local/lib/libgirepository-1.0.a +0 -0
  81. data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
  82. data/vendor/local/lib/libgirepository-1.0.la +2 -2
  83. data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +1 -1
  84. data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +1 -1
  85. data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +10 -4
  86. data/vendor/local/share/gir-1.0/GLib-2.0.gir +939 -162
  87. data/vendor/local/share/gir-1.0/GObject-2.0.gir +389 -565
  88. data/vendor/local/share/gir-1.0/Gio-2.0.gir +594 -173
  89. data/vendor/local/share/gobject-introspection-1.0/gdump.c +8 -1
  90. data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +13 -0
  91. metadata +7 -5
@@ -78,44 +78,33 @@ module GObjectIntrospection
78
78
  end
79
79
 
80
80
  def define_module_function(target_module, name, function_info)
81
- unlock_gvl = should_unlock_gvl?(function_info, target_module)
82
- prepare = lambda do |arguments, &block|
83
- arguments, block = build_arguments(function_info, arguments, &block)
84
- method_name = "#{target_module}\#.#{name}"
85
- validate_arguments(function_info, method_name, arguments)
86
- [arguments, block]
87
- end
81
+ function_info.unlock_gvl = should_unlock_gvl?(function_info, target_module)
82
+ method_name = "#{target_module}\#.#{name}"
83
+ arguments_builder = ArgumentsBuilder.new(function_info, method_name)
88
84
  target_module.module_eval do
89
85
  define_method(name) do |*arguments, &block|
90
- arguments, block = prepare.call(arguments, &block)
91
- function_info.invoke({
92
- :arguments => arguments,
93
- :unlock_gvl => unlock_gvl,
94
- },
95
- &block)
86
+ arguments_builder.build(arguments, block)
87
+ arguments = arguments_builder.arguments
88
+ block = arguments_builder.block
89
+ function_info.invoke(arguments, &block)
96
90
  end
97
91
  module_function(name)
98
92
  end
99
93
  end
100
94
 
101
95
  def define_singleton_method(klass, name, info)
102
- unlock_gvl = should_unlock_gvl?(info, klass)
103
- prepare = lambda do |arguments, &block|
104
- arguments, block = build_arguments(info, arguments, &block)
105
- validate_arguments(info, "#{klass}.#{name}", arguments)
106
- [arguments, block]
107
- end
96
+ info.unlock_gvl = should_unlock_gvl?(info, klass)
97
+ arguments_builder = ArgumentsBuilder.new(info, "#{klass}.#{name}")
98
+ require_callback_p = info.require_callback?
108
99
  singleton_class = (class << klass; self; end)
109
100
  singleton_class.__send__(:define_method, name) do |*arguments, &block|
110
- arguments, block = prepare.call(arguments, &block)
111
- if block.nil? and info.require_callback?
101
+ arguments_builder.build(arguments, block)
102
+ arguments = arguments_builder.arguments
103
+ block = arguments_builder.block
104
+ if block.nil? and require_callback_p
112
105
  to_enum(name, *arguments)
113
106
  else
114
- info.invoke({
115
- :arguments => arguments,
116
- :unlock_gvl => unlock_gvl,
117
- },
118
- &block)
107
+ info.invoke(arguments, &block)
119
108
  end
120
109
  end
121
110
  end
@@ -286,25 +275,18 @@ module GObjectIntrospection
286
275
  def load_constructor_infos(infos, klass)
287
276
  return if infos.empty?
288
277
 
289
- prepare = lambda do |info, method_name, arguments, &block|
290
- arguments, block = build_arguments(info, arguments, &block)
291
- validate_arguments(info, "#{klass}\##{method_name}", arguments)
292
- [arguments, block]
293
- end
294
278
  call_initialize_post = lambda do |object|
295
279
  initialize_post(object)
296
280
  end
297
281
  infos.each do |info|
298
282
  name = "initialize_#{info.name}"
299
- unlock_gvl = should_unlock_gvl?(info, klass)
283
+ info.unlock_gvl = should_unlock_gvl?(info, klass)
284
+ arguments_builder = ArgumentsBuilder.new(info, "#{klass}\##{name}")
300
285
  klass.__send__(:define_method, name) do |*arguments, &block|
301
- arguments, block = prepare.call(info, name, arguments, &block)
302
- info.invoke({
303
- :receiver => self,
304
- :arguments => arguments,
305
- :unlock_gvl => unlock_gvl,
306
- },
307
- &block)
286
+ arguments_builder.build(arguments, block)
287
+ arguments = arguments_builder.arguments
288
+ block = arguments_builder.block
289
+ info.invoke(self, arguments, &block)
308
290
  call_initialize_post.call(self)
309
291
  end
310
292
  klass.__send__(:private, name)
@@ -320,30 +302,8 @@ module GObjectIntrospection
320
302
  end
321
303
 
322
304
  def initialize_post(object)
323
- end
324
-
325
- def build_arguments(info, arguments, &block)
326
- last_in_arg = info.in_args.last
327
- if block and last_in_arg and last_in_arg.gclosure?
328
- [arguments + [block], nil]
329
- else
330
- [arguments, block]
331
- end
332
- end
333
-
334
- def validate_arguments(info, method_name, arguments)
335
- n_in_args = info.n_in_args
336
- n_required_in_args = info.n_required_in_args
337
- return if (n_required_in_args..n_in_args).cover?(arguments.size)
338
-
339
- detail = "#{arguments.size} for "
340
- if n_in_args == n_required_in_args
341
- detail << "#{n_in_args}"
342
- else
343
- detail << "#{n_required_in_args}..#{n_in_args}"
344
- end
345
- message = "#{method_name}: wrong number of arguments (#{detail})"
346
- raise ArgumentError, message
305
+ return unless object.is_a?(GLib::Object)
306
+ self.class.reference_gobject(object, :sink => true)
347
307
  end
348
308
 
349
309
  def find_suitable_callable_info(infos, arguments)
@@ -453,7 +413,7 @@ module GObjectIntrospection
453
413
  case return_type_tag
454
414
  when TypeTag::BOOLEAN
455
415
  case name
456
- when /\A(?:is|get_is)_/
416
+ when /\A(?:is|get_is|can_be)_/
457
417
  "#{$POSTMATCH}?"
458
418
  when /\Aget_/
459
419
  if function_info.n_in_args.zero?
@@ -539,33 +499,29 @@ module GObjectIntrospection
539
499
  end
540
500
 
541
501
  def define_method(info, klass, method_name)
542
- unlock_gvl = should_unlock_gvl?(info, klass)
502
+ info.unlock_gvl = should_unlock_gvl?(info, klass)
543
503
  remove_existing_method(klass, method_name)
544
504
  function_info_p = (info.class == FunctionInfo)
545
- no_return_value_p =
546
- (info.return_type.tag == TypeTag::VOID and info.n_out_args.zero?)
547
- prepare = lambda do |arguments, &block|
548
- arguments, block = build_arguments(info, arguments, &block)
549
- validate_arguments(info, "#{klass}\##{method_name}", arguments)
550
- [arguments, block]
551
- end
505
+ have_return_value_p = info.have_return_value?
506
+ arguments_builder = ArgumentsBuilder.new(info, "#{klass}\##{method_name}")
552
507
  require_callback_p = info.require_callback?
553
508
  klass.__send__(:define_method, method_name) do |*arguments, &block|
554
- arguments = [self] + arguments if function_info_p
555
- arguments, block = prepare.call(arguments, &block)
509
+ arguments.unshift(self) if function_info_p
510
+ arguments_builder.build(arguments, block)
511
+ arguments = arguments_builder.arguments
512
+ block = arguments_builder.block
556
513
  if block.nil? and require_callback_p
557
514
  to_enum(method_name, *arguments)
558
515
  else
559
- options = {
560
- :arguments => arguments,
561
- :unlock_gvl => unlock_gvl,
562
- }
563
- options[:receiver] = self unless function_info_p
564
- return_value = info.invoke(options, &block)
565
- if no_return_value_p
566
- self
516
+ if function_info_p
517
+ return_value = info.invoke(arguments, &block)
567
518
  else
519
+ return_value = info.invoke(self, arguments, &block)
520
+ end
521
+ if have_return_value_p
568
522
  return_value
523
+ else
524
+ self
569
525
  end
570
526
  end
571
527
  end
@@ -609,5 +565,80 @@ module GObjectIntrospection
609
565
  load_fields(info, klass)
610
566
  load_methods(info, klass)
611
567
  end
568
+
569
+ class ArgumentsBuilder
570
+ attr_reader :arguments
571
+ attr_reader :block
572
+ def initialize(info, method_name)
573
+ @info = info
574
+ @method_name = method_name
575
+
576
+ @prepared = false
577
+
578
+ @arguments = nil
579
+ @block = nil
580
+ end
581
+
582
+ def build(arguments, block)
583
+ prepare
584
+
585
+ @arguments = arguments
586
+ @block = block
587
+
588
+ build_arguments
589
+ validate_arguments
590
+ end
591
+
592
+ private
593
+ def prepare
594
+ return if @prepared
595
+
596
+ @in_args = @info.in_args
597
+ @n_in_args = @in_args.size
598
+ @n_required_in_args = @info.n_required_in_args
599
+ @last_in_arg = @in_args.last
600
+ if @last_in_arg
601
+ @last_in_arg_is_gclosure = @last_in_arg.gclosure?
602
+ else
603
+ @last_in_arg_is_gclosure = false
604
+ end
605
+ @valid_n_args_range = (@n_required_in_args..@n_in_args)
606
+
607
+ @prepared = true
608
+ end
609
+
610
+ def build_arguments
611
+ if @block and @last_in_arg_is_gclosure
612
+ @arguments << @block
613
+ @block = nil
614
+ end
615
+
616
+ n_missing_arguments = @n_in_args - @arguments.size
617
+ if n_missing_arguments > 0
618
+ nil_indexes = []
619
+ @in_args.each_with_index do |arg, i|
620
+ nil_indexes << i if arg.may_be_null?
621
+ end
622
+ return if nil_indexes.size < n_missing_arguments
623
+ nil_indexes.each_with_index do |nil_index, i|
624
+ next if i <= n_missing_arguments
625
+ @arguments.insert(nil_index, nil)
626
+ end
627
+ end
628
+ end
629
+
630
+ def validate_arguments
631
+ return if @valid_n_args_range.cover?(@arguments.size)
632
+
633
+ detail = "#{@arguments.size} for "
634
+ if @n_in_args == @n_required_in_args
635
+ detail << "#{@n_in_args}"
636
+ else
637
+ detail << "#{@n_required_in_args}..#{@n_in_args}"
638
+ end
639
+ message = "#{@method_name}: wrong number of arguments (#{detail})"
640
+ raise ArgumentError, message
641
+ end
642
+ end
612
643
  end
613
644
  end
Binary file
Binary file
Binary file
@@ -569,7 +569,8 @@ class Node(Annotated):
569
569
  (namespace, name) pair. When combined with a ., this is called a
570
570
  GIName. It's possible for nodes to contain or point to other nodes."""
571
571
 
572
- c_name = property(lambda self: self.namespace.name + self.name)
572
+ c_name = property(lambda self: self.namespace.name + self.name if self.namespace else
573
+ self.name)
573
574
  gi_name = property(lambda self: '%s.%s' % (self.namespace.name, self.name))
574
575
 
575
576
  def __init__(self, name=None):
Binary file
@@ -1,5 +1,5 @@
1
1
  # libgirepository-1.0.la - a libtool library file
2
- # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.11
2
+ # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1
3
3
  #
4
4
  # Please DO NOT delete this file!
5
5
  # It is necessary for linking the library.
@@ -13,7 +13,7 @@ library_names='libgirepository-1.0.dll.a'
13
13
  # The name of the static archive.
14
14
  old_library='libgirepository-1.0.a'
15
15
 
16
- # Linker flags that can not go in dependency_libs.
16
+ # Linker flags that cannot go in dependency_libs.
17
17
  inherited_linker_flags=' -pthread'
18
18
 
19
19
  # Libraries that this one depends upon.