[package]
name = "rust_widgets"
version = "1.1.2"
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 = [
"build.rs",
"src/**/*",
"tests/**/*",
"benches/**/*",
"examples/**/*",
"include/**/*",
"language/**/*",
"tools/widget_gallery.rs",
"LICENSE",
"README.md",
"README.zh-CN.md",
"CHANGELOG.md",
"clippy.toml",
"rustfmt.toml",
]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("ohos"))',
'cfg(feature, values("cargo-clippy"))',
] }
[lib]
crate-type = ["lib", "cdylib"]
[features]
default = ["desktop"]
desktop = [
"os-auto",
"cocoa-legacy",
"desktop-runtime",
"wgpu",
"touch",
"i18n",
"chart",
"print",
"pdf",
"a11y",
"quality-management",
"advanced-widgets",
"controls-native",
"controls-custom",
"image",
"video",
"audio",
"pdf-encryption",
"js-engine",
"dep:chrono",
"serde",
"serde_json",
]
tablet = [
"os-auto",
"wgpu",
"touch",
"i18n",
"desktop-runtime",
"serde",
"serde_json",
"dep:chrono",
"quality-management",
"controls-native",
"controls-custom",
"image",
]
mobile = [
"os-auto",
"wgpu",
"touch",
"i18n",
"desktop-runtime",
"serde",
"serde_json",
"dep:chrono",
"quality-management",
"mobile-api",
"controls-native",
"controls-custom",
"image",
]
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",
"serde",
"serde_json",
]
macos-legacy = ["dep:cocoa", "dep:objc", "dep:objc-foundation"]
ios = [
"dep:objc2",
"dep:objc2-foundation",
"dep:objc2-core-foundation",
"dep:objc2-core-graphics",
"dep:objc2-ui-kit",
]
windows = []
linux-gtk = ["dep:gtk"]
linux-wayland = [
"dep:wayland-client",
"dep:wayland-protocols",
"dep:wayland-cursor",
"dep:libc",
]
linux-a11y = ["dep:zbus", "dep:pollster"]
android = ["dep:jni"]
jni = ["dep:jni"]
wasm = ["dep:wasm-bindgen", "dep:web-sys", "dep:js-sys", "serde"]
harmony = []
touch = []
gpu = ["dep:wgpu"]
wgpu = ["gpu"]
software = []
i18n = ["dep:notify", "dep:crossbeam-channel", "dep:serde", "dep:serde_json"]
chart = []
print = []
pdf = []
a11y = []
image = ["dep:miniz_oxide", "image-codecs", "svg-rasterizer"]
image-codecs = ["dep:image-codecs"]
svg-rasterizer = ["dep:resvg"]
video = ["dep:jpeg-decoder", "image"]
audio = ["dep:minimp3_fixed"]
holographic = []
projection = []
desktop-runtime = ["dep:notify", "dep:crossbeam-channel"]
quality-management = []
mobile-api = []
controls-native = []
controls-custom = []
advanced-widgets = ["dep:dirs"]
profile-embedded-mini = []
pdf-encryption = ["aes", "sha2", "cbc"]
audio-output = ["cpal"]
js-engine = ["boa_engine"]
webkit-engine = ["dep:webkit2gtk"]
video-codecs = ["dep:ffmpeg-next"]
web-http = ["dep:ureq"]
serde = ["dep:serde"]
serde_json = ["dep:serde_json"]
unstable-pipeline-routing = []
unstable-special-widgets = []
symphonia-codecs = ["symphonia"]
objc2-macos = ["macos"]
cocoa-legacy = ["macos-legacy"]
ios-uikit-ffi = ["ios"]
gtk-native = ["linux-gtk"]
wayland-native = ["linux-wayland"]
android-jni = ["android", "jni"]
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",
"pdf-encryption",
"symphonia-codecs",
"audio-output",
"js-engine",
"webkit-engine",
"video-codecs",
]
[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.4", optional = true }
chrono = { version = "0.4", optional = true }
notify = { version = "7.0", optional = true }
dirs = { version = "6.0", optional = true }
log = "0.4"
minimp3_fixed = { version = "0.5", optional = true }
miniz_oxide = { version = "0.8", optional = true }
image-codecs = { package = "image", version = "0.25.10", optional = true, default-features = false, features = [
"gif",
"webp",
"tiff",
"avif",
"ico",
] }
resvg = { version = "0.48.1", optional = true }
jpeg-decoder = { version = "0.3", optional = true }
ureq = { version = "3.0", optional = true, features = [] }
symphonia = { version = "0.5", default-features = false, features = [
"all",
], optional = true }
aes = { version = "0.8", optional = true }
sha2 = { version = "0.10", optional = true }
cbc = { version = "0.1", optional = true }
cpal = { version = "0.15", optional = true }
boa_engine = { version = "0.19", optional = true }
wgpu = { version = "30.0.1", optional = true }
wasm-bindgen = { version = "0.2", optional = true }
js-sys = { version = "0.3", optional = true }
ffmpeg-next = { version = "9.0", 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.17", 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",
"shobjidl",
"winerror",
"errhandlingapi",
"libloaderapi",
"sysinfoapi",
"psapi",
] }
[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.25", optional = true }
[target.'cfg(target_os = "ios")'.dependencies]
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", optional = true }
objc2-core-foundation = { version = "0.3", optional = true }
objc2-core-graphics = { 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 }
libc = { version = "0.2", 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 }
webkit2gtk = { version = "2.0", optional = true }
[target.'cfg(target_os = "harmony")'.dependencies]
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom02 = { package = "getrandom", version = "0.2", features = ["js"] }
getrandom03 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }
[dev-dependencies]
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = "0.8.2"
tempfile = "3.14"
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"
[[example]]
name = "menu_shortcut_runtime"
required-features = ["desktop"]