clutter 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 724241686e50278be1f05eae1c4f8c85efcd61c0
4
- data.tar.gz: 086c84951a1f44ebda80436c72e5d89a673ab7a2
3
+ metadata.gz: cbe72f011aefe6827e5c3a5374e2edc15c2e3fff
4
+ data.tar.gz: 4af28c0f48bb0ceececa6d198f8f59016c9c62c8
5
5
  SHA512:
6
- metadata.gz: 32592973ac043703804b303f5d5d88152362573ead8fb19d09f41128280888e868501b311000be10f1dc19500d5bb81d3013b66a158b42685c026a6b8a1ffe6c
7
- data.tar.gz: 7dda545d56ac268032265f8c3496c3c51d648da2ae1af36f0bf364e95328fbf41bde1e5a370f0979f33f00bc2648ed5951caff13ae3d86711808aed5615c9f9c
6
+ metadata.gz: 322b736c8ed95996d449255e747fe48cfabe4ee00a0bf50ef5fe721e31d4b0bdde279370ba3302e2520391b27e5a25f2a01f22c000de44471f10c14643fd1f2f
7
+ data.tar.gz: c77ef69b9ea6f276af305a285019905670bc8255b21d707d22e311b7e686108394dfc3c797ffb713022200db645c7247cce387cdc8def8e2c813d1f15eea1e1a
data/Rakefile CHANGED
@@ -22,7 +22,11 @@ require "gnome2/rake/package-task"
22
22
  package_task = GNOME2::Rake::PackageTask.new do |package|
23
23
  package.summary = "Ruby/Clutter is a Ruby binding of Clutter."
24
24
  package.description = "Ruby/Clutter is a Ruby binding of Clutter."
25
- package.dependency.gem.runtime = ["cairo-gobject", "gobject-introspection"]
25
+ package.dependency.gem.runtime = [
26
+ "cairo-gobject",
27
+ "gobject-introspection",
28
+ "pango"
29
+ ]
26
30
  package.dependency.gem.development = ["test-unit-notify"]
27
31
  package.windows.packages = []
28
32
  package.windows.dependencies = []
@@ -43,15 +47,14 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
43
47
  # MinGW w64 bundles old OpenGL headers. Here are changes to build Cogl:
44
48
  #
45
49
  # (1) Put the latest glext.h that can be downloaded from
46
- # http://www.opengl.org/registry/api/glext.h into
47
- # /usr/i686-w64-mingw32/include/GL/ directory:
50
+ # https://www.opengl.org/registry/api/GL/glext.h into
51
+ # /usr/share/mingw-w64/include/GL/ directory:
48
52
  #
49
- # % wget http://www.opengl.org/registry/api/glext.h
50
- # % sudo cp glext.h /usr/i686-w64-mingw32/include/GL/
51
- # % sudo chown root:root /usr/i686-w64-mingw32/include/GL/glext.h
53
+ # % wget https://www.opengl.org/registry/api/GL/glext.h
54
+ # % sudo install glext.h /usr/share/mingw-w64/include/GL/
52
55
  #
53
56
  # (2) Add missing declarations and includes to
54
- # /usr/i686-w64-mingw32/include/GL/gl.h:
57
+ # /usr/share/mingw-w64/include/GL/gl.h:
55
58
  #
56
59
  # Before:
57
60
  # ...
@@ -124,7 +127,6 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
124
127
  package.cross_compiling do |spec|
125
128
  if /mingw|mswin/ =~ spec.platform.to_s
126
129
  spec.add_runtime_dependency("atk", "= #{package.version}")
127
- spec.add_runtime_dependency("pango", "= #{package.version}")
128
130
  spec.add_runtime_dependency("gdk_pixbuf2", "= #{package.version}")
129
131
  end
130
132
  end
@@ -16,6 +16,7 @@
16
16
 
17
17
  require "gobject-introspection"
18
18
  require "cairo-gobject"
19
+ require "pango"
19
20
 
20
21
  base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
21
22
  vendor_dir = base_dir + "vendor" + "local"
@@ -26,7 +27,6 @@ GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
26
27
 
27
28
  if vendor_dir.exist?
28
29
  require "atk"
29
- require "pango"
30
30
  require "gdk_pixbuf2"
31
31
  end
32
32
 
@@ -61,6 +61,7 @@ module Clutter
61
61
  require "clutter/event"
62
62
  require "clutter/point"
63
63
  require "clutter/text"
64
+ require "clutter/text-buffer"
64
65
  require "clutter/threads"
65
66
  end
66
67
  end
@@ -92,6 +93,8 @@ module Clutter
92
93
  @base_module.const_set("Keys", @keys_module)
93
94
  @threads_module = Module.new
94
95
  @base_module.const_set("Threads", @threads_module)
96
+ @feature_module = Module.new
97
+ @base_module.const_set("Feature", @feature_module)
95
98
  end
96
99
 
97
100
  def post_load(repository, namespace)
@@ -141,6 +144,13 @@ module Clutter
141
144
  # ignore
142
145
  when /\Athreads_/
143
146
  define_module_function(@threads_module, $POSTMATCH, info)
147
+ when /\Afeature_/
148
+ method_name = rubyish_method_name(info, :prefix => "feature_")
149
+ case method_name
150
+ when "available"
151
+ method_name = "#{method_name}?"
152
+ end
153
+ define_module_function(@feature_module, method_name, info)
144
154
  else
145
155
  super
146
156
  end
@@ -0,0 +1,36 @@
1
+ # Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Clutter
18
+ class TextBuffer
19
+ alias_method :set_text_raw, :set_text
20
+ alias_method :insert_text_raw, :insert_text
21
+ alias_method :emit_inserted_text_raw, :emit_inserted_text
22
+
23
+ def set_text(string)
24
+ set_text_raw(string, string.length)
25
+ end
26
+ alias_method :text=, :set_text
27
+
28
+ def insert_text(position, string)
29
+ insert_text_raw(position, string, string.length)
30
+ end
31
+
32
+ def emit_inserted_text(position, string)
33
+ emit_inserted_text_raw(position, string, string.length)
34
+ end
35
+ end
36
+ end
@@ -31,4 +31,8 @@ module ClutterTestUtils
31
31
  omit("This test can't be run on this environment.")
32
32
  end
33
33
  end
34
+
35
+ def omit_on_travis_ci
36
+ omit("This test can't be run on Travis CI") if ENV["CI"]
37
+ end
34
38
  end
@@ -22,16 +22,19 @@ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
22
22
  glib_base = File.join(ruby_gnome2_base, "glib2")
23
23
  cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
24
24
  gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
25
+ pango_base = File.join(ruby_gnome2_base, "pango")
25
26
  clutter_base = File.join(ruby_gnome2_base, "clutter")
26
27
 
27
28
  modules = [
28
29
  [glib_base, "glib2"],
29
30
  [cairo_gobject_base, "cairo-gobject"],
30
31
  [gobject_introspection_base, "gobject-introspection"],
32
+ [pango_base, "pango"],
31
33
  [clutter_base, "clutter"],
32
34
  ]
33
35
  modules.each do |target, module_name|
34
- if File.exist?("Makefile") and system("which make > /dev/null")
36
+ makefile = File.join(target, "Makefile")
37
+ if File.exist?(makefile) and system("which make > /dev/null")
35
38
  `make -C #{target.dump} > /dev/null` or exit(false)
36
39
  end
37
40
  $LOAD_PATH.unshift(File.join(target, "ext", module_name))
@@ -0,0 +1,242 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class ClutterActorTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ @actor = Clutter::Actor.new
22
+ end
23
+
24
+ def test_flags
25
+ actor_flag = Clutter::ActorFlags::REACTIVE
26
+ @actor.flags = actor_flag
27
+ assert_equal(actor_flag, @actor.flags)
28
+
29
+ @actor.unset_flags(actor_flag)
30
+ assert_true(@actor.flags.empty?)
31
+ end
32
+
33
+ def test_scaled
34
+ assert_false(@actor.scaled?)
35
+
36
+ scale_x = 5.5
37
+ scale_y = 7.5
38
+ @actor.set_scale(scale_x, scale_y)
39
+ assert_true(@actor.scaled?)
40
+ end
41
+
42
+ def test_rotation_angle
43
+ only_clutter_version(1, 12, 0)
44
+ rotate_angle = 0.5
45
+ @actor.set_rotation_angle(Clutter::RotateAxis::X_AXIS, rotate_angle)
46
+ assert_equal(rotate_angle,
47
+ @actor.get_rotation_angle(Clutter::RotateAxis::X_AXIS))
48
+ end
49
+
50
+ def test_name
51
+ actor_name = "ClutterActor"
52
+ @actor.name = actor_name
53
+ assert_equal(actor_name, @actor.name)
54
+ end
55
+
56
+ def test_fixed_position_set
57
+ @actor.fixed_position_set = true
58
+ assert_true(@actor.fixed_position_set?)
59
+ end
60
+
61
+ def test_x_align
62
+ align = Clutter::ActorAlign::FILL
63
+ @actor.x_align = align
64
+ assert_equal(align, @actor.x_align)
65
+ end
66
+
67
+ def test_y_align
68
+ align = Clutter::ActorAlign::CENTER
69
+ @actor.y_align = align
70
+ assert_equal(align, @actor.y_align)
71
+ end
72
+
73
+ def test_content_gravity
74
+ gravity = Clutter::ContentGravity::CENTER
75
+ @actor.content_gravity = gravity
76
+ assert_equal(gravity, @actor.content_gravity)
77
+ end
78
+
79
+ def test_opacity_accessors
80
+ opacity_value = 220
81
+ @actor.opacity = opacity_value
82
+ assert_equal(opacity_value, @actor.opacity)
83
+ end
84
+
85
+ def test_easing_delay
86
+ delay_msec = 300
87
+ @actor.save_easing_state
88
+ @actor.easing_delay = delay_msec
89
+ assert_equal(delay_msec, @actor.easing_delay)
90
+ end
91
+
92
+ def test_easing_mode
93
+ only_clutter_version(1, 12, 0)
94
+ mode = Clutter::AnimationMode::EASE
95
+ @actor.easing_mode = mode
96
+ assert_equal(mode, @actor.easing_mode)
97
+ end
98
+
99
+ def test_pango_context
100
+ @actor.create_pango_context
101
+ assert_kind_of(Pango::Context, @actor.pango_context)
102
+ end
103
+
104
+ def test_width_accessors
105
+ actor_width = 20
106
+ @actor.width = actor_width
107
+ assert_equal(actor_width, @actor.width)
108
+ end
109
+
110
+ def test_height_accessors
111
+ actor_height = 30
112
+ @actor.height = actor_height
113
+ assert_equal(actor_height, @actor.height)
114
+ end
115
+
116
+ def test_x_accessors
117
+ actor_x = 35
118
+ @actor.x = actor_x
119
+ assert_equal(actor_x, @actor.x)
120
+ end
121
+
122
+ def test_y_accessors
123
+ actor_y = 15
124
+ @actor.y = actor_y
125
+ assert_equal(actor_y, @actor.y)
126
+ end
127
+
128
+ def test_z_position_accessors
129
+ only_clutter_version(1, 12, 0)
130
+ actor_z_position = 55
131
+ @actor.z_position = actor_z_position
132
+ assert_equal(actor_z_position, @actor.z_position)
133
+ end
134
+
135
+ def test_pivot_point_accessors
136
+ only_clutter_version(1, 12, 0)
137
+ pivot_x = 1.0
138
+ pivot_y = 3.0
139
+ @actor.set_pivot_point(pivot_x, pivot_y)
140
+ assert_equal([pivot_x, pivot_y], @actor.pivot_point)
141
+ end
142
+
143
+ def test_pivot_point_z_accessors
144
+ only_clutter_version(1, 12, 0)
145
+ pivot_z = 5.0
146
+ @actor.pivot_point_z = pivot_z
147
+ assert_equal(pivot_z, @actor.pivot_point_z)
148
+ end
149
+
150
+ def test_reactive_accessors
151
+ @actor.reactive = true
152
+ assert_true(@actor.reactive?)
153
+ end
154
+
155
+ def test_scale_accessors
156
+ scale_x = 1.5
157
+ scale_y = 3.5
158
+ @actor.set_scale(scale_x, scale_y)
159
+ assert_equal([scale_x, scale_y], @actor.scale)
160
+ end
161
+
162
+ def test_scale_z_accessors
163
+ only_clutter_version(1, 12, 0)
164
+ scale_z = 4.5
165
+ @actor.scale_z = scale_z
166
+ assert_equal(scale_z, @actor.scale_z)
167
+ end
168
+
169
+ def test_text_direction_accessors
170
+ direction = Clutter::TextDirection::LTR
171
+ @actor.text_direction = direction
172
+ assert_equal(direction, @actor.text_direction)
173
+ end
174
+
175
+ def test_clutter_transform
176
+ # TODO: !!needs CoglMatrix!!
177
+ # Clutter::Matrix equals Cogl::Matrix
178
+ # ref: https://developer.gnome.org/clutter/stable/clutter-Base-geometric-types.html#ClutterMatrix
179
+ # Cogl::Matrix type is returned by Cogl::Matrix.init_identity API in clutter 1.18
180
+ end
181
+
182
+ class TestMargin < self
183
+ def test_margin_top
184
+ margin = 3.0
185
+ @actor.margin_top = margin
186
+ assert_equal(margin, @actor.margin_top)
187
+ end
188
+
189
+ def test_margin_right
190
+ margin = 5.0
191
+ @actor.margin_right = margin
192
+ assert_equal(margin, @actor.margin_right)
193
+ end
194
+
195
+ def test_margin_left
196
+ margin = 3.5
197
+ @actor.margin_left = margin
198
+ assert_equal(margin, @actor.margin_left)
199
+ end
200
+
201
+ def test_margin_bottom
202
+ margin = 4.5
203
+ @actor.margin_bottom = margin
204
+ assert_equal(margin, @actor.margin_bottom)
205
+ end
206
+ end
207
+
208
+ class TestEnum < self
209
+ def test_allocation_flags
210
+ assert_const_defined(Clutter::AllocationFlags, :DELEGATE_LAYOUT)
211
+ end
212
+
213
+ def test_actor_align
214
+ assert_const_defined(Clutter::ActorAlign, :FILL)
215
+ end
216
+
217
+ def test_actor_flags
218
+ assert_const_defined(Clutter::ActorFlags, :REACTIVE)
219
+ end
220
+
221
+ def test_content_gravity
222
+ assert_const_defined(Clutter::ContentGravity, :CENTER)
223
+ end
224
+
225
+ def test_content_repeat
226
+ only_clutter_version(1, 12, 0)
227
+ assert_const_defined(Clutter::ContentRepeat, :BOTH)
228
+ end
229
+
230
+ def test_scaling_fliter
231
+ assert_const_defined(Clutter::ScalingFilter, :LINEAR)
232
+ end
233
+
234
+ def test_request_mode
235
+ assert_const_defined(Clutter::RequestMode, :WIDTH_FOR_HEIGHT)
236
+ end
237
+
238
+ def test_offscreen_redirect
239
+ assert_const_defined(Clutter::OffscreenRedirect, :ALWAYS)
240
+ end
241
+ end
242
+ end
@@ -0,0 +1,34 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class ClutterFeatureTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def test_avaliable
21
+ feature_flag = Clutter::FeatureFlags::SYNC_TO_VBLANK
22
+ assert_boolean(Clutter::Feature.available?(feature_flag))
23
+ end
24
+
25
+ def test_all
26
+ assert_kind_of(Clutter::FeatureFlags, Clutter::Feature.all)
27
+ end
28
+
29
+ class TestEnum
30
+ def test_flags
31
+ assert_const_defined(Clutter::FeatureFlags, :TEXTURE_NPOT)
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,83 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class ClutterFlowLayoutTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ default_orientation = Clutter::FlowOrientation::VERTICAL
22
+ @flow_layout = Clutter::FlowLayout.new(default_orientation)
23
+ end
24
+
25
+ def test_column_spacing_accessors
26
+ column_space = 1.0
27
+ @flow_layout.column_spacing = column_space
28
+ assert_equal(column_space, @flow_layout.column_spacing)
29
+ end
30
+
31
+ def test_homogeneous_accessors
32
+ @flow_layout.homogeneous = true
33
+ assert_true(@flow_layout.homogeneous?)
34
+ end
35
+
36
+ def test_max_column_width_accessors
37
+ max_width = 300
38
+ @flow_layout.max_column_width = max_width
39
+ assert_equal(max_width, @flow_layout.max_column_width)
40
+ end
41
+
42
+ def test_min_column_width_accessors
43
+ min_width = 10
44
+ @flow_layout.min_column_width = min_width
45
+ assert_equal(min_width, @flow_layout.min_column_width)
46
+ end
47
+
48
+ def test_max_row_height_accessors
49
+ max_height = 400
50
+ @flow_layout.max_row_height = max_height
51
+ assert_equal(max_height, @flow_layout.max_row_height)
52
+ end
53
+
54
+ def test_min_row_height_accessors
55
+ min_height = 5
56
+ @flow_layout.min_row_height = min_height
57
+ assert_equal(min_height, @flow_layout.min_row_height)
58
+ end
59
+
60
+ def test_orientation_accessors
61
+ changed_orientation = Clutter::FlowOrientation::HORIZONTAL
62
+ @flow_layout.orientation = changed_orientation
63
+ assert_equal(changed_orientation, @flow_layout.orientation)
64
+ end
65
+
66
+ def test_row_spacing_accessors
67
+ row_space = 1.5
68
+ @flow_layout.row_spacing = row_space
69
+ assert_equal(row_space, @flow_layout.row_spacing)
70
+ end
71
+
72
+ def test_snap_to_grid_accessors
73
+ only_clutter_version(1, 16, 0)
74
+ @flow_layout.snap_to_grid = false
75
+ assert_false(@flow_layout.snap_to_grid?)
76
+ end
77
+
78
+ class TestEnum < self
79
+ def test_enum
80
+ assert_const_defined(Clutter::FlowOrientation, :HORIZONTAL)
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,30 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class ClutterPropertyTransitionTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ @transition = Clutter::PropertyTransition.new
22
+ end
23
+
24
+ def test_property_name_accessors
25
+ only_clutter_version(1, 10, 0)
26
+ name = "clutter property"
27
+ @transition.property_name = name
28
+ assert_equal(name, @transition.property_name)
29
+ end
30
+ end
@@ -0,0 +1,72 @@
1
+ # coding: utf-8
2
+ # Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ class ClutterTextBufferTest < Test::Unit::TestCase
19
+ include ClutterTestUtils
20
+
21
+ def setup
22
+ @text_buffer = Clutter::TextBuffer.new
23
+ end
24
+
25
+ def test_text
26
+ string = "clutter test"
27
+ @text_buffer.text = string
28
+ assert_equal(string, @text_buffer.text)
29
+ end
30
+
31
+ def test_max_length
32
+ length = 80
33
+ @text_buffer.max_length = length
34
+ assert_equal(length, @text_buffer.max_length)
35
+ end
36
+
37
+ def test_length_read_property
38
+ string = "clutter test"
39
+ length = string.length
40
+ @text_buffer.text = string
41
+ assert_equal(length, @text_buffer.length)
42
+ end
43
+
44
+ def test_insert_text
45
+ string = "clutter test"
46
+ @text_buffer.text = string
47
+
48
+ append_string = "append"
49
+ append_string_length = append_string.length
50
+ result_string = string + append_string
51
+
52
+ assert_equal(append_string_length,
53
+ @text_buffer.insert_text(string.length, append_string))
54
+ assert_equal(result_string, @text_buffer.text)
55
+ end
56
+
57
+ def test_delete_text
58
+ string = "clutter test string"
59
+ @text_buffer.text = string
60
+
61
+ delete_text = "clutter"
62
+ delete_position = delete_text.length
63
+ delete_string = " test"
64
+ delete_string_length = delete_string.length
65
+ result_string = "clutter string"
66
+
67
+ assert_equal(delete_string_length,
68
+ @text_buffer.delete_text(delete_position,
69
+ delete_string_length))
70
+ assert_equal(result_string, @text_buffer.text)
71
+ end
72
+ end
@@ -0,0 +1,59 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class ClutterTimelineTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ default_duration = 100
22
+ @timeline = Clutter::Timeline.new(default_duration)
23
+ end
24
+
25
+ def test_auto_reverse_accessors
26
+ @timeline.auto_reverse = true
27
+ assert_true(@timeline.auto_reverse?)
28
+ end
29
+
30
+ def test_delay_accessors
31
+ delay_msec = 2000
32
+ @timeline.delay = delay_msec
33
+ assert_equal(delay_msec, @timeline.delay)
34
+ end
35
+
36
+ def test_direction_accessors
37
+ timeline_direction = Clutter::TimelineDirection::FORWARD
38
+ @timeline.direction = timeline_direction
39
+ assert_equal(timeline_direction, @timeline.direction)
40
+ end
41
+
42
+ def test_duration_accessors
43
+ duration_msec = 1500
44
+ @timeline.duration = duration_msec
45
+ assert_equal(duration_msec, @timeline.duration)
46
+ end
47
+
48
+ def test_repeat_count_accessors
49
+ count = 5
50
+ @timeline.repeat_count = count
51
+ assert_equal(count, @timeline.repeat_count)
52
+ end
53
+
54
+ def test_progress_mode_accessors
55
+ animation_mode = Clutter::AnimationMode::EASE_IN_QUAD
56
+ @timeline.progress_mode = animation_mode
57
+ assert_equal(animation_mode, @timeline.progress_mode)
58
+ end
59
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-26 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo-gobject
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.3
19
+ version: 2.2.4
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: 2.2.3
26
+ version: 2.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gobject-introspection
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.3
33
+ version: 2.2.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.2.3
40
+ version: 2.2.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: pango
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.2.4
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.2.4
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: test-unit-notify
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -69,6 +83,7 @@ files:
69
83
  - lib/clutter/color.rb
70
84
  - lib/clutter/event.rb
71
85
  - lib/clutter/point.rb
86
+ - lib/clutter/text-buffer.rb
72
87
  - lib/clutter/text.rb
73
88
  - lib/clutter/threads.rb
74
89
  - sample/basic-actor.rb
@@ -88,14 +103,20 @@ files:
88
103
  - sample/scroll-actor.rb
89
104
  - test/clutter-test-utils.rb
90
105
  - test/run-test.rb
106
+ - test/test-clutter-actor.rb
91
107
  - test/test-clutter-blur-effect.rb
92
108
  - test/test-clutter-brightness-contrast-effect.rb
93
109
  - test/test-clutter-canvas.rb
94
110
  - test/test-clutter-color.rb
95
111
  - test/test-clutter-colorize-effect.rb
96
112
  - test/test-clutter-desaturate-effect.rb
113
+ - test/test-clutter-feature.rb
114
+ - test/test-clutter-flow-layout.rb
97
115
  - test/test-clutter-page-turn-effect.rb
116
+ - test/test-clutter-property-transiton.rb
98
117
  - test/test-clutter-shader-effect.rb
118
+ - test/test-clutter-text-buffer.rb
119
+ - test/test-clutter-timeline.rb
99
120
  homepage: http://ruby-gnome2.sourceforge.jp/
100
121
  licenses:
101
122
  - LGPLv2.1 or later