i-slint-backend-winit 1.8.0

Winit backend for Slint
Documentation
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

[package]
name = "i-slint-backend-winit"
description = "Winit backend for Slint"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
build = "build.rs"

[lib]
path = "lib.rs"

# Note, these features need to be kept in sync (along with their defaults) in
# the C++ crate's CMakeLists.txt
[features]
wayland = ["winit/wayland", "winit/wayland-csd-adwaita", "glutin?/wayland", "glutin-winit?/wayland", "copypasta/wayland", "i-slint-renderer-skia?/wayland", "softbuffer?/wayland", "softbuffer?/wayland-dlopen"]
x11 = ["winit/x11", "glutin?/x11", "glutin?/glx", "glutin-winit?/x11", "glutin-winit?/glx", "copypasta/x11", "i-slint-renderer-skia?/x11", "softbuffer?/x11", "softbuffer?/x11-dlopen"]
renderer-femtovg = ["dep:i-slint-renderer-femtovg", "dep:glutin", "dep:glutin-winit"]
renderer-skia = ["i-slint-renderer-skia", "winit/rwh_06"]
renderer-skia-opengl = ["renderer-skia", "i-slint-renderer-skia/opengl"]
renderer-skia-vulkan = ["renderer-skia", "i-slint-renderer-skia/vulkan"]
renderer-software = ["dep:softbuffer", "dep:imgref", "dep:rgb", "i-slint-core/software-renderer-systemfonts", "dep:bytemuck", "winit/rwh_06"]
accessibility = ["dep:accesskit", "dep:accesskit_winit"]
raw-window-handle-06 = ["winit/rwh_06"]
default = []

[dependencies]
i-slint-core = { workspace = true, features = ["default"] }
i-slint-core-macros = { workspace = true, features = ["default"] }
i-slint-common = { workspace = true, features = ["default"] }

const-field-offset = { version = "0.1", path = "../../../helper_crates/const-field-offset" }

cfg-if = "1"
derive_more = { workspace = true }
lyon_path = "1.0"
once_cell = "1.5"
pin-weak = "1"
scoped-tls-hkt = "0.1"
winit = { version = "0.30.2", default-features = false }
raw-window-handle = { version = "0.6", features = ["alloc"] }
scopeguard =  { version = "1.1.0", default-features = false }

# For the FemtoVG renderer
i-slint-renderer-femtovg = { workspace = true, features = ["default"], optional = true }

# For the Skia renderer
i-slint-renderer-skia = {  workspace = true, features = ["default"], optional = true }

# For the software renderer
softbuffer = { workspace = true, optional = true, default-features = false }
imgref = { version = "1.6.1", optional = true }
rgb = { version = "0.8.27", optional = true }
bytemuck = { workspace = true, optional = true, features = ["derive"] }


[target.'cfg(target_arch = "wasm32")'.dependencies]
web-sys = { version = "0.3", features=["HtmlInputElement", "HtmlCanvasElement", "Window", "Document", "Event", "KeyboardEvent", "InputEvent", "CompositionEvent", "DomStringMap", "ClipboardEvent", "DataTransfer"] }
wasm-bindgen = { version = "0.2" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
glutin = { workspace = true, optional = true, default-features = false, features = ["egl", "wgl"] }
glutin-winit = { version = "0.5", optional = true, default-features = false, features = ["egl", "wgl"] }
accesskit = { version = "0.16.0", optional = true }
accesskit_winit = { version = "0.22.0", optional = true }
copypasta = { version = "0.10", default-features = false }

[target.'cfg(target_os = "macos")'.dependencies]
# For GL rendering
cocoa = { version = "0.25.0" }

[build-dependencies]
cfg_aliases = { workspace = true }

[dev-dependencies]
slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-2", "backend-winit", "renderer-software", "raw-window-handle-06"] }

[package.metadata.docs.rs]
features = ["wayland", "renderer-software"]