Update to Metal 3

This commit is contained in:
gingerBill
2023-04-26 15:28:30 +01:00
parent f2ec438166
commit 827f36e2c0
7 changed files with 1023 additions and 8 deletions
+30
View File
@@ -27,4 +27,34 @@ Notification_object :: proc(self: ^Notification) -> ^Object {
@(objc_type=Notification, objc_name="userInfo")
Notification_userInfo :: proc(self: ^Notification) -> ^Dictionary {
return msgSend(^Dictionary, self, "userInfo")
}
NotificationName :: ^String
@(objc_class="NSNotificationCenter")
NotificationCenter :: struct{using _: Object}
@(objc_type=NotificationCenter, objc_name="alloc", objc_is_class_method=true)
NotificationCenter_alloc :: proc() -> ^NotificationCenter {
return msgSend(^NotificationCenter, NotificationCenter, "alloc")
}
@(objc_type=NotificationCenter, objc_name="init")
NotificationCenter_init :: proc(self: ^NotificationCenter) -> ^NotificationCenter {
return msgSend(^NotificationCenter, self, "init")
}
@(objc_type=NotificationCenter, objc_name="defaultCenter", objc_is_class_method=true)
NotificationCenter_defaultCenter :: proc() -> ^NotificationCenter {
return msgSend(^NotificationCenter, NotificationCenter, "defaultCenter")
}
@(objc_type=NotificationCenter, objc_name="addObserver")
NotificationCenter_addObserverName :: proc(self: ^NotificationCenter, name: NotificationName, pObj: ^Object, pQueue: rawptr, block: ^Block) -> ^Object {
return msgSend(^Object, self, "addObserverName:object:queue:block:", name, pObj, pQueue, block)
}
@(objc_type=NotificationCenter, objc_name="removeObserver")
NotificationCenter_removeObserver :: proc(self: ^NotificationCenter, pObserver: ^Object) {
msgSend(nil, self, "removeObserver:", pObserver)
}