Scoop API

scoop:scoop.window:0.1.0

src/identity.scoop

Selected production source · src/identity.scoop

1package scoop.window
3/** A library-assigned window identity, never reused by its application. */
4public struct WindowId(val value: Long) : Equals<WindowId>, Hash {
5 public override operator fun equals(other: WindowId): Boolean = value == other.value
6 public override fun hash(): Long = value.hash()
7}
9/** A known input-device identity; events use None when the platform cannot identify it. */
10public struct DeviceId(val value: Long) : Equals<DeviceId>, Hash {
11 public override operator fun equals(other: DeviceId): Boolean = value == other.value
12 public override fun hash(): Long = value.hash()
15/** The implemented window-system backend. */
16public enum WindowBackend {
17 AppKit, Win32, X11, Wayland, UIKit
20/** Whether an operation was observed, requested, or has no platform implementation. */
21public enum RequestStatus {
22 Applied, Requested, Unsupported
25/** Platform failures, separate from invalid arguments. */
26public enum WindowErrorKind {
27 Unsupported, Unavailable, PermissionDenied, InvalidState, ResourceBusy, Disconnected, NativeFailure
30/** A window-system failure retaining the operation and optional platform status. */
31public 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? = None
36) : Exception(Some("window operation failed: " + operation)) {
37 public val backend: WindowBackend = platformBackend()
40/** Explicit window lifetime; garbage collection does not destroy native windows. */
41public enum WindowState {
42 PendingConfigure, Open, Closing, Destroyed
45/** A platform appearance, when known. */
46public enum Theme {
47 Light, Dark