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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
//! Shared datatypes for azul-* crates
//!
//! `azul-core` provides the platform-independent core types used throughout
//! the Azul toolkit. Key modules include [`dom`] for DOM construction,
//! [`callbacks`] for event callback types, [`styled_dom`] for the CSSOM,
//! and [`window`] for OS windowing abstractions.
//!
//! This crate depends on [`azul_css`] for CSS property definitions and is
//! consumed by `azul-layout`, `azul-dll`, and the platform shell crates.
//! It supports `no_std` environments via `#![cfg_attr(not(feature = "std"), no_std)]`.
// Lint policy: deny correctness/safety issues, warn on style
// `extern crate` + `#[macro_use]` required for `no_std` support:
// makes `core` and `alloc` macros available without `use` imports.
extern crate core;
extern crate alloc;
extern crate azul_css;
/// Internal macros for `Vec`, `Option`, and callback boilerplate.
/// Debug logging system with category filtering.
/// SQL database POD types — `DbValue` + `DbRows` (engine-agnostic). The
/// `Db` handle + SQLite engine live in `azul_dll` behind `db-sqlite`.
/// Unified `AZ_PROFILE` gate for memory and CPU profiling instrumentation.
/// Callback types: layout, event, timer, thread, and focus handling.
/// Host-language callback invoker registry — the C-ABI surface managed-FFI
/// bindings (Lua, Ruby, …) use to register one per-kind invoker + a single
/// shared releaser, so callbacks can be created via `_createFromHostHandle`
/// without the host having to generate trampolines for struct-by-value
/// signatures their FFI library can't handle.
/// Accessibility types for screen-reader integration (AccessKit).
/// DOM construction: `Dom`, `NodeData`, `NodeType`, and the CSS-in-Rust API.
/// Drag context for text selection, scrollbar, node, and window drags.
/// Icon provider system for loading icons from fonts, images, or zip packs.
/// Resource management: font/image loading, caching, and garbage collection.
/// Text selection and cursor positioning for inline content.
/// Motion-sensor POD types — `SensorKind` + `SensorReading`.
/// Stateful manager lives in `azul_layout::managers::sensors`.
/// Linear-time DOM diffing for incremental updates.
/// CSS animation and transition configuration.
/// Event filtering: mouse, keyboard, window, and synthetic events.
/// Biometric-auth POD types — `BiometricKind` + `BiometricResult` + `BiometricPrompt`.
/// Stateful manager lives in `azul_layout::managers::biometric`.
/// Geolocation POD types — `LocationFix` + `GeolocationProbeConfig`.
/// Stateful manager lives in `azul_layout::managers::geolocation`.
/// Gamepad POD types — `GamepadId` + `GamepadButton` + `GamepadAxis` +
/// `GamepadState`. Stateful manager lives in `azul_layout::managers::gamepad`.
/// Camera-capture POD types — `CaptureStreamId` + `CameraConfig` +
/// `CameraFacing` + `StreamState` + … . The stateful `CameraStream` /
/// `CameraManager` (which own the shared `ImageRef` texture) live in
/// `azul_layout::managers::camera`.
/// Screen-capture POD types — `ScreenCaptureSource` + `ScreenCaptureConfig`.
/// Symmetric to the camera surface (a "dumb widget" in
/// `azul_layout::widgets::screencap`); reuses `camera`'s capture status types.
/// Video-playback POD types — `VideoConfig` (source URL + autoplay/loop).
/// Same "dumb widget" architecture (`azul_layout::widgets::video`); decoded
/// via vk-video into the shared GL texture.
/// Audio POD types — `AudioConfig` (stream format) + `AudioFrame` (interleaved
/// f32 samples). The unit captured from the mic, played back, and (P8) shared
/// over UDP. Backend (rodio / cpal / AVAudioEngine / AAudio) lives dll-side.
/// UDP chunked-message framing (P8): split a >MTU payload into sequenced
/// datagrams + reassemble them, tolerating reorder + loss. Pure logic the
/// dll's `Udp` handle builds on; unit-tested here. See `udp_framing.rs`.
/// Logical and physical coordinate types (`LogicalSize`, `PhysicalPosition`, etc.).
/// OpenGL context wrappers, shader compilation, and texture cache.
/// FXAA (Fast Approximate Anti-Aliasing) shader.
/// OpenGL constants (GL 1.1 through GL 4.x).
/// GPU value cache for CSS transforms and opacity.
/// Hit-test results: which DOM nodes are under the cursor.
/// Type-safe hit-test tag system for compositor integration.
/// Arena-based node tree storage and hierarchy management.
/// System-keyring POD types — `KeyringRequest` + `KeyringResult`.
/// Stateful manager lives in `azul_layout::managers::keyring`.
/// Menu system: context menus, dropdown menus, and menu bars.
/// CSS property cache for efficient per-node style resolution.
/// Converts `CssPropertyCache` into compact three-tier numeric cache.
/// Type-erased, ref-counted smart pointer with runtime borrow checking.
/// CSS cascade: selector matching, specificity, and property inheritance.
/// `StyledDom` — the result of applying CSS to a DOM tree (the CSSOM).
/// SVG rendering, path tessellation, and geometric operations.
/// SVG `d=""` path data parser.
/// Timer, thread, and async task management.
/// 3D transform matrix computation for CSS transforms.
/// Built-in user-agent default stylesheet.
/// Default font/text constants and small geometry helpers for layout.
/// Window configuration, input state, and platform-specific options.
/// XML and XHTML parsing for declarative UI definitions.
/// JSON value types for the C API (no serde dependency).
/// Ordered map alias used throughout `azul-core`.
///
/// This is backed by `BTreeMap` (not a hash map) because the `core` crate
/// supports `no_std`, where `HashMap` is unavailable. The webrender crates
/// define their own `FastHashMap` using `HashMap` + `FxHasher`.
pub type OrderedMap<T, U> = BTreeMap;
pub type FastBTreeSet<T> = BTreeSet;