Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

darwinkit: generate struct reference typedefs #174

Open
progrium opened this issue Aug 8, 2023 · 1 comment
Open

darwinkit: generate struct reference typedefs #174

progrium opened this issue Aug 8, 2023 · 1 comment
Labels
generation Related to generation toolchain help wanted Extra attention is needed
Milestone

Comments

@progrium
Copy link
Owner

progrium commented Aug 8, 2023

Typedefs that the API uses that are not generated include object/struct reference types like these:

https://developer.apple.com/documentation/coregraphics/cgcolorref
https://developer.apple.com/documentation/appkit/nsmodalsession

There aren't many and for now at least the ones referenced in current API coverage are manually added in the <module>_custom.go source file for module/framework packages. These are pretty easy to generate for Go, they're just types based on unsafe.Pointer. But they should live in their own generated source file and be generated based on struct symbols found that are I guess typedef struct aliases to another type with declarations like:

typedef struct CGColor CGColorRef;
typedef struct _NSModalSession NSModalSession;

They usually but don't always have a "Ref" suffix.

@progrium progrium added this to the 0.5.0 milestone Aug 8, 2023
@progrium progrium changed the title darwinkit: generate object reference typedefs darwinkit: generate struct reference typedefs Aug 8, 2023
@progrium progrium added generation Related to generation toolchain help wanted Extra attention is needed labels Aug 19, 2023
@progrium
Copy link
Owner Author

So apparently we're right to alias as pointers, but for a lot of these (prob most ending with Ref), we could alias to a type we have bindings for:
https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/Toll-FreeBridgin/Toll-FreeBridgin.html#//apple_ref/doc/uid/TP40010810-CH2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generation Related to generation toolchain help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant