gdk4 3.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2013 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ class TestGdkGeometry < Test::Unit::TestCase
20
+ def test_min_width
21
+ geometry = Gdk::Geometry.new
22
+ assert_equal(0, geometry.min_width)
23
+ end
24
+ end
@@ -0,0 +1,80 @@
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 TestGdkKeyval < Test::Unit::TestCase
18
+ def test_consntant_name
19
+ assert_equal("a".unpack("c")[0], Gdk::Keyval::KEY_a)
20
+ end
21
+
22
+ def test_to_name
23
+ assert_equal("A", Gdk::Keyval.to_name(Gdk::Keyval::KEY_A))
24
+ end
25
+
26
+ def test_from_name
27
+ assert_equal("A".unpack("c")[0], Gdk::Keyval.from_name("A"))
28
+ end
29
+
30
+ sub_test_case "#lower?" do
31
+ def test_lower
32
+ assert_true(Gdk::Keyval.lower?(Gdk::Keyval::KEY_a))
33
+ end
34
+
35
+ def test_upper
36
+ assert_false(Gdk::Keyval.lower?(Gdk::Keyval::KEY_A))
37
+ end
38
+ end
39
+
40
+ sub_test_case "#upper?" do
41
+ def test_lower
42
+ assert_false(Gdk::Keyval.upper?(Gdk::Keyval::KEY_a))
43
+ end
44
+
45
+ def test_upper
46
+ assert_true(Gdk::Keyval.upper?(Gdk::Keyval::KEY_A))
47
+ end
48
+ end
49
+
50
+ sub_test_case "#to_lower" do
51
+ def test_lower
52
+ assert_equal(Gdk::Keyval::KEY_a,
53
+ Gdk::Keyval.to_lower(Gdk::Keyval::KEY_a))
54
+ end
55
+
56
+ def test_upper
57
+ assert_equal(Gdk::Keyval::KEY_a,
58
+ Gdk::Keyval.to_lower(Gdk::Keyval::KEY_A))
59
+ end
60
+ end
61
+
62
+ sub_test_case "#to_upper" do
63
+ def test_lower
64
+ assert_equal(Gdk::Keyval::KEY_A,
65
+ Gdk::Keyval.to_upper(Gdk::Keyval::KEY_a))
66
+ end
67
+
68
+ def test_upper
69
+ assert_equal(Gdk::Keyval::KEY_A,
70
+ Gdk::Keyval.to_upper(Gdk::Keyval::KEY_A))
71
+ end
72
+ end
73
+
74
+ sub_test_case "#to_unicode" do
75
+ def test_to_unicode
76
+ assert_equal("\u02D8", # BREVE
77
+ [Gdk::Keyval.to_unicode(Gdk::Keyval::KEY_breve)].pack("U"))
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,43 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ class TestGdkPixbuf < Test::Unit::TestCase
20
+ def test_window
21
+ gdk_window = Gdk.default_root_window
22
+ src_x = 0
23
+ src_y = 0
24
+ width = 290
25
+ height = 200
26
+
27
+ pixbuf = gdk_window.to_pixbuf(src_x,
28
+ src_y,
29
+ width,
30
+ height)
31
+ assert_equal([width, height],
32
+ [pixbuf.width, pixbuf.height])
33
+ end
34
+
35
+ def test_surface
36
+ width = 290
37
+ height = 200
38
+ surface = Cairo::ImageSurface.new(:argb32, width, height)
39
+ pixbuf = surface.to_pixbuf
40
+ assert_equal([width, height],
41
+ [pixbuf.width, pixbuf.height])
42
+ end
43
+ end
@@ -0,0 +1,74 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2013-2015 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ class TestGdkRectangle < Test::Unit::TestCase
20
+ def test_intersect
21
+ rectangle1 = Gdk::Rectangle.new(0, 10, 20, 30)
22
+ rectangle2 = Gdk::Rectangle.new(5, 15, 10, 20)
23
+ intersected = rectangle1.intersect(rectangle2)
24
+ assert_equal([
25
+ 5,
26
+ 15,
27
+ 10,
28
+ 20,
29
+ ],
30
+ [
31
+ intersected.x,
32
+ intersected.y,
33
+ intersected.width,
34
+ intersected.height,
35
+ ])
36
+ end
37
+
38
+ def test_union
39
+ rectangle1 = Gdk::Rectangle.new(0, 10, 20, 30)
40
+ rectangle2 = Gdk::Rectangle.new(5, 15, 40, 20)
41
+ unioned_rectangle = rectangle1.union(rectangle2)
42
+ assert_equal([
43
+ 0,
44
+ 10,
45
+ 45,
46
+ 30,
47
+ ],
48
+ [
49
+ unioned_rectangle.x,
50
+ unioned_rectangle.y,
51
+ unioned_rectangle.width,
52
+ unioned_rectangle.height,
53
+ ])
54
+ end
55
+
56
+ def test_to_a
57
+ rectangle = Gdk::Rectangle.new(0, 10, 20, 30)
58
+ assert_equal([
59
+ 0,
60
+ 10,
61
+ 20,
62
+ 30,
63
+ ],
64
+ rectangle.to_a)
65
+ end
66
+
67
+ test "#==" do
68
+ rectangle1 = Gdk::Rectangle.new(0, 10, 20, 30)
69
+ rectangle2 = Gdk::Rectangle.new(0, 10, 20, 30)
70
+ assert do
71
+ rectangle1 == rectangle2
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,94 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ class TestGdkRGBA < Test::Unit::TestCase
20
+ def test_to_s
21
+ rgba = Gdk::RGBA.new(0.2, 0.4, 0.6, 0.5)
22
+ assert_equal("rgba(51,102,153,0.5)", rgba.to_s)
23
+ end
24
+
25
+ def test_to_a
26
+ rgba = Gdk::RGBA.new(0.2, 0.4, 0.6, 0.5)
27
+ assert_equal([0.2, 0.4, 0.6, 0.5], rgba.to_a)
28
+ end
29
+
30
+ sub_test_case("new") do
31
+ def test_empty
32
+ rgba = Gdk::RGBA.new
33
+ assert_equal([0.0, 0.0, 0.0, 1.0], rgba.to_a)
34
+ end
35
+
36
+ def test_rgb
37
+ rgba = Gdk::RGBA.new(0.2, 0.4, 0.6)
38
+ assert_equal([0.2, 0.4, 0.6, 1.0], rgba.to_a)
39
+ end
40
+ end
41
+
42
+ sub_test_case("parse") do
43
+ def test_name
44
+ rgba = Gdk::RGBA.parse("red")
45
+ assert_equal([1.0, 0.0, 0.0, 1.0], rgba.to_a)
46
+ end
47
+
48
+ def test_hash_rgb
49
+ rgba = Gdk::RGBA.parse("#f0f")
50
+ assert_equal([1.0, 0.0, 1.0, 1.0], rgba.to_a)
51
+ end
52
+
53
+ def test_hash_rrggbb
54
+ rgba = Gdk::RGBA.parse("#ff00ff")
55
+ assert_equal([1.0, 0.0, 1.0, 1.0], rgba.to_a)
56
+ end
57
+
58
+ def test_hash_rrrgggbbb
59
+ rgba = Gdk::RGBA.parse("#fff000fff")
60
+ assert_equal([1.0, 0.0, 1.0, 1.0], rgba.to_a)
61
+ end
62
+
63
+ def test_hash_rrrrggggbbbb
64
+ rgba = Gdk::RGBA.parse("#ffff0000ffff")
65
+ assert_equal([1.0, 0.0, 1.0, 1.0], rgba.to_a)
66
+ end
67
+
68
+ def test_rgb
69
+ rgba = Gdk::RGBA.parse("rgb(255, 0, 255)")
70
+ assert_equal([1.0, 0.0, 1.0, 1.0], rgba.to_a)
71
+ end
72
+
73
+ def test_rgba
74
+ rgba = Gdk::RGBA.parse("rgba(255, 0, 255, 0.5)")
75
+ assert_equal([1.0, 0.0, 1.0, 0.5], rgba.to_a)
76
+ end
77
+
78
+ def test_invalid
79
+ message = "invalid RGBA format: \"invalid\" "
80
+ message << "(available formats: "
81
+ message << "COLOR_NAME, "
82
+ message << "\#RGB, "
83
+ message << "\#RRGGBB, "
84
+ message << "\#RRRGGGBBB, "
85
+ message << "\#RRRRGGGGBBBB, "
86
+ message << "rgb(R, G, B), "
87
+ message << "rgba(R, G, B, A)"
88
+ message << ")"
89
+ assert_raise(ArgumentError.new(message)) do
90
+ Gdk::RGBA.parse("invalid")
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,29 @@
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 TestGdkSelection < Test::Unit::TestCase
18
+ class TestConstant < self
19
+ def test_primary
20
+ atom = Gdk::Selection::PRIMARY
21
+ assert_equal("PRIMARY", atom.name)
22
+ end
23
+
24
+ def test_clipboard
25
+ atom = Gdk::Selection::CLIPBOARD
26
+ assert_equal("CLIPBOARD", atom.name)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,32 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ class TestGdkWindowAttr < Test::Unit::TestCase
20
+ include GdkTestUtils
21
+
22
+ def test_initialize
23
+ attrs = Gdk::WindowAttr.new(100, 100, :input_only, :temp)
24
+ assert_equal([
25
+ 100,
26
+ 100,
27
+ Gdk::WindowWindowClass::INPUT_ONLY,
28
+ Gdk::WindowType::TEMP,
29
+ ],
30
+ [attrs.width, attrs.height, attrs.wclass, attrs.window_type])
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gdk4
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.4.4
5
+ platform: ruby
6
+ authors:
7
+ - The Ruby-GNOME Project Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pango
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.4.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.4.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: gdk_pixbuf2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.4.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.4.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: cairo-gobject
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 3.4.4
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 3.4.4
55
+ description: Ruby/GDK4 is a Ruby binding of GDK-4.x.
56
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
57
+ executables: []
58
+ extensions:
59
+ - dependency-check/Rakefile
60
+ extra_rdoc_files: []
61
+ files:
62
+ - COPYING.LIB
63
+ - README.md
64
+ - Rakefile
65
+ - dependency-check/Rakefile
66
+ - gdk4.gemspec
67
+ - lib/gdk4.rb
68
+ - lib/gdk4/cairo.rb
69
+ - lib/gdk4/loader.rb
70
+ - lib/gdk4/rectangle.rb
71
+ - lib/gdk4/rgba.rb
72
+ - lib/gdk4/version.rb
73
+ - lib/gdk4/x11-loader.rb
74
+ - test/fixture/ruby-gnome2-logo.png
75
+ - test/gdk-test-utils.rb
76
+ - test/run-test.rb
77
+ - test/test-gdk-cairo.rb
78
+ - test/test-gdk-cursor.rb
79
+ - test/test-gdk-event-mask.rb
80
+ - test/test-gdk-event-type.rb
81
+ - test/test-gdk-event.rb
82
+ - test/test-gdk-geometry.rb
83
+ - test/test-gdk-keyval.rb
84
+ - test/test-gdk-pixbuf.rb
85
+ - test/test-gdk-rectangle.rb
86
+ - test/test-gdk-rgba.rb
87
+ - test/test-gdk-selection.rb
88
+ - test/test-gdk-window-attr.rb
89
+ homepage: https://ruby-gnome2.osdn.jp/
90
+ licenses:
91
+ - LGPL-2.1+
92
+ metadata:
93
+ msys2_mingw_dependencies: gtk4
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubygems_version: 3.3.0.dev
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Ruby/GDK4 is a Ruby binding of GDK-4.x.
113
+ test_files: []