[package] name = "ltk" version = "0.3.0" edition = "2021" rust-version = "1.85" # MSRV-aware resolver: keep a fresh resolve on deps compatible with rust-version (Debian stable = 1.85). resolver = "3" license = "LGPL-2.1-only" description = "Lightweight declarative Wayland UI toolkit. Elm-shaped App / view / update model with GLES and software rendering backends, layer-shell support, runtime theming and a runtime-free core surface for embedding." repository = "https://github.com/liberux/ltk" documentation = "https://docs.rs/ltk" homepage = "https://liberux.net" readme = "README.md" keywords = [ "wayland", "ui", "gui", "toolkit", "layer-shell" ] categories = [ "gui", "rendering", "os::linux-apis" ] authors = [ "Liberux Labs, S. L. " ] exclude = [ "target/*", "debian/*", "themes/*", "liberux.toml", "TODO", ] [features] default = [ "wayland" ] # The Wayland backend: `ltk::run` on a Wayland compositor, with AT-SPI2 # accessibility. Without any backend only the runtime-free core builds # (`UiSurface`, widgets, theming, rendering). wayland = [ "dep:smithay-client-toolkit", "dep:calloop-wayland-source", "dep:wayland-protocols", "dep:wayland-egl", "dep:wayland-scanner", "dep:accesskit_unix", ] # The Android backend: `ltk::run` in a NativeActivity, after `android_main` # hands its `AndroidApp` to `ltk::set_android_app`. Builds only for Android # targets and excludes `wayland`, so an Android build disables the default # features. android = [ "dep:android-activity", "dep:ndk", "dep:jni", ] # The browser backend: `ltk::run` on a page's canvas through WebGL2, or a 2D # context without it. Builds only for `wasm32-unknown-unknown` and excludes # the other backends, so a web build disables the default features. web = [ "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:js-sys", "dep:web-sys", ] # Exposes `ltk::test_support` — internal helpers (widget handlers, laid-out # widget lookup, slider math) used only by ltk's own integration tests. Not # part of the stable public API; off by default so third-party builds never # see it. `make test` enables it. test-support = [] [dependencies] chrono = { version = "0.4", features = ["clock"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" smithay-client-toolkit = { version = "0.20", features = ["calloop", "calloop-wayland-source", "xkbcommon"], optional = true } # The `Keysym` sctk re-exports, named directly so it does not depend on Wayland. xkeysym = "0.2" calloop-wayland-source = { version = "0.4", optional = true } tiny-skia = "0.12" unicode-bidi = "0.3" rustybuzz = "0.14" image = { version = "=0.25.9", default-features = false, features = ["png", "jpeg", "webp"] } resvg = "0.44" rust-i18n = "3" # Transitive dep of rust-i18n (globwalk → ignore); 0.4.24+ needs a rustc # newer than Debian's 1.85, and its manifest does not declare that MSRV. ignore = "=0.4.23" libc = "0.2" wayland-protocols = { version = "0.32", features = ["client", "unstable", "staging"], optional = true } wayland-egl = { version = "0.32", optional = true } wayland-scanner = { version = "0.31", optional = true } glow = "0.17" # AT-SPI2 / accessibility is delegated to AccessKit so we get the same # Node / Role / TreeUpdate model the rest of the Rust GUI ecosystem # (egui, iced via the COSMIC fork, dioxus) is converging on. The # Linux platform adapter (`accesskit_unix`) handles every D-Bus # detail — registering against `org.a11y.Bus`, exposing the # `org.a11y.atspi.Accessible` interface hierarchy, translating # `Action`s back into our event loop, emitting state-changed signals # — so this crate only has to construct an `accesskit::TreeUpdate` # from `widget_rects` once per frame. accesskit = "0.17" accesskit_unix = { version = "0.13", optional = true } android-activity = { version = "0.6", features = ["native-activity"], optional = true } ndk = { version = "0.9", default-features = false, optional = true } jni = { version = "0.21", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] calloop = "0.14" khronos-egl = { version = "6", features = ["dynamic"] } raw-window-handle = "0.6" [target.'cfg(target_arch = "wasm32")'.dependencies] chrono = { version = "0.4", features = ["clock", "wasmbind"] } web-time = "1" # wasm-bindgen-cli must be this same version, and later ones need a rustc newer than Debian's 1.85. wasm-bindgen = { version = "=0.2.117", optional = true } wasm-bindgen-futures = { version = "0.4", optional = true } js-sys = { version = "0.3", optional = true } web-sys = { version = "0.3", optional = true, features = [ "CanvasRenderingContext2d", "ClipboardEvent", "CssStyleDeclaration", "DataTransfer", "Document", "Element", "Event", "EventTarget", "HtmlCanvasElement", "HtmlElement", "ImageData", "KeyboardEvent", "MediaQueryList", "MouseEvent", "Navigator", "Node", "OffscreenCanvas", "PointerEvent", "Response", "WebGl2RenderingContext", "WheelEvent", "Window", "console", ] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] criterion = { version = "0.5", features = ["html_reports"] } [[example]] name = "android_hello" crate-type = [ "cdylib" ] required-features = [ "android" ] [[example]] name = "web_hello" crate-type = [ "cdylib" ] required-features = [ "web" ] [[example]] name = "web_shell" crate-type = [ "cdylib" ] required-features = [ "web" ] [[bench]] name = "lookup" harness = false