gdk3 3.3.7 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dependency-check/Rakefile +4 -3
- data/gdk3.gemspec +2 -2
- data/lib/gdk3/color.rb +13 -6
- data/lib/gdk3/cursor.rb +5 -1
- data/lib/gdk3/rgba.rb +12 -1
- data/test/gdk-test-utils.rb +3 -2
- data/test/run-test.rb +12 -10
- data/test/test-gdk-color.rb +14 -8
- data/test/test-gdk-rgba.rb +13 -3
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51e16ac4c9e43be3c07a758e56cc4726533ff6cd116164cab162652192545f8b
|
4
|
+
data.tar.gz: ce95c4182d6901d6039681662a13ff2c98553220918d50a066550f66601dd3ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9883fdd3bcd9d662dd61360ed404dc33af0e061707614db28bb8ae212d7909b649e8d1a45135374a36e9d497c2e68cbea2b6ecccdd7de9156b8315531443543f
|
7
|
+
data.tar.gz: 264c287ad84c2003a7ea82d0e1f8887dcfb79d1b5f1c797d6ff2d70d0aa4eb048497605aa45eb0bafc674f74e7460d7b523417785b28ecf5784b71837bc398d1
|
data/dependency-check/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2017 Ruby-
|
1
|
+
# Copyright (C) 2017-2019 Ruby-GNOME 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
|
@@ -29,10 +29,11 @@ end
|
|
29
29
|
namespace :dependency do
|
30
30
|
desc "Check dependency"
|
31
31
|
task :check do
|
32
|
-
|
32
|
+
package_id = "gdk-3.0"
|
33
|
+
unless PKGConfig.check_version?(package_id)
|
33
34
|
unless NativePackageInstaller.install(:altlinux => "libgtk+3-devel",
|
34
35
|
:debian => "libgtk-3-dev",
|
35
|
-
:redhat => "pkgconfig(
|
36
|
+
:redhat => "pkgconfig(#{package_id})",
|
36
37
|
:homebrew => "gtk+3",
|
37
38
|
:macports => "gtk3",
|
38
39
|
:msys2 => "gtk3")
|
data/gdk3.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2018 Ruby-
|
3
|
+
# Copyright (C) 2018 Ruby-GNOME Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.name = "gdk3"
|
23
23
|
s.summary = "Ruby/GDK3 is a Ruby binding of GDK-3.x."
|
24
24
|
s.description = "Ruby/GDK3 is a Ruby binding of GDK-3.x."
|
25
|
-
s.author = "The Ruby-
|
25
|
+
s.author = "The Ruby-GNOME Project Team"
|
26
26
|
s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
|
27
27
|
s.homepage = "https://ruby-gnome2.osdn.jp/"
|
28
28
|
s.licenses = ["LGPL-2.1+"]
|
data/lib/gdk3/color.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014 Ruby-
|
1
|
+
# Copyright (C) 2014-2019 Ruby-GNOME 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
|
@@ -27,15 +27,22 @@ module Gdk
|
|
27
27
|
message << "\"\#rrggbb\", "
|
28
28
|
message << "\"\#rrggbb\", "
|
29
29
|
message << "\"\#rrrgggbbb\", "
|
30
|
-
message << "\"\#rrrrggggbbbb\"
|
31
|
-
message << "\"\#fff\", "
|
32
|
-
message << "\"\#ffffff\", "
|
33
|
-
message << "\"\#fffffffff\", "
|
34
|
-
message << "\"\#fffffffffffff\""
|
30
|
+
message << "\"\#rrrrggggbbbb\""
|
35
31
|
raise ArgumentError, message
|
36
32
|
end
|
37
33
|
color
|
38
34
|
end
|
35
|
+
|
36
|
+
def try_convert(value)
|
37
|
+
case value
|
38
|
+
when String
|
39
|
+
parse(value)
|
40
|
+
when Symbol
|
41
|
+
parse(value.to_s)
|
42
|
+
else
|
43
|
+
nil
|
44
|
+
end
|
45
|
+
end
|
39
46
|
end
|
40
47
|
|
41
48
|
alias_method :initialize_raw, :initialize
|
data/lib/gdk3/cursor.rb
CHANGED
@@ -38,7 +38,11 @@ module Gdk
|
|
38
38
|
end
|
39
39
|
display = options[:display] || Display.default
|
40
40
|
|
41
|
-
|
41
|
+
if args.size == 1 and args[0].is_a?(String)
|
42
|
+
initialize_new_from_name(display, *args)
|
43
|
+
else
|
44
|
+
initialize_raw(display, *args)
|
45
|
+
end
|
42
46
|
end
|
43
47
|
end
|
44
48
|
end
|
data/lib/gdk3/rgba.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014 Ruby-
|
1
|
+
# Copyright (C) 2014-2019 Ruby-GNOME 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
|
@@ -35,6 +35,17 @@ module Gdk
|
|
35
35
|
end
|
36
36
|
rgba
|
37
37
|
end
|
38
|
+
|
39
|
+
def try_convert(value)
|
40
|
+
case value
|
41
|
+
when String
|
42
|
+
parse(value)
|
43
|
+
when Symbol
|
44
|
+
parse(value.to_s)
|
45
|
+
else
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
end
|
38
49
|
end
|
39
50
|
|
40
51
|
alias_method :initialize_raw, :initialize
|
data/test/gdk-test-utils.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013 Ruby-
|
1
|
+
# Copyright (C) 2013-2019 Ruby-GNOME 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,13 +14,14 @@
|
|
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 "pkg-config"
|
17
18
|
require "test-unit"
|
18
19
|
|
19
20
|
module GdkTestUtils
|
20
21
|
private
|
21
22
|
def only_gdk_version(major, minor, micro=nil)
|
22
23
|
micro ||= 0
|
23
|
-
gdk_version_raw =
|
24
|
+
gdk_version_raw = PKGConfig.modversion("gdk-3.0")
|
24
25
|
gdk_version = gdk_version_raw.split(".").collect(&:to_i)
|
25
26
|
unless (gdk_version <=> [major, minor, micro]) >= 0
|
26
27
|
omit("Require GDK >= #{major}.#{minor}.#{micro}")
|
data/test/run-test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Copyright (C) 2013-
|
3
|
+
# Copyright (C) 2013-2020 Ruby-GNOME Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -16,19 +16,21 @@
|
|
16
16
|
# License along with this library; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
ruby_gnome_base = File.join(File.dirname(__FILE__), "..", "..")
|
20
|
+
ruby_gnome_base = File.expand_path(ruby_gnome_base)
|
21
21
|
|
22
|
-
glib_base = File.join(
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
glib_base = File.join(ruby_gnome_base, "glib2")
|
23
|
+
gio_base = File.join(ruby_gnome_base, "gio2")
|
24
|
+
atk_base = File.join(ruby_gnome_base, "atk")
|
25
|
+
cairo_gobject_base = File.join(ruby_gnome_base, "cairo-gobject")
|
26
|
+
pango_base = File.join(ruby_gnome_base, "pango")
|
27
|
+
gdk_pixbuf_base = File.join(ruby_gnome_base, "gdk_pixbuf2")
|
28
|
+
gobject_introspection_base = File.join(ruby_gnome_base, "gobject-introspection")
|
29
|
+
gdk3_base = File.join(ruby_gnome_base, "gdk3")
|
29
30
|
|
30
31
|
[
|
31
32
|
[glib_base, "glib2"],
|
33
|
+
[gio_base, "gio2"],
|
32
34
|
[atk_base, "atk"],
|
33
35
|
[cairo_gobject_base, "cairo-gobject"],
|
34
36
|
[pango_base, "pango"],
|
data/test/test-gdk-color.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2013-2019 Ruby-GNOME Project Team
|
4
2
|
#
|
5
3
|
# This library is free software; you can redistribute it and/or
|
6
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -26,11 +24,7 @@ class TestGdkColor < Test::Unit::TestCase
|
|
26
24
|
message << "\"\#rrggbb\", "
|
27
25
|
message << "\"\#rrggbb\", "
|
28
26
|
message << "\"\#rrrgggbbb\", "
|
29
|
-
message << "\"\#rrrrggggbbbb\"
|
30
|
-
message << "\"\#fff\", "
|
31
|
-
message << "\"\#ffffff\", "
|
32
|
-
message << "\"\#fffffffff\", "
|
33
|
-
message << "\"\#fffffffffffff\""
|
27
|
+
message << "\"\#rrrrggggbbbb\""
|
34
28
|
assert_raise(ArgumentError.new(message)) do
|
35
29
|
Gdk::Color.parse(spec)
|
36
30
|
end
|
@@ -42,6 +36,18 @@ class TestGdkColor < Test::Unit::TestCase
|
|
42
36
|
end
|
43
37
|
end
|
44
38
|
|
39
|
+
sub_test_case ".try_convert" do
|
40
|
+
test("String") do
|
41
|
+
assert_equal(Gdk::Color.parse("gray"),
|
42
|
+
Gdk::Color.try_convert("gray"))
|
43
|
+
end
|
44
|
+
|
45
|
+
test("Symbol") do
|
46
|
+
assert_equal(Gdk::Color.parse("gray"),
|
47
|
+
Gdk::Color.try_convert(:gray))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
45
51
|
def test_to_s
|
46
52
|
color = Gdk::Color.new(0xffff, 0x1234, 0xabcd)
|
47
53
|
assert_equal("#ffff1234abcd", color.to_s)
|
data/test/test-gdk-rgba.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2013-2019 Ruby-GNOME Project Team
|
4
2
|
#
|
5
3
|
# This library is free software; you can redistribute it and/or
|
6
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -17,6 +15,18 @@
|
|
17
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
16
|
|
19
17
|
class TestGdkRGBA < Test::Unit::TestCase
|
18
|
+
sub_test_case ".try_convert" do
|
19
|
+
test("String") do
|
20
|
+
assert_equal(Gdk::RGBA.parse("gray"),
|
21
|
+
Gdk::RGBA.try_convert("gray"))
|
22
|
+
end
|
23
|
+
|
24
|
+
test("Symbol") do
|
25
|
+
assert_equal(Gdk::RGBA.parse("gray"),
|
26
|
+
Gdk::RGBA.try_convert(:gray))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
20
30
|
def test_to_s
|
21
31
|
rgba = Gdk::RGBA.new(0.2, 0.4, 0.6, 0.5)
|
22
32
|
assert_equal("rgba(51,102,153,0.5)", rgba.to_s)
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdk3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- The Ruby-
|
7
|
+
- The Ruby-GNOME Project Team
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2020-05-02 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: pango
|
@@ -15,42 +16,42 @@ dependencies:
|
|
15
16
|
requirements:
|
16
17
|
- - '='
|
17
18
|
- !ruby/object:Gem::Version
|
18
|
-
version: 3.
|
19
|
+
version: 3.4.2
|
19
20
|
type: :runtime
|
20
21
|
prerelease: false
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
22
23
|
requirements:
|
23
24
|
- - '='
|
24
25
|
- !ruby/object:Gem::Version
|
25
|
-
version: 3.
|
26
|
+
version: 3.4.2
|
26
27
|
- !ruby/object:Gem::Dependency
|
27
28
|
name: gdk_pixbuf2
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
31
|
- - '='
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
33
|
+
version: 3.4.2
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
38
|
- - '='
|
38
39
|
- !ruby/object:Gem::Version
|
39
|
-
version: 3.
|
40
|
+
version: 3.4.2
|
40
41
|
- !ruby/object:Gem::Dependency
|
41
42
|
name: cairo-gobject
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
43
44
|
requirements:
|
44
45
|
- - '='
|
45
46
|
- !ruby/object:Gem::Version
|
46
|
-
version: 3.
|
47
|
+
version: 3.4.2
|
47
48
|
type: :runtime
|
48
49
|
prerelease: false
|
49
50
|
version_requirements: !ruby/object:Gem::Requirement
|
50
51
|
requirements:
|
51
52
|
- - '='
|
52
53
|
- !ruby/object:Gem::Version
|
53
|
-
version: 3.
|
54
|
+
version: 3.4.2
|
54
55
|
description: Ruby/GDK3 is a Ruby binding of GDK-3.x.
|
55
56
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
56
57
|
executables: []
|
@@ -115,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
116
|
- !ruby/object:Gem::Version
|
116
117
|
version: '0'
|
117
118
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
119
|
+
rubygems_version: 3.2.0.pre1
|
119
120
|
signing_key:
|
120
121
|
specification_version: 4
|
121
122
|
summary: Ruby/GDK3 is a Ruby binding of GDK-3.x.
|