Native Mac APIs for Go. Soon to be renamed DarwinKit!
I think this might now be the best bindings project in existence for Apple APIs. Possibly even the best way to make small utilities on the Mac. And soon even other Apple devices.
This is a preview release for v0.5.0
which is a major rewrite and expansion on these bindings. This release is incompatible with previous releases, however there is an unmaintained legacy branch and all the previous releases for existing code to use. The API in this release is very close to what a 1.0 release would look like, so there shouldn't be significant changes only additions to what's here now, which includes:
However, in this preview release we have a few things left out that with your help we can get into the final v0.5.0
release:
Another way you can help is to let me know what kind of examples you want to see. Drop your requests in Discussions.
This preview release is an official reboot of the project with a new name: DarwinKit. Between now and the final release, the repository will remain macdriver
while everything else updates to DarwinKit, and when we release v0.5.0
we'll rename the repository as well.
A huge thanks to @mkrautz for his work 10 years ago that I found and started this project on in 2020. Unfortunately most of his code is now gone, replaced by the more recent great work by @hsiafan. The previous code generation was by @mgood, which has also been majorly upgraded. Also thanks to @tmc and @programmingkidx for engaging more recently and motivating me to do this rewrite. But also thanks to all the previous contributors that helped get to this point.
Adds additional API coverage.
This release is in preparation for the next release which will be more go-idiomatic in terms of naming, but will break existing APIs with slight method name changes.
cocoa.NSWorkspace
added (@tmc)cocoa.NSRunningApplication
added (@tmc)cocoa.NSUserDefaults
added (@tmc)cocoa.NSTextField
added (@tmc)Full Changelog: https://github.com/progrium/macdriver/compare/v0.3.0...v0.4.0
This release has a few minor additions to bindings and APIs, but is mostly about arm64 support.
cocoa.NSSound
added (@yummyweb)cocoa.NSEvent_LocalMonitorMatchingMask
added (@Bob620)Full Changelog: https://github.com/progrium/macdriver/compare/v0.2.0...v0.3.0
This release introduces generated bindings to greatly expand the methods defined on the current types, as well as adding a number of new types. See: https://github.com/progrium/macdriver/pull/56
core.NSAttributedString
added (@mvrilo)objc.Autorelease
added to wrap functions with an autoreleasepool (@mgood)core.NSNib
got NSNib_InitWithNibNamed_Bundle
, NSNib_InitWithNibData_Bundle
, InstantiateWithOwner_TopLevelObjects
(@firelizzard18)cocoa.NSControl
added (@fserb)cocoa.NSPopover
added (@fserb)core.NSAutoreleasePool
replaced by objc.Autorelease
sendMsg
and selector lookups (@firelizzard18)C.CString
(@mgood)Full Changelog: https://github.com/progrium/macdriver/compare/v0.1.0...v0.2.0
core.NSData
got Length, Bytes (@flexzuu)core.NSArray
got NSArray_WithObjects, Count, ObjectAtIndex, Strings (@flexzuu)cocoa.NSPasteboard
added with SetStringForType, StringForType, DataForType, Types, AvailableTypeFromArray (@flexzuu)cocoa.NSWindow
got SetHasShadow, HasShadow, OrderOut, OrderFront, OrderBackcocoa.NSTextView
got SetTextColor (@tmc)cocoa.NSScreen
got NSScreen_Screens (@tmc)misc/bundle
packagebridge
package and bridgehost
example (moved to new repo)This is a release candidate of sorts for v0.1.0, which will include a full changelog of changes since first release. Most notably, "bridge" and "schema" work have been split out into separate projects.