progrium / darwinkit

Native Mac APIs for Go. Previously known as MacDriver
MIT License
4.42k stars 147 forks source link

Methods with pointer to pointer arguments using old signature #255

Closed programmingkidx closed 1 month ago

programmingkidx commented 2 months ago

A commit was made to better support pointer to pointer arguments. This is commit https://github.com/progrium/macdriver/commit/6a98f82290e53bc5d82cb59436644f705156d7cb. Running 'go generate ./macos/appkit' would update all the methods in a selected folder to use the new function signature.

Example: // Before running 'go generate ./macos/appkit' func (n_ Nib) InstantiateWithOwnerTopLevelObjects(owner objc.IObject, topLevelObjects []objc.IObject) bool {

// After running 'go generate ./macos/appkit' func (n_ Nib) InstantiateWithOwnerTopLevelObjects(owner objc.IObject, topLevelObjects unsafe.Pointer) bool {

The '[]objc.IObject' type is replaced with an 'unsafe.Pointer' type.

I ask that the Macdriver repo have all its supported frameworks updated by running 'go generate ./macos/framework-name-here'

Thank you.

progrium commented 1 month ago

I guess we need a special case for arrays since they too are often pointers to pointers.

progrium commented 1 month ago

Or is this fine? I will run generate soon either way.

progrium commented 1 month ago

This touched a lot, but it's in. All examples are working. Let me know if it's what you expected so I can make any fixes before finally releasing 0.5.0 ... thanks for all your help @programmingkidx