gtk3 3.4.3 → 3.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gtk3/dialog.rb +10 -11
- data/lib/gtk3/loader.rb +2 -1
- data/lib/gtk3/response-type.rb +30 -0
- data/lib/gtk3/widget.rb +19 -1
- data/test/gtk-test-utils.rb +5 -1
- data/test/run-test.rb +17 -59
- data/test/test-gtk-widget.rb +37 -1
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46f440c547ffc229c731a6d434a278203084202d005f7bf4a2db47ae54e7521d
|
4
|
+
data.tar.gz: 5d9fbab7ff4fffc9fe44362a70e794d4072ed9424d0d0e6bedc6c2e32337a986
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3ffd7c7828d9ce4b4b819158014c87c12e5274dc4446f94521b33ea3c32a5aac9fa4c74916cde4bb3ebafca16bba9ba9cdc5d3b8f77872b9b06f415cf61abfe
|
7
|
+
data.tar.gz: e90825bf6764ff792c210b62a097b7b4808e1bf6e82a56e2fe1464d2db10f83b6ea0325c0181e64141c4def1061d0ad489726697f2ac5afd200371a5b26c4e89
|
data/lib/gtk3/dialog.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015-
|
1
|
+
# Copyright (C) 2015-2020 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
|
@@ -56,21 +56,20 @@ module Gtk
|
|
56
56
|
|
57
57
|
alias_method :add_button_raw, :add_button
|
58
58
|
def add_button(text, response_id)
|
59
|
-
|
60
|
-
when Symbol
|
61
|
-
response_id = ResponseType.new(response_id)
|
62
|
-
end
|
63
|
-
add_button_raw(text, response_id)
|
59
|
+
add_button_raw(text, ResponseType.resolve(response_id))
|
64
60
|
end
|
65
61
|
|
66
62
|
alias_method :get_widget_for_response_raw, :get_widget_for_response
|
67
63
|
def get_widget_for_response(response_id)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
get_widget_for_response_raw(ResponseType.resolve(response_id))
|
65
|
+
end
|
66
|
+
|
67
|
+
alias_method :set_default_response_raw, :set_default_response
|
68
|
+
def set_default_response(response_id)
|
69
|
+
set_default_response_raw(ResponseType.resolve(response_id))
|
73
70
|
end
|
71
|
+
alias_method :default_response_raw=, :default_response=
|
72
|
+
alias_method :default_response=, :set_default_response
|
74
73
|
|
75
74
|
if method_defined?(:use_header_bar)
|
76
75
|
alias_method :use_header_bar_raw, :use_header_bar
|
data/lib/gtk3/loader.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
1
|
+
# Copyright (C) 2014-2020 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
|
@@ -114,6 +114,7 @@ module Gtk
|
|
114
114
|
require "gtk3/radio-action"
|
115
115
|
require "gtk3/radio-button"
|
116
116
|
require "gtk3/recent-chooser-dialog"
|
117
|
+
require "gtk3/response-type"
|
117
118
|
require "gtk3/scale-button"
|
118
119
|
require "gtk3/scrolled-window"
|
119
120
|
require "gtk3/search-bar"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright (C) 2020 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 Gtk
|
18
|
+
class ResponseType
|
19
|
+
class << self
|
20
|
+
def resolve(id)
|
21
|
+
case id
|
22
|
+
when Symbol
|
23
|
+
new(id)
|
24
|
+
else
|
25
|
+
id
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/gtk3/widget.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015-
|
1
|
+
# Copyright (C) 2015-2020 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
|
@@ -82,6 +82,24 @@ module Gtk
|
|
82
82
|
alias_method :events_raw=, :events=
|
83
83
|
alias_method :events=, :set_events
|
84
84
|
|
85
|
+
alias_method :set_size_request_raw, :set_size_request
|
86
|
+
def set_size_request(*args)
|
87
|
+
case args.size
|
88
|
+
when 1
|
89
|
+
options = args[0]
|
90
|
+
raise ArgumentError, ":width is missing" unless options.key?(:width)
|
91
|
+
width = options[:width]
|
92
|
+
raise ArgumentError, ":height is missing" unless options.key?(:height)
|
93
|
+
height = options[:height]
|
94
|
+
when 2
|
95
|
+
width, height = args
|
96
|
+
else
|
97
|
+
message = "wrong number of arguments (given #{args.size}, expected 1..2)"
|
98
|
+
raise ArgumentError, message
|
99
|
+
end
|
100
|
+
set_size_request_raw(width, height)
|
101
|
+
end
|
102
|
+
|
85
103
|
alias_method :drag_source_set_raw, :drag_source_set
|
86
104
|
def drag_source_set(flags, targets, actions)
|
87
105
|
targets = ensure_drag_targets(targets)
|
data/test/gtk-test-utils.rb
CHANGED
@@ -17,6 +17,9 @@
|
|
17
17
|
require "tempfile"
|
18
18
|
require "fileutils"
|
19
19
|
|
20
|
+
require "gtk3"
|
21
|
+
Gtk.init
|
22
|
+
|
20
23
|
module GtkTestUtils
|
21
24
|
private
|
22
25
|
def only_gtk_version(major, minor, micro=nil)
|
@@ -52,6 +55,7 @@ module GtkTestUtils
|
|
52
55
|
end
|
53
56
|
|
54
57
|
def fixture_path(*components)
|
55
|
-
File.join(
|
58
|
+
File.expand_path(File.join(*components),
|
59
|
+
ENV["GTK3_FIXTURE_DIR"] || File.join("test", "fixture"))
|
56
60
|
end
|
57
61
|
end
|
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-2021 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,62 +16,20 @@
|
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
[
|
37
|
-
[glib_base, "glib2"],
|
38
|
-
[gobject_introspection_base, "gobject-introspection"],
|
39
|
-
[atk_base, "atk"],
|
40
|
-
[cairo_gobject_base, "cairo-gobject"],
|
41
|
-
[pango_base, "pango"],
|
42
|
-
[gdk_pixbuf_base, "gdk_pixbuf2"],
|
43
|
-
[gio2_base, "gio2"],
|
44
|
-
[gdk3_base, "gdk3"],
|
45
|
-
[gtk3_base, "gtk3"]
|
46
|
-
].each do |target, module_name|
|
47
|
-
if File.exist?(File.join(target, "Makefile"))
|
48
|
-
if system("which make > /dev/null")
|
49
|
-
`make -C #{target.dump} > /dev/null` or exit(false)
|
50
|
-
end
|
51
|
-
$LOAD_PATH.unshift(File.join(target, "ext", module_name))
|
52
|
-
end
|
53
|
-
$LOAD_PATH.unshift(File.join(target, "lib"))
|
54
|
-
end
|
55
|
-
|
56
|
-
source_fixture_dir = File.join(gtk3_base, "test", "fixture")
|
57
|
-
build_fixture_dir = File.join(build_dir, "test", "fixture")
|
58
|
-
unless source_fixture_dir == build_fixture_dir
|
59
|
-
FileUtils.rm_rf(build_fixture_dir)
|
60
|
-
FileUtils.mkdir_p(File.dirname(build_fixture_dir))
|
61
|
-
FileUtils.cp_r(source_fixture_dir, build_fixture_dir)
|
19
|
+
require_relative "../../glib2/test/run-test"
|
20
|
+
|
21
|
+
run_test(__dir__,
|
22
|
+
[
|
23
|
+
"glib2",
|
24
|
+
"gobject-introspection",
|
25
|
+
"atk",
|
26
|
+
"cairo-gobject",
|
27
|
+
"gdk_pixbuf2",
|
28
|
+
"gio2",
|
29
|
+
"pango",
|
30
|
+
"gdk3",
|
31
|
+
"gtk3",
|
32
|
+
]) do |context|
|
33
|
+
ENV["GTK3_FIXTURE_DIR"] = context[:build_fixture_dir]
|
34
|
+
require_relative "gtk-test-utils"
|
62
35
|
end
|
63
|
-
Dir.chdir(build_fixture_dir) do
|
64
|
-
system("rake") or exit(false)
|
65
|
-
end
|
66
|
-
|
67
|
-
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
68
|
-
require 'glib-test-init'
|
69
|
-
|
70
|
-
$LOAD_PATH.unshift(File.join(gtk3_base, "test"))
|
71
|
-
require 'gtk-test-utils'
|
72
|
-
|
73
|
-
require 'gtk3'
|
74
|
-
|
75
|
-
Gtk.init
|
76
|
-
|
77
|
-
exit Test::Unit::AutoRunner.run(true, File.join(gtk3_base, "test"))
|
data/test/test-gtk-widget.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2008-
|
1
|
+
# Copyright (C) 2008-2020 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
|
@@ -130,6 +130,42 @@ class TestGtkWidget < Test::Unit::TestCase
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
+
sub_test_case "#set_size_request" do
|
134
|
+
test("{width:, height:}") do
|
135
|
+
entry = Gtk::Entry.new
|
136
|
+
entry.set_size_request(width: 50, height: 100)
|
137
|
+
assert_equal([50, 100], entry.size_request)
|
138
|
+
end
|
139
|
+
|
140
|
+
test("{width:}") do
|
141
|
+
entry = Gtk::Entry.new
|
142
|
+
assert_raise(ArgumentError.new(":height is missing")) do
|
143
|
+
entry.set_size_request(width: 50)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
test("{height:}") do
|
148
|
+
entry = Gtk::Entry.new
|
149
|
+
assert_raise(ArgumentError.new(":width is missing")) do
|
150
|
+
entry.set_size_request(height: 100)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
test("(width, height)") do
|
155
|
+
entry = Gtk::Entry.new
|
156
|
+
entry.set_size_request(50, 100)
|
157
|
+
assert_equal([50, 100], entry.size_request)
|
158
|
+
end
|
159
|
+
|
160
|
+
test("nothing") do
|
161
|
+
entry = Gtk::Entry.new
|
162
|
+
assert_raise(ArgumentError.new("wrong number of arguments " +
|
163
|
+
"(given 0, expected 1..2)")) do
|
164
|
+
entry.set_size_request
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
133
169
|
sub_test_case "#style_get_property" do
|
134
170
|
test("existent") do
|
135
171
|
entry = Gtk::Entry.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gio2
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.4.
|
19
|
+
version: 3.4.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: 3.4.
|
26
|
+
version: 3.4.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: atk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.4.
|
33
|
+
version: 3.4.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: 3.4.
|
40
|
+
version: 3.4.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pango
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.4.
|
47
|
+
version: 3.4.4
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.4.
|
54
|
+
version: 3.4.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: gdk_pixbuf2
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.4.
|
61
|
+
version: 3.4.4
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.4.
|
68
|
+
version: 3.4.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: gdk3
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.4.
|
75
|
+
version: 3.4.4
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.4.
|
82
|
+
version: 3.4.4
|
83
83
|
description: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
|
84
84
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
85
85
|
executables: []
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/gtk3/radio-action.rb
|
148
148
|
- lib/gtk3/radio-button.rb
|
149
149
|
- lib/gtk3/recent-chooser-dialog.rb
|
150
|
+
- lib/gtk3/response-type.rb
|
150
151
|
- lib/gtk3/scale-button.rb
|
151
152
|
- lib/gtk3/scrolled-window.rb
|
152
153
|
- lib/gtk3/search-bar.rb
|
@@ -653,7 +654,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
653
654
|
- !ruby/object:Gem::Version
|
654
655
|
version: '0'
|
655
656
|
requirements: []
|
656
|
-
rubygems_version: 3.
|
657
|
+
rubygems_version: 3.3.0.dev
|
657
658
|
signing_key:
|
658
659
|
specification_version: 4
|
659
660
|
summary: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
|