From 8f086a695761e84e4d25da8aebe68102810ef7fb Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 24 Aug 2023 23:31:21 +0100 Subject: [PATCH] Add NSSet --- vendor/darwin/Foundation/NSEvent.odin | 2 +- vendor/darwin/Foundation/NSSet.odin | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 vendor/darwin/Foundation/NSSet.odin diff --git a/vendor/darwin/Foundation/NSEvent.odin b/vendor/darwin/Foundation/NSEvent.odin index 6e960a4f2..b57057bbe 100644 --- a/vendor/darwin/Foundation/NSEvent.odin +++ b/vendor/darwin/Foundation/NSEvent.odin @@ -9,7 +9,7 @@ EventMask :: distinct bit_set[EventType; UInteger] EventMaskAny :: ~EventMask{} when size_of(UInteger) == 4 { - // We don't support a 32-bit darwin system but this is mostly to shut up -vet for the time being + // We don't support a 32-bit darwin system but this is mostly to shut up the type checker for the time being EventType :: enum UInteger { LeftMouseDown = 1, LeftMouseUp = 2, diff --git a/vendor/darwin/Foundation/NSSet.odin b/vendor/darwin/Foundation/NSSet.odin new file mode 100644 index 000000000..7fb8db6c2 --- /dev/null +++ b/vendor/darwin/Foundation/NSSet.odin @@ -0,0 +1,27 @@ +package objc_Foundation + +@(objc_class="NSSet") +Set :: struct {using _: Copying(Set)} + + +@(objc_type=Set, objc_name="alloc", objc_is_class_method=true) +Set_alloc :: proc "c" () -> ^Set { + return msgSend(^Set, Set, "alloc") +} + +@(objc_type=Set, objc_name="init") +Set_init :: proc "c" (self: ^Set) -> ^Set { + return msgSend(^Set, self, "init") +} + + +@(objc_type=Set, objc_name="initWithObjects") +Set_initWithObjects :: proc "c" (self: ^Set, objects: [^]^Object, count: UInteger) -> ^Set { + return msgSend(^Set, self, "initWithObjects:count:", objects, count) +} + + +@(objc_type=Set, objc_name="initWithCoder") +Set_initWithCoder :: proc "c" (self: ^Set, coder: ^Coder) -> ^Set { + return msgSend(^Set, self, "initWithCoder:", coder) +}