mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 00:28:49 +00:00
Update vendor:darwin/Foundation to implement Event, Color, Screen, and other fixes
This commit is contained in:
+32
-1
@@ -1,9 +1,22 @@
|
||||
package objc_Foundation
|
||||
|
||||
foreign import "system:Foundation.framework"
|
||||
|
||||
import "core:intrinsics"
|
||||
import "core:runtime"
|
||||
import "core:strings"
|
||||
|
||||
RunLoopMode :: ^String
|
||||
|
||||
@(link_prefix="NS")
|
||||
foreign Foundation {
|
||||
CommonRunLoopMode: RunLoopMode
|
||||
DefaultRunLoopMode: RunLoopMode
|
||||
EventTrackingRunLoopMode: RunLoopMode
|
||||
ModalPanelRunLoopMode: RunLoopMode
|
||||
TrackingRunLoopMode: RunLoopMode
|
||||
}
|
||||
|
||||
ActivationPolicy :: enum UInteger {
|
||||
Regular = 0,
|
||||
Accessory = 1,
|
||||
@@ -87,12 +100,30 @@ Application_run :: proc "c" (self: ^Application) {
|
||||
msgSend(nil, self, "run")
|
||||
}
|
||||
|
||||
|
||||
@(objc_type=Application, objc_name="terminate")
|
||||
Application_terminate :: proc "c" (self: ^Application, sender: ^Object) {
|
||||
msgSend(nil, self, "terminate:", sender)
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="isRunning")
|
||||
Application_isRunning :: proc "c" (self: ^Application) -> BOOL {
|
||||
return msgSend(BOOL, self, "isRunning")
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="currentEvent")
|
||||
Application_currentEvent :: proc "c" (self: ^Application) -> ^Event {
|
||||
return msgSend(^Event, self, "currentEvent")
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="nextEventMatchingMask")
|
||||
Application_nextEventMatchingMask :: proc "c" (self: ^Application, mask: EventMask, expiration: ^Date, in_mode: RunLoopMode, dequeue: BOOL) -> ^Event {
|
||||
return msgSend(^Event, self, "nextEventMatchingMask:untilDate:inMode:dequeue:", mask, expiration, in_mode, dequeue)
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="sendEvent")
|
||||
Application_sendEvent :: proc "c" (self: ^Application, event: ^Event) {
|
||||
msgSend(Event, self, "sendEvent:", event)
|
||||
}
|
||||
|
||||
|
||||
@(objc_class="NSRunningApplication")
|
||||
|
||||
Reference in New Issue
Block a user