euv_example/state/struct.rs
1use super::*;
2
3/// Decoded Media Studio sample assets assembled off the UI critical path and committed atomically.
4#[derive(Clone, Getter)]
5pub struct MediaSampleBundle {
6 /// Decoded LZW GIF89a animation sample.
7 pub(crate) gif: GifAnimation,
8 /// Sample LIVE Photo motion asset.
9 pub(crate) live: LivePhotoAsset,
10 /// Decoded ISOBMFF MP4 HDR video track.
11 pub(crate) video: VideoTrack,
12 /// Synthesized WAV audio waveform track.
13 pub(crate) audio: AudioTrack,
14 /// Multi-page native PDF sample document.
15 pub(crate) pdf: PdfDocument,
16}
17
18/// Pre-built `.wasm` OTA registry entry `(url, bytes, etag, fault)` generated off the UI critical path.
19#[derive(Clone, Getter)]
20pub struct WasmRegistryEntry {
21 /// Target CDN bundle URL.
22 pub(crate) url: String,
23 /// Encoded WebAssembly module bytes.
24 pub(crate) bytes: Vec<u8>,
25 /// Cache ETag token for conditional fetches.
26 pub(crate) etag: String,
27 /// Fault injection mode exercised by the registry fetcher.
28 #[get(type(copy))]
29 pub(crate) fault: WasmFaultKind,
30}
31
32/// Collection of pre-built `.wasm` OTA registry payloads generated off the UI critical path.
33#[derive(Clone, Getter)]
34pub struct WasmSampleBundle {
35 /// Ordered list of registry entries ready to register on the UI thread.
36 pub(crate) entries: Vec<WasmRegistryEntry>,
37}
38
39/// Lazily initialized signals powering the `/reactive` showcase page.
40#[derive(Clone, Copy, Getter)]
41pub struct ReactiveSignals {
42 /// Interactive counter signal for fine-grained reactivity demos.
43 #[get(type(copy))]
44 pub(crate) counter: Signal<i32>,
45 /// Derived memo computing `counter * 2` without redundant notifications.
46 #[get(type(copy))]
47 pub(crate) doubled: Memo<i32>,
48}
49
50/// Lazily initialized signals powering the `/render` and `/window` showcase pages.
51#[derive(Clone, Copy, Getter)]
52pub struct RenderWindowSignals {
53 /// Active component-scoped demo render pipeline preview index (`0 = Auto`, `1 = Software`, `2 = Hardware`, `3 = Hybrid`).
54 #[get(type(copy))]
55 pub(crate) render_mode_index: Signal<usize>,
56 /// Active component-scoped demo FPS cap index on `/window` (`0 = Native Uncapped` .. `6 = 360`).
57 #[get(type(copy))]
58 pub(crate) demo_fps_cap_index: Signal<usize>,
59 /// Controlled fullscreen window toggle state.
60 #[get(type(copy))]
61 pub(crate) fullscreen: Signal<bool>,
62 /// Live Dynamic Island / Live Activity active state.
63 #[get(type(copy))]
64 pub(crate) island_active: Signal<bool>,
65 /// Live Dynamic Island progress percentage (`0..=100`).
66 #[get(type(copy))]
67 pub(crate) island_progress: Signal<u8>,
68 /// Live Camera system permission status text.
69 #[get(type(copy))]
70 pub(crate) camera_perm_status: Signal<String>,
71 /// Live protocol registration and deep link telemetry text.
72 #[get(type(copy))]
73 pub(crate) protocol_status: Signal<String>,
74 /// Total accessibility live announcements emitted interactively.
75 #[get(type(copy))]
76 pub(crate) a11y_announcements: Signal<u32>,
77 /// Total haptic pulses emitted interactively.
78 #[get(type(copy))]
79 pub(crate) haptic_pulses: Signal<u32>,
80 /// Simulated target platform index for cross-platform Dynamic Island & permissions matrix (`0..7`).
81 #[get(type(copy))]
82 pub(crate) os_target_platform_idx: Signal<usize>,
83 /// Active Dynamic Island presentation mode index (`0..6`).
84 #[get(type(copy))]
85 pub(crate) island_mode_idx: Signal<usize>,
86 /// Live notification delivery stack displayed via `EuvSonner`.
87 #[get(type(copy))]
88 pub(crate) system_notifications: Signal<Vec<(String, String)>>,
89 /// Per-permission status map across all 14 `SystemPermission` categories.
90 #[get(type(copy))]
91 pub(crate) permission_statuses: Signal<Vec<PermissionStatus>>,
92}
93
94/// Lazily initialized signals powering the `/forms` showcase page.
95#[derive(Clone, Copy, Getter)]
96pub struct FormsSignals {
97 /// Controlled form text input value.
98 #[get(type(copy))]
99 pub(crate) username: Signal<String>,
100 /// Controlled multi-line textarea value.
101 #[get(type(copy))]
102 pub(crate) bio: Signal<String>,
103 /// Controlled numeric stepper value.
104 #[get(type(copy))]
105 pub(crate) stepper_value: Signal<i64>,
106 /// Controlled radio group selection index.
107 #[get(type(copy))]
108 pub(crate) radio_index: Signal<usize>,
109 /// Controlled continuous slider value.
110 #[get(type(copy))]
111 pub(crate) slider_value: Signal<f32>,
112 /// Controlled select dropdown index.
113 #[get(type(copy))]
114 pub(crate) select_index: Signal<usize>,
115 /// Controlled select dropdown open state.
116 #[get(type(copy))]
117 pub(crate) select_open: Signal<bool>,
118 /// Controlled star rating value.
119 #[get(type(copy))]
120 pub(crate) rating_value: Signal<usize>,
121 /// Controlled toggle pill pressed state.
122 #[get(type(copy))]
123 pub(crate) pin_toggled: Signal<bool>,
124 /// Controlled toggle switch for hardware acceleration preference.
125 #[get(type(copy))]
126 pub(crate) hardware_accel: Signal<bool>,
127 /// Controlled checkbox for terms acknowledgment.
128 #[get(type(copy))]
129 pub(crate) agree_terms: Signal<bool>,
130 /// Controlled tab bar index.
131 #[get(type(copy))]
132 pub(crate) active_tab: Signal<usize>,
133 /// Controlled pagination page number.
134 #[get(type(copy))]
135 pub(crate) page_index: Signal<usize>,
136 /// Controlled steps indicator active index.
137 #[get(type(copy))]
138 pub(crate) step_index: Signal<usize>,
139 /// Controlled accordion expanded item index.
140 #[get(type(copy))]
141 pub(crate) accordion_open: Signal<Option<usize>>,
142 /// Controlled accent color selection for `EuvColorPicker`.
143 #[get(type(copy))]
144 pub(crate) picker_color: Signal<Color>,
145 /// Controlled 24-hour `(hour, minute)` selection for `EuvTimePicker`.
146 #[get(type(copy))]
147 pub(crate) picker_time: Signal<(u8, u8)>,
148 /// Controlled dynamic tag list for `EuvTagInput`.
149 #[get(type(copy))]
150 pub(crate) tag_items: Signal<Vec<String>>,
151 /// Controlled selected node label for interactive `EuvTree`.
152 #[get(type(copy))]
153 pub(crate) tree_selected: Signal<Option<String>>,
154 /// Controlled active breadcrumb index for interactive `EuvBreadcrumb`.
155 #[get(type(copy))]
156 pub(crate) breadcrumb_active: Signal<usize>,
157}
158
159/// Lazily initialized signals powering the `/overlays` showcase page.
160#[derive(Clone, Copy, Getter)]
161pub struct OverlaysSignals {
162 /// Controlled modal visibility flag.
163 #[get(type(copy))]
164 pub(crate) modal_open: Signal<bool>,
165 /// Controlled drawer visibility flag.
166 #[get(type(copy))]
167 pub(crate) drawer_open: Signal<bool>,
168 /// Controlled bottom sheet visibility flag.
169 #[get(type(copy))]
170 pub(crate) sheet_open: Signal<bool>,
171 /// Controlled popover visibility flag.
172 #[get(type(copy))]
173 pub(crate) popover_open: Signal<bool>,
174 /// Controlled dropdown menu open flag.
175 #[get(type(copy))]
176 pub(crate) dropdown_open: Signal<bool>,
177 /// Controlled dropdown last selected index.
178 #[get(type(copy))]
179 pub(crate) dropdown_selected: Signal<Option<usize>>,
180 /// Controlled toast banner visibility flag.
181 #[get(type(copy))]
182 pub(crate) toast_visible: Signal<bool>,
183 /// Controlled corner notification visibility flag.
184 #[get(type(copy))]
185 pub(crate) notif_visible: Signal<bool>,
186 /// Controlled loading overlay active flag.
187 #[get(type(copy))]
188 pub(crate) loading_active: Signal<bool>,
189}
190
191/// Lazily initialized signals powering the `/data` virtualized list page.
192#[derive(Clone, Copy, Getter)]
193pub struct DataSignals {
194 /// Reactive vertical scroll offset driving the 10,000-row virtualized list.
195 #[get(type(copy))]
196 pub(crate) list_scroll_y: Signal<f32>,
197}
198
199/// Lazily initialized signals powering the `/game3d` PBR + BVH ray-tracing page.
200#[derive(Clone, Copy, Debug, Getter)]
201pub struct Engine3dSignals {
202 /// Shared mutable runtime 3D graphics/ray-tracing configuration adjusted live from UI controls.
203 #[get(type(copy))]
204 pub(crate) engine3d_quality: Signal<RenderQualityConfig>,
205 /// Reactive 3D quality preset index (`0=Low, 1=Medium, 2=High, 3=Ultra, 4=Cinematic`).
206 #[get(type(copy))]
207 pub(crate) engine3d_preset_idx: Signal<usize>,
208 /// Reactive 3D ray-tracing mode index (`0=Off, 1=Shadows, 2=Shadows+Refl, 3=Full GI`).
209 #[get(type(copy))]
210 pub(crate) engine3d_rt_idx: Signal<usize>,
211 /// Reactive 3D internal resolution scale percentage (`40.0..=125.0`).
212 #[get(type(copy))]
213 pub(crate) engine3d_res_scale: Signal<f32>,
214 /// Reactive 3D open-world time of day (`6.0..=23.0` hours).
215 #[get(type(copy))]
216 pub(crate) engine3d_time_of_day: Signal<f32>,
217 /// Pending live 3D model import request counter consumed on the next 3D tick.
218 #[get(type(copy))]
219 pub(crate) engine3d_import_queue: Signal<u64>,
220 /// Human-readable status of the most recent 3D model import.
221 #[get(type(copy))]
222 pub(crate) engine3d_import_status: Signal<String>,
223 /// Active 3D camera perspective mode (`0=Chase, 1=Hood, 2=Orbit, 3=Aerial`).
224 #[get(type(copy))]
225 pub(crate) engine3d_camera_mode: Signal<u8>,
226}
227
228/// Lazily initialized signals powering the `/dynamic` OTA & WASM showcase page.
229#[derive(Clone, Copy, Getter)]
230pub struct DynamicSignals {
231 /// Sibling counter preserved untouched during surgical component-level dynamic updates.
232 #[get(type(copy))]
233 pub(crate) sibling_counter: Signal<i32>,
234 /// Human-readable log of the most recent action dispatched from a dynamically updated control.
235 #[get(type(copy))]
236 pub(crate) dynamic_action_log: Signal<String>,
237 /// Simulated offline network mode toggle for verifying verified offline WASM cache hits.
238 #[get(type(copy))]
239 pub(crate) wasm_offline: Signal<bool>,
240 /// Live human-readable readout of the latest dynamic WASM download or fault verification case.
241 #[get(type(copy))]
242 pub(crate) wasm_fault_status: Signal<String>,
243 /// Active background worker handle building `.wasm` OTA fixtures off the UI thread.
244 #[get(type(copy))]
245 pub(crate) wasm_bg_task: Signal<Option<BackgroundTask<WasmSampleBundle>>>,
246}
247
248/// Lazily initialized signals powering the `/lab` UI & Edge Lab page.
249#[derive(Clone, Copy, Getter)]
250pub struct LabSignals {
251 /// Controlled shadcn `EuvAlertDialog` open state.
252 #[get(type(copy))]
253 pub(crate) alert_dialog_open: Signal<bool>,
254 /// Controlled shadcn `EuvAlertDialog` confirmed status.
255 #[get(type(copy))]
256 pub(crate) alert_dialog_confirmed: Signal<bool>,
257 /// Controlled shadcn `EuvCollapsible` expanded state.
258 #[get(type(copy))]
259 pub(crate) collapsible_open: Signal<bool>,
260 /// Controlled shadcn `EuvToggleGroup` active option index.
261 #[get(type(copy))]
262 pub(crate) toggle_group_index: Signal<usize>,
263 /// Controlled shadcn `EuvInputOtp` passcode string.
264 #[get(type(copy))]
265 pub(crate) otp_code: Signal<String>,
266 /// Controlled shadcn `EuvCommand` search filter text.
267 #[get(type(copy))]
268 pub(crate) command_query: Signal<String>,
269 /// Controlled shadcn `EuvCommand` selected action index.
270 #[get(type(copy))]
271 pub(crate) command_selected: Signal<Option<usize>>,
272 /// Controlled shadcn `EuvHoverCard` open flag.
273 #[get(type(copy))]
274 pub(crate) hover_card_open: Signal<bool>,
275 /// Controlled shadcn `EuvCalendar` selected day of month.
276 #[get(type(copy))]
277 pub(crate) calendar_day: Signal<u32>,
278 /// Controlled shadcn `EuvMenubar` active menu index.
279 #[get(type(copy))]
280 pub(crate) menubar_active: Signal<Option<usize>>,
281 /// Controlled shadcn `EuvCarousel` active slide index.
282 #[get(type(copy))]
283 pub(crate) carousel_index: Signal<usize>,
284 /// Controlled search query for `EuvCombobox` in the UI & Edge Lab.
285 #[get(type(copy))]
286 pub(crate) lab_combobox_query: Signal<String>,
287 /// Controlled selected index for `EuvCombobox`.
288 #[get(type(copy))]
289 pub(crate) lab_combobox_selected: Signal<usize>,
290 /// Controlled open flag for `EuvCombobox`.
291 #[get(type(copy))]
292 pub(crate) lab_combobox_open: Signal<bool>,
293 /// Controlled filter string for `EuvDataTable`.
294 #[get(type(copy))]
295 pub(crate) lab_table_filter: Signal<String>,
296 /// Controlled sort order for `EuvDataTable`.
297 #[get(type(copy))]
298 pub(crate) lab_table_sort_asc: Signal<bool>,
299 /// Controlled selected row index for `EuvDataTable`.
300 #[get(type(copy))]
301 pub(crate) lab_table_selected: Signal<Option<usize>>,
302 /// Controlled selected day for `EuvDatePicker`.
303 #[get(type(copy))]
304 pub(crate) lab_date_day: Signal<u32>,
305 /// Controlled open flag for `EuvDatePicker`.
306 #[get(type(copy))]
307 pub(crate) lab_date_open: Signal<bool>,
308 /// Controlled domain input value for `EuvInputGroup`.
309 #[get(type(copy))]
310 pub(crate) lab_input_group_val: Signal<String>,
311 /// Controlled selected index for `EuvNativeSelect`.
312 #[get(type(copy))]
313 pub(crate) lab_native_select_idx: Signal<usize>,
314 /// Controlled active dropdown index for `EuvNavigationMenu`.
315 #[get(type(copy))]
316 pub(crate) lab_nav_menu_active: Signal<Option<usize>>,
317 /// Controlled split ratio for `EuvResizable`.
318 #[get(type(copy))]
319 pub(crate) lab_split_ratio: Signal<f32>,
320 /// Toggle controlling whether the nested edge-case box blocks scroll penetration (`true`) or allows chaining (`false`).
321 #[get(type(copy))]
322 pub(crate) lab_block_scroll_chain: Signal<bool>,
323 /// Toggle controlling whether the nested edge-case box stops click event bubbling (`true`) or allows bubbling (`false`).
324 #[get(type(copy))]
325 pub(crate) lab_stop_click_bubble: Signal<bool>,
326 /// Counter tracking clicks received by the outer parent card in the event bubbling test.
327 #[get(type(copy))]
328 pub(crate) lab_parent_clicks: Signal<u32>,
329 /// Counter tracking clicks received by the inner button in the event bubbling test.
330 #[get(type(copy))]
331 pub(crate) lab_child_clicks: Signal<u32>,
332 /// Persistent counter proving live resize never destroys or resets page state.
333 #[get(type(copy))]
334 pub(crate) lab_resize_preserve_count: Signal<u32>,
335 /// Controlled direction mode toggle (`false=LTR, true=RTL`).
336 #[get(type(copy))]
337 pub(crate) lab_rtl_mode: Signal<bool>,
338}
339
340/// Lazily initialized signals powering the `/media` Media Studio page.
341#[derive(Clone, Copy, Getter)]
342pub struct MediaSignals {
343 /// Reactive animated GIF playback state for the Media Studio showcase.
344 #[get(type(copy))]
345 pub(crate) media_gif: Signal<GifAnimation>,
346 /// Reactive LIVE Photo motion state for the Media Studio showcase.
347 #[get(type(copy))]
348 pub(crate) media_live: Signal<LivePhotoAsset>,
349 /// Reactive cross-platform video track state for the Media Studio showcase.
350 #[get(type(copy))]
351 pub(crate) media_video: Signal<VideoTrack>,
352 /// Reactive WAV audio track and waveform state for the Media Studio showcase.
353 #[get(type(copy))]
354 pub(crate) media_audio: Signal<AudioTrack>,
355 /// Reactive multi-page PDF document state for the Media Studio showcase.
356 #[get(type(copy))]
357 pub(crate) media_pdf: Signal<PdfDocument>,
358 /// Most recently clicked native HTML hyperlink URI in the Media Studio showcase.
359 #[get(type(copy))]
360 pub(crate) media_html_link_log: Signal<String>,
361 /// Reactive indicator set while Media Studio codecs decode on a background worker thread.
362 #[get(type(copy))]
363 pub(crate) media_loading: Signal<bool>,
364 /// Active background worker handle decoding Media Studio sample codecs off the UI thread.
365 #[get(type(copy))]
366 pub(crate) media_bg_task: Signal<Option<BackgroundTask<MediaSampleBundle>>>,
367}
368
369/// Lazily initialized signals powering the `/markdown` Markdown & Code Studio page.
370#[derive(Clone, Copy, Getter)]
371pub struct MarkdownSignals {
372 /// Latest copied code block telemetry readout on `/markdown`.
373 #[get(type(copy))]
374 pub(crate) markdown_copy_log: Signal<String>,
375 /// Latest clicked Markdown hyperlink URL readout on `/markdown`.
376 #[get(type(copy))]
377 pub(crate) markdown_link_log: Signal<String>,
378 /// Total GFM checklist tasks toggled interactively on `/markdown`.
379 #[get(type(copy))]
380 pub(crate) markdown_tasks_toggled: Signal<u32>,
381 /// Selected code example language tab index on `/markdown` (`0=Rust, 1=TS, 2=JSON, 3=Diff`).
382 #[get(type(copy))]
383 pub(crate) markdown_lang_tab: Signal<usize>,
384 /// Toggle controlling whether text inside the Markdown & Code Studio is selectable.
385 #[get(type(copy))]
386 pub(crate) markdown_selectable: Signal<bool>,
387}
388
389/// Lazily initialized signals powering the `/stress` Stress Lab page.
390#[derive(Clone, Copy, Getter)]
391pub struct StressSignals {
392 /// Live interactive UI stress benchmark results for `/stress`.
393 #[get(type(copy))]
394 pub(crate) stress_results: Signal<Vec<StressCaseResult>>,
395 /// Latest interactive UI stress benchmark status readout for `/stress`.
396 #[get(type(copy))]
397 pub(crate) stress_summary: Signal<String>,
398}
399
400/// Lazily initialized signals powering the `/charts` ECharts Studio page.
401#[derive(Clone, Copy, Getter)]
402pub struct ChartsSignals {
403 /// Active category filter index on `/charts` (`0=All`, `1=Cartesian`, `2=Financial`, `3=Radial`, `4=Hierarchy`, `5=Geo & Flow`).
404 #[get(type(copy))]
405 pub(crate) charts_category_idx: Signal<usize>,
406 /// Live interaction readout updated when hovering, clicking, toggling legends, or dragging DataZoom on `/charts`.
407 #[get(type(copy))]
408 pub(crate) charts_event_log: Signal<String>,
409}
410
411/// Lazily initialized signals powering the `/water` gyroscope liquid physics studio page.
412#[derive(Clone, Copy, Debug, Getter)]
413pub struct WaterSignals {
414 /// Liquid tank fill ratio percentage (`25.0..=80.0`).
415 #[get(type(copy))]
416 pub(crate) fill_pct: Signal<f32>,
417 /// Active viscosity preset index (`0 = Water 1.0 mPa·s`, `1 = Light Oil`, `2 = Honey`).
418 #[get(type(copy))]
419 pub(crate) viscosity_idx: Signal<usize>,
420 /// Toggle controlling whether Archimedes buoyant bodies (orb and ice cube) are active.
421 #[get(type(copy))]
422 pub(crate) buoyant_enabled: Signal<bool>,
423 /// Fullscreen portal visibility flag for the liquid tank.
424 #[get(type(copy))]
425 pub(crate) fullscreen_open: Signal<bool>,
426 /// Status message displayed for browser/OS motion sensor permission requests.
427 #[get(type(copy))]
428 pub(crate) sensor_perm_status: Signal<String>,
429 /// Reactive live physics, gravity, and frame-timing telemetry mirrored from `GyroLiquidGameScene`.
430 #[get(type(copy))]
431 pub(crate) stats: Signal<GyroLiquidStats>,
432}
433
434/// Zero-boot-cost lazy `GameScene` wrapper deferring `GyroLiquidGameScene` allocation until `/water` is visited.
435#[derive(Clone, Debug, Getter)]
436pub struct LazyWaterScene {
437 /// Shared lazily allocated liquid scene handle (`None` at boot until `/water` is visited).
438 pub(crate) scene_cell: Rc<RefCell<Option<GyroLiquidGameScene>>>,
439 /// Shared lazy cell holding `/water` control and telemetry signals.
440 pub(crate) signals_cell: Rc<Cell<Option<WaterSignals>>>,
441}
442
443/// Reactive application state powering the cross-platform showcase with minimal boot signals and lazy route-scoped signal groups.
444#[derive(Clone, Getter)]
445pub struct ShowcaseState {
446 /// Active route path signal.
447 #[get(type(copy))]
448 pub(crate) route: Signal<String>,
449 /// Root ownership scope retaining lazily materialized showcase signals across route evictions and global WASM slot swaps.
450 #[get(type(copy))]
451 pub(crate) state_scope: Scope,
452 /// Active reactive theme state across all 17 design schemes and light/dark modes.
453 pub(crate) theme: UiThemeState,
454 /// Embedded deterministic 2D physics game host rendered directly inside `euv`.
455 pub(crate) game_host: GameEngineHost,
456 /// Embedded AAA 3D open-world PBR + BVH ray-tracing game host.
457 pub(crate) game3d_host: GameEngineHost,
458 /// Embedded real-time SI PBF gyroscope liquid water host (zero allocation at boot until `/water` is visited).
459 pub(crate) water_host: GameEngineHost,
460 /// Lazily materialized `GyroLiquidGameScene` handle shared between `water_host` and `/water` UI controls.
461 pub(crate) water_scene_cell: Rc<RefCell<Option<GyroLiquidGameScene>>>,
462 /// Shared hub managing live component-level and page-level dynamic OTA updates.
463 pub(crate) dynamic_hub: DynamicUpdateHub,
464 /// Cross-platform in-memory WASM CDN registry serving real `.wasm` binaries and fault scenarios.
465 pub(crate) wasm_registry: RegistryWasmFetcher,
466 /// Dynamic WASM download, verification, sandbox execution, cache, and rollback manager.
467 pub(crate) wasm_manager: WasmDynamicManager,
468 /// Controlled global Command Palette modal visibility flag.
469 #[get(type(copy))]
470 pub(crate) cmd_palette_open: Signal<bool>,
471 /// Controlled global Command Palette filter query.
472 #[get(type(copy))]
473 pub(crate) cmd_palette_query: Signal<String>,
474 /// Persistent lazy-loading page-lifecycle router shared across the showcase shell.
475 pub(crate) router: EuvRouter,
476 /// Guard flag ensuring routes are registered on `router` once.
477 pub(crate) router_ready: Rc<Cell<bool>>,
478 /// Total lazy page `on_mount` lifecycle hooks executed.
479 #[get(type(copy))]
480 pub(crate) lifecycle_mounts: Signal<u32>,
481 /// Total `PageRetention::Freeze` `on_freeze` hooks executed on route leave.
482 #[get(type(copy))]
483 pub(crate) lifecycle_freezes: Signal<u32>,
484 /// Total `on_resume` hooks executed when returning to a frozen page.
485 #[get(type(copy))]
486 pub(crate) lifecycle_resumes: Signal<u32>,
487 /// Total `on_destroy` hooks executed on page disposal.
488 #[get(type(copy))]
489 pub(crate) lifecycle_destroys: Signal<u32>,
490 /// Latest human-readable page lifecycle transition log line.
491 #[get(type(copy))]
492 pub(crate) lifecycle_last_event: Signal<String>,
493 /// Rolling log of recent normalized cross-platform `SystemEvent` entries.
494 #[get(type(copy))]
495 pub(crate) system_event_log: Signal<Vec<String>>,
496 /// Total count of normalized `SystemEvent` notifications observed in this session.
497 #[get(type(copy))]
498 pub(crate) system_event_count: Signal<u32>,
499 /// Reactive flag indicating whether showcase pages are currently frozen in background.
500 #[get(type(copy))]
501 pub(crate) bg_frozen: Signal<bool>,
502 /// Total count of background freeze transitions executed across showcase pages.
503 #[get(type(copy))]
504 pub(crate) bg_freeze_count: Signal<u32>,
505 /// Total count of lossless foreground restore transitions executed across showcase pages.
506 #[get(type(copy))]
507 pub(crate) bg_restore_count: Signal<u32>,
508 /// Snapshot of whether the 2D physics game host was running immediately before entering background.
509 pub(crate) bg_snap_game2d_running: Rc<Cell<bool>>,
510 /// Snapshot of whether the 3D ray-tracing host was running immediately before entering background.
511 pub(crate) bg_snap_game3d_running: Rc<Cell<bool>>,
512 /// Snapshot of whether the gyroscope liquid water host was running immediately before entering background.
513 pub(crate) bg_snap_water_running: Rc<Cell<bool>>,
514 /// Snapshot of whether Media Studio animated GIF playback was playing before background.
515 pub(crate) bg_snap_gif_playing: Rc<Cell<bool>>,
516 /// Snapshot of whether Media Studio LIVE Photo motion burst was playing before background.
517 pub(crate) bg_snap_live_playing: Rc<Cell<bool>>,
518 /// Snapshot of whether Media Studio video playback was playing before background.
519 pub(crate) bg_snap_video_playing: Rc<Cell<bool>>,
520 /// Snapshot of whether Media Studio audio playback was playing before background.
521 pub(crate) bg_snap_audio_playing: Rc<Cell<bool>>,
522 /// Guard flag ensuring Media Studio sample codecs/frames hydrate lazily on first `/media` visit.
523 pub(crate) media_loaded: Rc<Cell<bool>>,
524 /// Guard flag ensuring `.wasm` OTA binaries populate lazily on first `/dynamic` visit.
525 pub(crate) wasm_registry_loaded: Rc<Cell<bool>>,
526 /// Guard flag ensuring Stress Lab workload catalog hydrates lazily on first `/stress` visit.
527 pub(crate) stress_loaded: Rc<Cell<bool>>,
528 /// Guard flag ensuring ECharts Studio 20-series catalog hydrates lazily on first `/charts` visit.
529 pub(crate) charts_loaded: Rc<Cell<bool>>,
530 /// Enables off-main-thread background workers for heavy `/media`, `/dynamic`, and `/game3d` route payloads on interactive native targets.
531 pub(crate) bg_workers_enabled: Rc<Cell<bool>>,
532 /// Default host platform index applied lazily when `/window` signals initialize.
533 pub(crate) default_host_plat_idx: Rc<Cell<usize>>,
534 /// Lazily materialized `/reactive` signals (`None` at boot).
535 pub(crate) reactive_signals: Rc<Cell<Option<ReactiveSignals>>>,
536 /// Lazily materialized `/render` and `/window` signals (`None` at boot).
537 pub(crate) render_window_signals: Rc<Cell<Option<RenderWindowSignals>>>,
538 /// Lazily materialized `/forms` signals (`None` at boot).
539 pub(crate) forms_signals: Rc<Cell<Option<FormsSignals>>>,
540 /// Lazily materialized `/overlays` signals (`None` at boot).
541 pub(crate) overlays_signals: Rc<Cell<Option<OverlaysSignals>>>,
542 /// Lazily materialized `/data` signals (`None` at boot).
543 pub(crate) data_signals: Rc<Cell<Option<DataSignals>>>,
544 /// Lazily materialized `/game3d` signals (`None` at boot).
545 pub(crate) engine3d_signals: Rc<Cell<Option<Engine3dSignals>>>,
546 /// Lazily materialized `/dynamic` signals (`None` at boot).
547 pub(crate) dynamic_signals: Rc<Cell<Option<DynamicSignals>>>,
548 /// Lazily materialized `/lab` signals (`None` at boot).
549 pub(crate) lab_signals: Rc<Cell<Option<LabSignals>>>,
550 /// Lazily materialized `/media` signals (`None` at boot).
551 pub(crate) media_signals: Rc<Cell<Option<MediaSignals>>>,
552 /// Lazily materialized `/markdown` signals (`None` at boot).
553 pub(crate) markdown_signals: Rc<Cell<Option<MarkdownSignals>>>,
554 /// Lazily materialized `/stress` signals (`None` at boot).
555 pub(crate) stress_signals: Rc<Cell<Option<StressSignals>>>,
556 /// Lazily materialized `/charts` signals (`None` at boot).
557 pub(crate) charts_signals: Rc<Cell<Option<ChartsSignals>>>,
558 /// Lazily materialized `/water` signals (`None` at boot).
559 pub(crate) water_signals: Rc<Cell<Option<WaterSignals>>>,
560}
561
562/// Full-featured 2D arcade arena scene powered by `GameWorld`, `PhysicsWorld2D`, `Camera2D`, `ParticleSystem`, `TileMap`, `ActionMap`, and `AudioBus`.
563#[derive(Clone, Data, Debug)]
564pub struct DemoPhysicsScene {
565 /// Generational ECS entity arena holding player, drones, projectiles, and obstacles.
566 pub(crate) world: GameWorld,
567 /// Spatial-hash 2D rigid-body physics and raycast solver.
568 pub(crate) physics: PhysicsWorld2D,
569 /// 2D follow camera with trauma-based screen shake and frustum culling.
570 #[get(type(copy))]
571 pub(crate) camera: Camera2D,
572 /// Zero-allocation pooled neon particle engine.
573 pub(crate) particles: ParticleSystem,
574 /// Frustum-culled tiled arena map with solid corner pillars.
575 pub(crate) tilemap: TileMap,
576 /// Declarative arcade input bindings (WASD, Arrows, Space/Click fire, E dash, R wave).
577 pub(crate) actions: ActionMap,
578 /// Deterministic cross-platform sound cue bus.
579 pub(crate) audio: AudioBus,
580 /// Player ship entity handle.
581 #[get(type(copy))]
582 pub(crate) player_id: EntityId,
583 /// Remaining weapon cooldown in seconds.
584 #[get(type(copy))]
585 pub(crate) fire_cooldown: f32,
586 /// Remaining dash cooldown in seconds.
587 #[get(type(copy))]
588 pub(crate) dash_cooldown: f32,
589 /// Current player arcade score.
590 #[get(type(copy))]
591 pub(crate) score: u32,
592 /// Current wave counter.
593 #[get(type(copy))]
594 pub(crate) wave: u32,
595 /// Toggle for wireframe collider debug visualization.
596 #[get(type(copy))]
597 pub(crate) show_colliders: bool,
598 /// Smoothed real-time frames-per-second telemetry.
599 #[get(type(copy))]
600 pub(crate) smoothed_fps: f32,
601 /// Total fixed physics ticks simulated.
602 #[get(type(copy))]
603 pub(crate) ticks: u64,
604 /// Last rendered viewport size in logical pixels for responsive camera framing in inline and fullscreen modes.
605 #[get(type(copy))]
606 pub(crate) viewport_size: Size,
607 /// Whether the full arena tilemap, entities, and particle pool have been lazily initialized.
608 #[get(type(copy))]
609 pub(crate) initialized: bool,
610 /// Double-buffered immutable 2D world snapshots enabling discontinuity-safe alpha interpolation.
611 pub(crate) snapshots: DoubleBufferedSnapshot<World2DSnapshot>,
612 /// Reusable per-tick despawn buffer preventing fresh `Vec` allocation during collision resolution.
613 pub(crate) to_despawn_scratch: Vec<(EntityId, Point, bool)>,
614 /// Fixed tick counter corresponding to `cached_interp`.
615 #[get(type(copy))]
616 pub(crate) last_sampled_tick: u64,
617 /// Quantized alpha (`(alpha * 1000.0).round() as i32`) corresponding to `cached_interp`.
618 #[get(type(copy))]
619 pub(crate) last_sampled_alpha_milli: i32,
620 /// Cached interpolated snapshot preventing duplicate interpolation on HUD-only repaints.
621 pub(crate) cached_interp: Option<World2DSnapshot>,
622}
623
624/// Interactive AAA 3D open-world city scene with PBR shading, BVH ray tracing, model importing, and runtime settings.
625#[derive(Clone, Data, Debug)]
626pub struct DemoOpenWorld3DScene {
627 /// Open-world 3D city scene graph with instanced towers, reflective wet boulevard, and drivable GT car.
628 pub(crate) world: World3D,
629 /// Zero-allocation PBR + BVH ray-tracing renderer.
630 pub(crate) renderer: Renderer3D,
631 /// Shared arcade action bindings for driving/flying the 3D scene.
632 pub(crate) actions: ActionMap,
633 /// Shared lazy cell holding `/game3d` control signals (`None` at boot until `/game3d` is entered).
634 pub(crate) signals_cell: Rc<Cell<Option<Engine3dSignals>>>,
635 /// Root ownership scope retaining lazily materialized `/game3d` signals across route evictions.
636 #[get(type(copy))]
637 pub(crate) state_scope: Scope,
638 /// Shared flag enabling off-main-thread `World3D::create_open_world_city()` initialization on interactive native apps.
639 pub(crate) bg_workers_enabled: Rc<Cell<bool>>,
640 /// Active background task constructing the Vice Boulevard 3D city meshes and BVH off the UI thread.
641 pub(crate) bg_city_task: Option<BackgroundTask<World3D>>,
642 /// Last processed import counter.
643 #[get(type(copy))]
644 pub(crate) last_import_seq: u64,
645 /// Smoothed real-time FPS telemetry.
646 #[get(type(copy))]
647 pub(crate) smoothed_fps: f32,
648 /// Whether the 3D city meshes, materials, and BVH acceleration structure have been lazily built.
649 #[get(type(copy))]
650 pub(crate) initialized: bool,
651 /// Double-buffered immutable 3D world snapshots for high-refresh alpha interpolation and camera-cut snapping.
652 pub(crate) snapshots: DoubleBufferedSnapshot<World3DSnapshot>,
653 /// Bounded reusable RGBA8 frame pool avoiding steady-state per-frame heap allocations on CPU fallback.
654 pub(crate) frame_pool: RenderBufferPool,
655 /// Same-device GPU composite target tracking independent world and HUD dirty revisions.
656 pub(crate) gpu_target: GpuCompositeTarget,
657 /// Monotonic frame submission fence value guarding pooled 3D frame leases.
658 #[get(type(copy))]
659 pub(crate) frame_fence: u64,
660 /// Last applied 3D camera mode for instant discontinuity-safe camera-cut detection.
661 #[get(type(copy))]
662 pub(crate) last_camera_mode: u8,
663 /// Monotonic fixed simulation tick counter for 3D snapshot commits.
664 #[get(type(copy))]
665 pub(crate) ticks: u64,
666 /// Cached rendered 3D world frame reused across HUD-only overlay updates without re-ray-tracing.
667 pub(crate) cached_world_frame: Option<ImageBuffer>,
668 /// World revision matching `cached_world_frame`.
669 #[get(type(copy))]
670 pub(crate) cached_world_rev: u64,
671 /// Quantized interpolation alpha matching `cached_world_frame`.
672 #[get(type(copy))]
673 pub(crate) cached_alpha_milli: i32,
674 /// Internal render dimensions `(width, height)` matching `cached_world_frame`.
675 #[get(type(copy))]
676 pub(crate) cached_dims: (u32, u32),
677 /// Active quality configuration matching `cached_world_frame`.
678 #[get(type(copy))]
679 pub(crate) cached_quality: RenderQualityConfig,
680}