Scoop API

scoop:scoop.window:0.1.0

platform/darwin/watch.scoop

Selected production source · platform/darwin/watch.scoop

1package scoop.window.native
3import scoop.window.*
5@Unsafe
6internal fun installReadableWatch(
7 owner: ApplicationOwner,
8 descriptor: Int,
9 ready: () -> Unit
10): ApplicationWatch =
11 owner.registerWatch(
12 fun(identity: Long): NativeWatchResult {
13 @Unsafe
14 {
15 val(pointer, error) = nativeWatchCreate(owner.native!!, identity, descriptor)
16 return NativeWatchResult(pointer, error.toLong())
17 }
18 },
19 ready
20 )
22@Unsafe
23internal fun installWindowsWatch(
24 owner: ApplicationOwner,
25 event: Ptr<Unit>,
26 ready: () -> Unit
27): ApplicationWatch {
28 throw IllegalArgumentException(Some("AppKit requires a readable descriptor"))
31@Extern(name = "scoop_window_watch_create", captureErrno = true)
32private fun nativeWatchCreate(application: Ptr<Unit>, identity: Long, descriptor: Int): (
33 Ptr<Unit>?,
34 Int