gtk4 3.5.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gtk4.gemspec +1 -5
- data/lib/gtk4/{menu-item.rb → application.rb} +11 -10
- data/lib/gtk4/box.rb +1 -1
- data/lib/gtk4/builder.rb +14 -61
- data/lib/gtk4/button.rb +1 -2
- data/lib/gtk4/combo-box.rb +1 -6
- data/lib/gtk4/deprecated.rb +234 -246
- data/lib/gtk4/dialog.rb +10 -21
- data/lib/gtk4/{action.rb → entry.rb} +11 -8
- data/lib/gtk4/{gdk-drag-context.rb → gdk-display.rb} +12 -10
- data/lib/gtk4/icon-theme.rb +9 -12
- data/lib/gtk4/image.rb +12 -56
- data/lib/gtk4/list-store.rb +8 -0
- data/lib/gtk4/loader.rb +153 -27
- data/lib/gtk4/message-dialog.rb +1 -1
- data/lib/gtk4/paned.rb +17 -11
- data/lib/gtk4/{clipboard.rb → response-type.rb} +11 -6
- data/lib/gtk4/ruby-builder-scope.rb +47 -0
- data/lib/gtk4/scale-button.rb +6 -13
- data/lib/gtk4/stack.rb +23 -27
- data/lib/gtk4/style-context.rb +20 -4
- data/lib/gtk4/text-buffer.rb +14 -10
- data/lib/gtk4/{style-properties.rb → tree-model-sort.rb} +7 -9
- data/lib/gtk4/tree-model.rb +21 -1
- data/lib/gtk4/{target-list.rb → tree-sortable.rb} +8 -11
- data/lib/gtk4/tree-view-column.rb +9 -1
- data/lib/gtk4/version.rb +2 -2
- data/lib/gtk4/widget.rb +44 -71
- data/lib/gtk4.rb +4 -35
- data/sample/demos/README.md +4 -0
- data/sample/examples/README.md +4 -0
- data/sample/{action-namespace.rb → examples/action-namespace.rb} +0 -0
- data/sample/{builder.rb → examples/builder.rb} +0 -0
- data/sample/{builder.ui → examples/builder.ui} +0 -0
- data/sample/{drawing.rb → examples/drawing.rb} +0 -0
- data/sample/{grid_packing.rb → examples/grid_packing.rb} +0 -0
- data/sample/{hello_world.rb → examples/hello_world.rb} +0 -0
- data/sample/{utils.rb → examples/utils.rb} +0 -0
- data/sample/getting-started/README.md +4 -0
- metadata +26 -92
- data/lib/gtk4/action-group.rb +0 -131
- data/lib/gtk4/calendar.rb +0 -30
- data/lib/gtk4/check-menu-item.rb +0 -34
- data/lib/gtk4/container.rb +0 -62
- data/lib/gtk4/icon-size.rb +0 -32
- data/lib/gtk4/image-menu-item.rb +0 -37
- data/lib/gtk4/radio-action.rb +0 -28
- data/lib/gtk4/radio-button.rb +0 -49
- data/lib/gtk4/recent-chooser-dialog.rb +0 -38
- data/lib/gtk4/selection-data.rb +0 -42
- data/lib/gtk4/stock-item.rb +0 -36
- data/lib/gtk4/stock.rb +0 -70
- data/lib/gtk4/table.rb +0 -43
- data/lib/gtk4/target-entry.rb +0 -27
- data/lib/gtk4/toggle-action.rb +0 -27
- data/lib/gtk4/tool-button.rb +0 -36
- data/lib/gtk4/ui-manager.rb +0 -35
- data/lib/gtk4/window.rb +0 -42
- data/test/fixture/gnome-logo-icon.png +0 -0
- data/test/gtk-test-utils.rb +0 -36
- data/test/run-test.rb +0 -42
- data/test/test-gtk-box.rb +0 -36
- data/test/test-gtk-button.rb +0 -46
- data/test/test-gtk-dialog.rb +0 -74
- data/test/test-gtk-menu-item.rb +0 -42
- data/test/test-gtk-message-dialog.rb +0 -62
- data/test/test-gtk-version.rb +0 -47
- data/test/test-gtk-window.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de023553f78e80f657467bf0a4180750463785a135f79cf9276bc10b00b91027
|
4
|
+
data.tar.gz: b6a6e7a6ec94fb6027f049043513f8e101b348430ea1ef4dd405fc20abc10c88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30e0eea79cd1177703457ab30f33fbf8dd68ec5e447104ebbd0cd12ef7db5e81d981180823841705e86a6dccecd8b1a5b53bbe923dc1117d06799571134bcbca
|
7
|
+
data.tar.gz: 0515cb09dc45ef50a2f5b0cdbeccc9d82bd64b943a5f2b907bb0d1fa951091040f94788e02d81a214f252e87567493d9a4ca7c4198597a421527f0481e129a25
|
data/gtk4.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2018 Ruby-GNOME Project Team
|
3
|
+
# Copyright (C) 2018-2022 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
|
@@ -36,11 +36,7 @@ Gem::Specification.new do |s|
|
|
36
36
|
]
|
37
37
|
s.files += Dir.glob("lib/**/*.rb")
|
38
38
|
s.files += Dir.glob("sample/**/*")
|
39
|
-
s.files += Dir.glob("test/**/*")
|
40
39
|
|
41
|
-
s.add_runtime_dependency("gio2", "= #{s.version}")
|
42
40
|
s.add_runtime_dependency("atk", "= #{s.version}")
|
43
|
-
s.add_runtime_dependency("pango", "= #{s.version}")
|
44
|
-
s.add_runtime_dependency("gdk_pixbuf2", "= #{s.version}")
|
45
41
|
s.add_runtime_dependency("gdk4", "= #{s.version}")
|
46
42
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C)
|
1
|
+
# Copyright (C) 2018 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
|
@@ -15,19 +15,20 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
module Gtk
|
18
|
-
class
|
18
|
+
class Application
|
19
19
|
alias_method :initialize_raw, :initialize
|
20
|
-
def initialize(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
def initialize(*args)
|
21
|
+
case args.size
|
22
|
+
when 0
|
23
|
+
initialize_raw(nil, :flags_none)
|
24
|
+
when 1
|
25
|
+
if args[0].is_a?(String)
|
26
|
+
initialize_raw(args[0], :flags_none)
|
26
27
|
else
|
27
|
-
|
28
|
+
initialize_raw(nil, args[0])
|
28
29
|
end
|
29
30
|
else
|
30
|
-
initialize_raw
|
31
|
+
initialize_raw(*args)
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
data/lib/gtk4/box.rb
CHANGED
data/lib/gtk4/builder.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015-
|
1
|
+
# Copyright (C) 2015-2022 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,68 +14,28 @@
|
|
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_relative "ruby-builder-scope"
|
18
|
+
|
17
19
|
module Gtk
|
18
20
|
class Builder
|
19
|
-
class << self
|
20
|
-
def connect_signal(builder,
|
21
|
-
object,
|
22
|
-
signal_name,
|
23
|
-
handler_name,
|
24
|
-
connect_object,
|
25
|
-
flags,
|
26
|
-
&block)
|
27
|
-
handler_name = normalize_handler_name(handler_name)
|
28
|
-
if connect_object
|
29
|
-
handler = connect_object.method(handler_name)
|
30
|
-
else
|
31
|
-
handler = block.call(handler_name)
|
32
|
-
end
|
33
|
-
|
34
|
-
unless handler
|
35
|
-
$stderr.puts("Undefined handler: #{handler_name}") if $DEBUG
|
36
|
-
return
|
37
|
-
end
|
38
|
-
|
39
|
-
if flags.is_a?(Integer)
|
40
|
-
flags = GLib::ConnectFlags.new(flags)
|
41
|
-
end
|
42
|
-
|
43
|
-
if flags.after?
|
44
|
-
signal_connect_method = :signal_connect_after
|
45
|
-
else
|
46
|
-
signal_connect_method = :signal_connect
|
47
|
-
end
|
48
|
-
|
49
|
-
if handler.arity.zero?
|
50
|
-
object.__send__(signal_connect_method, signal_name) do
|
51
|
-
handler.call
|
52
|
-
end
|
53
|
-
else
|
54
|
-
object.__send__(signal_connect_method, signal_name, &handler)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
private
|
59
|
-
def normalize_handler_name(name)
|
60
|
-
name.gsub(/[-\s]+/, "_")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
21
|
alias_method :initialize_raw, :initialize
|
65
22
|
def initialize(options={})
|
66
|
-
|
67
|
-
|
68
|
-
|
23
|
+
object = options[:object]
|
24
|
+
path = options[:path] || options[:file]
|
25
|
+
resource = options[:resource]
|
26
|
+
string = options[:string]
|
27
|
+
|
28
|
+
initialize_new
|
29
|
+
set_current_object(object) if object
|
30
|
+
set_scope(RubyBuilderScope.new)
|
69
31
|
|
70
32
|
if path
|
71
33
|
path = path.to_path if path.respond_to?(:to_path)
|
72
|
-
|
34
|
+
add_from_file(path)
|
73
35
|
elsif resource
|
74
|
-
|
36
|
+
add_from_resource(resource)
|
75
37
|
elsif string
|
76
|
-
|
77
|
-
else
|
78
|
-
initialize_raw
|
38
|
+
add_from_string(string)
|
79
39
|
end
|
80
40
|
end
|
81
41
|
|
@@ -144,12 +104,5 @@ module Gtk
|
|
144
104
|
add(target)
|
145
105
|
self
|
146
106
|
end
|
147
|
-
|
148
|
-
alias_method :connect_signals_raw, :connect_signals
|
149
|
-
def connect_signals(&block)
|
150
|
-
connect_signals_raw do |*args|
|
151
|
-
self.class.connect_signal(*args, &block)
|
152
|
-
end
|
153
|
-
end
|
154
107
|
end
|
155
108
|
end
|
data/lib/gtk4/button.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
1
|
+
# Copyright (C) 2014-2022 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
|
@@ -28,7 +28,6 @@ module Gtk
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
icon_name = options[:icon_name]
|
31
|
-
icon_size = options[:icon_size] || :button
|
32
31
|
|
33
32
|
if label
|
34
33
|
if use_underline
|
data/lib/gtk4/combo-box.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015 Ruby-
|
1
|
+
# Copyright (C) 2015-2022 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
|
@@ -20,21 +20,16 @@ module Gtk
|
|
20
20
|
def initialize(options={})
|
21
21
|
entry = options[:entry]
|
22
22
|
model = options[:model]
|
23
|
-
area = options[:area]
|
24
23
|
|
25
24
|
if entry
|
26
25
|
if model
|
27
26
|
initialize_new_with_model_and_entry(model)
|
28
|
-
elsif area
|
29
|
-
initialize_new_with_area_and_entry(area)
|
30
27
|
else
|
31
28
|
initialize_new_with_entry
|
32
29
|
end
|
33
30
|
else
|
34
31
|
if model
|
35
32
|
initialize_new_with_model(model)
|
36
|
-
elsif area
|
37
|
-
initialize_new_with_area(area)
|
38
33
|
else
|
39
34
|
initialize_new
|
40
35
|
end
|