clutter-gtk 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +75 -0
  3. data/lib/clutter-gtk.rb +77 -0
  4. data/sample/events.rb +176 -0
  5. data/sample/multistage.rb +78 -0
  6. data/sample/redhand.png +0 -0
  7. data/sample/test-actor.rb +163 -0
  8. data/sample/test-scroll.rb +174 -0
  9. data/sample/test.rb +169 -0
  10. data/sample/window-test.rb +113 -0
  11. data/sample/window-test2.rb +132 -0
  12. data/test/clutter-gtk-test-utils.rb +21 -0
  13. data/test/run-test.rb +73 -0
  14. data/test/test-clutter-gtk-embed.rb +21 -0
  15. data/vendor/local/bin/libclutter-gtk-1.0-0.dll +0 -0
  16. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/clutter-gtk.h +17 -0
  17. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/gtk-clutter-actor.h +87 -0
  18. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/gtk-clutter-embed.h +94 -0
  19. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/gtk-clutter-texture.h +115 -0
  20. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/gtk-clutter-util.h +46 -0
  21. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/gtk-clutter-version.h +111 -0
  22. data/vendor/local/include/clutter-gtk-1.0/clutter-gtk/gtk-clutter-window.h +90 -0
  23. data/vendor/local/lib/girepository-1.0/GtkClutter-1.0.typelib +0 -0
  24. data/vendor/local/lib/libclutter-gtk-1.0.dll.a +0 -0
  25. data/vendor/local/lib/libclutter-gtk-1.0.la +41 -0
  26. data/vendor/local/lib/pkgconfig/clutter-gtk-1.0.pc +13 -0
  27. data/vendor/local/share/gir-1.0/GtkClutter-1.0.gir +696 -0
  28. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/GtkClutterActor.html +307 -0
  29. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/GtkClutterEmbed.html +305 -0
  30. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/GtkClutterWindow.html +179 -0
  31. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/annotation-glossary.html +48 -0
  32. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ch01.html +36 -0
  33. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ch02.html +42 -0
  34. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ch03.html +34 -0
  35. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/clutter-gtk-1.0-Utility-Functions.html +258 -0
  36. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/clutter-gtk-1.0.devhelp2 +50 -0
  37. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/cluttergtk-glossary.html +35 -0
  38. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/cluttergtk-object-hierarchy.html +45 -0
  39. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/cluttergtk-object-index.html +60 -0
  40. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/cluttergtk-objects.html +38 -0
  41. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/home.png +0 -0
  42. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/index.html +83 -0
  43. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/index.sgml +60 -0
  44. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ix01.html +100 -0
  45. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ix02.html +198 -0
  46. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ix03.html +66 -0
  47. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/ix04.html +32 -0
  48. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/left-insensitive.png +0 -0
  49. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/left.png +0 -0
  50. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/license.html +59 -0
  51. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/right-insensitive.png +0 -0
  52. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/right.png +0 -0
  53. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/style.css +476 -0
  54. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/up-insensitive.png +0 -0
  55. data/vendor/local/share/gtk-doc/html/clutter-gtk-1.0/up.png +0 -0
  56. data/vendor/local/share/license/clutter-gtk/COPYING +504 -0
  57. data/vendor/local/share/locale/ja/LC_MESSAGES/cluttergtk-1.0.mo +0 -0
  58. data/vendor/local/share/locale/pl/LC_MESSAGES/cluttergtk-1.0.mo +0 -0
  59. data/vendor/local/share/locale/zh_CN/LC_MESSAGES/cluttergtk-1.0.mo +0 -0
  60. metadata +143 -0
@@ -0,0 +1,174 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This sample code is a port of clutter-gtk/examples/gtk-clutter-test-scroll.c.
4
+ # It is licensed under the terms of the GNU Lesser General Public
5
+ # License, version 2.1 or (at your option) later.
6
+ #
7
+ # Copyright (C) 2013 Ruby-GNOME2 Project Team
8
+ #
9
+ # This library is free software; you can redistribute it and/or
10
+ # modify it under the terms of the GNU Lesser General Public
11
+ # License as published by the Free Software Foundation; either
12
+ # version 2.1 of the License, or (at your option) any later version.
13
+ #
14
+ # This library is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ # Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public
20
+ # License along with this library; if not, write to the Free Software
21
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+
23
+ require "clutter-gtk"
24
+
25
+ N_WIDGETS = 5
26
+ WINDOW_WIDTH = 400
27
+ WINDOW_HEIGHT = 400
28
+ RADIUS = 80
29
+
30
+ do_rotate_p = true
31
+
32
+ window = Gtk::Window.new
33
+ window.signal_connect("destroy") do
34
+ Gtk.main_quit
35
+ end
36
+
37
+ vbox = Gtk::Box.new(:vertical, 6)
38
+ window.add(vbox)
39
+
40
+ clutter = ClutterGtk::Embed.new
41
+ clutter.set_size_request(WINDOW_WIDTH, WINDOW_HEIGHT)
42
+
43
+ vbox.add(clutter)
44
+
45
+ stage = clutter.stage
46
+
47
+ button = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT)
48
+ button.signal_connect("clicked") do |_button|
49
+ window.destroy
50
+ end
51
+ vbox.pack_start(button, :expand => false, :fill => false, :padding => 0)
52
+
53
+ # and its background color
54
+ stage.background_color = Clutter::Color.new(0x61, 0x64, 0x8c, 0xff)
55
+
56
+ widgets = []
57
+
58
+ # create a new group to hold multiple actors in a group
59
+ group = Clutter::Group.new
60
+
61
+ create_gtk_actor = lambda do
62
+ gtk_actor = ClutterGtk::Actor.new
63
+ bin = gtk_actor.widget
64
+
65
+ scroll = Gtk::ScrolledWindow.new
66
+ scroll.set_policy(:never, :automatic)
67
+ bin.add(scroll)
68
+
69
+ vbox = Gtk::Box.new(:vertical, 6)
70
+ scroll.add_with_viewport(vbox)
71
+
72
+ button = Gtk::Button.new(:label => "A Button")
73
+ vbox.pack_start(button, :expand => false, :fill => false, :padding => 0)
74
+
75
+ button.signal_connect("clicked") do |_button|
76
+ puts("button clicked")
77
+ label = Gtk::Label.new("A new label")
78
+ label.show
79
+ vbox.pack_start(label, :expand => false, :fill => false, :padding => 0)
80
+ end
81
+
82
+ 6.times do |i|
83
+ button = Gtk::CheckButton.new("Another button")
84
+ vbox.pack_start(button, :expand => false, :fill => false, :padding => 0)
85
+ end
86
+
87
+ entry = Gtk::Entry.new
88
+ vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0)
89
+
90
+ bin.show_all
91
+
92
+ gtk_actor
93
+ end
94
+
95
+ N_WIDGETS.times do |i|
96
+ widget = create_gtk_actor.call
97
+ widgets[i] = widget
98
+
99
+ # Place around a circle
100
+ w = widgets.first.width
101
+ h = widgets.first.height
102
+
103
+ x = WINDOW_WIDTH / 2 +
104
+ RADIUS * Math.cos(i * 2 * Math::PI / (N_WIDGETS)) - w / 2
105
+ y = WINDOW_HEIGHT / 2 +
106
+ RADIUS * Math.sin(i * 2 * Math::PI / (N_WIDGETS)) - h / 2
107
+
108
+ widget.set_position(x, y)
109
+
110
+ # Add to our group group
111
+ group.add_actor(widget)
112
+ end
113
+
114
+ # Add the group to the stage
115
+ stage.add_actor(group)
116
+ stage.signal_connect("button-press-event") do |_stage, event|
117
+ x, y = event.coords
118
+
119
+ actor = _stage.get_actor_at_pos(:all, x, y)
120
+ puts("click at #{x}, #{y} -> #{actor.gtype.name}:#{actor}")
121
+ if !actor.is_a?(Clutter::Stage) and !actor.is_a?(Clutter::Group)
122
+ actor.hide
123
+ end
124
+ end
125
+ stage.signal_connect("key-release-event") do |_sage, event|
126
+ unichar = [event.key_unicode].pack("U*")
127
+ puts("*** key press event (key:#{unichar}) ***")
128
+
129
+ if event.key_symbol == Clutter::Keys::KEY_q
130
+ Gtk.main_quit
131
+ end
132
+ end
133
+
134
+ window.show_all
135
+
136
+ # Only show the actors after parent show otherwise it will just be
137
+ # unrealized when the clutter foreign window is set. widget_show
138
+ # will call show on the stage.
139
+ group.show_all
140
+
141
+ # Create a timeline to manage animation
142
+ timeline = Clutter::Timeline.new(6000)
143
+ timeline.loop = true
144
+
145
+ # fire a callback for frame change
146
+ timeline.signal_connect("new-frame") do |_timeline, m_secs|
147
+ rotation = _timeline.progress * 360.0
148
+ if do_rotate_p
149
+ # Rotate everything clockwise about stage center
150
+ group.set_rotation(:z_axis,
151
+ rotation,
152
+ WINDOW_WIDTH / 2,
153
+ WINDOW_HEIGHT / 2,
154
+ 0)
155
+
156
+ widgets.each do |widget|
157
+ # rotate each widget around its center
158
+ w = widget.width
159
+ h = widget.height
160
+
161
+ widget.set_rotation(:z_axis,
162
+ -(2 * rotation),
163
+ w / 2,
164
+ h / 2,
165
+ 0)
166
+ widget.opacity = 50 * Math.sin(2 * Math::PI * rotation / 360) + (255 - 50)
167
+ end
168
+ end
169
+ end
170
+
171
+ # and start it
172
+ timeline.start
173
+
174
+ Gtk.main
data/sample/test.rb ADDED
@@ -0,0 +1,169 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This sample code is a port of
4
+ # clutter-gtk/examples/gtk-clutter-test.c. The image file used in
5
+ # this sample code is copied from
6
+ # clutter-gtk/examples/redhand.png. They are licensed under the terms
7
+ # of the GNU Lesser General Public License, version 2.1 or (at your
8
+ # option) later.
9
+ #
10
+ # Copyright (C) 2013 Ruby-GNOME2 Project Team
11
+ #
12
+ # This library is free software; you can redistribute it and/or
13
+ # modify it under the terms of the GNU Lesser General Public
14
+ # License as published by the Free Software Foundation; either
15
+ # version 2.1 of the License, or (at your option) any later version.
16
+ #
17
+ # This library is distributed in the hope that it will be useful,
18
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
+ # Lesser General Public License for more details.
21
+ #
22
+ # You should have received a copy of the GNU Lesser General Public
23
+ # License along with this library; if not, write to the Free Software
24
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
+
26
+ require "clutter-gtk"
27
+ require "gdk_pixbuf2"
28
+
29
+ N_HANDS = 4
30
+ WINDOW_WIDTH = 400
31
+ WINDOW_HEIGHT = 400
32
+ RADIUS = 150
33
+
34
+ fade_p = false
35
+ fullscreen_p = false
36
+
37
+ pixbuf = Gdk::Pixbuf.new(File.expand_path("redhand.png", File.dirname(__FILE__)))
38
+
39
+ window = Gtk::Window.new
40
+ window.set_default_size(WINDOW_WIDTH, WINDOW_HEIGHT)
41
+ window.title = "Clutter Embedding"
42
+ window.signal_connect("destroy") do
43
+ Gtk.main_quit
44
+ end
45
+
46
+ vbox = Gtk::Grid.new
47
+ vbox.orientation = :vertical
48
+ vbox.hexpand = true
49
+ vbox.vexpand = true
50
+ window.add(vbox)
51
+
52
+ clutter = ClutterGtk::Embed.new
53
+ vbox.add(clutter)
54
+
55
+ stage = clutter.stage
56
+ stage.background_color = Clutter::Color.new(:sky_blue_light)
57
+
58
+ label = Gtk::Label.new("This is a label")
59
+ vbox.add(label)
60
+ label.hexpand = true
61
+
62
+ button = Gtk::Button.new(:label => "This is a button...clicky")
63
+ button.signal_connect("clicked") do |_button|
64
+ fade_p = !fade_p
65
+ end
66
+ vbox.add(button)
67
+ button.hexpand = true
68
+
69
+ button = Gtk::Button.new(:label => "Fullscreen")
70
+ button.image = Gtk::Image.new(:stock => Gtk::Stock::FULLSCREEN, :size => :button)
71
+ button.signal_connect("clicked") do |_button|
72
+ if fullscreen_p
73
+ window.unfullscreen
74
+ fullscreen_p = false
75
+ else
76
+ window.fullscreen
77
+ fullscreen_p = true
78
+ end
79
+ end
80
+ vbox.add(button)
81
+ button.hexpand = true
82
+
83
+ button = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT)
84
+ button.signal_connect("clicked") do |_button|
85
+ _button.destroy
86
+ end
87
+ vbox.add(button)
88
+ button.hexpand = true
89
+
90
+ group = Clutter::Actor.new
91
+ hands = []
92
+ N_HANDS.times do |i|
93
+ if i.zero?
94
+ hands[i] = ClutterGtk::Texture.new
95
+ hands[i].set_from_pixbuf(pixbuf)
96
+ else
97
+ hands[i] = Clutter::Clone.new(hands[0])
98
+ end
99
+
100
+ # Place around a circle
101
+ w = hands[0].width
102
+ h = hands[0].height
103
+
104
+ x = WINDOW_WIDTH / 2 + RADIUS * Math.cos(i * Math::PI / (N_HANDS / 2)) - w / 2
105
+ y = WINDOW_HEIGHT / 2 + RADIUS * Math.sin(i * Math::PI / (N_HANDS / 2)) - h / 2
106
+
107
+ hands[i].set_position(x, y)
108
+
109
+ # Add to our group group
110
+ group.add_child(hands[i])
111
+ end
112
+
113
+ # Add the group to the stage
114
+ stage.add_child(group)
115
+
116
+ constraint = Clutter::AlignConstraint.new(stage, :x_axis, 0.5)
117
+ group.add_constraint(constraint)
118
+ constraint = Clutter::AlignConstraint.new(stage, :y_axis, 0.5)
119
+ group.add_constraint(constraint)
120
+
121
+ stage.signal_connect("button-press-event") do |_stage, event|
122
+ x, y = event.coords
123
+ actor = _stage.get_actor_at_pos(:all, x, y)
124
+ if actor.is_a?(ClutterGtk::Texture) or actor.is_a?(Clutter::Clone)
125
+ actor.hide
126
+ end
127
+
128
+ Clutter::Event::STOP
129
+ end
130
+ stage.signal_connect("key-release-event") do |_stage, event|
131
+ puts("*** key press event (key:#{[event.key_unicode].pack('U*')}) ***")
132
+ case event.key_symbol
133
+ when Clutter::Keys::KEY_q
134
+ Gtk.main_quit
135
+ when Clutter::Keys::KEY_r
136
+ N_HANDS.times do |i|
137
+ hands[i].show
138
+ end
139
+ end
140
+
141
+ Clutter::Event::STOP
142
+ end
143
+
144
+ window.show_all
145
+
146
+ # Create a timeline to manage animation
147
+ timeline = Clutter::Timeline.new(6000)
148
+ timeline.repeat_count = -1
149
+
150
+ # fire a callback for frame change
151
+ timeline.signal_connect("new-frame") do |_timeline, msecs|
152
+ rotation = _timeline.progress * 360.0
153
+ group.set_rotation(:z_axis, rotation, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2, 0)
154
+ N_HANDS.times do |i|
155
+ hands[i].set_rotation(:z_axis,
156
+ -(6.0 * rotation),
157
+ hands[i].width / 2,
158
+ hands[i].height / 2,
159
+ 0)
160
+ if fade_p
161
+ hands[i].opacity = (255 - (rotation % 255))
162
+ end
163
+ end
164
+ end
165
+
166
+ # and start it
167
+ timeline.start
168
+
169
+ Gtk.main
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This sample code is a port of clutter-gtk/examples/gtk-clutter-window-test.c.
4
+ # It is licensed under the terms of the GNU Lesser General Public
5
+ # License, version 2.1 or (at your option) later.
6
+ #
7
+ # The original header:
8
+ # (c) 2009, Collabora Ltd.
9
+ #
10
+ # Written by Davyd Madeley <davyd.madeley@collabora.co.uk>
11
+ #
12
+ # Copyright (C) 2013 Ruby-GNOME2 Project Team
13
+ #
14
+ # This library is free software; you can redistribute it and/or
15
+ # modify it under the terms of the GNU Lesser General Public
16
+ # License as published by the Free Software Foundation; either
17
+ # version 2.1 of the License, or (at your option) any later version.
18
+ #
19
+ # This library is distributed in the hope that it will be useful,
20
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
+ # Lesser General Public License for more details.
23
+ #
24
+ # You should have received a copy of the GNU Lesser General Public
25
+ # License along with this library; if not, write to the Free Software
26
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27
+
28
+ require "clutter-gtk"
29
+ require "gdk_pixbuf2"
30
+
31
+ window = ClutterGtk::Window.new
32
+ window.signal_connect("destroy") do
33
+ Gtk.main_quit
34
+ end
35
+ window.set_default_size(400, 300)
36
+
37
+ NAME_COLUMN = 0
38
+ PIXBUF_COLUMN = 1
39
+ store = Gtk::ListStore.new(String, Gdk::Pixbuf)
40
+ theme = Gtk::IconTheme.default
41
+ [
42
+ "devhelp",
43
+ "empathy",
44
+ "evince",
45
+ "gnome-panel",
46
+ "seahorse",
47
+ "sound-juicer",
48
+ "totem",
49
+ ].each do |icon_name|
50
+ pixbuf = theme.load_icon(icon_name, 48, 0)
51
+ iter = store.append
52
+ iter[0] = icon_name
53
+ iter[1] = pixbuf
54
+ end
55
+
56
+ icon_view = Gtk::IconView.new(store)
57
+ icon_view.text_column = NAME_COLUMN
58
+ icon_view.pixbuf_column = PIXBUF_COLUMN
59
+
60
+ scrolled_window = Gtk::ScrolledWindow.new
61
+ window.add(scrolled_window)
62
+ scrolled_window.add(icon_view)
63
+ scrolled_window.show_all
64
+
65
+ # Widget 2 is a toolbar
66
+ stage = window.stage
67
+
68
+ toolbar = Gtk::Toolbar.new
69
+ [
70
+ Gtk::Stock::ADD,
71
+ Gtk::Stock::BOLD,
72
+ Gtk::Stock::ITALIC,
73
+ Gtk::Stock::CANCEL,
74
+ Gtk::Stock::CDROM,
75
+ Gtk::Stock::CONVERT,
76
+ ].each do |stock_id|
77
+ item = Gtk::ToolButton.new(:stock_id => stock_id)
78
+ toolbar.insert(item, -1)
79
+ end
80
+
81
+ toolbar.show_all
82
+ actor = ClutterGtk::Actor.new(toolbar)
83
+ actor.add_constraint(Clutter::BindConstraint.new(stage, :width, 0.0))
84
+ actor.signal_connect("enter-event") do |_actor, event|
85
+ _actor.save_easing_state do
86
+ _actor.easing_mode = :linear
87
+
88
+ _actor.opacity = 255
89
+ _actor.y = 0
90
+ end
91
+
92
+ Clutter::Event::STOP
93
+ end
94
+
95
+ actor.signal_connect("leave-event") do |_actor, event|
96
+ _actor.save_easing_state do
97
+ _actor.easing_mode = :linear
98
+
99
+ _actor.opacity = 128
100
+ _actor.y = _actor.height * -0.5
101
+ end
102
+
103
+ Clutter::Event::STOP
104
+ end
105
+
106
+ actor.y = actor.height * -0.5
107
+ actor.opacity = 128
108
+ actor.reactive = true
109
+ stage.add_child(actor)
110
+
111
+ window.show_all
112
+
113
+ Gtk.main