Macdriver Versions Save

Native Mac APIs for Go. Soon to be renamed DarwinKit!

v0.5.0-preview

8 months ago

MacDriver is becoming 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:

  • Over 30 frameworks with nearly complete bindings and more are on the way
  • Over 2,000 classes with near complete coverage. Previously we had partial coverage of about 80.
  • 22,000 methods/properties and nearly 10,000 constants/enums. We had less than 50 constants before.
  • Automatic conversion and use of native Go builtin types in APIs like strings, bools, []byte, maps, etc.
  • Support for block arguments as Go functions with properly typed arguments (callbacks!)
  • Pre-made delegate implementations you can simply set Go functions on
  • More 1-to-1 mapping to Objective-C symbol names while also improving Go idiomaticness
  • Documentation for all symbols including a link to official Apple docs on that symbol
  • Simple model for working with Objective-C memory management
  • As the new name implies, we are set up to support more platforms like iOS, tvOS, watchOS, maybe visionOS
  • Continued support for both Intel and Apple Silicon
  • No more compile warnings, nearly all previous GitHub issues are resolved
  • More examples, better docs, and bindings are nearly all generated

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.

v0.4.0

9 months ago

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.

API Additions

  • cocoa.NSWorkspace added (@tmc)
  • cocoa.NSRunningApplication added (@tmc)
  • cocoa.NSUserDefaults added (@tmc)
  • cocoa.NSTextField added (@tmc)

Docs & Examples

Full Changelog: https://github.com/progrium/macdriver/compare/v0.3.0...v0.4.0

v0.3.0

10 months ago

This release has a few minor additions to bindings and APIs, but is mostly about arm64 support.

Platform Additions

API Additions

  • cocoa.NSSound added (@yummyweb)
  • cocoa.NSEvent_LocalMonitorMatchingMask added (@Bob620)

Docs & Examples

  • fix early exit on Monterey in pomodoro example (@mgood)
  • added subclass example (@progrium)

Bug Fixes

New Contributors

Full Changelog: https://github.com/progrium/macdriver/compare/v0.2.0...v0.3.0

v0.2.0

2 years ago

API Additions

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)

API Removals

  • core.NSAutoreleasePool replaced by objc.Autorelease
  • remove code for 386 architecture (@firelizzard18)

Docs & Examples

  • comments on discovering enum values moved to wiki (@flexzuu)
  • fix a few typos and rewording (@bradfitz)
  • fix top frame example (@revilon1991)
  • OpenGL example (@firelizzard18)

Optimizations

  • optimize sendMsg and selector lookups (@firelizzard18)
  • fix memory leaks with C.CString (@mgood)

New Contributors

Full Changelog: https://github.com/progrium/macdriver/compare/v0.1.0...v0.2.0

v0.1.0

3 years ago

API Additions

  • 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, OrderBack
  • cocoa.NSTextView got SetTextColor (@tmc)
  • cocoa.NSScreen got NSScreen_Screens (@tmc)

API Removals

  • Removed exported class reference variables (NSApplication_, NSMenu_, NSWindow_, etc)

Package Removals

  • Removed misc/bundle package
  • Removed bridge package and bridgehost example (moved to new repo)

v0.0.3

3 years ago

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.

v0.0.2

3 years ago