From adbb74ac8a6d4ee2fa3bdc2cf45bc09643659247 Mon Sep 17 00:00:00 2001 From: Rene Hexel Date: Thu, 5 Oct 2023 06:43:48 +1000 Subject: [PATCH 1/3] Support glib-2.78 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4c1f4f58..31724fe3 100644 --- a/README.md +++ b/README.md @@ -94,18 +94,18 @@ After that, use the (usual) Build and Test buttons to build/test this package. To build, download Swift from https://swift.org/download/ -- if you are using macOS, make sure you have the command line tools installed as well). Test that your compiler works using `swift --version`, which should give you something like $ swift --version - swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100) - Target: arm64-apple-macosx13.0 + swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) + Target: arm64-apple-macosx14.0 on macOS, or on Linux you should get something like: $ swift --version - Swift version 5.8.1 (swift-5.8.1-RELEASE) + Swift version 5.9 (swift-5.9-RELEASE) Target: x86_64-unknown-linux-gnu ### Gtk 3.22 or higher -The Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, 2.68, 2.70, 2.72, 2.74, and 2.76, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, 4.6, 4.8, and 4.10 on the `gtk4` branch. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed. +The Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, 2.68, 2.70, 2.72, 2.74, 2.76 and 2.78, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, 4.6, 4.8, and 4.10 on the `gtk4` branch. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed. #### Linux From 62cec188b94888a8736c237823c7b1df65115a0a Mon Sep 17 00:00:00 2001 From: Rene Hexel Date: Thu, 5 Oct 2023 08:51:30 +1000 Subject: [PATCH 2/3] Disambiguate load_from --- Gtk-4.0.sed | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gtk-4.0.sed b/Gtk-4.0.sed index cfeec427..707d9f7c 100644 --- a/Gtk-4.0.sed +++ b/Gtk-4.0.sed @@ -49,3 +49,5 @@ s/var metatypeForSnapshot:/var metatypeForGtkSnapshot:/ s/var wrapperForSnapshot:/var wrapperForGtkSnapshot:/ s/GLib.RefSListRef/GLib.RefSListRef/ s/free(UnsafeMutableRawPointer/systemFree(UnsafeMutableRawPointer/ +s/func load(from path: UnsafePointer/func loadFrom(file path: UnsafePointer/ +s/func load(from string: UnsafePointer/func loadFrom(string: UnsafePointer/ From 6afc71a2a4bb198cbb1b7db470f9fa990c06762d Mon Sep 17 00:00:00 2001 From: Rene Hexel Date: Thu, 5 Oct 2023 08:51:38 +1000 Subject: [PATCH 3/3] Make this work with gtk-4.12 --- README.md | 2 +- Sources/CGtk/gtk_bridging.h | 8 ++++++++ Sources/Gtk/SwiftGtk.swift | 8 ++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 31724fe3..8e8f0cf1 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ on macOS, or on Linux you should get something like: ### Gtk 3.22 or higher -The Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, 2.68, 2.70, 2.72, 2.74, 2.76 and 2.78, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, 4.6, 4.8, and 4.10 on the `gtk4` branch. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed. +The Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, 2.68, 2.70, 2.72, 2.74, 2.76 and 2.78, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, 4.6, 4.8, 4.10, and 4.12 on the `gtk4` branch. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed. #### Linux diff --git a/Sources/CGtk/gtk_bridging.h b/Sources/CGtk/gtk_bridging.h index d67be8cf..54e4e5e4 100644 --- a/Sources/CGtk/gtk_bridging.h +++ b/Sources/CGtk/gtk_bridging.h @@ -57,6 +57,10 @@ struct _GtkColorChooserDialogPrivate {}; struct _GtkColorChooserWidgetPrivate {}; struct _GtkColorSelectionDialogPrivate {}; struct _GtkColorSelectionPrivate {}; +struct _GtkColumnViewCell {}; +struct _GtkColumnViewCellClass {}; +struct _GtkColumnViewRow {}; +struct _GtkColumnViewRowClass {}; struct _GtkComboBoxAccessiblePrivate {}; struct _GtkComboBoxPrivate {}; struct _GtkComboBoxTextPrivate {}; @@ -150,6 +154,8 @@ struct _GtkLinkButtonAccessiblePrivate {}; struct _GtkLinkButtonPrivate {}; struct _GtkListBoxAccessiblePrivate {}; struct _GtkListStorePrivate {}; +struct _GtkListHeader {}; +struct _GtkListHeaderClass {}; struct _GtkLockButtonAccessiblePrivate {}; struct _GtkLockButtonPrivate {}; struct _GtkMenuAccessiblePrivate {}; @@ -214,10 +220,12 @@ struct _GtkScaleAccessiblePrivate {}; struct _GtkScaleButtonAccessiblePrivate {}; struct _GtkScaleButtonPrivate {}; struct _GtkScalePrivate {}; +struct _GtkScrollInfo {}; struct _GtkScrollable {}; struct _GtkScrolledWindowAccessiblePrivate {}; struct _GtkScrolledWindowPrivate {}; struct _GtkSelectionData {}; +struct _GtkSectionModel {}; struct _GtkSeparatorPrivate {}; struct _GtkSeparatorToolItemPrivate {}; struct _GtkSettingsPrivate {}; diff --git a/Sources/Gtk/SwiftGtk.swift b/Sources/Gtk/SwiftGtk.swift index 4c2c243b..e75ee408 100644 --- a/Sources/Gtk/SwiftGtk.swift +++ b/Sources/Gtk/SwiftGtk.swift @@ -8,13 +8,17 @@ import GLib import GLibObject import GIO import Cairo +import Gdk + +/// Alias for the `Gdk.GLAPI` +public typealias GdkGLAPI = Gdk.GLAPI /// Internal Class that wraps a 2-parameter closure to make sure the closure /// is retained until no longer required public class DualClosureHolder { - + public let call: (S, T) -> U - + public init(_ closure: @escaping (S, T) -> U) { self.call = closure }