Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Jul 29, 2023
2 parents a2d345d + 71e256b commit 91ba88b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
8 changes: 8 additions & 0 deletions Gtk-3.0.sed
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,11 @@ s|getSearch(path: UnsafeMutablePointer<UnsafeMutablePointer<gchar>|getSearch(pat
s|setSearch(path: UnsafeMutablePointer<gchar>|setSearch(path: UnsafeMutablePointer<UnsafePointer<gchar>?>|
s|rv = Gdk\(ModifierType(.*)\)|rv = Gdk.\1|
s|rv = Gdk\(EventMask(.*)\)|rv = Gdk.\1|
s/var metatypeReferenceForApplication:/var metatypeReferenceForGtkApplication:/
s/var metatypeForApplication:/var metatypeForGtkApplication:/
s/var wrapperForApplication:/var wrapperForGtkApplication:/
s/var metatypeReferenceForMountOperation:/var metatypeReferenceForGtkMountOperation:/
s/var metatypeForMountOperation:/var metatypeForGtkMountOperation:/
s/var wrapperForMountOperation:/var wrapperForGtkMountOperation:/
s/GLib.RefSListRef<ObjectRef>/GLib.RefSListRef<GLibObject.ObjectRef>/
s/free(UnsafeMutableRawPointer/systemFree(UnsafeMutableRawPointer/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,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.45.2 Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
Target: x86_64-apple-darwin20.3.0
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

on macOS, or on Linux you should get something like:

$ swift --version
Swift version 5.6.1 (swift-5.6.1-RELEASE)
Swift version 5.8.1 (swift-5.8.1-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 and 2.72, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, and 4.6 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, and 2.74, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, and 4.6 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
13 changes: 13 additions & 0 deletions Sources/Gtk/GtkTypeAliases.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import CGtk

/// Free the memory allocated for the given pointer.
///
/// This function calles the `free()` function provided
/// by the system.
///
/// - Note: The only reason this function exists is to avoid collisions with gtk object`free()` methods.
///
/// - Parameter ptr: The pointer to free.
@usableFromInline
func systemFree(_ ptr: UnsafeMutableRawPointer?) {
free(ptr)
}

// Private structs not exported but needed for public pointers
public typealias GtkArrowAccessiblePrivate = _GtkArrowAccessiblePrivate
public typealias GtkBooleanCellAccessiblePrivate = _GtkBooleanCellAccessiblePrivate
Expand Down

0 comments on commit 91ba88b

Please sign in to comment.