gtk4 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a79b0fe5bfd71d726aa0d6676af6e23368668b9a1d1312f735dfa06df96d6f8f
4
- data.tar.gz: ef24b5d5e87230e00d8cb5281ab25943fc67274ff0a957b4f8430ae269071353
3
+ metadata.gz: 1fd29b5c43f2bbf99765dd2b0a165351a55ba71244c10392eed5f443f7953f13
4
+ data.tar.gz: 7ed521f6ebb50e85924f9a80c46c172540f8565f148d84d8d71f6940f17ea22c
5
5
  SHA512:
6
- metadata.gz: 5322fc6370d45c196e9e508049a00cecfededd341f675e513c75be76014d28d6429a62edc18719ab69a6ca0df0cfbcc49a498e00f6294cc2f1ec18cc8fc23600
7
- data.tar.gz: b92ae2e18974f442ab411ba72920833a13c6347ab7f88e42ae6b09dff521f338327e0b5dcaafbc2ff5185cd6a4f77120fc94171a61b5c5b286345a86a9b538a6
6
+ metadata.gz: 7c3658a5a78e4bc7854ece88656989a8710b238f4f39199b6c737953c52eec2c284fd3dbdb6e7db149efbca8be35d47c15706e04301ae7b31cae7a25445d713f
7
+ data.tar.gz: 2d96bbe7d280d461c2a0b67033619e88a57c4409dedabe56156b67099ba9f87dbd83253f3ba83069d6c6538198167b2ca2f18d6b0fd642b4336eacd75247c946
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2022 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
+ require "pathname"
20
+
21
+ base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
22
+ top_dir = base_dir.parent
23
+ top_build_dir = Pathname(".").parent.parent.parent.expand_path
24
+
25
+ mkmf_gnome2_dir = top_dir + "glib2" + "lib"
26
+ version_suffix = ""
27
+ unless mkmf_gnome2_dir.exist?
28
+ if /(-\d+\.\d+\.\d+)\z/ =~ base_dir.basename.to_s
29
+ version_suffix = $1
30
+ mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + "lib"
31
+ end
32
+ end
33
+
34
+ $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
35
+
36
+ module_name = "gtk4"
37
+ package_id = "gtk4"
38
+
39
+ require "mkmf-gnome"
40
+
41
+ depended_packages = [
42
+ "glib2",
43
+ "gobject-introspection",
44
+ "cairo-gobject",
45
+ "atk",
46
+ "pango",
47
+ "gdk_pixbuf2",
48
+ "gdk4",
49
+ ]
50
+ depended_packages.each do |package|
51
+ directory = "#{package}#{version_suffix}"
52
+ build_base_path = "#{directory}/tmp/#{RUBY_PLATFORM}"
53
+ package_library_name = package.gsub(/-/, "_")
54
+ build_dir = "#{build_base_path}/#{package_library_name}/#{RUBY_VERSION}"
55
+ add_depend_package(package, "#{directory}/ext/#{package}",
56
+ top_dir.to_s,
57
+ :top_build_dir => top_build_dir.to_s,
58
+ :target_build_dir => build_dir)
59
+ end
60
+
61
+ unless check_cairo(:top_dir => top_dir)
62
+ exit(false)
63
+ end
64
+
65
+ unless required_pkg_config_package(package_id,
66
+ :alt_linux => "libgtk4-devel",
67
+ :debian => "libgtk-4-dev",
68
+ :redhat => "pkgconfig(#{package_id})",
69
+ :arch_linux => "gtk4",
70
+ :homebrew => "gtk4",
71
+ :macports => "gtk4",
72
+ :msys2 => "gtk4")
73
+ exit(false)
74
+ end
75
+
76
+ unless PKGConfig.have_package("gobject-introspection-1.0")
77
+ exit(false)
78
+ end
79
+
80
+ create_pkg_config_file("Ruby/GTK4", package_id)
81
+
82
+ $defs << "-DRUBY_GTK4_COMPILATION"
83
+ create_makefile(module_name)
84
+
85
+ pkg_config_dir = with_config("pkg-config-dir")
86
+ if pkg_config_dir.is_a?(String)
87
+ File.open("Makefile", "ab") do |makefile|
88
+ makefile.puts
89
+ makefile.puts("pkgconfigdir=#{pkg_config_dir}")
90
+ end
91
+ end
@@ -0,0 +1,33 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2022 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,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ /*
24
+ * AlmaLinux 9: GTK 4.4
25
+ * Debian GNU/Linux bookworm: GTK 4.6
26
+ * Ubuntu 22.04: GTK 4.6
27
+ */
28
+ #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_4_4
29
+
30
+ #include "rb-gtk4.h"
31
+
32
+ G_GNUC_INTERNAL void rb_gtk4_widget_init(void);
33
+ G_GNUC_INTERNAL void rb_gtk4_window_init(void);
@@ -0,0 +1,37 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2015-2022 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,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rb-gtk4-private.h"
22
+
23
+ static void
24
+ rb_gtk4_widget_mark(gpointer object)
25
+ {
26
+ GtkWidget *child = gtk_widget_get_first_child(object);
27
+ while (child) {
28
+ rbgobj_gc_mark_instance(child);
29
+ child = gtk_widget_get_next_sibling(child);
30
+ }
31
+ }
32
+
33
+ void
34
+ rb_gtk4_widget_init(void)
35
+ {
36
+ rbgobj_register_mark_func(GTK_TYPE_WIDGET, rb_gtk4_widget_mark);
37
+ }
@@ -0,0 +1,65 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2017-2022 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,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rb-gtk4-private.h"
22
+
23
+ typedef struct {
24
+ int dummy;
25
+ } ToplevelWindowMarkerData;
26
+
27
+ static void
28
+ toplevel_window_marker_mark(G_GNUC_UNUSED void *_)
29
+ {
30
+ GList *list = gtk_window_list_toplevels();
31
+ GList *node;
32
+ for (node = list; node; node = g_list_next(node)) {
33
+ rbgobj_gc_mark_instance(node->data);
34
+ }
35
+ g_list_free(list);
36
+ }
37
+
38
+ static void
39
+ toplevel_window_marker_free(void *data)
40
+ {
41
+ xfree(data);
42
+ }
43
+
44
+ static const rb_data_type_t toplevel_window_marker_type = {
45
+ "Gtk::ToplevelsMarker",
46
+ {
47
+ toplevel_window_marker_mark,
48
+ toplevel_window_marker_free,
49
+ },
50
+ NULL,
51
+ NULL,
52
+ RUBY_TYPED_FREE_IMMEDIATELY,
53
+ };
54
+
55
+ void
56
+ rb_gtk4_window_init(void)
57
+ {
58
+ ToplevelWindowMarkerData *data;
59
+ VALUE toplevel_window_marker =
60
+ TypedData_Make_Struct(rb_cObject,
61
+ ToplevelWindowMarkerData,
62
+ &toplevel_window_marker_type,
63
+ data);
64
+ rb_gc_register_mark_object(toplevel_window_marker);
65
+ }
@@ -0,0 +1,28 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2022 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,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rb-gtk4-private.h"
22
+
23
+ void
24
+ Init_gtk4(void)
25
+ {
26
+ rb_gtk4_widget_init();
27
+ rb_gtk4_window_init();
28
+ }
@@ -0,0 +1,27 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2022 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,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #pragma once
22
+
23
+ #include <gtk/gtk.h>
24
+
25
+ #include <rb-gobject-introspection.h>
26
+
27
+ extern void Init_gtk4(void);
data/gtk4.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.homepage = "https://ruby-gnome2.osdn.jp/"
28
28
  s.licenses = ["LGPL-2.1+"]
29
29
  s.version = ruby_glib2_version
30
+ s.extensions = ["ext/#{s.name}/extconf.rb"]
30
31
  s.require_paths = ["lib"]
31
32
  s.files = [
32
33
  "COPYING.LIB",
@@ -35,6 +36,7 @@ Gem::Specification.new do |s|
35
36
  "#{s.name}.gemspec",
36
37
  ]
37
38
  s.files += Dir.glob("lib/**/*.rb")
39
+ s.files += Dir.glob("ext/#{s.name}/*.{c,h,def,rb}")
38
40
  s.files += Dir.glob("sample/**/*")
39
41
 
40
42
  s.add_runtime_dependency("atk", "= #{s.version}")
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.0.2
4
+ version: 4.0.3
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: 2022-09-05 00:00:00.000000000 Z
11
+ date: 2022-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atk
@@ -16,37 +16,44 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.2
19
+ version: 4.0.3
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.0.2
26
+ version: 4.0.3
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.0.2
33
+ version: 4.0.3
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.0.2
40
+ version: 4.0.3
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: []
44
- extensions: []
44
+ extensions:
45
+ - ext/gtk4/extconf.rb
45
46
  extra_rdoc_files: []
46
47
  files:
47
48
  - COPYING.LIB
48
49
  - README.md
49
50
  - Rakefile
51
+ - ext/gtk4/extconf.rb
52
+ - ext/gtk4/rb-gtk4-private.h
53
+ - ext/gtk4/rb-gtk4-widget.c
54
+ - ext/gtk4/rb-gtk4-window.c
55
+ - ext/gtk4/rb-gtk4.c
56
+ - ext/gtk4/rb-gtk4.h
50
57
  - gtk4.gemspec
51
58
  - lib/gtk4.rb
52
59
  - lib/gtk4/about-dialog.rb