Minor aesthetic clean ups of Foundation

This commit is contained in:
gingerBill
2022-02-15 15:34:07 +00:00
parent 3ab5db8297
commit 803648be89
8 changed files with 7 additions and 21 deletions
-6
View File
@@ -105,7 +105,6 @@ Bundle_sharedFrameworksURL :: proc(self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "sharedFrameworksURL") return msgSend(^URL, self, "sharedFrameworksURL")
} }
@(objc_type=Bundle, objc_name="sharedSupportURL") @(objc_type=Bundle, objc_name="sharedSupportURL")
Bundle_sharedSupportURL :: proc(self: ^Bundle) -> ^URL { Bundle_sharedSupportURL :: proc(self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "sharedSupportURL") return msgSend(^URL, self, "sharedSupportURL")
@@ -121,9 +120,6 @@ Bundle_appStoreReceiptURL :: proc(self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "appStoreReceiptURL") return msgSend(^URL, self, "appStoreReceiptURL")
} }
@(objc_type=Bundle, objc_name="bundlePath") @(objc_type=Bundle, objc_name="bundlePath")
Bundle_bundlePath :: proc(self: ^Bundle) -> ^String { Bundle_bundlePath :: proc(self: ^Bundle) -> ^String {
return msgSend(^String, self, "bundlePath") return msgSend(^String, self, "bundlePath")
@@ -154,7 +150,6 @@ Bundle_sharedFrameworksPath :: proc(self: ^Bundle) -> ^String {
return msgSend(^String, self, "sharedFrameworksPath") return msgSend(^String, self, "sharedFrameworksPath")
} }
@(objc_type=Bundle, objc_name="sharedSupportPath") @(objc_type=Bundle, objc_name="sharedSupportPath")
Bundle_sharedSupportPath :: proc(self: ^Bundle) -> ^String { Bundle_sharedSupportPath :: proc(self: ^Bundle) -> ^String {
return msgSend(^String, self, "sharedSupportPath") return msgSend(^String, self, "sharedSupportPath")
@@ -175,7 +170,6 @@ Bundle_bundleIdentifier :: proc(self: ^Bundle) -> ^String {
return msgSend(^String, self, "bundleIdentifier") return msgSend(^String, self, "bundleIdentifier")
} }
@(objc_type=Bundle, objc_name="infoDictionary") @(objc_type=Bundle, objc_name="infoDictionary")
Bundle_infoDictionary :: proc(self: ^Bundle) -> ^Dictionary { Bundle_infoDictionary :: proc(self: ^Bundle) -> ^Dictionary {
return msgSend(^Dictionary, self, "infoDictionary") return msgSend(^Dictionary, self, "infoDictionary")
-1
View File
@@ -13,7 +13,6 @@ Date_init :: proc(self: ^Date) -> ^Date {
return msgSend(^Date, self, "init") return msgSend(^Date, self, "init")
} }
@(objc_type=Date, objc_name="dateWithTimeIntervalSinceNow") @(objc_type=Date, objc_name="dateWithTimeIntervalSinceNow")
Date_dateWithTimeIntervalSinceNow :: proc(secs: TimeInterval) -> ^Date { Date_dateWithTimeIntervalSinceNow :: proc(secs: TimeInterval) -> ^Date {
return msgSend(^Date, Date, "dateWithTimeIntervalSinceNow:", secs) return msgSend(^Date, Date, "dateWithTimeIntervalSinceNow:", secs)
@@ -29,7 +29,6 @@ Dictionary_init :: proc(self: ^Dictionary) -> ^Dictionary {
return msgSend(^Dictionary, self, "init") return msgSend(^Dictionary, self, "init")
} }
@(objc_type=Dictionary, objc_name="initWithObjects") @(objc_type=Dictionary, objc_name="initWithObjects")
Dictionary_initWithObjects :: proc(self: ^Dictionary, objects: [^]^Object, forKeys: [^]^Object, count: UInteger) -> ^Dictionary { Dictionary_initWithObjects :: proc(self: ^Dictionary, objects: [^]^Object, forKeys: [^]^Object, count: UInteger) -> ^Dictionary {
return msgSend(^Dictionary, self, "initWithObjects:forKeys:count", objects, forKeys, count) return msgSend(^Dictionary, self, "initWithObjects:forKeys:count", objects, forKeys, count)
@@ -14,7 +14,6 @@ Notification_init :: proc(self: ^Notification) -> ^Notification {
return msgSend(^Notification, self, "init") return msgSend(^Notification, self, "init")
} }
@(objc_type=Notification, objc_name="name") @(objc_type=Notification, objc_name="name")
Notification_name :: proc(self: ^Notification) -> ^String { Notification_name :: proc(self: ^Notification) -> ^String {
return msgSend(^String, self, "name") return msgSend(^String, self, "name")
-1
View File
@@ -63,7 +63,6 @@ Value_pointerValue :: proc(self: ^Value) -> rawptr {
@(objc_class="NSNumber") @(objc_class="NSNumber")
Number :: struct{using _: Copying(Number), using _: Value} Number :: struct{using _: Copying(Number), using _: Value}
@(objc_type=Number, objc_name="alloc", objc_is_class_method=true) @(objc_type=Number, objc_name="alloc", objc_is_class_method=true)
Number_alloc :: proc() -> ^Number { Number_alloc :: proc() -> ^Number {
return msgSend(^Number, Number, "alloc") return msgSend(^Number, Number, "alloc")
+3 -3
View File
@@ -49,12 +49,12 @@ StringCompareOption :: enum UInteger {
unichar :: distinct u16 unichar :: distinct u16
foreign Foundation {
__CFStringMakeConstantString :: proc "c" (c: cstring) -> ^String ---
}
AT :: MakeConstantString AT :: MakeConstantString
MakeConstantString :: proc "c" (#const c: cstring) -> ^String { MakeConstantString :: proc "c" (#const c: cstring) -> ^String {
foreign Foundation {
__CFStringMakeConstantString :: proc "c" (c: cstring) -> ^String ---
}
return __CFStringMakeConstantString(c) return __CFStringMakeConstantString(c)
} }
+4 -1
View File
@@ -14,14 +14,17 @@ URL_init :: proc(self: ^URL) -> ^URL {
return msgSend(^URL, self, "init") return msgSend(^URL, self, "init")
} }
@(objc_type=URL, objc_name="initWithString")
URL_initWithString :: proc(self: ^URL, value: ^String) -> ^URL { URL_initWithString :: proc(self: ^URL, value: ^String) -> ^URL {
return msgSend(^URL, self, "initWithString:", value) return msgSend(^URL, self, "initWithString:", value)
} }
@(objc_type=URL, objc_name="initFileURLWithPath")
URL_initFileURLWithPath :: proc(self: ^URL, path: ^String) -> ^URL { URL_initFileURLWithPath :: proc(self: ^URL, path: ^String) -> ^URL {
return msgSend(^URL, self, "initFileURLWithPath:", path) return msgSend(^URL, self, "initFileURLWithPath:", path)
} }
@(objc_type=URL, objc_name="fileSystemRepresentation")
URL_fileSystemRepresentation :: proc(self: ^URL) -> ^String { URL_fileSystemRepresentation :: proc(self: ^URL) -> ^String {
return msgSend(^String, self, "fileSystemRepresentation") return msgSend(^String, self, "fileSystemRepresentation")
} }
-7
View File
@@ -23,7 +23,6 @@ View :: struct {using _: Responder}
View_layer :: proc(self: ^View) -> ^Layer { View_layer :: proc(self: ^View) -> ^Layer {
return msgSend(^Layer, self, "layer") return msgSend(^Layer, self, "layer")
} }
@(objc_type=View, objc_name="setLayer") @(objc_type=View, objc_name="setLayer")
View_setLayer :: proc(self: ^View, layer: ^Layer) { View_setLayer :: proc(self: ^View, layer: ^Layer) {
msgSend(nil, self, "setLayer:", layer) msgSend(nil, self, "setLayer:", layer)
@@ -32,13 +31,10 @@ View_setLayer :: proc(self: ^View, layer: ^Layer) {
View_setSubLayer :: proc(self: ^View, layer: ^Layer) { View_setSubLayer :: proc(self: ^View, layer: ^Layer) {
msgSend(nil, self, "setSubLayer:", layer) msgSend(nil, self, "setSubLayer:", layer)
} }
@(objc_type=View, objc_name="wantsLayer") @(objc_type=View, objc_name="wantsLayer")
View_wantsLayer :: proc(self: ^View) -> BOOL { View_wantsLayer :: proc(self: ^View) -> BOOL {
return msgSend(BOOL, self, "wantsLayer") return msgSend(BOOL, self, "wantsLayer")
} }
@(objc_type=View, objc_name="setWantsLayer") @(objc_type=View, objc_name="setWantsLayer")
View_setWantsLayer :: proc(self: ^View, wantsLayer: BOOL) { View_setWantsLayer :: proc(self: ^View, wantsLayer: BOOL) {
msgSend(nil, self, "setWantsLayer:", wantsLayer) msgSend(nil, self, "setWantsLayer:", wantsLayer)
@@ -52,7 +48,6 @@ Window :: struct {using _: Responder}
Window_contentView :: proc(self: ^Window) -> ^View { Window_contentView :: proc(self: ^Window) -> ^View {
return msgSend(^View, self, "contentView") return msgSend(^View, self, "contentView")
} }
@(objc_type=Window, objc_name="frame") @(objc_type=Window, objc_name="frame")
Window_frame :: proc(self: ^Window) -> Rect { Window_frame :: proc(self: ^Window) -> Rect {
return msgSend(Rect, self, "frame") return msgSend(Rect, self, "frame")
@@ -61,7 +56,6 @@ Window_frame :: proc(self: ^Window) -> Rect {
Window_setFrame :: proc(self: ^Window, frame: Rect) { Window_setFrame :: proc(self: ^Window, frame: Rect) {
msgSend(nil, self, "setFrame:", frame) msgSend(nil, self, "setFrame:", frame)
} }
@(objc_type=Window, objc_name="opaque") @(objc_type=Window, objc_name="opaque")
Window_opaque :: proc(self: ^Window) -> NS.BOOL { Window_opaque :: proc(self: ^Window) -> NS.BOOL {
return msgSend(NS.BOOL, self, "opaque") return msgSend(NS.BOOL, self, "opaque")
@@ -70,7 +64,6 @@ Window_opaque :: proc(self: ^Window) -> NS.BOOL {
Window_setOpaque :: proc(self: ^Window, ok: NS.BOOL) { Window_setOpaque :: proc(self: ^Window, ok: NS.BOOL) {
msgSend(nil, self, "setOpaque:", ok) msgSend(nil, self, "setOpaque:", ok)
} }
@(objc_type=Window, objc_name="backgroundColor") @(objc_type=Window, objc_name="backgroundColor")
Window_backgroundColor :: proc(self: ^Window) -> ^NS.Color { Window_backgroundColor :: proc(self: ^Window) -> ^NS.Color {
return msgSend(^NS.Color, self, "backgroundColor") return msgSend(^NS.Color, self, "backgroundColor")