gsk4 4.3.2 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gsk4/loader.rb +18 -0
- data/lib/gsk4/rounded-rect.rb +79 -0
- data/lib/gsk4.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fddd70c9fa4f9f10f17f62df944a8a5beb5582c3775ba3195c7e2e10374bcc9
|
4
|
+
data.tar.gz: a8f0fc46a075ea6ecbaca305cdfca822f586b5a1ce774e29416b235f0042ec12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33f4d17b35402dbd096d5b46dbb0a5ccbfc04353ef29da5afb05a56c41a4d5fc8a4946987c12adcbcd5350713ba76b8aa86a764068e5f5433830fcb4635fa83b
|
7
|
+
data.tar.gz: 3e59a3f0e1f1d034faaea9e28bb6bc1ba25ce4a447ef7e7fff503ad40dd74b94ce9f99ac8d4889fc06bdb237e110312a70046d98dcd66e0a4d1b62172c4457f5
|
data/lib/gsk4/loader.rb
CHANGED
@@ -25,5 +25,23 @@ module Gsk
|
|
25
25
|
self.version = "4.0"
|
26
26
|
super("Gsk")
|
27
27
|
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def post_load(repository, namespace)
|
31
|
+
require_relative "rounded-rect"
|
32
|
+
end
|
33
|
+
|
34
|
+
def field_name(field_info, klass)
|
35
|
+
case klass.name
|
36
|
+
when "Gsk::RoundedRect"
|
37
|
+
if field_info.name == "corner"
|
38
|
+
"corners"
|
39
|
+
else
|
40
|
+
super
|
41
|
+
end
|
42
|
+
else
|
43
|
+
super
|
44
|
+
end
|
45
|
+
end
|
28
46
|
end
|
29
47
|
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# Copyright (C) 2025 Ruby-GNOME 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 Gsk
|
18
|
+
class RoundedRect
|
19
|
+
class << self
|
20
|
+
def try_convert(value)
|
21
|
+
case value
|
22
|
+
when Array
|
23
|
+
n_values = value.size
|
24
|
+
return nil if n_values < 2
|
25
|
+
|
26
|
+
bounds = Graphene::Rect.try_convert(value[0])
|
27
|
+
return nil if bounds.nil?
|
28
|
+
case n_values
|
29
|
+
when 2
|
30
|
+
radius = value[1]
|
31
|
+
new(bounds, radius)
|
32
|
+
when 5
|
33
|
+
corners = []
|
34
|
+
(1..4).each do |i|
|
35
|
+
corner = Graphene::Size.try_convert(value[i])
|
36
|
+
return nil if corner.nil?
|
37
|
+
corners << corner
|
38
|
+
end
|
39
|
+
new(bounds, *corners)
|
40
|
+
else
|
41
|
+
nil
|
42
|
+
end
|
43
|
+
else
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
alias_method :initialize_raw, :initialize
|
50
|
+
def initialize(*args)
|
51
|
+
super()
|
52
|
+
case args.size
|
53
|
+
when 0
|
54
|
+
when 1
|
55
|
+
init_copy(args[0])
|
56
|
+
when 2
|
57
|
+
init_from_rect(args[0], args[1])
|
58
|
+
when 5
|
59
|
+
init(*args)
|
60
|
+
else
|
61
|
+
message = +"wrong number of arguments "
|
62
|
+
message << "(given #{args.size}, expected 0, 1, 2 or 5)"
|
63
|
+
raise ArgumentError, message
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def ==(other)
|
68
|
+
other.is_a?(self.class) and
|
69
|
+
bounds == other.bounds and
|
70
|
+
corners == other.corners
|
71
|
+
end
|
72
|
+
|
73
|
+
def inspect
|
74
|
+
super.sub(/>\z/) do
|
75
|
+
" bounds=#{bounds.inspect} corners=#{corners.inspect}>"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/lib/gsk4.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gsk4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
@@ -15,28 +15,28 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - '='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 4.3.
|
18
|
+
version: 4.3.3
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - '='
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 4.3.
|
25
|
+
version: 4.3.3
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: graphene1
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - '='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 4.3.
|
32
|
+
version: 4.3.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - '='
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 4.3.
|
39
|
+
version: 4.3.3
|
40
40
|
description: Ruby/GSK4 is a Ruby binding of GSK 4.x.
|
41
41
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
42
42
|
executables: []
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- gsk4.gemspec
|
50
50
|
- lib/gsk4.rb
|
51
51
|
- lib/gsk4/loader.rb
|
52
|
+
- lib/gsk4/rounded-rect.rb
|
52
53
|
- lib/gsk4/version.rb
|
53
54
|
homepage: https://ruby-gnome.github.io/
|
54
55
|
licenses:
|