gtk4 4.3.0 → 4.3.1
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/README.md +8 -6
- data/gtk4.gemspec +1 -0
- data/lib/gtk4/deprecated.rb +6 -3
- data/lib/gtk4/image.rb +11 -2
- data/lib/gtk4/loader.rb +2 -1
- data/lib/gtk4/snapshot.rb +31 -0
- data/lib/gtk4.rb +1 -0
- metadata +21 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 594341a672fef1c67eeef1f1d3354d653159776f38bf91be8ca02d80f66b79d0
|
4
|
+
data.tar.gz: 76ffb0a798252613e79235cd66dbd0578bfa4912fac3412aa9e6c1e42ba5ce3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 015e9f5e73f4275dca4c56f89350f72aba1f800e1ac711aad961262449f2c6428764afee9907f4d3acef1335df7708052f760e42517d13287a1c29700248fbcc
|
7
|
+
data.tar.gz: 75485b2b4317c06d01151f439b764fbfd2659a236d604f1671c5a425cec4595067f7a3b74d75660c4a7991af1907bf215290a3e139bf4503bfa5cbc57a0f324b
|
data/README.md
CHANGED
@@ -4,15 +4,17 @@ Ruby/GTK4 is a Ruby binding of GTK 4.
|
|
4
4
|
|
5
5
|
## Requirements
|
6
6
|
|
7
|
-
* Ruby/GLib2, Ruby/
|
8
|
-
Ruby/GDK4, Ruby/
|
7
|
+
* Ruby/GLib2, Ruby/GObjectIntrospection, Ruby/ATK, Ruby/Pango, Ruby/GdkPixbuf2,
|
8
|
+
Ruby/GIO2, Ruby/GDK4, Ruby/Graphene and Ruby/GSK4 in
|
9
9
|
[Ruby-GNOME2](https://ruby-gnome.github.io/)
|
10
10
|
* [rcairo](https://github.com/rcairo/rcairo)
|
11
11
|
* [GTK](https://www.gtk.org/)
|
12
12
|
|
13
13
|
## Install
|
14
14
|
|
15
|
-
|
15
|
+
```bash
|
16
|
+
gem install gtk4
|
17
|
+
```
|
16
18
|
|
17
19
|
## Tutorials, examples:
|
18
20
|
|
@@ -20,12 +22,12 @@ Ruby/GTK4 is a Ruby binding of GTK 4.
|
|
20
22
|
|
21
23
|
## License
|
22
24
|
|
23
|
-
Copyright (C) 2002-
|
25
|
+
Copyright (C) 2002-2025 Ruby-GNOME Project Team
|
24
26
|
|
25
27
|
This program is free software. You can distribute/modify this program
|
26
|
-
under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
|
28
|
+
under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
|
29
|
+
or later.
|
27
30
|
|
28
31
|
## Project Websites
|
29
32
|
|
30
|
-
* https://github.com/ruby-gnome/ruby-gnome
|
31
33
|
* https://ruby-gnome.github.io/
|
data/gtk4.gemspec
CHANGED
data/lib/gtk4/deprecated.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2011-
|
1
|
+
# Copyright (C) 2011-2025 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
|
@@ -619,7 +619,8 @@ module Gtk
|
|
619
619
|
define_deprecated_method :set, warn: message
|
620
620
|
define_deprecated_method_by_hash_args :initialize,
|
621
621
|
'image',
|
622
|
-
'icon_name: nil, icon: nil, file: nil, pixbuf: nil'
|
622
|
+
'icon_name: nil, icon: nil, file: nil, pixbuf: nil, resource: nil, ' +
|
623
|
+
'paintable: nil' do
|
623
624
|
|_self, image|
|
624
625
|
case image
|
625
626
|
when String
|
@@ -631,9 +632,11 @@ module Gtk
|
|
631
632
|
when Symbol
|
632
633
|
[{icon_name: image}]
|
633
634
|
when GdkPixbuf::Pixbuf
|
634
|
-
[{:
|
635
|
+
[{pixbuf: image}]
|
635
636
|
when Gio::Icon
|
636
637
|
[{icon: image}]
|
638
|
+
when Gdk::Paintable
|
639
|
+
[{paintable: paintable}]
|
637
640
|
else
|
638
641
|
message =
|
639
642
|
"Image must be String, Symbol, GdkPixbuf::Pixbuf or " +
|
data/lib/gtk4/image.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
1
|
+
# Copyright (C) 2014-2025 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,7 +20,7 @@ module Gtk
|
|
20
20
|
# Creates a Gtk::Image. The source of the image depends on the options
|
21
21
|
# given.
|
22
22
|
#
|
23
|
-
# @param Hash{Symbol => String, Gio::Icon, GdkPixbuf::Pixbuf}
|
23
|
+
# @param Hash{Symbol => String, Gio::Icon, GdkPixbuf::Pixbuf, Gdk::Paintable}
|
24
24
|
#
|
25
25
|
# @example Create an empty image.
|
26
26
|
# image = Gtk::Image.new
|
@@ -49,12 +49,19 @@ module Gtk
|
|
49
49
|
# Gio::Resources.register(resource)
|
50
50
|
# resource_path = "/path/to/image.png"
|
51
51
|
# image = Gtk::Image.new(resource: resource_path)
|
52
|
+
#
|
53
|
+
# @example Create an image from a paintable
|
54
|
+
# Gio::File.open(path: "my.png") do |file|
|
55
|
+
# texture = Gdk::Texture.new(file)
|
56
|
+
# image = Gtk::Image.new(paintable: texture)
|
57
|
+
# end
|
52
58
|
def initialize(options={})
|
53
59
|
icon_name = options[:icon_name] || nil
|
54
60
|
icon = options[:icon] || options[:gicon] || nil
|
55
61
|
file = options[:file] || nil
|
56
62
|
pixbuf = options[:pixbuf] || nil
|
57
63
|
resource = options[:resource] || nil
|
64
|
+
paintable = options[:paintable] || nil
|
58
65
|
|
59
66
|
if icon_name
|
60
67
|
initialize_new_from_icon_name(icon_name)
|
@@ -66,6 +73,8 @@ module Gtk
|
|
66
73
|
initialize_new_from_pixbuf(pixbuf)
|
67
74
|
elsif resource
|
68
75
|
initialize_new_from_resource(resource)
|
76
|
+
elsif paintable
|
77
|
+
initialize_new_from_paintable(paintable)
|
69
78
|
else
|
70
79
|
initialize_raw
|
71
80
|
end
|
data/lib/gtk4/loader.rb
CHANGED
@@ -109,8 +109,9 @@ module Gtk
|
|
109
109
|
require_relative "scale-button"
|
110
110
|
require_relative "scrolled-window"
|
111
111
|
require_relative "search-bar"
|
112
|
-
require_relative "spin-button"
|
113
112
|
require_relative "show-uri"
|
113
|
+
require_relative "snapshot"
|
114
|
+
require_relative "spin-button"
|
114
115
|
require_relative "stack"
|
115
116
|
require_relative "style-context"
|
116
117
|
require_relative "text-buffer"
|
@@ -0,0 +1,31 @@
|
|
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 Gtk
|
18
|
+
class Snapshot
|
19
|
+
alias_method :save_raw, :save
|
20
|
+
def save
|
21
|
+
save_raw
|
22
|
+
if block_given?
|
23
|
+
begin
|
24
|
+
yield
|
25
|
+
ensure
|
26
|
+
restore
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/gtk4.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
@@ -15,28 +15,42 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - '='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 4.3.
|
18
|
+
version: 4.3.1
|
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.1
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: gdk4
|
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.1
|
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.1
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: gsk4
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 4.3.1
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 4.3.1
|
40
54
|
description: Ruby/GTK4 is a Ruby binding of GTK 4.x. It allows Ruby programmers to
|
41
55
|
use the GTK graphics toolkit to make graphical user interfaces for their Ruby scripts.
|
42
56
|
Many of the programs you use like file explorers, browsers, graphics programs etc.
|
@@ -105,6 +119,7 @@ files:
|
|
105
119
|
- lib/gtk4/scrolled-window.rb
|
106
120
|
- lib/gtk4/search-bar.rb
|
107
121
|
- lib/gtk4/show-uri.rb
|
122
|
+
- lib/gtk4/snapshot.rb
|
108
123
|
- lib/gtk4/spin-button.rb
|
109
124
|
- lib/gtk4/stack.rb
|
110
125
|
- lib/gtk4/style-context.rb
|
@@ -205,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
220
|
- !ruby/object:Gem::Version
|
206
221
|
version: '0'
|
207
222
|
requirements: []
|
208
|
-
rubygems_version: 3.6.
|
223
|
+
rubygems_version: 3.6.9
|
209
224
|
specification_version: 4
|
210
225
|
summary: Ruby/GTK4 is a Ruby binding of GTK+-4.x.
|
211
226
|
test_files: []
|