clutter 2.2.2 → 2.2.3

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: c7a73e0da7ae914716c7959a3365871261ba6cde
4
- data.tar.gz: 99cf56c7915c155a64ae80377f8587441d5b382b
3
+ metadata.gz: 724241686e50278be1f05eae1c4f8c85efcd61c0
4
+ data.tar.gz: 086c84951a1f44ebda80436c72e5d89a673ab7a2
5
5
  SHA512:
6
- metadata.gz: ea664added17421f51a21c857694fdfd2f7e6459cfdcfbe03a362bbef6fa629f9253f8c76eba8700dbc8b6c7896736868e00f113d5ad8d25911c6d28dbd07633
7
- data.tar.gz: cfa3e330299e7be71efcca27c908bba96bd5fd610023f54e6ad64c9f977198bfa6b41b253bd6833f50261e05cc7cb265c6de08511710918a15c689e2c9dfe5b9
6
+ metadata.gz: 32592973ac043703804b303f5d5d88152362573ead8fb19d09f41128280888e868501b311000be10f1dc19500d5bb81d3013b66a158b42685c026a6b8a1ffe6c
7
+ data.tar.gz: 7dda545d56ac268032265f8c3496c3c51d648da2ae1af36f0bf364e95328fbf41bde1e5a370f0979f33f00bc2648ed5951caff13ae3d86711808aed5615c9f9c
data/lib/clutter.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2012-2014 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
@@ -54,7 +54,9 @@ module Clutter
54
54
  require "clutter/actor"
55
55
  require "clutter/actor-iter"
56
56
  require "clutter/animatable"
57
+ require "clutter/brightness-contrast-effect"
57
58
  require "clutter/cairo"
59
+ require "clutter/clutter"
58
60
  require "clutter/color"
59
61
  require "clutter/event"
60
62
  require "clutter/point"
@@ -0,0 +1,44 @@
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
+ module Clutter
18
+ class BrightnessContrastEffect
19
+ alias_method :set_contrast_raw, :set_contrast
20
+ def set_contrast(contrast_all_or_red, contrast_green=nil, contrast_blue=nil)
21
+ if contrast_green.nil? && contrast_blue.nil?
22
+ contrast_all = contrast_all_or_red
23
+ set_contrast_raw(contrast_all)
24
+ else
25
+ contrast_red = contrast_all_or_red
26
+ set_contrast_full(contrast_red, contrast_green,
27
+ contrast_blue)
28
+ end
29
+ end
30
+
31
+ alias_method :set_brightness_raw, :set_brightness
32
+ def set_brightness(brightness_all_or_red, brightness_green=nil,
33
+ brightness_blue=nil)
34
+ if brightness_green.nil? && brightness_blue.nil?
35
+ brightness_all = brightness_all_or_red
36
+ set_brightness_raw(brightness_all)
37
+ else
38
+ brightness_red = brightness_all_or_red
39
+ set_brightness_full(brightness_red, brightness_green,
40
+ brightness_blue)
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,25 @@
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
+ module Clutter
18
+ class << self
19
+ alias_method :check_version_raw, :check_version
20
+ remove_method :check_version
21
+ def check_version?(major, minor, micro=nil)
22
+ check_version_raw(major, minor, micro)
23
+ end
24
+ end
25
+ end
@@ -18,6 +18,14 @@ require "test-unit"
18
18
  require "test/unit/notify"
19
19
 
20
20
  module ClutterTestUtils
21
+ private
22
+ def only_clutter_version(major, minor, micro=nil)
23
+ micro ||= 0
24
+ unless Clutter.check_version?(major, minor, micro)
25
+ omit("Require Clutter >= #{major}.#{minor}.#{micro}")
26
+ end
27
+ end
28
+
21
29
  def omit_if_clutter_color_hash_expect_arguments
22
30
  unless Clutter::Color.method(:hash).parameters.empty?
23
31
  omit("This test can't be run on this environment.")
@@ -0,0 +1,27 @@
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 ClutterBlurEffectTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ @blur_effect = Clutter::BlurEffect.new
22
+ end
23
+
24
+ def test_blur_effect_new
25
+ assert_kind_of(Clutter::Effect, @blur_effect)
26
+ end
27
+ end
@@ -0,0 +1,56 @@
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 ClutterBrightnessContrastEffectTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ @effect = Clutter::BrightnessContrastEffect.new
22
+ end
23
+
24
+ def test_brightness
25
+ brightness = 127
26
+ @effect.brightness = brightness
27
+ assert_equal([brightness, brightness, brightness],
28
+ @effect.brightness)
29
+ end
30
+
31
+ def test_brightness_rgb_params
32
+ brightness_red = 120
33
+ brightness_green = 200
34
+ brightness_blue = 250
35
+ @effect.set_brightness(brightness_red, brightness_green,
36
+ brightness_blue)
37
+ assert_equal([brightness_red, brightness_green, brightness_blue],
38
+ @effect.brightness)
39
+ end
40
+
41
+ def test_contrast
42
+ contrast = 127
43
+ @effect.contrast = contrast
44
+ assert_equal([contrast, contrast, contrast],
45
+ @effect.contrast)
46
+ end
47
+
48
+ def test_contrast_rgb_params
49
+ contrast_red = 250
50
+ contrast_green = 120
51
+ contrast_blue = 100
52
+ @effect.set_contrast(contrast_red, contrast_green, contrast_blue)
53
+ assert_equal([contrast_red, contrast_green, contrast_blue],
54
+ @effect.contrast)
55
+ end
56
+ end
@@ -0,0 +1,43 @@
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 ClutterCanvasTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ @canvas = Clutter::Canvas.new
22
+ end
23
+
24
+ def test_scale_factor
25
+ only_clutter_version(1, 18, 0)
26
+ scale = 2
27
+ @canvas.scale_factor = scale
28
+ assert_equal(scale, @canvas.scale_factor)
29
+ assert_true(@canvas.scale_factor_set?)
30
+ end
31
+
32
+ def test_height_accessors
33
+ height = 320
34
+ @canvas.height = height
35
+ assert_equal(height, @canvas.height)
36
+ end
37
+
38
+ def test_width_accessors
39
+ width = 640
40
+ @canvas.width = width
41
+ assert_equal(width, @canvas.width)
42
+ end
43
+ end
@@ -0,0 +1,31 @@
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 ClutterColorizeEffectTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ omit_if_clutter_color_hash_expect_arguments
22
+ default_color = Clutter::Color.rgb(255, 0, 0)
23
+ @colorize_effect = Clutter::ColorizeEffect.new(default_color)
24
+ end
25
+
26
+ def test_tint_accessors
27
+ color = Clutter::Color.rgb(127, 127, 0)
28
+ @colorize_effect.tint = color
29
+ assert_equal(color.to_s, @colorize_effect.tint.to_s)
30
+ end
31
+ 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 ClutterDesaturateEffectTest < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ default_factor = 1.0
22
+ @desaturate_effect = Clutter::DesaturateEffect.new(default_factor)
23
+ end
24
+
25
+ def test_factor_accesssors
26
+ factor = 0.8
27
+ @desaturate_effect.factor = factor
28
+ assert_equal(factor, @desaturate_effect.factor)
29
+ end
30
+ end
@@ -0,0 +1,46 @@
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 ClutterPageTurnEffect < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ default_period = 1.0
22
+ default_angle = 180.0
23
+ default_radious = 20.0
24
+ @page_turn_effect = Clutter::PageTurnEffect.new(default_period,
25
+ default_angle,
26
+ default_radious)
27
+ end
28
+
29
+ def test_angle_accessors
30
+ page_angle = 150
31
+ @page_turn_effect.angle = page_angle
32
+ assert_equal(page_angle, @page_turn_effect.angle)
33
+ end
34
+
35
+ def test_period_accessors
36
+ page_period = 0.5
37
+ @page_turn_effect.period = page_period
38
+ assert_equal(page_period, @page_turn_effect.period)
39
+ end
40
+
41
+ def test_radius_accessors
42
+ page_radius = 50.0
43
+ @page_turn_effect.radius = page_radius
44
+ assert_equal(page_radius, @page_turn_effect.radius)
45
+ end
46
+ end
@@ -0,0 +1,65 @@
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 ClutterShaderEffect < Test::Unit::TestCase
18
+ include ClutterTestUtils
19
+
20
+ def setup
21
+ @shader_effect = Clutter::ShaderEffect.new(Clutter::ShaderType::FRAGMENT_SHADER)
22
+ @fragment_shader_source = <<-EOS
23
+ #ifdef GL_ES
24
+ precision mediump float;
25
+ #endif
26
+
27
+ void main( void ) {
28
+ gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );
29
+ }
30
+ EOS
31
+ # TODO: use original Cogl::INVALID_HANDLE
32
+ # original value: NULL
33
+ # ref: https://developer.gnome.org/cogl/1.18/cogl-General-API.html#COGL-INVALID-HANDLE:CAPS
34
+ # It should create gi based cogl binding?
35
+ @cogl_invalid_handle = 0
36
+ end
37
+
38
+ def test_set_uniform_value
39
+ gvalue = 1.0
40
+ assert_nothing_raised do
41
+ @shader_effect.set_uniform_value("components", gvalue)
42
+ end
43
+ end
44
+
45
+ def test_set_shader_source
46
+ result = @shader_effect.set_shader_source(@fragment_shader_source)
47
+ assert_true(result)
48
+ end
49
+
50
+ def test_get_program
51
+ @shader_effect.shader_source = @fragment_shader_source
52
+ assert_not_equal(@cogl_invalid_handle, @shader_effect.program)
53
+ end
54
+
55
+ def test_get_shader
56
+ @shader_effect.shader_source = @fragment_shader_source
57
+ assert_not_equal(@cogl_invalid_handle, @shader_effect.shader)
58
+ end
59
+
60
+ class TestEnum < self
61
+ def test_shader_type
62
+ assert_const_defined(Clutter::ShaderType, :VERTEX_SHADER)
63
+ end
64
+ end
65
+ 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.2
4
+ version: 2.2.3
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-12 00:00:00.000000000 Z
11
+ date: 2014-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo-gobject
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.2
19
+ version: 2.2.3
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.2
26
+ version: 2.2.3
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.2
33
+ version: 2.2.3
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.2
40
+ version: 2.2.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit-notify
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -63,7 +63,9 @@ files:
63
63
  - lib/clutter/actor-iter.rb
64
64
  - lib/clutter/actor.rb
65
65
  - lib/clutter/animatable.rb
66
+ - lib/clutter/brightness-contrast-effect.rb
66
67
  - lib/clutter/cairo.rb
68
+ - lib/clutter/clutter.rb
67
69
  - lib/clutter/color.rb
68
70
  - lib/clutter/event.rb
69
71
  - lib/clutter/point.rb
@@ -86,7 +88,14 @@ files:
86
88
  - sample/scroll-actor.rb
87
89
  - test/clutter-test-utils.rb
88
90
  - test/run-test.rb
91
+ - test/test-clutter-blur-effect.rb
92
+ - test/test-clutter-brightness-contrast-effect.rb
93
+ - test/test-clutter-canvas.rb
89
94
  - test/test-clutter-color.rb
95
+ - test/test-clutter-colorize-effect.rb
96
+ - test/test-clutter-desaturate-effect.rb
97
+ - test/test-clutter-page-turn-effect.rb
98
+ - test/test-clutter-shader-effect.rb
90
99
  homepage: http://ruby-gnome2.sourceforge.jp/
91
100
  licenses:
92
101
  - LGPLv2.1 or later