# Copyright © SixtyFPS GmbH # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 # cSpell: ignore bitflags [package] name = "i-slint-core" description = "Internal Slint Runtime Library." authors.workspace = true documentation.workspace = true edition = "2024" homepage.workspace = true keywords.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true categories = ["gui", "development-tools", "no-std"] [lib] path = "lib.rs" [features] ffi = ["dep:static_assertions", "i-slint-core-macros/ffi"] # Expose C ABI libm = ["num-traits/libm", "euclid/libm"] # Allow the viewer to query at runtime information about item types rtti = [] # Use the standard library std = [ "euclid/std", "once_cell/std", "dep:web-time", "path", "raw-window-handle-06?/std", "chrono/std", "chrono/wasmbind", "chrono/clock", "dep:sys-locale", "shared-fontique", "i-slint-common/locale-decimal-separator", "i-slint-common/color-parsing", "i-slint-common/markdown", "taffy/std", ] # Unsafe feature meaning that there is only one core running and all thread_local are static. # You can only enable this feature if you are sure that any API of this crate is only called # from a single core, and not in a interrupt or signal handler. unsafe-single-threaded = [] unicode = ["unicode-script", "unicode-linebreak"] # Decode encoded images with the image crate. Not needed on wasm, where the # browser decodes encoded image data. image-decoders = ["dep:image", "dep:clru"] image-default-formats = ["image?/default-formats"] svg = ["dep:resvg", "i-slint-common/svg-text"] box-shadow-cache = [] testing = [] shared-fontique = ["i-slint-common/shared-fontique"] raw-window-handle-06 = ["dep:raw-window-handle-06"] # The wgpu-{29,30} feature enables the internal wgpu module (SurfaceTarget, init helpers) # without exposing public API types (GraphicsAPI::WGPU*, WGPUTexture, WGPUConfiguration). # The unstable-wgpu-{29,30} feature additionally enables those public API types. wgpu-29 = ["dep:wgpu-29"] wgpu-30 = ["dep:wgpu-30"] unstable-wgpu-29 = ["wgpu-29"] unstable-wgpu-30 = ["wgpu-30"] ## If enabled, calls of `debug()` in `.slint` files use to the [`log::debug!()`] macro ## of the [log](https://crates.io/crates/log) crate instead of just `println!()`. log = ["dep:log"] tr = ["dep:tr"] 32-bit-color = [] default = ["std", "unicode", "shared-parley"] # System tray (`SystemTrayIcon`) support. On Linux/BSD this pulls `ksni`; on # other platforms it gates the native backend. When disabled, `SystemTrayIcon` # constructs against a no-op backend. Opt-in (not part of `std`/`default`) so an # application that doesn't want the tray dependency can leave it off; the # user-facing crates list it in their own `default` so it stays on out of the box. system-tray = ["dep:ksni", "dep:async-channel", "ksni/async-io", "ksni/blocking"] shared-parley = ["shared-fontique", "dep:parley", "dep:skrifa", "dep:icu_normalizer"] accessibility-text = ["std", "shared-parley", "dep:accesskit", "parley?/accesskit"] shared-swash = ["dep:swash"] path = ["dep:lyon_path", "dep:lyon_geom", "dep:lyon_algorithms", "dep:lyon_extra"] [dependencies] i-slint-common = { workspace = true, features = ["default"] } i-slint-core-macros = { workspace = true, features = ["default"] } const-field-offset = { version = "0.2.1", path = "../../helper_crates/const-field-offset" } vtable = { workspace = true } portable-atomic = { version = "1", features = ["critical-section"] } cfg-if = "1" derive_more = { workspace = true, features = ["error", "deref", "deref_mut"] } euclid = { workspace = true } lyon_algorithms = { version = "1.0", optional = true, default-features = false } lyon_geom = { version = "1.0", optional = true, default-features = false } lyon_path = { workspace = true, optional = true, default-features = false } lyon_extra = { version = "1.1", optional = true, default-features = false } num-traits = { version = "0.2", default-features = false } once_cell = { version = "1.5", default-features = false, features = ["critical-section"] } pin-project = "1" pin-weak = { version = "1.1", default-features = false } # Note: the rgb version is extracted in ci.yaml for rustdoc builds rgb = "0.8.27" scopeguard = { version = "1.1.0", default-features = false } slab = { version = "0.4.3", default-features = false } static_assertions = { version = "1.1", optional = true } strum = { workspace = true } log = { workspace = true, optional = true } # Note: We're migrating our unicode handling over to the icu family of crates. # Prefer using icu crates over adding more unicode-* dependencies # parley uses the icu crates internally as well, so we'll share the dependency there. unicode-segmentation = { workspace = true } unicode-linebreak = { version = "0.1.5", optional = true } unicode-script = { version = "0.5.7", optional = true } icu_normalizer = { workspace = true, optional = true } sys-locale = { version = "0.3.2", optional = true, features = ["js"] } accesskit = { version = "0.24", optional = true } image = { workspace = true, optional = true, default-features = false } clru = { workspace = true, optional = true } resvg = { workspace = true, optional = true } serde = { workspace = true, optional = true } raw-window-handle-06 = { workspace = true, optional = true } bitflags = { version = "2.4.2" } chrono = { version = "0.4", default-features = false, features = ["alloc"] } skrifa = { workspace = true, optional = true } swash = { workspace = true, optional = true, features = ["scale"] } wgpu-29 = { workspace = true, optional = true } wgpu-30 = { workspace = true, optional = true } tr = { workspace = true, optional = true } taffy = { version = "0.10", default-features = false, features = ["flexbox", "taffy_tree", "alloc"] } [target.'cfg(target_family = "unix")'.dependencies] gettext-rs = { version = "0.7.1", optional = true, features = ["gettext-system"] } [target.'cfg(target_os = "macos")'.dependencies] objc2 = { workspace = true } objc2-app-kit = { version = "0.3.2", default-features = false, features = ["std", "NSStatusBar", "NSStatusItem", "NSStatusBarButton", "NSButton", "NSControl", "NSResponder", "NSView", "NSImage", "NSMenu", "NSMenuItem", "NSApplication", "NSAppearance", "objc2-core-foundation"] } objc2-foundation = { version = "0.3.2", default-features = false, features = ["std", "NSArray", "NSData", "NSDictionary", "NSKeyValueObserving", "NSString", "NSGeometry", "NSObjCRuntime"] } image = { workspace = true, default-features = false, features = ["png"] } [target.'cfg(target_os = "windows")'.dependencies] windows = { workspace = true, features = ["Win32_Foundation", "Win32_Graphics_Gdi", "Win32_System_LibraryLoader", "Win32_UI_Shell", "Win32_UI_WindowsAndMessaging"] } [target.'cfg(all(target_family = "unix", not(target_vendor = "apple"), not(target_os = "android")))'.dependencies] ksni = { version = "0.3.3", optional = true, default-features = false } async-channel = { version = "2", optional = true } # The complex-scripts line-breaking dictionaries cost several MB, so leave them out of # wasm binaries. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] parley = { version = "0.11.1", optional = true, features = ["complex-scripts"] } [target.'cfg(target_arch = "wasm32")'.dependencies] parley = { version = "0.11.1", optional = true } web-time = { version = "1.0", optional = true } wasm-bindgen = { version = "0.2" } js-sys = { version = "0.3", default-features = false, features = ["std"] } clru = { workspace = true } web-sys = { workspace = true, features = ["HtmlImageElement", "Navigator", "Blob", "BlobPropertyBag", "Url", "DomParser", "SupportedType", "Document", "Element"] } [dev-dependencies] slint = { path = "../../api/rs/slint", default-features = false, features = ["std", "compat-1-2", "renderer-software"] } i-slint-backend-testing = { path = "../backends/testing", features = ["internal"] } rustybuzz = { workspace = true } ttf-parser = { workspace = true } serde_json = { workspace = true } tiny-skia = "0.12.0" tokio = { version = "1.35", features = ["rt-multi-thread", "macros", "time", "net", "io-util"] } async-compat = { version = "0.2.4" } tempfile = { version = "3.12.0" } fontique = { workspace = true } criterion = "0.8" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ["cfg(slint_debug_property)", "cfg(cbindgen)", "cfg(slint_int_coord)", "cfg(slint_nightly_test)"] } [lints.clippy] # Coord is an alias for f32 in most architectures, but not always, so the cast # to f32 *is* necessary. unnecessary_cast = { level = "allow" } [package.metadata.docs.rs] rustdoc-args = ["--generate-link-to-definition"] [[bench]] name = "string" harness = false