1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// devela::ui::event::id
//
//! Defines [`DeviceId`], [`WindowId`].
//
use crateEventTarget;
crate_impl_init!;
/// A backend-agnostic identifier for a UI window.
///
/// Backends (X11, Wayland, Win32, macOS, terminal, web…) map their native
/// window or surface handles into a compact, stable `WindowId`.
///
/// This decouples the UI event system from backend-specific handle types
/// (`xcb_window_t`, `HWND`, `NSWindow*`, browser document, terminal view…).
///
/// Events originating from these sources use [`EventTarget`]`::Window(WindowId)`.
///
/// The value is treated as an opaque token. It is not an index into user
/// data structures, and it has no arithmetic meaning.
;
/// A backend-agnostic identifier for an input device.
///
/// Backends map native device handles (libinput device, MIDI port, gamepad,
/// tablet, virtual input stream…) into a stable `DeviceId`.
///
/// Events originating from these sources use [`EventTarget`]`::Device(DeviceId)`.
///
/// The value is treated as an opaque token. It is not an index into user
/// data structures, and it has no arithmetic meaning.
;
// /// Maps backend-native window handles to stable [`WindowId`]s.
// pub type WindowRegistry<const MAX: usize> = IdRegistry<WindowId, MAX>;
// /// Maps backend-native window handles to stable [`DeviceId`]s.
// pub type DeviceRegistry<const MAX: usize> = IdRegistry<DeviceId, MAX>;