gobject-introspection 1.1.9 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013 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
@@ -14,16 +14,15 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- require "gobject-introspection"
17
+ require "gobject-introspection/collection-reader"
18
18
 
19
- module Clutter
20
- class Loader < GObjectIntrospection::Loader
21
- private
22
- def load_constant_info(info)
23
- return unless /\A(?:KEY_|COLOR_)/ =~ info.name
24
- super
25
- end
19
+ module GObjectIntrospection
20
+ class UnionInfo
21
+ extend CollectionReader
26
22
 
27
- load("Clutter", Clutter)
23
+ alias_method :__methods__, :methods
24
+
25
+ collection_reader("fields")
26
+ collection_reader("methods")
28
27
  end
29
28
  end
@@ -19,7 +19,7 @@ class TestArgInfo < Test::Unit::TestCase
19
19
  @repository = GObjectIntrospection::Repository.default
20
20
  @repository.require("GObject")
21
21
  @callable_info = @repository.find("GObject", "signal_name")
22
- @info = @callable_info[0]
22
+ @info = @callable_info.get_arg(0)
23
23
  end
24
24
 
25
25
  def test_direction
@@ -39,8 +39,8 @@ class TestCallableInfo < Test::Unit::TestCase
39
39
  assert_equal(1, @info.n_args)
40
40
  end
41
41
 
42
- def test_aref
43
- assert_equal("signal_id", @info[0].name)
42
+ def test_get_arg
43
+ assert_equal("signal_id", @info.get_arg(0).name)
44
44
  end
45
45
 
46
46
  def test_args
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobject-introspection
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 1
9
- - 9
10
- version: 1.1.9
8
+ - 2
9
+ - 0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - The Ruby-GNOME2 Project Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-30 00:00:00 Z
18
+ date: 2013-01-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: glib2
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 1
28
+ hash: 31
29
29
  segments:
30
30
  - 1
31
- - 1
32
- - 9
33
- version: 1.1.9
31
+ - 2
32
+ - 0
33
+ version: 1.2.0
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -59,8 +59,11 @@ files:
59
59
  - Rakefile
60
60
  - extconf.rb
61
61
  - lib/gobject-introspection.rb
62
+ - lib/gobject-introspection/interface-info.rb
63
+ - lib/gobject-introspection/union-info.rb
62
64
  - lib/gobject-introspection/object-info.rb
63
65
  - lib/gobject-introspection/loader.rb
66
+ - lib/gobject-introspection/callable-info.rb
64
67
  - lib/gobject-introspection/repository.rb
65
68
  - lib/gobject-introspection/collection-reader.rb
66
69
  - lib/gobject-introspection/struct-info.rb
@@ -96,8 +99,6 @@ files:
96
99
  - ext/gobject-introspection/rb-gi-enum-info.c
97
100
  - ext/gobject-introspection/rb-gi-vfunc-info.c
98
101
  - ext/gobject-introspection/rb-gi-type-tag.c
99
- - sample/clutter.rb
100
- - sample/clutter-basic-actor.rb
101
102
  - test/test-type-info.rb
102
103
  - test/test-union-info.rb
103
104
  - test/test-interface-info.rb
@@ -1,132 +0,0 @@
1
- # This sample code is a port of clutter/examples/basic-actor.c.
2
- # It is licensed under the terms of the GNU Lesser General Public
3
- # License, version 2.1 or (at your option) later.
4
- #
5
- # Copyright (C) 2012 Ruby-GNOME2 Project Team
6
- #
7
- # This library is free software; you can redistribute it and/or
8
- # modify it under the terms of the GNU Lesser General Public
9
- # License as published by the Free Software Foundation; either
10
- # version 2.1 of the License, or (at your option) any later version.
11
- #
12
- # This library is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- # Lesser General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU Lesser General Public
18
- # License along with this library; if not, write to the Free Software
19
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
-
21
- require "clutter"
22
-
23
- Clutter.init(ARGV.size, ARGV)
24
-
25
- stage = Clutter::Stage.new
26
- stage.signal_connect("destroy") do |*args|
27
- Clutter.main_quit
28
- end
29
-
30
- vase = Clutter::Actor.new
31
- vase.name = "vase"
32
- vase.layout_manager = Clutter::BoxLayout.new
33
- vase.background_color = Clutter::Color.get_static(:sky_blue_light)
34
- vase.add_constraint(Clutter::AlignConstraint.new(stage, :both, 0.5))
35
- stage.add_child(vase)
36
-
37
- SIZE = 128
38
-
39
- flowers = []
40
-
41
- flower = Clutter::Actor.new
42
- flowers << flower
43
- flower.name = "flower.1"
44
- flower.set_size(SIZE, SIZE)
45
- flower.margin_left = 12
46
- flower.background_color = Clutter::Color.get_static(:red)
47
- flower.reactive = true
48
- vase.add_child(flower)
49
-
50
- toggled = true
51
- flower.signal_connect("button-press-event") do |actor, event|
52
- if toggled
53
- end_color = Clutter::Color.get_static(:blue)
54
- else
55
- end_color = Clutter::Color.get_static(:red)
56
- end
57
-
58
- actor.save_easing_state
59
- actor.set_easing_duration(500)
60
- actor.set_easing_mode(:linear)
61
- actor.background_color = end_color
62
- actor.restore_easing_state
63
-
64
- toggled = !toggled
65
-
66
- stop = true
67
- stop
68
- end
69
-
70
- flower = Clutter::Actor.new
71
- flowers << flower
72
- flower.set_name("flower.2")
73
- flower.set_size(SIZE, SIZE)
74
- flower.set_margin_top(12)
75
- flower.set_margin_left(6)
76
- flower.set_margin_right(6)
77
- flower.set_margin_bottom(12)
78
- flower.set_background_color(Clutter::Color.get_static(:yellow))
79
- flower.set_reactive(flower, true)
80
- vase.add_child(flower)
81
-
82
- on_crossing = lambda do |actor, event|
83
- if event.type == Clutter::EventType::ENTER
84
- zpos = -250.0
85
- else
86
- zpos = 0.0
87
- end
88
-
89
- actor.save_easing_state
90
- actor.set_easing_duration(500)
91
- actor.set_easing_mode(:ease_out_bounce)
92
- actor.set_z_position(zpos)
93
- actor.restore_easing_state
94
-
95
- stop = true
96
- stop
97
- end
98
- flower.signal_connect("enter-event", &on_crossing)
99
- flower.signal_connect("leave-event", &on_crossing)
100
-
101
- flower = Clutter::Actor.new
102
- flowers << flower
103
- flower.set_name("flower.3")
104
- flower.set_size(SIZE, SIZE)
105
- flower.set_margin_right(12)
106
- flower.set_background_color(Clutter::Color::get_static(:green))
107
- flower.set_pivot_point(0.5, 0.0)
108
- flower.set_reactive(true)
109
- vase.add_child(flower);
110
- flower.signal_connect("button-press-event") do |actor, event|
111
- actor.save_easing_state
112
- actor.set_easing_duration(1000)
113
-
114
- actor.set_rotation_angle(:y_axis, 360.0)
115
-
116
- actor.restore_easing_state
117
-
118
- id = actor.signal_connect("transition-stopped::rotation-angle-y") do
119
- actor.save_easing_state
120
- actor.set_rotation_angle(:y_axis, 0.0)
121
- actor.restore_easing_state
122
-
123
- actor.signal_handler_disconnect(id)
124
- end
125
-
126
- stop = true
127
- stop
128
- end
129
-
130
- stage.show
131
-
132
- Clutter.main