Skip to content

Commit

Permalink
Merge branch 'gtk4-development' into gtk4
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Oct 5, 2023
2 parents ea071c4 + 6afc71a commit 2787077
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Gtk-4.0.sed
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ s/var metatypeForSnapshot:/var metatypeForGtkSnapshot:/
s/var wrapperForSnapshot:/var wrapperForGtkSnapshot:/
s/GLib.RefSListRef<ObjectRef>/GLib.RefSListRef<GLibObject.ObjectRef>/
s/free(UnsafeMutableRawPointer/systemFree(UnsafeMutableRawPointer/
s/func load(from path: UnsafePointer<CChar>/func loadFrom(file path: UnsafePointer<CChar>/
s/func load(from string: UnsafePointer<CChar>/func loadFrom(string: UnsafePointer<CChar>/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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

Expand Down
8 changes: 8 additions & 0 deletions Sources/CGtk/gtk_bridging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down Expand Up @@ -150,6 +154,8 @@ struct _GtkLinkButtonAccessiblePrivate {};
struct _GtkLinkButtonPrivate {};
struct _GtkListBoxAccessiblePrivate {};
struct _GtkListStorePrivate {};
struct _GtkListHeader {};
struct _GtkListHeaderClass {};
struct _GtkLockButtonAccessiblePrivate {};
struct _GtkLockButtonPrivate {};
struct _GtkMenuAccessiblePrivate {};
Expand Down Expand Up @@ -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 {};
Expand Down
8 changes: 6 additions & 2 deletions Sources/Gtk/SwiftGtk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<S, T, U> {

public let call: (S, T) -> U

public init(_ closure: @escaping (S, T) -> U) {
self.call = closure
}
Expand Down

0 comments on commit 2787077

Please sign in to comment.