cacao
cacao copied to clipboard
Definition of NSWorkspace, NSNotificationCenter, and NSRunningApplication
Got a little carried away going down the rabbit hole of getting some notifications and NSWorkspace
methods working. I believe this PR should cover the majority of usecases, though there are some uncommon methods that I did not implement (I left comments marking what is missing).
- Introduces
Retainable
trait - Allows for a common way to buildretain
definitions and allows for theretain_nullable
connivence method, which will be needed more and more as more nullable instance properties are implemented - Expands
NSMutableDictionary
methods to be more complete. AddsIterator
support - Note that the untyped nature of Objective-C collections makes dictionaries particularly difficult. Several methods assumeNSString
keys - Adds
strum
macros for generatingNSString
constants from enums, like what is used forNotificationName
- I don't imagine there will be many other locations outside ofNSNotification
where this macro is used, but I think it's hugely helpful in this case. - Definitions for
NSWorkspace
,NSNotificationCenter
,NSRunningApplication
, andNSNotification
- These are all interconnected and rely on each other, hence the expanding scope of this PR. Addresses #24
I know there's a lot of stuff here, so take your time. I'm sure there's many things to complain about.
So I'm musing about juggling pull requests here - I definitely do want these in cacao, however I think the objc2
PR might muck this PR up. Given that we're starting to look into fixing more internal core stuff, I'd like to do the objc2
stuff first just so we're not backtracking later on - so apologies in advance if I put this into an un-merge-able state.
(Also: icrate
has NS[Mutable]Dictionary
iterators that doesn't require all the keys to be strings, so if you use that, you get iterators for free).
That's perfectly fine. I think most of this becomes unnecessary with objc2
anyway.