Use proc "c" calling convention in NS Foundation package

This commit is contained in:
gingerBill
2023-05-22 14:59:24 +01:00
parent 730192adc4
commit 8f563df7c5
22 changed files with 348 additions and 348 deletions

View File

@@ -58,38 +58,38 @@ ApplicationPresentationOptionsDisableCursorLocationAssistance :: ApplicationPres
Application :: struct {using _: Object}
@(objc_type=Application, objc_name="sharedApplication", objc_is_class_method=true)
Application_sharedApplication :: proc() -> ^Application {
Application_sharedApplication :: proc "c" () -> ^Application {
return msgSend(^Application, Application, "sharedApplication")
}
@(objc_type=Application, objc_name="setActivationPolicy")
Application_setActivationPolicy :: proc(self: ^Application, activationPolicy: ActivationPolicy) -> BOOL {
Application_setActivationPolicy :: proc "c" (self: ^Application, activationPolicy: ActivationPolicy) -> BOOL {
return msgSend(BOOL, self, "setActivationPolicy:", activationPolicy)
}
@(objc_type=Application, objc_name="activateIgnoringOtherApps")
Application_activateIgnoringOtherApps :: proc(self: ^Application, ignoreOtherApps: BOOL) {
Application_activateIgnoringOtherApps :: proc "c" (self: ^Application, ignoreOtherApps: BOOL) {
msgSend(nil, self, "activateIgnoringOtherApps:", ignoreOtherApps)
}
@(objc_type=Application, objc_name="setMainMenu")
Application_setMainMenu :: proc(self: ^Application, menu: ^Menu) {
Application_setMainMenu :: proc "c" (self: ^Application, menu: ^Menu) {
msgSend(nil, self, "setMainMenu:", menu)
}
@(objc_type=Application, objc_name="windows")
Application_windows :: proc(self: ^Application) -> ^Array {
Application_windows :: proc "c" (self: ^Application) -> ^Array {
return msgSend(^Array, self, "windows")
}
@(objc_type=Application, objc_name="run")
Application_run :: proc(self: ^Application) {
Application_run :: proc "c" (self: ^Application) {
msgSend(nil, self, "run")
}
@(objc_type=Application, objc_name="terminate")
Application_terminate :: proc(self: ^Application, sender: ^Object) {
Application_terminate :: proc "c" (self: ^Application, sender: ^Object) {
msgSend(nil, self, "terminate:", sender)
}
@@ -99,81 +99,81 @@ Application_terminate :: proc(self: ^Application, sender: ^Object) {
RunningApplication :: struct {using _: Object}
@(objc_type=RunningApplication, objc_name="currentApplication", objc_is_class_method=true)
RunningApplication_currentApplication :: proc() -> ^RunningApplication {
RunningApplication_currentApplication :: proc "c" () -> ^RunningApplication {
return msgSend(^RunningApplication, RunningApplication, "currentApplication")
}
@(objc_type=RunningApplication, objc_name="localizedName")
RunningApplication_localizedName :: proc(self: ^RunningApplication) -> ^String {
RunningApplication_localizedName :: proc "c" (self: ^RunningApplication) -> ^String {
return msgSend(^String, self, "localizedName")
}
ApplicationDelegateTemplate :: struct {
// Launching Applications
applicationWillFinishLaunching: proc(notification: ^Notification),
applicationDidFinishLaunching: proc(notification: ^Notification),
applicationWillFinishLaunching: proc(notification: ^Notification),
applicationDidFinishLaunching: proc(notification: ^Notification),
// Managing Active Status
applicationWillBecomeActive: proc(notification: ^Notification),
applicationDidBecomeActive: proc(notification: ^Notification),
applicationWillResignActive: proc(notification: ^Notification),
applicationDidResignActive: proc(notification: ^Notification),
applicationWillBecomeActive: proc(notification: ^Notification),
applicationDidBecomeActive: proc(notification: ^Notification),
applicationWillResignActive: proc(notification: ^Notification),
applicationDidResignActive: proc(notification: ^Notification),
// Terminating Applications
applicationShouldTerminate: proc(sender: ^Application) -> ApplicationTerminateReply,
applicationShouldTerminateAfterLastWindowClosed: proc(sender: ^Application) -> BOOL,
applicationWillTerminate: proc(notification: ^Notification),
applicationShouldTerminate: proc(sender: ^Application) -> ApplicationTerminateReply,
applicationShouldTerminateAfterLastWindowClosed: proc(sender: ^Application) -> BOOL,
applicationWillTerminate: proc(notification: ^Notification),
// Hiding Applications
applicationWillHide: proc(notification: ^Notification),
applicationDidHide: proc(notification: ^Notification),
applicationWillUnhide: proc(notification: ^Notification),
applicationDidUnhide: proc(notification: ^Notification),
applicationWillHide: proc(notification: ^Notification),
applicationDidHide: proc(notification: ^Notification),
applicationWillUnhide: proc(notification: ^Notification),
applicationDidUnhide: proc(notification: ^Notification),
// Managing Windows
applicationWillUpdate: proc(notification: ^Notification),
applicationDidUpdate: proc(notification: ^Notification),
applicationShouldHandleReopenHasVisibleWindows: proc(sender: ^Application, flag: BOOL) -> BOOL,
applicationWillUpdate: proc(notification: ^Notification),
applicationDidUpdate: proc(notification: ^Notification),
applicationShouldHandleReopenHasVisibleWindows: proc(sender: ^Application, flag: BOOL) -> BOOL,
// Managing the Dock Menu
applicationDockMenu: proc(sender: ^Application) -> ^Menu,
applicationDockMenu: proc(sender: ^Application) -> ^Menu,
// Localizing Keyboard Shortcuts
applicationShouldAutomaticallyLocalizeKeyEquivalents: proc(application: ^Application) -> BOOL,
applicationShouldAutomaticallyLocalizeKeyEquivalents: proc(application: ^Application) -> BOOL,
// Displaying Errors
applicationWillPresentError: proc(application: ^Application, error: ^Error) -> ^Error,
applicationWillPresentError: proc(application: ^Application, error: ^Error) -> ^Error,
// Managing the Screen
applicationDidChangeScreenParameters: proc(notification: ^Notification),
applicationDidChangeScreenParameters: proc(notification: ^Notification),
// Continuing User Activities
applicationWillContinueUserActivityWithType: proc(application: ^Application, userActivityType: ^String) -> BOOL,
applicationContinueUserActivityRestorationHandler: proc(application: ^Application, userActivity: ^UserActivity, restorationHandler: ^Block) -> BOOL,
applicationDidFailToContinueUserActivityWithTypeError: proc(application: ^Application, userActivityType: ^String, error: ^Error),
applicationDidUpdateUserActivity: proc(application: ^Application, userActivity: ^UserActivity),
applicationWillContinueUserActivityWithType: proc(application: ^Application, userActivityType: ^String) -> BOOL,
applicationContinueUserActivityRestorationHandler: proc(application: ^Application, userActivity: ^UserActivity, restorationHandler: ^Block) -> BOOL,
applicationDidFailToContinueUserActivityWithTypeError: proc(application: ^Application, userActivityType: ^String, error: ^Error),
applicationDidUpdateUserActivity: proc(application: ^Application, userActivity: ^UserActivity),
// Handling Push Notifications
applicationDidRegisterForRemoteNotificationsWithDeviceToken: proc(application: ^Application, deviceToken: ^Data),
applicationDidFailToRegisterForRemoteNotificationsWithError: proc(application: ^Application, error: ^Error),
applicationDidReceiveRemoteNotification: proc(application: ^Application, userInfo: ^Dictionary),
applicationDidReceiveRemoteNotification: proc(application: ^Application, userInfo: ^Dictionary),
// Handling CloudKit Invitations
// TODO: if/when we have cloud kit bindings implement
// applicationUserDidAcceptCloudKitShareWithMetadata: proc(application: ^Application, metadata: ^CKShareMetadata),
// applicationUserDidAcceptCloudKitShareWithMetadata: proc(application: ^Application, metadata: ^CKShareMetadata),
// Handling SiriKit Intents
// TODO: if/when we have siri kit bindings implement
// applicationHandlerForIntent: proc(application: ^Application, intent: ^INIntent) -> id,
// applicationHandlerForIntent: proc(application: ^Application, intent: ^INIntent) -> id,
// Opening Files
applicationOpenURLs: proc(application: ^Application, urls: ^Array),
applicationOpenFile: proc(sender: ^Application, filename: ^String) -> BOOL,
applicationOpenFileWithoutUI: proc(sender: id, filename: ^String) -> BOOL,
applicationOpenTempFile: proc(sender: ^Application, filename: ^String) -> BOOL,
applicationOpenFiles: proc(sender: ^Application, filenames: ^Array),
applicationShouldOpenUntitledFile: proc(sender: ^Application) -> BOOL,
applicationOpenUntitledFile: proc(sender: ^Application) -> BOOL,
applicationOpenURLs: proc(application: ^Application, urls: ^Array),
applicationOpenFile: proc(sender: ^Application, filename: ^String) -> BOOL,
applicationOpenFileWithoutUI: proc(sender: id, filename: ^String) -> BOOL,
applicationOpenTempFile: proc(sender: ^Application, filename: ^String) -> BOOL,
applicationOpenFiles: proc(sender: ^Application, filenames: ^Array),
applicationShouldOpenUntitledFile: proc(sender: ^Application) -> BOOL,
applicationOpenUntitledFile: proc(sender: ^Application) -> BOOL,
// Printing
applicationPrintFile: proc(sender: ^Application, filename: ^String) -> BOOL,
applicationPrintFilesWithSettingsShowPrintPanels: proc(application: ^Application, fileNames: ^Array, printSettings: ^Dictionary, showPrintPanels: BOOL) -> ApplicationPrintReply,
applicationPrintFile: proc(sender: ^Application, filename: ^String) -> BOOL,
applicationPrintFilesWithSettingsShowPrintPanels: proc(application: ^Application, fileNames: ^Array, printSettings: ^Dictionary, showPrintPanels: BOOL) -> ApplicationPrintReply,
// Restoring Application State
applicationSupportsSecureRestorableState: proc(app: ^Application) -> BOOL,
applicationProtectedDataDidBecomeAvailable: proc(notification: ^Notification),
applicationProtectedDataWillBecomeUnavailable: proc(notification: ^Notification),
applicationWillEncodeRestorableState: proc(app: ^Application, coder: ^Coder),
applicationDidDecodeRestorableState: proc(app: ^Application, coder: ^Coder),
applicationSupportsSecureRestorableState: proc(app: ^Application) -> BOOL,
applicationProtectedDataDidBecomeAvailable: proc(notification: ^Notification),
applicationProtectedDataWillBecomeUnavailable: proc(notification: ^Notification),
applicationWillEncodeRestorableState: proc(app: ^Application, coder: ^Coder),
applicationDidDecodeRestorableState: proc(app: ^Application, coder: ^Coder),
// Handling Changes to the Occlusion State
applicationDidChangeOcclusionState: proc(notification: ^Notification),
applicationDidChangeOcclusionState: proc(notification: ^Notification),
// Scripting Your App
applicationDelegateHandlesKey: proc(sender: ^Application, key: ^String) -> BOOL,
applicationDelegateHandlesKey: proc(sender: ^Application, key: ^String) -> BOOL,
}
ApplicationDelegate :: struct { using _: Object }
@@ -559,6 +559,6 @@ application_delegate_register_and_alloc :: proc(template: ApplicationDelegateTem
}
@(objc_type=Application, objc_name="setDelegate")
Application_setDelegate :: proc(self: ^Application, delegate: ^ApplicationDelegate) {
Application_setDelegate :: proc "c" (self: ^Application, delegate: ^ApplicationDelegate) {
msgSend(nil, self, "setDelegate:", delegate)
}

View File

@@ -8,35 +8,35 @@ Array :: struct {
}
@(objc_type=Array, objc_name="alloc", objc_is_class_method=true)
Array_alloc :: proc() -> ^Array {
Array_alloc :: proc "c" () -> ^Array {
return msgSend(^Array, Array, "alloc")
}
@(objc_type=Array, objc_name="init")
Array_init :: proc(self: ^Array) -> ^Array {
Array_init :: proc "c" (self: ^Array) -> ^Array {
return msgSend(^Array, self, "init")
}
@(objc_type=Array, objc_name="initWithObjects")
Array_initWithObjects :: proc(self: ^Array, objects: [^]^Object, count: UInteger) -> ^Array {
Array_initWithObjects :: proc "c" (self: ^Array, objects: [^]^Object, count: UInteger) -> ^Array {
return msgSend(^Array, self, "initWithObjects:count:", objects, count)
}
@(objc_type=Array, objc_name="initWithCoder")
Array_initWithCoder :: proc(self: ^Array, coder: ^Coder) -> ^Array {
Array_initWithCoder :: proc "c" (self: ^Array, coder: ^Coder) -> ^Array {
return msgSend(^Array, self, "initWithCoder:", coder)
}
@(objc_type=Array, objc_name="object")
Array_object :: proc(self: ^Array, index: UInteger) -> ^Object {
Array_object :: proc "c" (self: ^Array, index: UInteger) -> ^Object {
return msgSend(^Object, self, "objectAtIndex:", index)
}
@(objc_type=Array, objc_name="objectAs")
Array_objectAs :: proc(self: ^Array, index: UInteger, $T: typeid) -> T where intrinsics.type_is_pointer(T), intrinsics.type_is_subtype_of(T, ^Object) {
Array_objectAs :: proc "c" (self: ^Array, index: UInteger, $T: typeid) -> T where intrinsics.type_is_pointer(T), intrinsics.type_is_subtype_of(T, ^Object) {
return (T)(Array_object(self, index))
}
@(objc_type=Array, objc_name="count")
Array_count :: proc(self: ^Array) -> UInteger {
Array_count :: proc "c" (self: ^Array) -> UInteger {
return msgSend(UInteger, self, "count")
}

View File

@@ -4,30 +4,30 @@ package objc_Foundation
AutoreleasePool :: struct {using _: Object}
@(objc_type=AutoreleasePool, objc_name="alloc", objc_is_class_method=true)
AutoreleasePool_alloc :: proc() -> ^AutoreleasePool {
AutoreleasePool_alloc :: proc "c" () -> ^AutoreleasePool {
return msgSend(^AutoreleasePool, AutoreleasePool, "alloc")
}
@(objc_type=AutoreleasePool, objc_name="init")
AutoreleasePool_init :: proc(self: ^AutoreleasePool) -> ^AutoreleasePool {
AutoreleasePool_init :: proc "c" (self: ^AutoreleasePool) -> ^AutoreleasePool {
return msgSend(^AutoreleasePool, self, "init")
}
@(objc_type=AutoreleasePool, objc_name="drain")
AutoreleasePool_drain :: proc(self: ^AutoreleasePool) {
AutoreleasePool_drain :: proc "c" (self: ^AutoreleasePool) {
msgSend(nil, self, "drain")
}
@(objc_type=AutoreleasePool, objc_name="addObject")
AutoreleasePool_addObject :: proc(self: ^AutoreleasePool, obj: ^Object) {
AutoreleasePool_addObject :: proc "c" (self: ^AutoreleasePool, obj: ^Object) {
msgSend(nil, self, "addObject:", obj)
}
@(objc_type=AutoreleasePool, objc_name="showPools")
AutoreleasePool_showPools :: proc(self: ^AutoreleasePool, obj: ^Object) {
AutoreleasePool_showPools :: proc "c" (self: ^AutoreleasePool, obj: ^Object) {
msgSend(nil, self, "showPools")
}
@(deferred_out=AutoreleasePool_drain)
scoped_autoreleasepool :: proc() -> ^AutoreleasePool {
scoped_autoreleasepool :: proc "c" () -> ^AutoreleasePool {
return AutoreleasePool.alloc()->init()
}

View File

@@ -4,188 +4,188 @@ package objc_Foundation
Bundle :: struct { using _: Object }
@(objc_type=Bundle, objc_name="mainBundle", objc_is_class_method=true)
Bundle_mainBundle :: proc() -> ^Bundle {
Bundle_mainBundle :: proc "c" () -> ^Bundle {
return msgSend(^Bundle, Bundle, "mainBundle")
}
@(objc_type=Bundle, objc_name="bundleWithPath", objc_is_class_method=true)
Bundle_bundleWithPath :: proc(path: ^String) -> ^Bundle {
Bundle_bundleWithPath :: proc "c" (path: ^String) -> ^Bundle {
return msgSend(^Bundle, Bundle, "bundleWithPath:", path)
}
@(objc_type=Bundle, objc_name="bundleWithURL", objc_is_class_method=true)
Bundle_bundleWithURL :: proc(url: ^URL) -> ^Bundle {
Bundle_bundleWithURL :: proc "c" (url: ^URL) -> ^Bundle {
return msgSend(^Bundle, Bundle, "bundleWithUrl:", url)
}
@(objc_type=Bundle, objc_name="alloc", objc_is_class_method=true)
Bundle_alloc :: proc() -> ^Bundle {
Bundle_alloc :: proc "c" () -> ^Bundle {
return msgSend(^Bundle, Bundle, "alloc")
}
@(objc_type=Bundle, objc_name="init")
Bundle_init :: proc(self: ^Bundle) -> ^Bundle {
Bundle_init :: proc "c" (self: ^Bundle) -> ^Bundle {
return msgSend(^Bundle, self, "init")
}
@(objc_type=Bundle, objc_name="initWithPath")
Bundle_initWithPath :: proc(self: ^Bundle, path: ^String) -> ^Bundle {
Bundle_initWithPath :: proc "c" (self: ^Bundle, path: ^String) -> ^Bundle {
return msgSend(^Bundle, self, "initWithPath:", path)
}
@(objc_type=Bundle, objc_name="initWithURL")
Bundle_initWithURL :: proc(self: ^Bundle, url: ^URL) -> ^Bundle {
Bundle_initWithURL :: proc "c" (self: ^Bundle, url: ^URL) -> ^Bundle {
return msgSend(^Bundle, self, "initWithUrl:", url)
}
@(objc_type=Bundle, objc_name="allBundles")
Bundle_allBundles :: proc() -> (all: ^Array) {
Bundle_allBundles :: proc "c" () -> (all: ^Array) {
return msgSend(type_of(all), Bundle, "allBundles")
}
@(objc_type=Bundle, objc_name="allFrameworks")
Bundle_allFrameworks :: proc() -> (all: ^Array) {
Bundle_allFrameworks :: proc "c" () -> (all: ^Array) {
return msgSend(type_of(all), Bundle, "allFrameworks")
}
@(objc_type=Bundle, objc_name="load")
Bundle_load :: proc(self: ^Bundle) -> BOOL {
Bundle_load :: proc "c" (self: ^Bundle) -> BOOL {
return msgSend(BOOL, self, "load")
}
@(objc_type=Bundle, objc_name="unload")
Bundle_unload :: proc(self: ^Bundle) -> BOOL {
Bundle_unload :: proc "c" (self: ^Bundle) -> BOOL {
return msgSend(BOOL, self, "unload")
}
@(objc_type=Bundle, objc_name="isLoaded")
Bundle_isLoaded :: proc(self: ^Bundle) -> BOOL {
Bundle_isLoaded :: proc "c" (self: ^Bundle) -> BOOL {
return msgSend(BOOL, self, "isLoaded")
}
@(objc_type=Bundle, objc_name="preflightAndReturnError")
Bundle_preflightAndReturnError :: proc(self: ^Bundle) -> (ok: BOOL, error: ^Error) {
Bundle_preflightAndReturnError :: proc "contextless" (self: ^Bundle) -> (ok: BOOL, error: ^Error) {
ok = msgSend(BOOL, self, "preflightAndReturnError:", &error)
return
}
@(objc_type=Bundle, objc_name="loadAndReturnError")
Bundle_loadAndReturnError :: proc(self: ^Bundle) -> (ok: BOOL, error: ^Error) {
Bundle_loadAndReturnError :: proc "contextless" (self: ^Bundle) -> (ok: BOOL, error: ^Error) {
ok = msgSend(BOOL, self, "loadAndReturnError:", &error)
return
}
@(objc_type=Bundle, objc_name="bundleURL")
Bundle_bundleURL :: proc(self: ^Bundle) -> ^URL {
Bundle_bundleURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "bundleURL")
}
@(objc_type=Bundle, objc_name="resourceURL")
Bundle_resourceURL :: proc(self: ^Bundle) -> ^URL {
Bundle_resourceURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "resourceURL")
}
@(objc_type=Bundle, objc_name="executableURL")
Bundle_executableURL :: proc(self: ^Bundle) -> ^URL {
Bundle_executableURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "executableURL")
}
@(objc_type=Bundle, objc_name="URLForAuxiliaryExecutable")
Bundle_URLForAuxiliaryExecutable :: proc(self: ^Bundle, executableName: ^String) -> ^URL {
Bundle_URLForAuxiliaryExecutable :: proc "c" (self: ^Bundle, executableName: ^String) -> ^URL {
return msgSend(^URL, self, "URLForAuxiliaryExecutable:", executableName)
}
@(objc_type=Bundle, objc_name="privateFrameworksURL")
Bundle_privateFrameworksURL :: proc(self: ^Bundle) -> ^URL {
Bundle_privateFrameworksURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "privateFrameworksURL")
}
@(objc_type=Bundle, objc_name="sharedFrameworksURL")
Bundle_sharedFrameworksURL :: proc(self: ^Bundle) -> ^URL {
Bundle_sharedFrameworksURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "sharedFrameworksURL")
}
@(objc_type=Bundle, objc_name="sharedSupportURL")
Bundle_sharedSupportURL :: proc(self: ^Bundle) -> ^URL {
Bundle_sharedSupportURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "sharedSupportURL")
}
@(objc_type=Bundle, objc_name="builtInPlugInsURL")
Bundle_builtInPlugInsURL :: proc(self: ^Bundle) -> ^URL {
Bundle_builtInPlugInsURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "builtInPlugInsURL")
}
@(objc_type=Bundle, objc_name="appStoreReceiptURL")
Bundle_appStoreReceiptURL :: proc(self: ^Bundle) -> ^URL {
Bundle_appStoreReceiptURL :: proc "c" (self: ^Bundle) -> ^URL {
return msgSend(^URL, self, "appStoreReceiptURL")
}
@(objc_type=Bundle, objc_name="bundlePath")
Bundle_bundlePath :: proc(self: ^Bundle) -> ^String {
Bundle_bundlePath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "bundlePath")
}
@(objc_type=Bundle, objc_name="resourcePath")
Bundle_resourcePath :: proc(self: ^Bundle) -> ^String {
Bundle_resourcePath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "resourcePath")
}
@(objc_type=Bundle, objc_name="executablePath")
Bundle_executablePath :: proc(self: ^Bundle) -> ^String {
Bundle_executablePath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "executablePath")
}
@(objc_type=Bundle, objc_name="PathForAuxiliaryExecutable")
Bundle_PathForAuxiliaryExecutable :: proc(self: ^Bundle, executableName: ^String) -> ^String {
Bundle_PathForAuxiliaryExecutable :: proc "c" (self: ^Bundle, executableName: ^String) -> ^String {
return msgSend(^String, self, "PathForAuxiliaryExecutable:", executableName)
}
@(objc_type=Bundle, objc_name="privateFrameworksPath")
Bundle_privateFrameworksPath :: proc(self: ^Bundle) -> ^String {
Bundle_privateFrameworksPath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "privateFrameworksPath")
}
@(objc_type=Bundle, objc_name="sharedFrameworksPath")
Bundle_sharedFrameworksPath :: proc(self: ^Bundle) -> ^String {
Bundle_sharedFrameworksPath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "sharedFrameworksPath")
}
@(objc_type=Bundle, objc_name="sharedSupportPath")
Bundle_sharedSupportPath :: proc(self: ^Bundle) -> ^String {
Bundle_sharedSupportPath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "sharedSupportPath")
}
@(objc_type=Bundle, objc_name="builtInPlugInsPath")
Bundle_builtInPlugInsPath :: proc(self: ^Bundle) -> ^String {
Bundle_builtInPlugInsPath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "builtInPlugInsPath")
}
@(objc_type=Bundle, objc_name="appStoreReceiptPath")
Bundle_appStoreReceiptPath :: proc(self: ^Bundle) -> ^String {
Bundle_appStoreReceiptPath :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "appStoreReceiptPath")
}
@(objc_type=Bundle, objc_name="bundleIdentifier")
Bundle_bundleIdentifier :: proc(self: ^Bundle) -> ^String {
Bundle_bundleIdentifier :: proc "c" (self: ^Bundle) -> ^String {
return msgSend(^String, self, "bundleIdentifier")
}
@(objc_type=Bundle, objc_name="infoDictionary")
Bundle_infoDictionary :: proc(self: ^Bundle) -> ^Dictionary {
Bundle_infoDictionary :: proc "c" (self: ^Bundle) -> ^Dictionary {
return msgSend(^Dictionary, self, "infoDictionary")
}
@(objc_type=Bundle, objc_name="localizedInfoDictionary")
Bundle_localizedInfoDictionary :: proc(self: ^Bundle) -> ^Dictionary {
Bundle_localizedInfoDictionary :: proc "c" (self: ^Bundle) -> ^Dictionary {
return msgSend(^Dictionary, self, "localizedInfoDictionary")
}
@(objc_type=Bundle, objc_name="objectForInfoDictionaryKey")
Bundle_objectForInfoDictionaryKey :: proc(self: ^Bundle, key: ^String) -> ^Object {
Bundle_objectForInfoDictionaryKey :: proc "c" (self: ^Bundle, key: ^String) -> ^Object {
return msgSend(^Object, self, "objectForInfoDictionaryKey:", key)
}
@(objc_type=Bundle, objc_name="localizedStringForKey")
Bundle_localizedStringForKey :: proc(self: ^Bundle, key: ^String, value: ^String = nil, tableName: ^String = nil) -> ^String {
Bundle_localizedStringForKey :: proc "c" (self: ^Bundle, key: ^String, value: ^String = nil, tableName: ^String = nil) -> ^String {
return msgSend(^String, self, "localizedStringForKey:value:table:", key, value, tableName)
}

View File

@@ -4,21 +4,21 @@ package objc_Foundation
Data :: struct {using _: Copying(Data)}
@(objc_type=Data, objc_name="alloc", objc_is_class_method=true)
Data_alloc :: proc() -> ^Data {
Data_alloc :: proc "c" () -> ^Data {
return msgSend(^Data, Data, "alloc")
}
@(objc_type=Data, objc_name="init")
Data_init :: proc(self: ^Data) -> ^Data {
Data_init :: proc "c" (self: ^Data) -> ^Data {
return msgSend(^Data, self, "init")
}
@(objc_type=Data, objc_name="mutableBytes")
Data_mutableBytes :: proc(self: ^Data) -> rawptr {
Data_mutableBytes :: proc "c" (self: ^Data) -> rawptr {
return msgSend(rawptr, self, "mutableBytes")
}
@(objc_type=Data, objc_name="length")
Data_length :: proc(self: ^Data) -> UInteger {
Data_length :: proc "c" (self: ^Data) -> UInteger {
return msgSend(UInteger, self, "length")
}

View File

@@ -4,16 +4,16 @@ package objc_Foundation
Date :: struct {using _: Copying(Date)}
@(objc_type=Date, objc_name="alloc", objc_is_class_method=true)
Date_alloc :: proc() -> ^Date {
Date_alloc :: proc "c" () -> ^Date {
return msgSend(^Date, Date, "alloc")
}
@(objc_type=Date, objc_name="init")
Date_init :: proc(self: ^Date) -> ^Date {
Date_init :: proc "c" (self: ^Date) -> ^Date {
return msgSend(^Date, self, "init")
}
@(objc_type=Date, objc_name="dateWithTimeIntervalSinceNow")
Date_dateWithTimeIntervalSinceNow :: proc(secs: TimeInterval) -> ^Date {
Date_dateWithTimeIntervalSinceNow :: proc "c" (secs: TimeInterval) -> ^Date {
return msgSend(^Date, Date, "dateWithTimeIntervalSinceNow:", secs)
}

View File

@@ -4,47 +4,47 @@ package objc_Foundation
Dictionary :: struct {using _: Copying(Dictionary)}
@(objc_type=Dictionary, objc_name="dictionary", objc_is_class_method=true)
Dictionary_dictionary :: proc() -> ^Dictionary {
Dictionary_dictionary :: proc "c" () -> ^Dictionary {
return msgSend(^Dictionary, Dictionary, "dictionary")
}
@(objc_type=Dictionary, objc_name="dictionaryWithObject", objc_is_class_method=true)
Dictionary_dictionaryWithObject :: proc(object: ^Object, forKey: ^Object) -> ^Dictionary {
Dictionary_dictionaryWithObject :: proc "c" (object: ^Object, forKey: ^Object) -> ^Dictionary {
return msgSend(^Dictionary, Dictionary, "dictionaryWithObject:forKey:", object, forKey)
}
@(objc_type=Dictionary, objc_name="dictionaryWithObjects", objc_is_class_method=true)
Dictionary_dictionaryWithObjects :: proc(objects: [^]^Object, forKeys: [^]^Object, count: UInteger) -> ^Dictionary {
Dictionary_dictionaryWithObjects :: proc "c" (objects: [^]^Object, forKeys: [^]^Object, count: UInteger) -> ^Dictionary {
return msgSend(^Dictionary, Dictionary, "dictionaryWithObjects:forKeys:count", objects, forKeys, count)
}
@(objc_type=Dictionary, objc_name="alloc", objc_is_class_method=true)
Dictionary_alloc :: proc() -> ^Dictionary {
Dictionary_alloc :: proc "c" () -> ^Dictionary {
return msgSend(^Dictionary, Dictionary, "alloc")
}
@(objc_type=Dictionary, objc_name="init")
Dictionary_init :: proc(self: ^Dictionary) -> ^Dictionary {
Dictionary_init :: proc "c" (self: ^Dictionary) -> ^Dictionary {
return msgSend(^Dictionary, self, "init")
}
@(objc_type=Dictionary, objc_name="initWithObjects")
Dictionary_initWithObjects :: proc(self: ^Dictionary, objects: [^]^Object, forKeys: [^]^Object, count: UInteger) -> ^Dictionary {
Dictionary_initWithObjects :: proc "c" (self: ^Dictionary, objects: [^]^Object, forKeys: [^]^Object, count: UInteger) -> ^Dictionary {
return msgSend(^Dictionary, self, "initWithObjects:forKeys:count", objects, forKeys, count)
}
@(objc_type=Dictionary, objc_name="objectForKey")
Dictionary_objectForKey :: proc(self: ^Dictionary, key: ^Object) -> ^Object {
Dictionary_objectForKey :: proc "c" (self: ^Dictionary, key: ^Object) -> ^Object {
return msgSend(^Dictionary, self, "objectForKey:", key)
}
@(objc_type=Dictionary, objc_name="count")
Dictionary_count :: proc(self: ^Dictionary) -> UInteger {
Dictionary_count :: proc "c" (self: ^Dictionary) -> UInteger {
return msgSend(UInteger, self, "count")
}
@(objc_type=Dictionary, objc_name="keyEnumerator")
Dictionary_keyEnumerator :: proc(self: ^Dictionary, $KeyType: typeid) -> (enumerator: ^Enumerator(KeyType)) {
Dictionary_keyEnumerator :: proc "c" (self: ^Dictionary, $KeyType: typeid) -> (enumerator: ^Enumerator(KeyType)) {
return msgSend(type_of(enumerator), self, "keyEnumerator")
}

View File

@@ -20,30 +20,30 @@ Enumerator :: struct($T: typeid) where intrinsics.type_is_pointer(T), intrinsics
@(objc_type=FastEnumeration, objc_name="alloc", objc_is_class_method=true)
FastEnumeration_alloc :: proc() -> ^FastEnumeration {
FastEnumeration_alloc :: proc "c" () -> ^FastEnumeration {
return msgSend(^FastEnumeration, FastEnumeration, "alloc")
}
@(objc_type=FastEnumeration, objc_name="init")
FastEnumeration_init :: proc(self: ^FastEnumeration) -> ^FastEnumeration {
FastEnumeration_init :: proc "c" (self: ^FastEnumeration) -> ^FastEnumeration {
return msgSend(^FastEnumeration, self, "init")
}
@(objc_type=FastEnumeration, objc_name="countByEnumerating")
FastEnumeration_countByEnumerating :: proc(self: ^FastEnumeration, state: ^FastEnumerationState, buffer: [^]^Object, len: UInteger) -> UInteger {
FastEnumeration_countByEnumerating :: proc "c" (self: ^FastEnumeration, state: ^FastEnumerationState, buffer: [^]^Object, len: UInteger) -> UInteger {
return msgSend(UInteger, self, "countByEnumeratingWithState:objects:count:", state, buffer, len)
}
Enumerator_nextObject :: proc(self: ^$E/Enumerator($T)) -> T {
Enumerator_nextObject :: proc "c" (self: ^$E/Enumerator($T)) -> T {
return msgSend(T, self, "nextObject")
}
Enumerator_allObjects :: proc(self: ^$E/Enumerator($T)) -> (all: ^Array) {
Enumerator_allObjects :: proc "c" (self: ^$E/Enumerator($T)) -> (all: ^Array) {
return msgSend(type_of(all), self, "allObjects")
}
Enumerator_iterator :: proc(self: ^$E/Enumerator($T)) -> (obj: T, ok: bool) {
Enumerator_iterator :: proc "contextless" (self: ^$E/Enumerator($T)) -> (obj: T, ok: bool) {
obj = msgSend(T, self, "nextObject")
ok = obj != nil
return

View File

@@ -33,56 +33,56 @@ Error :: struct { using _: Copying(Error) }
@(objc_type=Error, objc_name="alloc", objc_is_class_method=true)
Error_alloc :: proc() -> ^Error {
Error_alloc :: proc "c" () -> ^Error {
return msgSend(^Error, Error, "alloc")
}
@(objc_type=Error, objc_name="init")
Error_init :: proc(self: ^Error) -> ^Error {
Error_init :: proc "c" (self: ^Error) -> ^Error {
return msgSend(^Error, self, "init")
}
@(objc_type=Error, objc_name="errorWithDomain", objc_is_class_method=true)
Error_errorWithDomain :: proc(domain: ErrorDomain, code: Integer, userInfo: ^Dictionary) -> ^Error {
Error_errorWithDomain :: proc "c" (domain: ErrorDomain, code: Integer, userInfo: ^Dictionary) -> ^Error {
return msgSend(^Error, Error, "errorWithDomain:code:userInfo:", domain, code, userInfo)
}
@(objc_type=Error, objc_name="initWithDomain")
Error_initWithDomain :: proc(self: ^Error, domain: ErrorDomain, code: Integer, userInfo: ^Dictionary) -> ^Error {
Error_initWithDomain :: proc "c" (self: ^Error, domain: ErrorDomain, code: Integer, userInfo: ^Dictionary) -> ^Error {
return msgSend(^Error, self, "initWithDomain:code:userInfo:", domain, code, userInfo)
}
@(objc_type=Error, objc_name="code")
Error_code :: proc(self: ^Error) -> Integer {
Error_code :: proc "c" (self: ^Error) -> Integer {
return msgSend(Integer, self, "code")
}
@(objc_type=Error, objc_name="domain")
Error_domain :: proc(self: ^Error) -> ErrorDomain {
Error_domain :: proc "c" (self: ^Error) -> ErrorDomain {
return msgSend(ErrorDomain, self, "domain")
}
@(objc_type=Error, objc_name="userInfo")
Error_userInfo :: proc(self: ^Error) -> ^Dictionary {
Error_userInfo :: proc "c" (self: ^Error) -> ^Dictionary {
return msgSend(^Dictionary, self, "userInfo")
}
@(objc_type=Error, objc_name="localizedDescription")
Error_localizedDescription :: proc(self: ^Error) -> ^String {
Error_localizedDescription :: proc "c" (self: ^Error) -> ^String {
return msgSend(^String, self, "localizedDescription")
}
@(objc_type=Error, objc_name="localizedRecoveryOptions")
Error_localizedRecoveryOptions :: proc(self: ^Error) -> (options: ^Array) {
Error_localizedRecoveryOptions :: proc "c" (self: ^Error) -> (options: ^Array) {
return msgSend(type_of(options), self, "localizedRecoveryOptions")
}
@(objc_type=Error, objc_name="localizedRecoverySuggestion")
Error_localizedRecoverySuggestion :: proc(self: ^Error) -> ^String {
Error_localizedRecoverySuggestion :: proc "c" (self: ^Error) -> ^String {
return msgSend(^String, self, "localizedRecoverySuggestion")
}
@(objc_type=Error, objc_name="localizedFailureReason")
Error_localizedFailureReason :: proc(self: ^Error) -> ^String {
Error_localizedFailureReason :: proc "c" (self: ^Error) -> ^String {
return msgSend(^String, self, "localizedFailureReason")
}

View File

@@ -2,10 +2,10 @@ package objc_Foundation
Locking :: struct($T: typeid) {using _: Object}
Locking_lock :: proc(self: ^Locking($T)) {
Locking_lock :: proc "c" (self: ^Locking($T)) {
msgSend(nil, self, "lock")
}
Locking_unlock :: proc(self: ^Locking($T)) {
Locking_unlock :: proc "c" (self: ^Locking($T)) {
msgSend(nil, self, "unlock")
}
@@ -14,40 +14,40 @@ Condition :: struct {using _: Locking(Condition) }
@(objc_type=Condition, objc_name="alloc", objc_is_class_method=true)
Condition_alloc :: proc() -> ^Condition {
Condition_alloc :: proc "c" () -> ^Condition {
return msgSend(^Condition, Condition, "alloc")
}
@(objc_type=Condition, objc_name="init")
Condition_init :: proc(self: ^Condition) -> ^Condition {
Condition_init :: proc "c" (self: ^Condition) -> ^Condition {
return msgSend(^Condition, self, "init")
}
@(objc_type=Condition, objc_name="wait")
Condition_wait :: proc(self: ^Condition) {
Condition_wait :: proc "c" (self: ^Condition) {
msgSend(nil, self, "wait")
}
@(objc_type=Condition, objc_name="waitUntilDate")
Condition_waitUntilDate :: proc(self: ^Condition, limit: ^Date) -> BOOL {
Condition_waitUntilDate :: proc "c" (self: ^Condition, limit: ^Date) -> BOOL {
return msgSend(BOOL, self, "waitUntilDate:", limit)
}
@(objc_type=Condition, objc_name="signal")
Condition_signal :: proc(self: ^Condition) {
Condition_signal :: proc "c" (self: ^Condition) {
msgSend(nil, self, "signal")
}
@(objc_type=Condition, objc_name="broadcast")
Condition_broadcast :: proc(self: ^Condition) {
Condition_broadcast :: proc "c" (self: ^Condition) {
msgSend(nil, self, "broadcast")
}
@(objc_type=Condition, objc_name="lock")
Condition_lock :: proc(self: ^Condition) {
Condition_lock :: proc "c" (self: ^Condition) {
msgSend(nil, self, "lock")
}
@(objc_type=Condition, objc_name="unlock")
Condition_unlock :: proc(self: ^Condition) {
Condition_unlock :: proc "c" (self: ^Condition) {
msgSend(nil, self, "unlock")
}

View File

@@ -27,11 +27,11 @@ MenuItemCallback :: proc "c" (unused: rawptr, name: SEL, sender: ^Object)
MenuItem :: struct {using _: Object}
@(objc_type=MenuItem, objc_name="alloc", objc_is_class_method=true)
MenuItem_alloc :: proc() -> ^MenuItem {
MenuItem_alloc :: proc "c" () -> ^MenuItem {
return msgSend(^MenuItem, MenuItem, "alloc")
}
@(objc_type=MenuItem, objc_name="registerActionCallback", objc_is_class_method=true)
MenuItem_registerActionCallback :: proc(name: cstring, callback: MenuItemCallback) -> SEL {
MenuItem_registerActionCallback :: proc "c" (name: cstring, callback: MenuItemCallback) -> SEL {
s := string(name)
n := len(s)
sel: SEL
@@ -51,22 +51,22 @@ MenuItem_registerActionCallback :: proc(name: cstring, callback: MenuItemCallbac
}
@(objc_type=MenuItem, objc_name="init")
MenuItem_init :: proc(self: ^MenuItem) -> ^MenuItem {
MenuItem_init :: proc "c" (self: ^MenuItem) -> ^MenuItem {
return msgSend(^MenuItem, self, "init")
}
@(objc_type=MenuItem, objc_name="setKeyEquivalentModifierMask")
MenuItem_setKeyEquivalentModifierMask :: proc(self: ^MenuItem, modifierMask: KeyEquivalentModifierMask) {
MenuItem_setKeyEquivalentModifierMask :: proc "c" (self: ^MenuItem, modifierMask: KeyEquivalentModifierMask) {
msgSend(nil, self, "setKeyEquivalentModifierMask:", modifierMask)
}
@(objc_type=MenuItem, objc_name="keyEquivalentModifierMask")
MenuItem_keyEquivalentModifierMask :: proc(self: ^MenuItem) -> KeyEquivalentModifierMask {
MenuItem_keyEquivalentModifierMask :: proc "c" (self: ^MenuItem) -> KeyEquivalentModifierMask {
return msgSend(KeyEquivalentModifierMask, self, "keyEquivalentModifierMask")
}
@(objc_type=MenuItem, objc_name="setSubmenu")
MenuItem_setSubmenu :: proc(self: ^MenuItem, submenu: ^Menu) {
MenuItem_setSubmenu :: proc "c" (self: ^MenuItem, submenu: ^Menu) {
msgSend(nil, self, "setSubmenu:", submenu)
}
@@ -77,27 +77,27 @@ MenuItem_setSubmenu :: proc(self: ^MenuItem, submenu: ^Menu) {
Menu :: struct {using _: Object}
@(objc_type=Menu, objc_name="alloc", objc_is_class_method=true)
Menu_alloc :: proc() -> ^Menu {
Menu_alloc :: proc "c" () -> ^Menu {
return msgSend(^Menu, Menu, "alloc")
}
@(objc_type=Menu, objc_name="init")
Menu_init :: proc(self: ^Menu) -> ^Menu {
Menu_init :: proc "c" (self: ^Menu) -> ^Menu {
return msgSend(^Menu, self, "init")
}
@(objc_type=Menu, objc_name="initWithTitle")
Menu_initWithTitle :: proc(self: ^Menu, title: ^String) -> ^Menu {
Menu_initWithTitle :: proc "c" (self: ^Menu, title: ^String) -> ^Menu {
return msgSend(^Menu, self, "initWithTitle:", title)
}
@(objc_type=Menu, objc_name="addItem")
Menu_addItem :: proc(self: ^Menu, item: ^MenuItem) {
Menu_addItem :: proc "c" (self: ^Menu, item: ^MenuItem) {
msgSend(nil, self, "addItem:", item)
}
@(objc_type=Menu, objc_name="addItemWithTitle")
Menu_addItemWithTitle :: proc(self: ^Menu, title: ^String, selector: SEL, keyEquivalent: ^String) -> ^MenuItem {
Menu_addItemWithTitle :: proc "c" (self: ^Menu, title: ^String, selector: SEL, keyEquivalent: ^String) -> ^MenuItem {
return msgSend(^MenuItem, self, "addItemWithTitle:action:keyEquivalent:", title, selector, keyEquivalent)
}

View File

@@ -5,27 +5,27 @@ Notification :: struct{using _: Object}
@(objc_type=Notification, objc_name="alloc", objc_is_class_method=true)
Notification_alloc :: proc() -> ^Notification {
Notification_alloc :: proc "c" () -> ^Notification {
return msgSend(^Notification, Notification, "alloc")
}
@(objc_type=Notification, objc_name="init")
Notification_init :: proc(self: ^Notification) -> ^Notification {
Notification_init :: proc "c" (self: ^Notification) -> ^Notification {
return msgSend(^Notification, self, "init")
}
@(objc_type=Notification, objc_name="name")
Notification_name :: proc(self: ^Notification) -> ^String {
Notification_name :: proc "c" (self: ^Notification) -> ^String {
return msgSend(^String, self, "name")
}
@(objc_type=Notification, objc_name="object")
Notification_object :: proc(self: ^Notification) -> ^Object {
Notification_object :: proc "c" (self: ^Notification) -> ^Object {
return msgSend(^Object, self, "object")
}
@(objc_type=Notification, objc_name="userInfo")
Notification_userInfo :: proc(self: ^Notification) -> ^Dictionary {
Notification_userInfo :: proc "c" (self: ^Notification) -> ^Dictionary {
return msgSend(^Dictionary, self, "userInfo")
}
@@ -36,25 +36,25 @@ NotificationCenter :: struct{using _: Object}
@(objc_type=NotificationCenter, objc_name="alloc", objc_is_class_method=true)
NotificationCenter_alloc :: proc() -> ^NotificationCenter {
NotificationCenter_alloc :: proc "c" () -> ^NotificationCenter {
return msgSend(^NotificationCenter, NotificationCenter, "alloc")
}
@(objc_type=NotificationCenter, objc_name="init")
NotificationCenter_init :: proc(self: ^NotificationCenter) -> ^NotificationCenter {
NotificationCenter_init :: proc "c" (self: ^NotificationCenter) -> ^NotificationCenter {
return msgSend(^NotificationCenter, self, "init")
}
@(objc_type=NotificationCenter, objc_name="defaultCenter", objc_is_class_method=true)
NotificationCenter_defaultCenter :: proc() -> ^NotificationCenter {
NotificationCenter_defaultCenter :: proc "c" () -> ^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 {
NotificationCenter_addObserverName :: proc "c" (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) {
NotificationCenter_removeObserver :: proc "c" (self: ^NotificationCenter, pObserver: ^Object) {
msgSend(nil, self, "removeObserver:", pObserver)
}

View File

@@ -12,37 +12,37 @@ when ODIN_OS == .Darwin {
Value :: struct{using _: Copying(Value)}
@(objc_type=Value, objc_name="alloc", objc_is_class_method=true)
Value_alloc :: proc() -> ^Value {
Value_alloc :: proc "c" () -> ^Value {
return msgSend(^Value, Value, "alloc")
}
@(objc_type=Value, objc_name="init")
Value_init :: proc(self: ^Value) -> ^Value {
Value_init :: proc "c" (self: ^Value) -> ^Value {
return msgSend(^Value, self, "init")
}
@(objc_type=Value, objc_name="valueWithBytes", objc_is_class_method=true)
Value_valueWithBytes :: proc(value: rawptr, type: cstring) -> ^Value {
Value_valueWithBytes :: proc "c" (value: rawptr, type: cstring) -> ^Value {
return msgSend(^Value, Value, "valueWithBytes:objCType:", value, type)
}
@(objc_type=Value, objc_name="valueWithPointer", objc_is_class_method=true)
Value_valueWithPointer :: proc(pointer: rawptr) -> ^Value {
Value_valueWithPointer :: proc "c" (pointer: rawptr) -> ^Value {
return msgSend(^Value, Value, "valueWithPointer:", pointer)
}
@(objc_type=Value, objc_name="initWithBytes")
Value_initWithBytes :: proc(self: ^Value, value: rawptr, type: cstring) -> ^Value {
Value_initWithBytes :: proc "c" (self: ^Value, value: rawptr, type: cstring) -> ^Value {
return msgSend(^Value, self, "initWithBytes:objCType:", value, type)
}
@(objc_type=Value, objc_name="initWithCoder")
Value_initWithCoder :: proc(self: ^Value, coder: ^Coder) -> ^Value {
Value_initWithCoder :: proc "c" (self: ^Value, coder: ^Coder) -> ^Value {
return msgSend(^Value, self, "initWithCoder:", coder)
}
@(objc_type=Value, objc_name="getValue")
Value_getValue :: proc(self: ^Value, value: rawptr, size: UInteger) {
Value_getValue :: proc "c" (self: ^Value, value: rawptr, size: UInteger) {
msgSend(nil, self, "getValue:size:", value, size)
}
@@ -67,28 +67,28 @@ Value_pointerValue :: proc "c" (self: ^Value) -> rawptr {
Number :: struct{using _: Copying(Number), using _: Value}
@(objc_type=Number, objc_name="alloc", objc_is_class_method=true)
Number_alloc :: proc() -> ^Number {
Number_alloc :: proc "c" () -> ^Number {
return msgSend(^Number, Number, "alloc")
}
@(objc_type=Number, objc_name="init")
Number_init :: proc(self: ^Number) -> ^Number {
Number_init :: proc "c" (self: ^Number) -> ^Number {
return msgSend(^Number, self, "init")
}
@(objc_type=Number, objc_name="numberWithI8", objc_is_class_method=true) Number_numberWithI8 :: proc(value: i8) -> ^Number { return msgSend(^Number, Number, "numberWithChar:", value) }
@(objc_type=Number, objc_name="numberWithU8", objc_is_class_method=true) Number_numberWithU8 :: proc(value: u8) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedChar:", value) }
@(objc_type=Number, objc_name="numberWithI16", objc_is_class_method=true) Number_numberWithI16 :: proc(value: i16) -> ^Number { return msgSend(^Number, Number, "numberWithShort:", value) }
@(objc_type=Number, objc_name="numberWithU16", objc_is_class_method=true) Number_numberWithU16 :: proc(value: u16) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedShort:", value) }
@(objc_type=Number, objc_name="numberWithI32", objc_is_class_method=true) Number_numberWithI32 :: proc(value: i32) -> ^Number { return msgSend(^Number, Number, "numberWithInt:", value) }
@(objc_type=Number, objc_name="numberWithU32", objc_is_class_method=true) Number_numberWithU32 :: proc(value: u32) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedInt:", value) }
@(objc_type=Number, objc_name="numberWithInt", objc_is_class_method=true) Number_numberWithInt :: proc(value: int) -> ^Number { return msgSend(^Number, Number, "numberWithLong:", value) }
@(objc_type=Number, objc_name="numberWithUint", objc_is_class_method=true) Number_numberWithUint :: proc(value: uint) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedLong:", value) }
@(objc_type=Number, objc_name="numberWithU64", objc_is_class_method=true) Number_numberWithU64 :: proc(value: u64) -> ^Number { return msgSend(^Number, Number, "numberWithLongLong:", value) }
@(objc_type=Number, objc_name="numberWithI64", objc_is_class_method=true) Number_numberWithI64 :: proc(value: i64) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedLongLong:", value) }
@(objc_type=Number, objc_name="numberWithF32", objc_is_class_method=true) Number_numberWithF32 :: proc(value: f32) -> ^Number { return msgSend(^Number, Number, "numberWithFloat:", value) }
@(objc_type=Number, objc_name="numberWithF64", objc_is_class_method=true) Number_numberWithF64 :: proc(value: f64) -> ^Number { return msgSend(^Number, Number, "numberWithDouble:", value) }
@(objc_type=Number, objc_name="numberWithBool", objc_is_class_method=true) Number_numberWithBool :: proc(value: BOOL) -> ^Number { return msgSend(^Number, Number, "numberWithBool:", value) }
@(objc_type=Number, objc_name="numberWithI8", objc_is_class_method=true) Number_numberWithI8 :: proc "c" (value: i8) -> ^Number { return msgSend(^Number, Number, "numberWithChar:", value) }
@(objc_type=Number, objc_name="numberWithU8", objc_is_class_method=true) Number_numberWithU8 :: proc "c" (value: u8) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedChar:", value) }
@(objc_type=Number, objc_name="numberWithI16", objc_is_class_method=true) Number_numberWithI16 :: proc "c" (value: i16) -> ^Number { return msgSend(^Number, Number, "numberWithShort:", value) }
@(objc_type=Number, objc_name="numberWithU16", objc_is_class_method=true) Number_numberWithU16 :: proc "c" (value: u16) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedShort:", value) }
@(objc_type=Number, objc_name="numberWithI32", objc_is_class_method=true) Number_numberWithI32 :: proc "c" (value: i32) -> ^Number { return msgSend(^Number, Number, "numberWithInt:", value) }
@(objc_type=Number, objc_name="numberWithU32", objc_is_class_method=true) Number_numberWithU32 :: proc "c" (value: u32) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedInt:", value) }
@(objc_type=Number, objc_name="numberWithInt", objc_is_class_method=true) Number_numberWithInt :: proc "c" (value: int) -> ^Number { return msgSend(^Number, Number, "numberWithLong:", value) }
@(objc_type=Number, objc_name="numberWithUint", objc_is_class_method=true) Number_numberWithUint :: proc "c" (value: uint) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedLong:", value) }
@(objc_type=Number, objc_name="numberWithU64", objc_is_class_method=true) Number_numberWithU64 :: proc "c" (value: u64) -> ^Number { return msgSend(^Number, Number, "numberWithLongLong:", value) }
@(objc_type=Number, objc_name="numberWithI64", objc_is_class_method=true) Number_numberWithI64 :: proc "c" (value: i64) -> ^Number { return msgSend(^Number, Number, "numberWithUnsignedLongLong:", value) }
@(objc_type=Number, objc_name="numberWithF32", objc_is_class_method=true) Number_numberWithF32 :: proc "c" (value: f32) -> ^Number { return msgSend(^Number, Number, "numberWithFloat:", value) }
@(objc_type=Number, objc_name="numberWithF64", objc_is_class_method=true) Number_numberWithF64 :: proc "c" (value: f64) -> ^Number { return msgSend(^Number, Number, "numberWithDouble:", value) }
@(objc_type=Number, objc_name="numberWithBool", objc_is_class_method=true) Number_numberWithBool :: proc "c" (value: BOOL) -> ^Number { return msgSend(^Number, Number, "numberWithBool:", value) }
Number_number :: proc{
Number_numberWithI8,
@@ -106,49 +106,49 @@ Number_number :: proc{
Number_numberWithBool,
}
@(objc_type=Number, objc_name="initWithI8") Number_initWithI8 :: proc(self: ^Number, value: i8) -> ^Number { return msgSend(^Number, self, "initWithChar:", value) }
@(objc_type=Number, objc_name="initWithU8") Number_initWithU8 :: proc(self: ^Number, value: u8) -> ^Number { return msgSend(^Number, self, "initWithUnsignedChar:", value) }
@(objc_type=Number, objc_name="initWithI16") Number_initWithI16 :: proc(self: ^Number, value: i16) -> ^Number { return msgSend(^Number, self, "initWithShort:", value) }
@(objc_type=Number, objc_name="initWithU16") Number_initWithU16 :: proc(self: ^Number, value: u16) -> ^Number { return msgSend(^Number, self, "initWithUnsignedShort:", value) }
@(objc_type=Number, objc_name="initWithI32") Number_initWithI32 :: proc(self: ^Number, value: i32) -> ^Number { return msgSend(^Number, self, "initWithInt:", value) }
@(objc_type=Number, objc_name="initWithU32") Number_initWithU32 :: proc(self: ^Number, value: u32) -> ^Number { return msgSend(^Number, self, "initWithUnsignedInt:", value) }
@(objc_type=Number, objc_name="initWithInt") Number_initWithInt :: proc(self: ^Number, value: int) -> ^Number { return msgSend(^Number, self, "initWithLong:", value) }
@(objc_type=Number, objc_name="initWithUint") Number_initWithUint :: proc(self: ^Number, value: uint) -> ^Number { return msgSend(^Number, self, "initWithUnsignedLong:", value) }
@(objc_type=Number, objc_name="initWithU64") Number_initWithU64 :: proc(self: ^Number, value: u64) -> ^Number { return msgSend(^Number, self, "initWithLongLong:", value) }
@(objc_type=Number, objc_name="initWithI64") Number_initWithI64 :: proc(self: ^Number, value: i64) -> ^Number { return msgSend(^Number, self, "initWithUnsignedLongLong:", value) }
@(objc_type=Number, objc_name="initWithF32") Number_initWithF32 :: proc(self: ^Number, value: f32) -> ^Number { return msgSend(^Number, self, "initWithFloat:", value) }
@(objc_type=Number, objc_name="initWithF64") Number_initWithF64 :: proc(self: ^Number, value: f64) -> ^Number { return msgSend(^Number, self, "initWithDouble:", value) }
@(objc_type=Number, objc_name="initWithBool") Number_initWithBool :: proc(self: ^Number, value: BOOL) -> ^Number { return msgSend(^Number, self, "initWithBool:", value) }
@(objc_type=Number, objc_name="initWithI8") Number_initWithI8 :: proc "c" (self: ^Number, value: i8) -> ^Number { return msgSend(^Number, self, "initWithChar:", value) }
@(objc_type=Number, objc_name="initWithU8") Number_initWithU8 :: proc "c" (self: ^Number, value: u8) -> ^Number { return msgSend(^Number, self, "initWithUnsignedChar:", value) }
@(objc_type=Number, objc_name="initWithI16") Number_initWithI16 :: proc "c" (self: ^Number, value: i16) -> ^Number { return msgSend(^Number, self, "initWithShort:", value) }
@(objc_type=Number, objc_name="initWithU16") Number_initWithU16 :: proc "c" (self: ^Number, value: u16) -> ^Number { return msgSend(^Number, self, "initWithUnsignedShort:", value) }
@(objc_type=Number, objc_name="initWithI32") Number_initWithI32 :: proc "c" (self: ^Number, value: i32) -> ^Number { return msgSend(^Number, self, "initWithInt:", value) }
@(objc_type=Number, objc_name="initWithU32") Number_initWithU32 :: proc "c" (self: ^Number, value: u32) -> ^Number { return msgSend(^Number, self, "initWithUnsignedInt:", value) }
@(objc_type=Number, objc_name="initWithInt") Number_initWithInt :: proc "c" (self: ^Number, value: int) -> ^Number { return msgSend(^Number, self, "initWithLong:", value) }
@(objc_type=Number, objc_name="initWithUint") Number_initWithUint :: proc "c" (self: ^Number, value: uint) -> ^Number { return msgSend(^Number, self, "initWithUnsignedLong:", value) }
@(objc_type=Number, objc_name="initWithU64") Number_initWithU64 :: proc "c" (self: ^Number, value: u64) -> ^Number { return msgSend(^Number, self, "initWithLongLong:", value) }
@(objc_type=Number, objc_name="initWithI64") Number_initWithI64 :: proc "c" (self: ^Number, value: i64) -> ^Number { return msgSend(^Number, self, "initWithUnsignedLongLong:", value) }
@(objc_type=Number, objc_name="initWithF32") Number_initWithF32 :: proc "c" (self: ^Number, value: f32) -> ^Number { return msgSend(^Number, self, "initWithFloat:", value) }
@(objc_type=Number, objc_name="initWithF64") Number_initWithF64 :: proc "c" (self: ^Number, value: f64) -> ^Number { return msgSend(^Number, self, "initWithDouble:", value) }
@(objc_type=Number, objc_name="initWithBool") Number_initWithBool :: proc "c" (self: ^Number, value: BOOL) -> ^Number { return msgSend(^Number, self, "initWithBool:", value) }
@(objc_type=Number, objc_name="i8Value") Number_i8Value :: proc(self: ^Number) -> i8 { return msgSend(i8, self, "charValue") }
@(objc_type=Number, objc_name="u8Value") Number_u8Value :: proc(self: ^Number) -> u8 { return msgSend(u8, self, "unsignedCharValue") }
@(objc_type=Number, objc_name="i16Value") Number_i16Value :: proc(self: ^Number) -> i16 { return msgSend(i16, self, "shortValue") }
@(objc_type=Number, objc_name="u16Value") Number_u16Value :: proc(self: ^Number) -> u16 { return msgSend(u16, self, "unsignedShortValue") }
@(objc_type=Number, objc_name="i32Value") Number_i32Value :: proc(self: ^Number) -> i32 { return msgSend(i32, self, "intValue") }
@(objc_type=Number, objc_name="u32Value") Number_u32Value :: proc(self: ^Number) -> u32 { return msgSend(u32, self, "unsignedIntValue") }
@(objc_type=Number, objc_name="intValue") Number_intValue :: proc(self: ^Number) -> int { return msgSend(int, self, "longValue") }
@(objc_type=Number, objc_name="uintValue") Number_uintValue :: proc(self: ^Number) -> uint { return msgSend(uint, self, "unsignedLongValue") }
@(objc_type=Number, objc_name="u64Value") Number_u64Value :: proc(self: ^Number) -> u64 { return msgSend(u64, self, "longLongValue") }
@(objc_type=Number, objc_name="i64Value") Number_i64Value :: proc(self: ^Number) -> i64 { return msgSend(i64, self, "unsignedLongLongValue") }
@(objc_type=Number, objc_name="f32Value") Number_f32Value :: proc(self: ^Number) -> f32 { return msgSend(f32, self, "floatValue") }
@(objc_type=Number, objc_name="f64Value") Number_f64Value :: proc(self: ^Number) -> f64 { return msgSend(f64, self, "doubleValue") }
@(objc_type=Number, objc_name="boolValue") Number_boolValue :: proc(self: ^Number) -> BOOL { return msgSend(BOOL, self, "boolValue") }
@(objc_type=Number, objc_name="integerValue") Number_integerValue :: proc(self: ^Number) -> Integer { return msgSend(Integer, self, "integerValue") }
@(objc_type=Number, objc_name="uintegerValue") Number_uintegerValue :: proc(self: ^Number) -> UInteger { return msgSend(UInteger, self, "unsignedIntegerValue") }
@(objc_type=Number, objc_name="stringValue") Number_stringValue :: proc(self: ^Number) -> ^String { return msgSend(^String, self, "stringValue") }
@(objc_type=Number, objc_name="i8Value") Number_i8Value :: proc "c" (self: ^Number) -> i8 { return msgSend(i8, self, "charValue") }
@(objc_type=Number, objc_name="u8Value") Number_u8Value :: proc "c" (self: ^Number) -> u8 { return msgSend(u8, self, "unsignedCharValue") }
@(objc_type=Number, objc_name="i16Value") Number_i16Value :: proc "c" (self: ^Number) -> i16 { return msgSend(i16, self, "shortValue") }
@(objc_type=Number, objc_name="u16Value") Number_u16Value :: proc "c" (self: ^Number) -> u16 { return msgSend(u16, self, "unsignedShortValue") }
@(objc_type=Number, objc_name="i32Value") Number_i32Value :: proc "c" (self: ^Number) -> i32 { return msgSend(i32, self, "intValue") }
@(objc_type=Number, objc_name="u32Value") Number_u32Value :: proc "c" (self: ^Number) -> u32 { return msgSend(u32, self, "unsignedIntValue") }
@(objc_type=Number, objc_name="intValue") Number_intValue :: proc "c" (self: ^Number) -> int { return msgSend(int, self, "longValue") }
@(objc_type=Number, objc_name="uintValue") Number_uintValue :: proc "c" (self: ^Number) -> uint { return msgSend(uint, self, "unsignedLongValue") }
@(objc_type=Number, objc_name="u64Value") Number_u64Value :: proc "c" (self: ^Number) -> u64 { return msgSend(u64, self, "longLongValue") }
@(objc_type=Number, objc_name="i64Value") Number_i64Value :: proc "c" (self: ^Number) -> i64 { return msgSend(i64, self, "unsignedLongLongValue") }
@(objc_type=Number, objc_name="f32Value") Number_f32Value :: proc "c" (self: ^Number) -> f32 { return msgSend(f32, self, "floatValue") }
@(objc_type=Number, objc_name="f64Value") Number_f64Value :: proc "c" (self: ^Number) -> f64 { return msgSend(f64, self, "doubleValue") }
@(objc_type=Number, objc_name="boolValue") Number_boolValue :: proc "c" (self: ^Number) -> BOOL { return msgSend(BOOL, self, "boolValue") }
@(objc_type=Number, objc_name="integerValue") Number_integerValue :: proc "c" (self: ^Number) -> Integer { return msgSend(Integer, self, "integerValue") }
@(objc_type=Number, objc_name="uintegerValue") Number_uintegerValue :: proc "c" (self: ^Number) -> UInteger { return msgSend(UInteger, self, "unsignedIntegerValue") }
@(objc_type=Number, objc_name="stringValue") Number_stringValue :: proc "c" (self: ^Number) -> ^String { return msgSend(^String, self, "stringValue") }
@(objc_type=Number, objc_name="compare")
Number_compare :: proc(self, other: ^Number) -> ComparisonResult {
Number_compare :: proc "c" (self, other: ^Number) -> ComparisonResult {
return msgSend(ComparisonResult, self, "compare:", other)
}
@(objc_type=Number, objc_name="isEqualToNumber")
Number_isEqualToNumber :: proc(self, other: ^Number) -> BOOL {
Number_isEqualToNumber :: proc "c" (self, other: ^Number) -> BOOL {
return msgSend(BOOL, self, "isEqualToNumber:", other)
}
@(objc_type=Number, objc_name="descriptionWithLocale")
Number_descriptionWithLocale :: proc(self: ^Number, locale: ^Object) -> ^String {
Number_descriptionWithLocale :: proc "c" (self: ^Number, locale: ^Object) -> ^String {
return msgSend(^String, self, "descriptionWithLocale:", locale)
}

View File

@@ -21,67 +21,67 @@ Object :: struct {using _: intrinsics.objc_object}
@(objc_class="NSObject")
Copying :: struct($T: typeid) {using _: Object}
alloc :: proc($T: typeid) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
alloc :: proc "c" ($T: typeid) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
return msgSend(^T, T, "alloc")
}
@(objc_type=Object, objc_name="init")
init :: proc(self: ^$T) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
init :: proc "c" (self: ^$T) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
return msgSend(^T, self, "init")
}
@(objc_type=Object, objc_name="copy")
copy :: proc(self: ^Copying($T)) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
copy :: proc "c" (self: ^Copying($T)) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
return msgSend(^T, self, "copy")
}
new :: proc($T: typeid) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
new :: proc "c" ($T: typeid) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
return init(alloc(T))
}
@(objc_type=Object, objc_name="retain")
retain :: proc(self: ^Object) {
retain :: proc "c" (self: ^Object) {
_ = msgSend(^Object, self, "retain")
}
@(objc_type=Object, objc_name="release")
release :: proc(self: ^Object) {
release :: proc "c" (self: ^Object) {
msgSend(nil, self, "release")
}
@(objc_type=Object, objc_name="autorelease")
autorelease :: proc(self: ^Object) {
autorelease :: proc "c" (self: ^Object) {
msgSend(nil, self, "autorelease")
}
@(objc_type=Object, objc_name="retainCount")
retainCount :: proc(self: ^Object) -> UInteger {
retainCount :: proc "c" (self: ^Object) -> UInteger {
return msgSend(UInteger, self, "retainCount")
}
@(objc_type=Object, objc_name="class")
class :: proc(self: ^Object) -> Class {
class :: proc "c" (self: ^Object) -> Class {
return msgSend(Class, self, "class")
}
@(objc_type=Object, objc_name="hash")
hash :: proc(self: ^Object) -> UInteger {
hash :: proc "c" (self: ^Object) -> UInteger {
return msgSend(UInteger, self, "hash")
}
@(objc_type=Object, objc_name="isEqual")
isEqual :: proc(self, pObject: ^Object) -> BOOL {
isEqual :: proc "c" (self, pObject: ^Object) -> BOOL {
return msgSend(BOOL, self, "isEqual:", pObject)
}
@(objc_type=Object, objc_name="description")
description :: proc(self: ^Object) -> ^String {
description :: proc "c" (self: ^Object) -> ^String {
return msgSend(^String, self, "description")
}
@(objc_type=Object, objc_name="debugDescription")
debugDescription :: proc(self: ^Object) -> ^String {
debugDescription :: proc "c" (self: ^Object) -> ^String {
if msgSendSafeCheck(self, intrinsics.objc_find_selector("debugDescription")) {
return msgSend(^String, self, "debugDescription")
}
return nil
}
bridgingCast :: proc($T: typeid, obj: ^Object) where intrinsics.type_is_pointer(T), intrinsics.type_is_subtype_of(T, ^Object) {
bridgingCast :: proc "c" ($T: typeid, obj: ^Object) where intrinsics.type_is_pointer(T), intrinsics.type_is_subtype_of(T, ^Object) {
return (T)(obj)
}

View File

@@ -4,28 +4,28 @@ package objc_Foundation
OpenPanel :: struct{ using _: SavePanel }
@(objc_type=OpenPanel, objc_name="openPanel", objc_is_class_method=true)
OpenPanel_openPanel :: proc() -> ^OpenPanel {
OpenPanel_openPanel :: proc "c" () -> ^OpenPanel {
return msgSend(^OpenPanel, OpenPanel, "openPanel")
}
@(objc_type=OpenPanel, objc_name="URLs")
OpenPanel_URLs :: proc(self: ^OpenPanel) -> ^Array {
OpenPanel_URLs :: proc "c" (self: ^OpenPanel) -> ^Array {
return msgSend(^Array, self, "URLs")
}
@(objc_type=OpenPanel, objc_name="setCanChooseFiles")
OpenPanel_setCanChooseFiles :: proc(self: ^OpenPanel, setting: BOOL) {
OpenPanel_setCanChooseFiles :: proc "c" (self: ^OpenPanel, setting: BOOL) {
msgSend(nil, self, "setCanChooseFiles:", setting)
}
@(objc_type=OpenPanel, objc_name="setCanChooseDirectories")
OpenPanel_setCanChooseDirectories :: proc(self: ^OpenPanel, setting: BOOL) {
OpenPanel_setCanChooseDirectories :: proc "c" (self: ^OpenPanel, setting: BOOL) {
msgSend(nil, self, "setCanChooseDirectories:", setting)
}
@(objc_type=OpenPanel, objc_name="setResolvesAliases")
OpenPanel_setResolvesAliases :: proc(self: ^OpenPanel, setting: BOOL) {
OpenPanel_setResolvesAliases :: proc "c" (self: ^OpenPanel, setting: BOOL) {
msgSend(nil, self, "setResolvesAliases:", setting)
}
@(objc_type=OpenPanel, objc_name="setAllowsMultipleSelection")
OpenPanel_setAllowsMultipleSelection :: proc(self: ^OpenPanel, setting: BOOL) {
OpenPanel_setAllowsMultipleSelection :: proc "c" (self: ^OpenPanel, setting: BOOL) {
msgSend(nil, self, "setAllowsMultipleSelection:", setting)
}

View File

@@ -5,18 +5,18 @@ Range :: struct {
length: UInteger,
}
Range_Make :: proc(loc, len: UInteger) -> Range {
Range_Make :: proc "c" (loc, len: UInteger) -> Range {
return Range{loc, len}
}
Range_Equal :: proc(a, b: Range) -> BOOL {
Range_Equal :: proc "c" (a, b: Range) -> BOOL {
return a == b
}
Range_LocationInRange :: proc(self: Range, loc: UInteger) -> BOOL {
Range_LocationInRange :: proc "c" (self: Range, loc: UInteger) -> BOOL {
return !((loc < self.location) && ((loc - self.location) < self.length))
}
Range_Max :: proc(self: Range) -> UInteger {
Range_Max :: proc "c" (self: Range) -> UInteger {
return self.location + self.length
}

View File

@@ -4,6 +4,6 @@ package objc_Foundation
SavePanel :: struct{ using _: Panel }
@(objc_type=SavePanel, objc_name="runModal")
SavePanel_runModal :: proc(self: ^SavePanel) -> ModalResponse {
SavePanel_runModal :: proc "c" (self: ^SavePanel) -> ModalResponse {
return msgSend(ModalResponse, self, "runModal")
}

View File

@@ -64,77 +64,77 @@ MakeConstantString :: proc "c" (#const c: cstring) -> ^String {
@(objc_type=String, objc_name="alloc", objc_is_class_method=true)
String_alloc :: proc() -> ^String {
String_alloc :: proc "c" () -> ^String {
return msgSend(^String, String, "alloc")
}
@(objc_type=String, objc_name="init")
String_init :: proc(self: ^String) -> ^String {
String_init :: proc "c" (self: ^String) -> ^String {
return msgSend(^String, self, "init")
}
@(objc_type=String, objc_name="initWithString")
String_initWithString :: proc(self: ^String, other: ^String) -> ^String {
String_initWithString :: proc "c" (self: ^String, other: ^String) -> ^String {
return msgSend(^String, self, "initWithString:", other)
}
@(objc_type=String, objc_name="initWithCString")
String_initWithCString :: proc(self: ^String, pString: cstring, encoding: StringEncoding) -> ^String {
String_initWithCString :: proc "c" (self: ^String, pString: cstring, encoding: StringEncoding) -> ^String {
return msgSend(^String, self, "initWithCstring:encoding:", pString, encoding)
}
@(objc_type=String, objc_name="initWithBytesNoCopy")
String_initWithBytesNoCopy :: proc(self: ^String, pBytes: rawptr, length: UInteger, encoding: StringEncoding, freeWhenDone: bool) -> ^String {
String_initWithBytesNoCopy :: proc "c" (self: ^String, pBytes: rawptr, length: UInteger, encoding: StringEncoding, freeWhenDone: bool) -> ^String {
return msgSend(^String, self, "initWithBytesNoCopy:length:encoding:freeWhenDone:", pBytes, length, encoding, freeWhenDone)
}
@(objc_type=String, objc_name="initWithOdinString")
String_initWithOdinString :: proc(self: ^String, str: string) -> ^String {
String_initWithOdinString :: proc "c" (self: ^String, str: string) -> ^String {
return String_initWithBytesNoCopy(self, raw_data(str), UInteger(len(str)), .UTF8, false)
}
@(objc_type=String, objc_name="characterAtIndex")
String_characterAtIndex :: proc(self: ^String, index: UInteger) -> unichar {
String_characterAtIndex :: proc "c" (self: ^String, index: UInteger) -> unichar {
return msgSend(unichar, self, "characterAtIndex:", index)
}
@(objc_type=String, objc_name="length")
String_length :: proc(self: ^String) -> UInteger {
String_length :: proc "c" (self: ^String) -> UInteger {
return msgSend(UInteger, self, "length")
}
@(objc_type=String, objc_name="cstringUsingEncoding")
String_cstringUsingEncoding :: proc(self: ^String, encoding: StringEncoding) -> cstring {
String_cstringUsingEncoding :: proc "c" (self: ^String, encoding: StringEncoding) -> cstring {
return msgSend(cstring, self, "cStringUsingEncoding:", encoding)
}
@(objc_type=String, objc_name="UTF8String")
String_UTF8String :: proc(self: ^String) -> cstring {
String_UTF8String :: proc "c" (self: ^String) -> cstring {
return msgSend(cstring, self, "UTF8String")
}
@(objc_type=String, objc_name="odinString")
String_odinString :: proc(self: ^String) -> string {
String_odinString :: proc "c" (self: ^String) -> string {
return string(String_UTF8String(self))
}
@(objc_type=String, objc_name="maximumLengthOfBytesUsingEncoding")
String_maximumLengthOfBytesUsingEncoding :: proc(self: ^String, encoding: StringEncoding) -> UInteger {
String_maximumLengthOfBytesUsingEncoding :: proc "c" (self: ^String, encoding: StringEncoding) -> UInteger {
return msgSend(UInteger, self, "maximumLengthOfBytesUsingEncoding:", encoding)
}
@(objc_type=String, objc_name="lengthOfBytesUsingEncoding")
String_lengthOfBytesUsingEncoding :: proc(self: ^String, encoding: StringEncoding) -> UInteger {
String_lengthOfBytesUsingEncoding :: proc "c" (self: ^String, encoding: StringEncoding) -> UInteger {
return msgSend(UInteger, self, "lengthOfBytesUsingEncoding:", encoding)
}
@(objc_type=String, objc_name="isEqualToString")
String_isEqualToString :: proc(self, other: ^String) -> BOOL {
String_isEqualToString :: proc "c" (self, other: ^String) -> BOOL {
return msgSend(BOOL, self, "isEqualToString:", other)
}
@(objc_type=String, objc_name="rangeOfString")
String_rangeOfString :: proc(self, other: ^String, options: StringCompareOptions) -> Range {
String_rangeOfString :: proc "c" (self, other: ^String, options: StringCompareOptions) -> Range {
return msgSend(Range, self, "rangeOfString:options:", other, options)
}

View File

@@ -5,26 +5,26 @@ URL :: struct{using _: Copying(URL)}
@(objc_type=URL, objc_name="alloc", objc_is_class_method=true)
URL_alloc :: proc() -> ^URL {
URL_alloc :: proc "c" () -> ^URL {
return msgSend(^URL, URL, "alloc")
}
@(objc_type=URL, objc_name="init")
URL_init :: proc(self: ^URL) -> ^URL {
URL_init :: proc "c" (self: ^URL) -> ^URL {
return msgSend(^URL, self, "init")
}
@(objc_type=URL, objc_name="initWithString")
URL_initWithString :: proc(self: ^URL, value: ^String) -> ^URL {
URL_initWithString :: proc "c" (self: ^URL, value: ^String) -> ^URL {
return msgSend(^URL, self, "initWithString:", value)
}
@(objc_type=URL, objc_name="initFileURLWithPath")
URL_initFileURLWithPath :: proc(self: ^URL, path: ^String) -> ^URL {
URL_initFileURLWithPath :: proc "c" (self: ^URL, path: ^String) -> ^URL {
return msgSend(^URL, self, "initFileURLWithPath:", path)
}
@(objc_type=URL, objc_name="fileSystemRepresentation")
URL_fileSystemRepresentation :: proc(self: ^URL) -> cstring {
URL_fileSystemRepresentation :: proc "c" (self: ^URL) -> cstring {
return msgSend(cstring, self, "fileSystemRepresentation")
}

View File

@@ -4,11 +4,11 @@ package objc_Foundation
UserDefaults :: struct { using _: Object }
@(objc_type=UserDefaults, objc_name="standardUserDefaults", objc_is_class_method=true)
UserDefaults_standardUserDefaults :: proc() -> ^UserDefaults {
UserDefaults_standardUserDefaults :: proc "c" () -> ^UserDefaults {
return msgSend(^UserDefaults, UserDefaults, "standardUserDefaults")
}
@(objc_type=UserDefaults, objc_name="setBoolForKey")
UserDefaults_setBoolForKey :: proc(self: ^UserDefaults, value: BOOL, name: ^String) {
UserDefaults_setBoolForKey :: proc "c" (self: ^UserDefaults, value: BOOL, name: ^String) {
msgSend(nil, self, "setBool:forKey:", value, name)
}

View File

@@ -53,75 +53,75 @@ BackingStoreType :: enum NS.UInteger {
WindowDelegateTemplate :: struct {
// Managing Sheets
windowWillPositionSheetUsingRect: proc(window: ^Window, sheet: ^Window, rect: Rect) -> Rect,
windowWillBeginSheet: proc(notification: ^Notification),
windowDidEndSheet: proc(notification: ^Notification),
windowWillPositionSheetUsingRect: proc(window: ^Window, sheet: ^Window, rect: Rect) -> Rect,
windowWillBeginSheet: proc(notification: ^Notification),
windowDidEndSheet: proc(notification: ^Notification),
// Sizing Windows
windowWillResizeToSize: proc(sender: ^Window, frameSize: Size) -> Size,
windowDidResize: proc(notification: ^Notification),
windowWillStartLiveResize: proc(noitifcation: ^Notification),
windowDidEndLiveResize: proc(notification: ^Notification),
windowWillResizeToSize: proc(sender: ^Window, frameSize: Size) -> Size,
windowDidResize: proc(notification: ^Notification),
windowWillStartLiveResize: proc(noitifcation: ^Notification),
windowDidEndLiveResize: proc(notification: ^Notification),
// Minimizing Windows
windowWillMiniaturize: proc(notification: ^Notification),
windowDidMiniaturize: proc(notification: ^Notification),
windowDidDeminiaturize: proc(notification: ^Notification),
windowWillMiniaturize: proc(notification: ^Notification),
windowDidMiniaturize: proc(notification: ^Notification),
windowDidDeminiaturize: proc(notification: ^Notification),
// Zooming window
windowWillUseStandardFrameDefaultFrame: proc(window: ^Window, newFrame: Rect) -> Rect,
windowShouldZoomToFrame: proc(window: ^Window, newFrame: Rect) -> BOOL,
windowWillUseStandardFrameDefaultFrame: proc(window: ^Window, newFrame: Rect) -> Rect,
windowShouldZoomToFrame: proc(window: ^Window, newFrame: Rect) -> BOOL,
// Managing Full-Screen Presentation
windowWillUseFullScreenContentSize: proc(window: ^Window, proposedSize: Size) -> Size,
windowWillUseFullScreenPresentationOptions: proc(window: ^Window, proposedOptions: ApplicationPresentationOptions) -> ApplicationPresentationOptions,
windowWillEnterFullScreen: proc(notification: ^Notification),
windowDidEnterFullScreen: proc(notification: ^Notification),
windowWillExitFullScreen: proc(notification: ^Notification),
windowDidExitFullScreen: proc(notification: ^Notification),
windowWillUseFullScreenContentSize: proc(window: ^Window, proposedSize: Size) -> Size,
windowWillUseFullScreenPresentationOptions: proc(window: ^Window, proposedOptions: ApplicationPresentationOptions) -> ApplicationPresentationOptions,
windowWillEnterFullScreen: proc(notification: ^Notification),
windowDidEnterFullScreen: proc(notification: ^Notification),
windowWillExitFullScreen: proc(notification: ^Notification),
windowDidExitFullScreen: proc(notification: ^Notification),
// Custom Full-Screen Presentation Animations
customWindowsToEnterFullScreenForWindow: proc(window: ^Window) -> ^Array,
customWindowsToEnterFullScreenForWindowOnScreen: proc(window: ^Window, screen: ^Screen) -> ^Array,
windowStartCustomAnimationToEnterFullScreenWithDuration: proc(window: ^Window, duration: TimeInterval),
windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration: proc(window: ^Window, screen: ^Screen, duration: TimeInterval),
windowDidFailToEnterFullScreen: proc(window: ^Window),
customWindowsToExitFullScreenForWindow: proc(window: ^Window) -> ^Array,
windowStartCustomAnimationToExitFullScreenWithDuration: proc(window: ^Window, duration: TimeInterval),
windowDidFailToExitFullScreen: proc(window: ^Window),
customWindowsToEnterFullScreenForWindow: proc(window: ^Window) -> ^Array,
customWindowsToEnterFullScreenForWindowOnScreen: proc(window: ^Window, screen: ^Screen) -> ^Array,
windowStartCustomAnimationToEnterFullScreenWithDuration: proc(window: ^Window, duration: TimeInterval),
windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration: proc(window: ^Window, screen: ^Screen, duration: TimeInterval),
windowDidFailToEnterFullScreen: proc(window: ^Window),
customWindowsToExitFullScreenForWindow: proc(window: ^Window) -> ^Array,
windowStartCustomAnimationToExitFullScreenWithDuration: proc(window: ^Window, duration: TimeInterval),
windowDidFailToExitFullScreen: proc(window: ^Window),
// Moving Windows
windowWillMove: proc(notification: ^Notification),
windowDidMove: proc(notification: ^Notification),
windowDidChangeScreen: proc(notification: ^Notification),
windowDidChangeScreenProfile: proc(notification: ^Notification),
windowDidChangeBackingProperties: proc(notification: ^Notification),
windowWillMove: proc(notification: ^Notification),
windowDidMove: proc(notification: ^Notification),
windowDidChangeScreen: proc(notification: ^Notification),
windowDidChangeScreenProfile: proc(notification: ^Notification),
windowDidChangeBackingProperties: proc(notification: ^Notification),
// Closing Windows
windowShouldClose: proc(sender: ^Window) -> BOOL,
windowWillClose: proc(notification: ^Notification),
windowShouldClose: proc(sender: ^Window) -> BOOL,
windowWillClose: proc(notification: ^Notification),
// Managing Key Status
windowDidBecomeKey: proc(notification: ^Notification),
windowDidResignKey: proc(notification: ^Notification),
windowDidBecomeKey: proc(notification: ^Notification),
windowDidResignKey: proc(notification: ^Notification),
// Managing Main Status
windowDidBecomeMain: proc(notification: ^Notification),
windowDidResignMain: proc(notification: ^Notification),
windowDidBecomeMain: proc(notification: ^Notification),
windowDidResignMain: proc(notification: ^Notification),
// Managing Field Editors
windowWillReturnFieldEditorToObject: proc(sender: ^Window, client: id) -> id,
windowWillReturnFieldEditorToObject: proc(sender: ^Window, client: id) -> id,
// Updating Windows
windowDidUpdate: proc (notification: ^Notification),
windowDidUpdate: proc (notification: ^Notification),
// Exposing Windows
windowDidExpose: proc (notification: ^Notification),
windowDidExpose: proc (notification: ^Notification),
// Managing Occlusion State
windowDidChangeOcclusionState: proc(notification: ^Notification),
windowDidChangeOcclusionState: proc(notification: ^Notification),
// Dragging Windows
windowShouldDragDocumentWithEventFromWithPasteboard: proc(window: ^Window, event: ^Event, dragImageLocation: Point, pasteboard: ^Pasteboard) -> BOOL,
windowShouldDragDocumentWithEventFromWithPasteboard: proc(window: ^Window, event: ^Event, dragImageLocation: Point, pasteboard: ^Pasteboard) -> BOOL,
// Getting the Undo Manager
windowWillReturnUndoManager: proc(window: ^Window) -> ^UndoManager,
windowWillReturnUndoManager: proc(window: ^Window) -> ^UndoManager,
// Managing Titles
windowShouldPopUpDocumentPathMenu: proc(window: ^Window, menu: ^Menu) -> BOOL,
windowShouldPopUpDocumentPathMenu: proc(window: ^Window, menu: ^Menu) -> BOOL,
// Managing Restorable State
windowWillEncodeRestorableState: proc(window: ^Window, state: ^Coder),
windowDidEncodeRestorableState: proc(window: ^Window, state: ^Coder),
windowWillEncodeRestorableState: proc(window: ^Window, state: ^Coder),
windowDidEncodeRestorableState: proc(window: ^Window, state: ^Coder),
// Managing Presentation in Version Browsers
windowWillResizeForVersionBrowserWithMaxPreferredSizeMaxAllowedSize: proc(window: ^Window, maxPreferredFrameSize: Size, maxAllowedFrameSize: Size) -> Size,
windowWillEnterVersionBrowser: proc(notification: ^Notification),
windowDidEnterVersionBrowser: proc(notification: ^Notification),
windowWillExitVersionBrowser: proc(notification: ^Notification),
windowDidExitVersionBrowser: proc(notification: ^Notification),
windowWillEnterVersionBrowser: proc(notification: ^Notification),
windowDidEnterVersionBrowser: proc(notification: ^Notification),
windowWillExitVersionBrowser: proc(notification: ^Notification),
windowDidExitVersionBrowser: proc(notification: ^Notification),
}
WindowDelegate :: struct { using _: Object }
@@ -562,19 +562,19 @@ Color :: struct {using _: Object}
Layer :: struct { using _: NS.Object }
@(objc_type=Layer, objc_name="contentsScale")
Layer_contentsScale :: proc(self: ^Layer) -> Float {
Layer_contentsScale :: proc "c" (self: ^Layer) -> Float {
return msgSend(Float, self, "contentsScale")
}
@(objc_type=Layer, objc_name="setContentsScale")
Layer_setContentsScale :: proc(self: ^Layer, scale: Float) {
Layer_setContentsScale :: proc "c" (self: ^Layer, scale: Float) {
msgSend(nil, self, "setContentsScale:", scale)
}
@(objc_type=Layer, objc_name="frame")
Layer_frame :: proc(self: ^Layer) -> Rect {
Layer_frame :: proc "c" (self: ^Layer) -> Rect {
return msgSend(Rect, self, "frame")
}
@(objc_type=Layer, objc_name="addSublayer")
Layer_addSublayer :: proc(self: ^Layer, layer: ^Layer) {
Layer_addSublayer :: proc "c" (self: ^Layer, layer: ^Layer) {
msgSend(nil, self, "addSublayer:", layer)
}
@@ -586,23 +586,23 @@ View :: struct {using _: Responder}
@(objc_type=View, objc_name="initWithFrame")
View_initWithFrame :: proc(self: ^View, frame: Rect) -> ^View {
View_initWithFrame :: proc "c" (self: ^View, frame: Rect) -> ^View {
return msgSend(^View, self, "initWithFrame:", frame)
}
@(objc_type=View, objc_name="layer")
View_layer :: proc(self: ^View) -> ^Layer {
View_layer :: proc "c" (self: ^View) -> ^Layer {
return msgSend(^Layer, self, "layer")
}
@(objc_type=View, objc_name="setLayer")
View_setLayer :: proc(self: ^View, layer: ^Layer) {
View_setLayer :: proc "c" (self: ^View, layer: ^Layer) {
msgSend(nil, self, "setLayer:", layer)
}
@(objc_type=View, objc_name="wantsLayer")
View_wantsLayer :: proc(self: ^View) -> BOOL {
View_wantsLayer :: proc "c" (self: ^View) -> BOOL {
return msgSend(BOOL, self, "wantsLayer")
}
@(objc_type=View, objc_name="setWantsLayer")
View_setWantsLayer :: proc(self: ^View, wantsLayer: BOOL) {
View_setWantsLayer :: proc "c" (self: ^View, wantsLayer: BOOL) {
msgSend(nil, self, "setWantsLayer:", wantsLayer)
}
@@ -610,7 +610,7 @@ View_setWantsLayer :: proc(self: ^View, wantsLayer: BOOL) {
Window :: struct {using _: Responder}
@(objc_type=Window, objc_name="alloc", objc_is_class_method=true)
Window_alloc :: proc() -> ^Window {
Window_alloc :: proc "c" () -> ^Window {
return msgSend(^Window, Window, "alloc")
}
@@ -630,70 +630,70 @@ Window_initWithContentRect :: proc (self: ^Window, contentRect: Rect, styleMask:
return self
}
@(objc_type=Window, objc_name="contentView")
Window_contentView :: proc(self: ^Window) -> ^View {
Window_contentView :: proc "c" (self: ^Window) -> ^View {
return msgSend(^View, self, "contentView")
}
@(objc_type=Window, objc_name="setContentView")
Window_setContentView :: proc(self: ^Window, content_view: ^View) {
Window_setContentView :: proc "c" (self: ^Window, content_view: ^View) {
msgSend(nil, self, "setContentView:", content_view)
}
@(objc_type=Window, objc_name="contentLayoutRect")
Window_contentLayoutRect :: proc(self: ^Window) -> Rect {
Window_contentLayoutRect :: proc "c" (self: ^Window) -> Rect {
return msgSend(Rect, self, "contentLayoutRect")
}
@(objc_type=Window, objc_name="frame")
Window_frame :: proc(self: ^Window) -> Rect {
Window_frame :: proc "c" (self: ^Window) -> Rect {
return msgSend(Rect, self, "frame")
}
@(objc_type=Window, objc_name="setFrame")
Window_setFrame :: proc(self: ^Window, frame: Rect) {
Window_setFrame :: proc "c" (self: ^Window, frame: Rect) {
msgSend(nil, self, "setFrame:", frame)
}
@(objc_type=Window, objc_name="opaque")
Window_opaque :: proc(self: ^Window) -> NS.BOOL {
Window_opaque :: proc "c" (self: ^Window) -> NS.BOOL {
return msgSend(NS.BOOL, self, "opaque")
}
@(objc_type=Window, objc_name="setOpaque")
Window_setOpaque :: proc(self: ^Window, ok: NS.BOOL) {
Window_setOpaque :: proc "c" (self: ^Window, ok: NS.BOOL) {
msgSend(nil, self, "setOpaque:", ok)
}
@(objc_type=Window, objc_name="backgroundColor")
Window_backgroundColor :: proc(self: ^Window) -> ^NS.Color {
Window_backgroundColor :: proc "c" (self: ^Window) -> ^NS.Color {
return msgSend(^NS.Color, self, "backgroundColor")
}
@(objc_type=Window, objc_name="setBackgroundColor")
Window_setBackgroundColor :: proc(self: ^Window, color: ^NS.Color) {
Window_setBackgroundColor :: proc "c" (self: ^Window, color: ^NS.Color) {
msgSend(nil, self, "setBackgroundColor:", color)
}
@(objc_type=Window, objc_name="makeKeyAndOrderFront")
Window_makeKeyAndOrderFront :: proc(self: ^Window, key: ^NS.Object) {
Window_makeKeyAndOrderFront :: proc "c" (self: ^Window, key: ^NS.Object) {
msgSend(nil, self, "makeKeyAndOrderFront:", key)
}
@(objc_type=Window, objc_name="setTitle")
Window_setTitle :: proc(self: ^Window, title: ^NS.String) {
Window_setTitle :: proc "c" (self: ^Window, title: ^NS.String) {
msgSend(nil, self, "setTitle:", title)
}
@(objc_type=Window, objc_name="setTitlebarAppearsTransparent")
Window_setTitlebarAppearsTransparent :: proc(self: ^Window, ok: NS.BOOL) {
Window_setTitlebarAppearsTransparent :: proc "c" (self: ^Window, ok: NS.BOOL) {
msgSend(nil, self, "setTitlebarAppearsTransparent:", ok)
}
@(objc_type=Window, objc_name="setMovable")
Window_setMovable :: proc(self: ^Window, ok: NS.BOOL) {
Window_setMovable :: proc "c" (self: ^Window, ok: NS.BOOL) {
msgSend(nil, self, "setMovable:", ok)
}
@(objc_type=Window, objc_name="setMovableByWindowBackground")
Window_setMovableByWindowBackground :: proc(self: ^Window, ok: NS.BOOL) {
Window_setMovableByWindowBackground :: proc "c" (self: ^Window, ok: NS.BOOL) {
msgSend(nil, self, "setMovableByWindowBackground:", ok)
}
@(objc_type=Window, objc_name="setStyleMask")
Window_setStyleMask :: proc(self: ^Window, style_mask: WindowStyleMask) {
Window_setStyleMask :: proc "c" (self: ^Window, style_mask: WindowStyleMask) {
msgSend(nil, self, "setStyleMask:", style_mask)
}
@(objc_type=Window, objc_name="close")
Window_close :: proc(self: ^Window) {
Window_close :: proc "c" (self: ^Window) {
msgSend(nil, self, "close")
}
@(objc_type=Window, objc_name="setDelegate")
Window_setDelegate :: proc(self: ^Window, delegate: ^WindowDelegate) {
Window_setDelegate :: proc "c" (self: ^Window, delegate: ^WindowDelegate) {
msgSend(nil, self, "setDelegate:", delegate)
}

View File

@@ -13,12 +13,12 @@ foreign Foundation {
objc_allocateClassPair :: proc "c" (superclass : Class, name : cstring, extraBytes : c.size_t) -> Class ---
objc_registerClassPair :: proc "c" (cls : Class) ---
class_addMethod :: proc "c" (cls: Class, name: SEL, imp: IMP, types: cstring) -> BOOL ---
class_addMethod :: proc "c" (cls: Class, name: SEL, imp: IMP, types: cstring) -> BOOL ---
class_getInstanceMethod :: proc "c" (cls: Class, name: SEL) -> Method ---
class_createInstance :: proc "c" (cls: Class, extraBytes: c.size_t) -> id ---
class_createInstance :: proc "c" (cls: Class, extraBytes: c.size_t) -> id ---
method_setImplementation :: proc "c" (method: Method, imp: IMP) ---
object_getIndexedIvars :: proc(obj: id) -> rawptr ---
object_getIndexedIvars :: proc(obj: id) -> rawptr ---
}