cacao icon indicating copy to clipboard operation
cacao copied to clipboard

Definition of NSWorkspace, NSNotificationCenter, and NSRunningApplication

Open agg23 opened this issue 11 months ago • 3 comments

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 build retain definitions and allows for the retain_nullable connivence method, which will be needed more and more as more nullable instance properties are implemented
  • Expands NSMutableDictionary methods to be more complete. Adds Iterator support - Note that the untyped nature of Objective-C collections makes dictionaries particularly difficult. Several methods assume NSString keys
  • Adds strum macros for generating NSString constants from enums, like what is used for NotificationName - I don't imagine there will be many other locations outside of NSNotification where this macro is used, but I think it's hugely helpful in this case.
  • Definitions for NSWorkspace, NSNotificationCenter, NSRunningApplication, and NSNotification - 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.

agg23 avatar Jul 21 '23 20:07 agg23