These replace the objc family of crates, and provide a bunch of improvements on top of it.
Improvements relevant for rfd:
No longer need to call msg_send!, (almost) all methods have automatically generated bindings in objc2-foundation.
MainThreadMarker, allows marking explicitly the functions that must run on the main thread.
Blocks in block2 have correct memory management, you no longer need to call mem::forget.
AppKit bindings are provided in objc2-app-kit, you no longer need to define NSApplication, NSAlertStyle and such manually.
To do this change, I had to change how AsModal works, as it was previously relying on the fact that NSAlert and NSSavePanel just so happened to have mostly compatible methods; now we ensure statically that the correct method is called.
Please do ask if there's anything about either the crates or the code here that's unclear!
These replace the
objc
family of crates, and provide a bunch of improvements on top of it.Improvements relevant for
rfd
:msg_send!
, (almost) all methods have automatically generated bindings inobjc2-foundation
.MainThreadMarker
, allows marking explicitly the functions that must run on the main thread.block2
have correct memory management, you no longer need to callmem::forget
.objc2-app-kit
, you no longer need to defineNSApplication
,NSAlertStyle
and such manually.To do this change, I had to change how
AsModal
works, as it was previously relying on the fact thatNSAlert
andNSSavePanel
just so happened to have mostly compatible methods; now we ensure statically that the correct method is called.Please do ask if there's anything about either the crates or the code here that's unclear!