1mod app;
9mod dynamic;
10mod font;
11mod game;
12mod layout;
13mod media;
14mod platform;
15mod reactive;
16mod render;
17mod scene;
18mod style;
19mod system;
20mod window;
21
22#[cfg(test)]
23#[path = "../tests/mod.rs"]
24mod tests;
25
26pub use {
27 app::*, dynamic::*, font::*, game::*, layout::*, media::*, platform::*, reactive::*, render::*,
28 scene::*, style::*, system::*, window::*,
29};
30
31#[cfg(any(target_os = "macos", target_os = "ios", target_os = "linux"))]
32use std::ffi::CStr;
33#[cfg(unix)]
34use std::ffi::CString;
35#[cfg(unix)]
36use std::ffi::c_char;
37#[cfg(any(unix, windows))]
38use std::ffi::c_void;
39#[cfg(target_os = "windows")]
40use std::mem::size_of;
41#[cfg(any(target_os = "macos", target_os = "ios"))]
42use std::mem::size_of_val;
43#[cfg(unix)]
44use std::mem::zeroed;
45#[cfg(any(target_os = "linux", target_os = "android"))]
46use std::path::Path;
47#[cfg(target_os = "android")]
48use std::ptr::copy_nonoverlapping;
49#[cfg(any(target_os = "macos", target_os = "ios", target_os = "linux", windows))]
50use std::ptr::null;
51#[cfg(target_arch = "wasm32")]
52use std::sync::{Arc, Mutex, MutexGuard};
53use std::{
54 any::{Any, TypeId},
55 borrow::Cow,
56 cell::{Cell, Ref, RefCell, RefMut},
57 collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque},
58 error::Error,
59 f32::consts::{FRAC_PI_2, PI, SQRT_2, TAU},
60 fmt::{self, Formatter},
61 hash::{Hash, Hasher},
62 marker::PhantomData,
63 mem::{swap, take, transmute},
64 ops::{Add, Mul, Sub},
65 ptr::null_mut,
66 rc::Rc,
67 slice::from_raw_parts_mut,
68 str::{Chars, from_utf8},
69 sync::atomic::{AtomicBool, AtomicPtr, AtomicU64, AtomicUsize, Ordering},
70};
71#[cfg(not(target_arch = "wasm32"))]
72use std::{
73 env, fs,
74 hint::spin_loop,
75 io::{self, BufRead, BufReader, ErrorKind, IsTerminal, Read, Write, stderr, stdout},
76 net::{SocketAddr, TcpStream, ToSocketAddrs},
77 slice::from_raw_parts,
78 str::Lines,
79 sync::{Arc, Condvar, Mutex, MutexGuard, OnceLock, PoisonError},
80 thread::{Builder, JoinHandle, available_parallelism, current, sleep},
81 time::{Duration, Instant},
82};
83#[cfg(all(test, not(target_arch = "wasm32")))]
84use std::{net::TcpListener, thread::spawn};
85
86use {
87 lombok_macros::{CustomDebug, Data, Getter, New},
88 serde::{Deserialize, Serialize},
89 serde_json::{Value, from_str, to_string, to_string_pretty},
90};
91
92#[cfg(target_arch = "wasm32")]
93use {
94 js_sys::{Function, Object, Promise, Reflect},
95 wasm_bindgen::{Clamped, JsCast, JsValue, closure::Closure},
96 web_sys::{
97 CanvasRenderingContext2d, Clipboard, Document, DomRect, Element, HtmlCanvasElement,
98 ImageData, MediaQueryList, Navigator, TextMetrics, WebGl2RenderingContext, WebGlProgram,
99 WebGlShader, Window, window,
100 },
101};