gtk4 4.1.0 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gtk4/css-provider.rb +9 -5
- data/lib/gtk4/loader.rb +2 -1
- data/sample/examples/application1/README.md +32 -0
- data/sample/examples/application1/exampleapp.png +0 -0
- data/sample/examples/application1/exampleapp.rb +50 -0
- data/sample/examples/application1/org.gtk.exampleapp.desktop +6 -0
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 031bdff3af35f8c9ca1993b8857fe51b9c6e658d327a3fb263d8df8e0fd476ee
|
4
|
+
data.tar.gz: ac2485eb8b4f99c3c714fcaa4ab18eccffd347980705a32e028c4503fa136585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687e5abb4016942dbfb0228d6371ddb0a64263b90192575c21cb14470fb8066402d5323b1086ca74dbdec18e4df92d3206689020b6864f53d571b46b4b40d302
|
7
|
+
data.tar.gz: f7b56275f7613f8f9a979d7b96ddfe16ef1c75b562c37516fd1da6da3840e236059d06426d0ee8008e3f8ba7b8a92d9c8f66890e00687d51e2ecbe0a47ea6938
|
data/lib/gtk4/css-provider.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
1
|
+
# Copyright (C) 2014-2023 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
|
@@ -36,10 +36,14 @@ module Gtk
|
|
36
36
|
end
|
37
37
|
|
38
38
|
alias_method :load_from_data_raw, :load_from_data
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
if Version.or_later?(4, 9, 3)
|
40
|
+
def load_from_data(data)
|
41
|
+
data = data.to_s if data.is_a?(GLib::Bytes)
|
42
|
+
load_from_data_raw(data, data.bytesize)
|
43
|
+
end
|
44
|
+
else
|
45
|
+
def load_from_data(data)
|
46
|
+
data = data.to_s if data.is_a?(GLib::Bytes)
|
43
47
|
load_from_data_raw(data)
|
44
48
|
end
|
45
49
|
end
|
data/lib/gtk4/loader.rb
CHANGED
@@ -70,6 +70,8 @@ module Gtk
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def require_libraries
|
73
|
+
require_relative "version"
|
74
|
+
|
73
75
|
require_relative "gdk-display"
|
74
76
|
|
75
77
|
require_relative "about-dialog"
|
@@ -122,7 +124,6 @@ module Gtk
|
|
122
124
|
require_relative "tree-store"
|
123
125
|
require_relative "tree-view"
|
124
126
|
require_relative "tree-view-column"
|
125
|
-
require_relative "version"
|
126
127
|
require_relative "widget"
|
127
128
|
|
128
129
|
require_relative "deprecated"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Step 1: A trivial application
|
2
|
+
|
3
|
+
The following is only useful in the desktop system based on [Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html) such as GNOME.
|
4
|
+
|
5
|
+
To make gnome-shell use the desktop file and icon for this example while running it uninstalled, do the following:
|
6
|
+
|
7
|
+
```console
|
8
|
+
$ mkdir -p ~/.local/share/applications
|
9
|
+
$ cp org.gtk.exampleapp.desktop ~/.local/share/applications/org.gtk.exampleapp.desktop
|
10
|
+
$ mkdir -p ~/.local/share/icons/hicolor/48x48/apps
|
11
|
+
$ cp exampleapp.png ~/.local/share/icons/hicolor/48x48/apps
|
12
|
+
```
|
13
|
+
|
14
|
+
The file exapmleapp.png is from the GTK GitLab repository.
|
15
|
+
The original file is [here](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/examples/application1/exampleapp.png) and the license is LGPL 2.1 or later.
|
16
|
+
|
17
|
+
Note:
|
18
|
+
|
19
|
+
1. You need to install your exampleapp.rb in advance.
|
20
|
+
|
21
|
+
```console
|
22
|
+
$ cp exampleapp.rb ~/.local/bin/exampleapp.rb
|
23
|
+
$ chmod +x ~/.local/bin/exampleapp.rb
|
24
|
+
```
|
25
|
+
|
26
|
+
2. If you use rbenv, your ruby executable may not be found.
|
27
|
+
You can solve this by creating a symbolic link in `~/.local/bin` to your ruby executable.
|
28
|
+
For example,
|
29
|
+
|
30
|
+
```console
|
31
|
+
$ ln -s $(rbenv which ruby) ~/.local/bin/ruby
|
32
|
+
```
|
Binary file
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2023 Ruby-GNOME Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
#
|
19
|
+
# Example from:
|
20
|
+
# * https://gitlab.gnome.org/GNOME/gtk/-/blob/main/examples/application1/exampleapp.c
|
21
|
+
# * https://gitlab.gnome.org/GNOME/gtk/-/blob/main/examples/application1/exampleappwin.c#
|
22
|
+
# License: LGPL2.1-or-later
|
23
|
+
|
24
|
+
require "gtk4"
|
25
|
+
|
26
|
+
class ExampleAppWindow < Gtk::ApplicationWindow
|
27
|
+
def open(file)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class ExampleApp < Gtk::Application
|
32
|
+
def initialize
|
33
|
+
super("org.gtk.exampleapp", :handles_open)
|
34
|
+
|
35
|
+
signal_connect "activate" do |application|
|
36
|
+
window = ExampleAppWindow.new(application)
|
37
|
+
window.present
|
38
|
+
end
|
39
|
+
signal_connect "open" do |application, files, hin|
|
40
|
+
window = application.windows[0] || ExampleAppWindow.new(application)
|
41
|
+
files.each do |file|
|
42
|
+
window.open(file)
|
43
|
+
end
|
44
|
+
window.present
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
app = ExampleApp.new
|
50
|
+
app.run
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
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: 2023-
|
11
|
+
date: 2023-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atk
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.1.
|
19
|
+
version: 4.1.2
|
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: 4.1.
|
26
|
+
version: 4.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gdk4
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.1.
|
33
|
+
version: 4.1.2
|
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: 4.1.
|
40
|
+
version: 4.1.2
|
41
41
|
description: Ruby/GTK4 is a Ruby binding of GTK+-4.x.
|
42
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
43
43
|
executables: []
|
@@ -117,6 +117,10 @@ files:
|
|
117
117
|
- sample/demos/README.md
|
118
118
|
- sample/examples/README.md
|
119
119
|
- sample/examples/action-namespace.rb
|
120
|
+
- sample/examples/application1/README.md
|
121
|
+
- sample/examples/application1/exampleapp.png
|
122
|
+
- sample/examples/application1/exampleapp.rb
|
123
|
+
- sample/examples/application1/org.gtk.exampleapp.desktop
|
120
124
|
- sample/examples/builder.rb
|
121
125
|
- sample/examples/builder.ui
|
122
126
|
- sample/examples/drawing.rb
|