[package]
name = "rust_widgets"
version = "0.9.6"
edition = "2021"
description = "Pure Rust cross-platform native GUI library with hardware-adaptive rendering, 60+ widgets, touch/gesture support, i18n, and SVG-pipeline-accurate output"
license = "MIT"
keywords = ["gui", "widget", "cross-platform", "mobile", "wasm"]
categories = ["gui", "rendering", "graphics", "embedded", "wasm"]
authors = ["Mike Wolfli <mikewolfli@gmail.com>"]
readme = "README.md"
homepage = "https://github.com/mikewolfli/rust-widgets"
repository = "https://github.com/mikewolfli/rust-widgets"
rust-version = "1.87"
include = ["src/**/*", "tests/**/*", "benches/**/*", "examples/**/*", "include/**/*", "tools/widget_gallery.rs", "LICENSE", "README.md", "README.zh-CN.md", "CHANGELOG.md", "clippy.toml", "rustfmt.toml"]
[lints.rust]
unexpected_cfgs = "allow"
[lib]
crate-type = ["lib", "cdylib"]
[features]
default = ["desktop"]
desktop = [
"os-auto", "desktop-runtime", "wgpu", "touch", "i18n",
"chart", "print", "pdf", "a11y",
"quality-management", "advanced-widgets",
"controls-native", "controls-custom",
"dep:chrono", "dep:serde", "dep:serde_json",
]
tablet = [
"os-auto", "wgpu", "touch", "i18n",
"quality-management", "controls-native", "controls-custom",
]
mobile = [
"os-auto", "wgpu", "touch", "i18n",
"quality-management", "mobile-api",
"controls-native", "controls-custom",
]
embedded = ["software", "controls-custom"]
mini = ["software", "controls-custom", "dep:heapless", "dep:hashbrown", "dep:spin", "dep:bumpalo"]
os-auto = []
macos = ["dep:objc2", "dep:objc2-foundation", "dep:objc2-app-kit", "dep:objc2-core-graphics"]
macos-legacy = ["dep:cocoa", "dep:objc", "dep:objc-foundation"]
ios = ["dep:objc2", "dep:objc2-foundation", "dep:objc2-ui-kit"]
windows = []
linux-gtk = ["dep:gtk"]
linux-wayland = ["dep:wayland-client", "dep:wayland-protocols", "dep:wayland-cursor"]
linux-a11y = ["dep:zbus", "dep:pollster"]
android = ["dep:jni"]
wasm = ["dep:wasm-bindgen", "dep:web-sys", "dep:js-sys"]
harmony = []
touch = []
gpu = ["dep:wgpu"]
wgpu = ["gpu"]
software = []
i18n = []
chart = []
print = []
pdf = []
a11y = []
holographic = []
projection = []
desktop-runtime = ["dep:notify", "dep:crossbeam-channel"]
quality-management = []
mobile-api = []
controls-native = []
controls-custom = []
advanced-widgets = ["dep:dirs"]
unstable-pipeline-routing = []
unstable-special-widgets = []
objc2-macos = ["macos"]
cocoa-legacy = ["macos-legacy"]
ios-uikit-ffi = ["ios"]
gtk-native = ["linux-gtk"]
wayland-native = ["linux-wayland"]
android-jni = ["android"]
gpu-wgpu = ["gpu", "dep:pollster"]
full = [
"desktop",
"macos", "macos-legacy", "ios", "linux-gtk", "linux-wayland",
"linux-a11y", "android", "wasm", "harmony",
"holographic", "projection",
"unstable-pipeline-routing", "unstable-special-widgets",
]
[dependencies]
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
crossbeam-channel = { version = "0.5", optional = true }
font8x8 = "0.2.7"
pollster = { version = "0.3", optional = true }
chrono = { version = "0.4", optional = true }
notify = { version = "6.1", optional = true }
dirs = { version = "5.0", optional = true }
log = "0.4"
wgpu = { version = "29.0.3", optional = true }
wasm-bindgen = { version = "0.2", optional = true }
js-sys = { version = "0.3", optional = true }
web-sys = { version = "0.3", features = [
"Window", "Document", "Element", "HtmlElement", "Node",
"Event", "MouseEvent", "KeyboardEvent", "console",
"HtmlCanvasElement", "CanvasRenderingContext2d",
"Clipboard", "Navigator", "Location",
], optional = true }
jni = { version = "0.21", features = ["invocation"], optional = true }
heapless = { version = "0.8", optional = true }
hashbrown = { version = "0.15", optional = true, default-features = false, features = ["alloc"] }
spin = { version = "0.9", optional = true }
bumpalo = { version = "3.16", optional = true, default-features = false }
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = [
"winuser", "commctrl", "commdlg", "winbase", "synchapi",
"wingdi", "shellapi", "ole2", "combaseapi", "objbase",
"knownfolders", "shlobj",
] }
[target.'cfg(target_os = "macos")'.dependencies]
objc = { version = "0.2", optional = true }
objc-foundation = { version = "0.1", optional = true }
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", optional = true }
objc2-app-kit = { version = "0.3", optional = true }
objc2-core-graphics = { version = "0.3", optional = true }
cocoa = { version = "0.24", optional = true }
[target.'cfg(target_os = "ios")'.dependencies]
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", optional = true }
objc2-ui-kit = { version = "0.3", optional = true }
[target.'cfg(target_os = "linux")'.dependencies]
gtk = { version = "0.18", optional = true }
wayland-client = { version = "0.31", optional = true }
wayland-protocols = { version = "0.32", features = ["staging", "client"], optional = true }
wayland-cursor = { version = "0.31", optional = true }
zbus = { version = "5", optional = true }
[target.'cfg(target_os = "harmony")'.dependencies]
[dev-dependencies]
criterion = "0.8.2"
tempfile = "3.8"
proptest = "1.6"
[package.metadata.docs.rs]
features = ["full", "touch", "holographic", "projection"]
rustc-args = ["--cfg", "docsrs"]
[badges]
maintenance = { status = "actively-developed" }
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
[profile.release-embedded]
inherits = "release"
opt-level = "s"
lto = true
codegen-units = 1
strip = true
panic = "abort"
[profile.release-mini]
inherits = "release"
opt-level = "z"
lto = true
codegen-units = 1
strip = true
panic = "abort"
[[bench]]
name = "render_bench"
harness = false
[[bench]]
name = "signal_bench"
harness = false
[[bench]]
name = "layout_bench"
harness = false
[[bench]]
name = "json_bench"
harness = false
[[bench]]
name = "event_bench"
harness = false
[[example]]
name = "widget_gallery"
path = "tools/widget_gallery.rs"