scoop:scoop.window:0.1.0
src/identity.scoop
Selected production source · src/identity.scoop
1
package scoop.window3
/** A library-assigned window identity, never reused by its application. */4
public struct WindowId(val value: Long) : Equals<WindowId>, Hash {5
public override operator fun equals(other: WindowId): Boolean = value == other.value6
public override fun hash(): Long = value.hash()7
}9
/** A known input-device identity; events use None when the platform cannot identify it. */10
public struct DeviceId(val value: Long) : Equals<DeviceId>, Hash {11
public override operator fun equals(other: DeviceId): Boolean = value == other.value12
public override fun hash(): Long = value.hash()13
}15
/** The implemented window-system backend. */16
public enum WindowBackend {17
AppKit, Win32, X11, Wayland, UIKit18
}20
/** Whether an operation was observed, requested, or has no platform implementation. */21
public enum RequestStatus {22
Applied, Requested, Unsupported23
}25
/** Platform failures, separate from invalid arguments. */26
public enum WindowErrorKind {27
Unsupported, Unavailable, PermissionDenied, InvalidState, ResourceBusy, Disconnected, NativeFailure28
}30
/** A window-system failure retaining the operation and optional platform status. */31
public class WindowException public constructor(32
public val operation: String,33
public val kind: WindowErrorKind,34
public val nativeCode: Long? = None,35
public val nativeDomain: String? = None36
) : Exception(Some("window operation failed: " + operation)) {37
public val backend: WindowBackend = platformBackend()38
}40
/** Explicit window lifetime; garbage collection does not destroy native windows. */41
public enum WindowState {42
PendingConfigure, Open, Closing, Destroyed43
}45
/** A platform appearance, when known. */46
public enum Theme {47
Light, Dark48
}