2
0

NSNotification.odin 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package objc_Foundation
  2. @(objc_class="NSNotification")
  3. Notification :: struct{using _: Object}
  4. @(objc_type=Notification, objc_name="alloc", objc_is_class_method=true)
  5. Notification_alloc :: proc "c" () -> ^Notification {
  6. return msgSend(^Notification, Notification, "alloc")
  7. }
  8. @(objc_type=Notification, objc_name="init")
  9. Notification_init :: proc "c" (self: ^Notification) -> ^Notification {
  10. return msgSend(^Notification, self, "init")
  11. }
  12. @(objc_type=Notification, objc_name="name")
  13. Notification_name :: proc "c" (self: ^Notification) -> ^String {
  14. return msgSend(^String, self, "name")
  15. }
  16. @(objc_type=Notification, objc_name="object")
  17. Notification_object :: proc "c" (self: ^Notification) -> ^Object {
  18. return msgSend(^Object, self, "object")
  19. }
  20. @(objc_type=Notification, objc_name="userInfo")
  21. Notification_userInfo :: proc "c" (self: ^Notification) -> ^Dictionary {
  22. return msgSend(^Dictionary, self, "userInfo")
  23. }
  24. NotificationName :: ^String
  25. @(objc_class="NSNotificationCenter")
  26. NotificationCenter :: struct{using _: Object}
  27. @(objc_type=NotificationCenter, objc_name="alloc", objc_is_class_method=true)
  28. NotificationCenter_alloc :: proc "c" () -> ^NotificationCenter {
  29. return msgSend(^NotificationCenter, NotificationCenter, "alloc")
  30. }
  31. @(objc_type=NotificationCenter, objc_name="init")
  32. NotificationCenter_init :: proc "c" (self: ^NotificationCenter) -> ^NotificationCenter {
  33. return msgSend(^NotificationCenter, self, "init")
  34. }
  35. @(objc_type=NotificationCenter, objc_name="defaultCenter", objc_is_class_method=true)
  36. NotificationCenter_defaultCenter :: proc "c" () -> ^NotificationCenter {
  37. return msgSend(^NotificationCenter, NotificationCenter, "defaultCenter")
  38. }
  39. @(objc_type=NotificationCenter, objc_name="addObserver")
  40. NotificationCenter_addObserverName :: proc "c" (self: ^NotificationCenter, name: NotificationName, pObj: ^Object, pQueue: rawptr, block: ^Block) -> ^Object {
  41. return msgSend(^Object, self, "addObserverName:object:queue:block:", name, pObj, pQueue, block)
  42. }
  43. @(objc_type=NotificationCenter, objc_name="removeObserver")
  44. NotificationCenter_removeObserver :: proc "c" (self: ^NotificationCenter, pObserver: ^Object) {
  45. msgSend(nil, self, "removeObserver:", pObserver)
  46. }