gobject-introspection 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2b33d8b025d28920a8a75802bb7e998c6eef5cbf
4
+ data.tar.gz: c795369cc730bca73b3a4cf493445f7193907246
5
+ SHA512:
6
+ metadata.gz: 6b45eb6712bbc7cd367090175b215b45eeb3528444916054965aa40e118b575c12525302c7b556ac9cadee39ead9a631b561bf28677b9833f84eee76c362e31a
7
+ data.tar.gz: 715cd7436f1d4223fb31e963ae94c5e422112c1dd0861a3569b5bdab99a8802b5af09f00526dd152468b2f9c0b3a66eb6e4b9a83a91c4cf89f5fabf3161030e7
data/Rakefile CHANGED
@@ -32,7 +32,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
32
32
  :name => "glib",
33
33
  :download_site => :gnome,
34
34
  :label => "GLib",
35
- :version => "2.36.2",
35
+ :version => "2.38.2",
36
36
  :compression_method => "xz",
37
37
  :windows => {
38
38
  :build => false,
@@ -40,13 +40,14 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
40
40
  :native => {
41
41
  :build => true,
42
42
  :need_autoreconf => true,
43
+ :built_file => "lib/libglib-2.0.so",
43
44
  },
44
45
  },
45
46
  {
46
47
  :name => "gobject-introspection",
47
48
  :download_site => :gnome,
48
49
  :label => "gobject-introspection",
49
- :version => "1.36.0",
50
+ :version => "1.38.0",
50
51
  :compression_method => "xz",
51
52
  :windows => {
52
53
  :configure_args => [
@@ -57,12 +58,14 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
57
58
  "0001-Support-external-g-ir-scanner.patch",
58
59
  ],
59
60
  :need_autoreconf => true,
61
+ :built_file => "bin/libgirepository-1.0-1.dll",
60
62
  },
61
63
  :native => {
62
64
  :build => true,
63
65
  :patches => [
64
66
  # "cross-compilable-g-ir-scanner.diff",
65
67
  ],
68
+ :built_file => "bin/g-ir-scanner",
66
69
  }
67
70
  },
68
71
  ]
@@ -29,6 +29,10 @@ array_c_to_ruby(const gchar **elements, GITypeInfo *type_info, VALUE rb_array)
29
29
  gboolean fixed_size_p;
30
30
  gboolean zero_terminated_p;
31
31
 
32
+ if (!elements) {
33
+ return;
34
+ }
35
+
32
36
  n_elements = g_type_info_get_array_length(type_info);
33
37
  fixed_size_p = g_type_info_get_array_fixed_size(type_info);
34
38
  zero_terminated_p = g_type_info_is_zero_terminated(type_info);
@@ -257,9 +261,13 @@ rb_gi_argument_to_ruby(GIArgument *argument, GITypeInfo *type_info)
257
261
  rb_argument = interface_to_ruby(argument, type_info);
258
262
  break;
259
263
  case GI_TYPE_TAG_GLIST:
264
+ rb_argument = GOBJGLIST2RVAL(argument->v_pointer);
265
+ break;
260
266
  case GI_TYPE_TAG_GSLIST:
261
267
  case GI_TYPE_TAG_GHASH:
262
- rb_raise(rb_eNotImpError, "TODO: GIArgument(unichar) -> Ruby");
268
+ rb_raise(rb_eNotImpError,
269
+ "TODO: GIArgument(%s) -> Ruby",
270
+ g_type_tag_to_string(type_tag));
263
271
  break;
264
272
  case GI_TYPE_TAG_ERROR:
265
273
  rb_argument = GERROR2RVAL(argument->v_pointer);
@@ -505,10 +513,201 @@ rb_gi_out_argument_fin(GIArgument *argument, GIArgInfo *arg_info)
505
513
  xfree(argument->v_pointer);
506
514
  }
507
515
 
516
+ static void
517
+ rb_gi_return_argument_free_container(GIArgument *argument,
518
+ GITypeInfo *type_info)
519
+ {
520
+ GITypeTag type_tag;
521
+
522
+ type_tag = g_type_info_get_tag(type_info);
523
+
524
+ rb_raise(rb_eNotImpError,
525
+ "TODO: free GIArgument(%s) as container",
526
+ g_type_tag_to_string(type_tag));
527
+ }
528
+
529
+ static void
530
+ rb_gi_return_argument_free_everything_array(GIArgument *argument,
531
+ GITypeInfo *type_info)
532
+ {
533
+ switch (g_type_info_get_array_type(type_info)) {
534
+ case GI_ARRAY_TYPE_C:
535
+ g_strfreev(argument->v_pointer);
536
+ break;
537
+ case GI_ARRAY_TYPE_ARRAY:
538
+ g_array_free(argument->v_pointer, TRUE);
539
+ break;
540
+ case GI_ARRAY_TYPE_PTR_ARRAY:
541
+ g_ptr_array_free(argument->v_pointer, TRUE);
542
+ break;
543
+ case GI_ARRAY_TYPE_BYTE_ARRAY:
544
+ g_ptr_array_free(argument->v_pointer, TRUE);
545
+ break;
546
+ default:
547
+ g_assert_not_reached();
548
+ break;
549
+ }
550
+ }
551
+
552
+ static void
553
+ rb_gi_return_argument_free_everything_interface(GIArgument *argument,
554
+ GITypeInfo *type_info)
555
+ {
556
+ GIBaseInfo *interface_info;
557
+ GIInfoType interface_type;
558
+
559
+ interface_info = g_type_info_get_interface(type_info);
560
+ interface_type = g_base_info_get_type(interface_info);
561
+ g_base_info_unref(interface_info);
562
+
563
+ switch (interface_type) {
564
+ case GI_INFO_TYPE_INVALID:
565
+ rb_raise(rb_eNotImpError,
566
+ "TODO: free GIArgument(interface)[invalid] everything");
567
+ break;
568
+ case GI_INFO_TYPE_FUNCTION:
569
+ rb_raise(rb_eNotImpError,
570
+ "TODO: free GIArgument(interface)[function] everything");
571
+ break;
572
+ case GI_INFO_TYPE_CALLBACK:
573
+ rb_raise(rb_eNotImpError,
574
+ "TODO: free GIArgument(interface)[callback] everything");
575
+ break;
576
+ case GI_INFO_TYPE_STRUCT:
577
+ rbgobj_instance_unref(argument->v_pointer);
578
+ break;
579
+ case GI_INFO_TYPE_BOXED:
580
+ rb_raise(rb_eNotImpError,
581
+ "TODO: free GIArgument(interface)[boxed] everything");
582
+ break;
583
+ case GI_INFO_TYPE_ENUM:
584
+ rb_raise(rb_eNotImpError,
585
+ "TODO: free GIArgument(interface)[enum] everything");
586
+ break;
587
+ case GI_INFO_TYPE_FLAGS:
588
+ rb_raise(rb_eNotImpError,
589
+ "TODO: free GIArgument(interface)[flags] everything");
590
+ break;
591
+ case GI_INFO_TYPE_OBJECT:
592
+ if (argument->v_pointer) {
593
+ g_object_unref(argument->v_pointer);
594
+ }
595
+ break;
596
+ case GI_INFO_TYPE_INTERFACE:
597
+ rb_raise(rb_eNotImpError,
598
+ "TODO: free GIArgument(interface)[interface] everything");
599
+ break;
600
+ case GI_INFO_TYPE_CONSTANT:
601
+ rb_raise(rb_eNotImpError,
602
+ "TODO: free GIArgument(interface)[constant] everything");
603
+ break;
604
+ case GI_INFO_TYPE_INVALID_0:
605
+ g_assert_not_reached();
606
+ break;
607
+ case GI_INFO_TYPE_UNION:
608
+ rb_raise(rb_eNotImpError,
609
+ "TODO: free GIArgument(interface)[union] everything");
610
+ break;
611
+ case GI_INFO_TYPE_VALUE:
612
+ rb_raise(rb_eNotImpError,
613
+ "TODO: free GIArgument(interface)[value] everything");
614
+ break;
615
+ case GI_INFO_TYPE_SIGNAL:
616
+ rb_raise(rb_eNotImpError,
617
+ "TODO: free GIArgument(interface)[signal] everything");
618
+ break;
619
+ case GI_INFO_TYPE_VFUNC:
620
+ rb_raise(rb_eNotImpError,
621
+ "TODO: free GIArgument(interface)[vfunc] everything");
622
+ break;
623
+ case GI_INFO_TYPE_PROPERTY:
624
+ rb_raise(rb_eNotImpError,
625
+ "TODO: free GIArgument(interface)[property] everything");
626
+ break;
627
+ case GI_INFO_TYPE_FIELD:
628
+ rb_raise(rb_eNotImpError,
629
+ "TODO: free GIArgument(interface)[field] everything");
630
+ break;
631
+ case GI_INFO_TYPE_ARG:
632
+ rb_raise(rb_eNotImpError,
633
+ "TODO: free GIArgument(interface)[arg] everything");
634
+ break;
635
+ case GI_INFO_TYPE_TYPE:
636
+ rb_raise(rb_eNotImpError,
637
+ "TODO: free GIArgument(interface)[type] everything");
638
+ break;
639
+ case GI_INFO_TYPE_UNRESOLVED:
640
+ rb_raise(rb_eNotImpError,
641
+ "TODO: free GIArgument(interface)[unresolved] everything");
642
+ break;
643
+ default:
644
+ g_assert_not_reached();
645
+ break;
646
+ }
647
+ }
648
+
649
+ static void
650
+ rb_gi_return_argument_free_everything(GIArgument *argument,
651
+ GITypeInfo *type_info)
652
+ {
653
+ GITypeTag type_tag;
654
+
655
+ type_tag = g_type_info_get_tag(type_info);
656
+ switch (type_tag) {
657
+ case GI_TYPE_TAG_VOID:
658
+ case GI_TYPE_TAG_BOOLEAN:
659
+ case GI_TYPE_TAG_INT8:
660
+ case GI_TYPE_TAG_UINT8:
661
+ case GI_TYPE_TAG_INT16:
662
+ case GI_TYPE_TAG_UINT16:
663
+ case GI_TYPE_TAG_INT32:
664
+ case GI_TYPE_TAG_UINT32:
665
+ case GI_TYPE_TAG_INT64:
666
+ case GI_TYPE_TAG_UINT64:
667
+ case GI_TYPE_TAG_FLOAT:
668
+ case GI_TYPE_TAG_DOUBLE:
669
+ case GI_TYPE_TAG_GTYPE:
670
+ rb_raise(rb_eNotImpError,
671
+ "TODO: free GIArgument(%s) everything",
672
+ g_type_tag_to_string(type_tag));
673
+ break;
674
+ case GI_TYPE_TAG_UTF8:
675
+ g_free(argument->v_string);
676
+ break;
677
+ case GI_TYPE_TAG_FILENAME:
678
+ rb_raise(rb_eNotImpError,
679
+ "TODO: free GIArgument(%s) everything",
680
+ g_type_tag_to_string(type_tag));
681
+ break;
682
+ case GI_TYPE_TAG_ARRAY:
683
+ rb_gi_return_argument_free_everything_array(argument, type_info);
684
+ break;
685
+ case GI_TYPE_TAG_INTERFACE:
686
+ rb_gi_return_argument_free_everything_interface(argument, type_info);
687
+ break;
688
+ case GI_TYPE_TAG_GLIST:
689
+ g_list_foreach(argument->v_pointer, (GFunc)g_object_unref, NULL);
690
+ g_list_free(argument->v_pointer);
691
+ break;
692
+ case GI_TYPE_TAG_GSLIST:
693
+ case GI_TYPE_TAG_GHASH:
694
+ case GI_TYPE_TAG_ERROR:
695
+ case GI_TYPE_TAG_UNICHAR:
696
+ rb_raise(rb_eNotImpError,
697
+ "TODO: free GIArgument(%s) everything",
698
+ g_type_tag_to_string(type_tag));
699
+ break;
700
+ default:
701
+ g_assert_not_reached();
702
+ break;
703
+ }
704
+ }
705
+
508
706
  VALUE
509
707
  rb_gi_return_argument_to_ruby(GIArgument *argument,
510
708
  GICallableInfo *callable_info)
511
709
  {
710
+ VALUE rb_argument;
512
711
  gboolean may_return_null;
513
712
  GITypeInfo return_value_info;
514
713
 
@@ -518,7 +717,21 @@ rb_gi_return_argument_to_ruby(GIArgument *argument,
518
717
  }
519
718
 
520
719
  g_callable_info_load_return_type(callable_info, &return_value_info);
521
- return rb_gi_argument_to_ruby(argument, &return_value_info);
720
+ rb_argument = rb_gi_argument_to_ruby(argument, &return_value_info);
721
+ switch (g_callable_info_get_caller_owns(callable_info)) {
722
+ case GI_TRANSFER_NOTHING:
723
+ break;
724
+ case GI_TRANSFER_CONTAINER:
725
+ rb_gi_return_argument_free_container(argument, &return_value_info);
726
+ break;
727
+ case GI_TRANSFER_EVERYTHING:
728
+ rb_gi_return_argument_free_everything(argument, &return_value_info);
729
+ break;
730
+ default:
731
+ g_assert_not_reached();
732
+ break;
733
+ }
734
+ return rb_argument;
522
735
  }
523
736
 
524
737
  static void
@@ -538,8 +751,6 @@ rb_gi_argument_from_ruby_array_c(GIArgument *argument,
538
751
  g_type_tag_to_string(element_type_tag));
539
752
  break;
540
753
  case GI_TYPE_TAG_INT8:
541
- argument->v_pointer = StringValueCStr(rb_argument);
542
- break;
543
754
  case GI_TYPE_TAG_UINT8:
544
755
  argument->v_pointer = RSTRING_PTR(rb_argument);
545
756
  break;
@@ -55,9 +55,14 @@ static VALUE
55
55
  struct_alloc(VALUE klass)
56
56
  {
57
57
  VALUE rb_size;
58
+ size_t size;
59
+ gpointer instance;
58
60
 
59
61
  rb_size = rb_iv_get(klass, "@size");
60
- return Data_Wrap_Struct(klass, NULL, xfree, xmalloc(NUM2ULONG(rb_size)));
62
+ size = NUM2ULONG(rb_size);
63
+ instance = xmalloc(size);
64
+ memset(instance, 0, size);
65
+ return Data_Wrap_Struct(klass, NULL, xfree, instance);
61
66
  }
62
67
 
63
68
  static VALUE
@@ -121,7 +126,7 @@ rg_s_register_boxed_class_converter(VALUE klass, VALUE rb_gtype)
121
126
 
122
127
  memset(&table, 0, sizeof(RGConvertTable));
123
128
  CONST_ID(id_to_i, "to_i");
124
- table.type = NUM2UINT(rb_funcall(rb_gtype, id_to_i, 0));
129
+ table.type = NUM2ULONG(rb_funcall(rb_gtype, id_to_i, 0));
125
130
  table.klass = Qnil;
126
131
  table.instance2robj = boxed_instance2robj;
127
132
 
@@ -71,7 +71,7 @@ rg_get_field_value(VALUE self, VALUE rb_struct, VALUE rb_n)
71
71
  VALUE rb_gtype;
72
72
  GType gtype;
73
73
  rb_gtype = rb_funcall(rb_struct, rb_intern("gtype"), 0);
74
- gtype = NUM2UINT(rb_funcall(rb_gtype, rb_intern("to_i"), 0));
74
+ gtype = NUM2ULONG(rb_funcall(rb_gtype, rb_intern("to_i"), 0));
75
75
  instance = RVAL2BOXED(rb_struct, gtype);
76
76
  } else {
77
77
  Data_Get_Struct(rb_struct, void, instance);
@@ -31,7 +31,9 @@ class TestFunctionInfo < Test::Unit::TestCase
31
31
  end
32
32
 
33
33
  def test_invoke
34
- assert_equal("notify", @info.invoke(1))
34
+ # TODO: "#invoke" expects Array. We should confirm specification.
35
+ #assert_equal("notify", @info.invoke(1))
36
+ assert_equal("notify", @info.invoke([1]))
35
37
  end
36
38
  end
37
39
 
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobject-introspection
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
5
- prerelease:
4
+ version: 2.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - The Ruby-GNOME2 Project Team
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-26 00:00:00.000000000 Z
11
+ date: 2013-12-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: glib2
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: 2.0.2
19
+ version: 2.0.3
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: 2.0.2
26
+ version: 2.0.3
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: test-unit
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '2'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '2'
46
41
  description: Ruby/GObjectIntrospection is a Ruby binding of GObjectIntrospection.
@@ -124,26 +119,25 @@ files:
124
119
  - test/test-vfunc-info.rb
125
120
  homepage: http://ruby-gnome2.sourceforge.jp/
126
121
  licenses: []
122
+ metadata: {}
127
123
  post_install_message:
128
124
  rdoc_options: []
129
125
  require_paths:
130
126
  - lib
131
127
  required_ruby_version: !ruby/object:Gem::Requirement
132
- none: false
133
128
  requirements:
134
- - - ! '>='
129
+ - - '>='
135
130
  - !ruby/object:Gem::Version
136
- version: 1.8.5
131
+ version: 1.9.3
137
132
  required_rubygems_version: !ruby/object:Gem::Requirement
138
- none: false
139
133
  requirements:
140
- - - ! '>='
134
+ - - '>='
141
135
  - !ruby/object:Gem::Version
142
136
  version: '0'
143
137
  requirements: []
144
138
  rubyforge_project:
145
- rubygems_version: 1.8.23
139
+ rubygems_version: 2.0.14
146
140
  signing_key:
147
- specification_version: 3
141
+ specification_version: 4
148
142
  summary: Ruby/GObjectIntrospection is a Ruby binding of GObjectIntrospection.
149
143
  test_files: []