1# Copyright © SixtyFPS GmbH <info@slint.dev>
2# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
4[package]
5name = "i-slint-backend-winit"
6description = "Winit backend for Slint"
7authors.workspace = true
8edition.workspace = true
9homepage.workspace = true
10license.workspace = true
11repository.workspace = true
12rust-version.workspace = true
13version.workspace = true
14build = "build.rs"
15
16[lib]
17path = "lib.rs"
18
19# Note, these features need to be kept in sync (along with their defaults) in
20# the C++ crate's CMakeLists.txt
21[features]
22wayland = [
23 "winit/wayland",
24 "winit/wayland-csd-adwaita",
25 "glutin?/wayland",
26 "glutin-winit?/wayland",
27 "copypasta/wayland",
28 "i-slint-renderer-skia?/wayland",
29 "softbuffer?/wayland",
30 "softbuffer?/wayland-dlopen",
31]
32x11 = [
33 "winit/x11",
34 "glutin?/x11",
35 "glutin?/glx",
36 "glutin-winit?/x11",
37 "glutin-winit?/glx",
38 "copypasta/x11",
39 "i-slint-renderer-skia?/x11",
40 "softbuffer?/x11",
41 "softbuffer?/x11-dlopen",
42]
43renderer-femtovg = ["dep:i-slint-renderer-femtovg", "dep:glutin", "dep:glutin-winit"]
44renderer-skia = ["i-slint-renderer-skia"]
45renderer-skia-opengl = ["renderer-skia", "i-slint-renderer-skia/opengl"]
46renderer-skia-vulkan = ["renderer-skia", "i-slint-renderer-skia/vulkan"]
47renderer-software = [
48 "dep:softbuffer",
49 "dep:imgref",
50 "dep:rgb",
51 "i-slint-core/software-renderer-systemfonts",
52 "dep:bytemuck",
53]
54accessibility = ["dep:accesskit", "dep:accesskit_winit"]
55raw-window-handle-06 = ["i-slint-core/raw-window-handle-06"]
56default = []
57
58[dependencies]
59i-slint-core = { workspace = true, features = ["default"] }
60i-slint-core-macros = { workspace = true, features = ["default"] }
61i-slint-common = { workspace = true, features = ["default"] }
62
63cfg-if = "1"
64derive_more = { workspace = true }
65lyon_path = "1.0"
66pin-weak = "1"
67scoped-tls-hkt = "0.1"
68winit = { version = "0.30.2", default-features = false, features = ["rwh_06"] }
69raw-window-handle = { version = "0.6", features = ["alloc"] }
70scopeguard = { version = "1.1.0", default-features = false }
71
72# For the FemtoVG renderer
73i-slint-renderer-femtovg = { workspace = true, features = ["default"], optional = true }
74
75# For the Skia renderer
76i-slint-renderer-skia = { workspace = true, features = ["default"], optional = true }
77
78# For the software renderer
79softbuffer = { workspace = true, optional = true, default-features = false }
80imgref = { version = "1.6.1", optional = true }
81rgb = { version = "0.8.27", optional = true }
82bytemuck = { workspace = true, optional = true, features = ["derive"] }
83
84[target.'cfg(any(target_os = "macos", target_family = "windows"))'.dependencies]
85muda = { version = "0.16.0", optional = true }
86vtable = { workspace = true }
87
88[target.'cfg(target_arch = "wasm32")'.dependencies]
89web-sys = { workspace = true, features = ["HtmlInputElement", "HtmlCanvasElement", "Window", "Document", "Event", "KeyboardEvent", "InputEvent", "CompositionEvent", "DomStringMap", "ClipboardEvent", "DataTransfer"] }
90wasm-bindgen = { version = "0.2" }
91
92[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
93glutin = { workspace = true, optional = true, default-features = false, features = ["egl", "wgl"] }
94glutin-winit = { version = "0.5", optional = true, default-features = false, features = ["egl", "wgl"] }
95accesskit = { version = "0.17", optional = true }
96accesskit_winit = { version = "0.23", optional = true }
97copypasta = { version = "0.10", default-features = false }
98
99[target.'cfg(not(any(target_family = "windows", target_os = "macos", target_os = "ios", target_arch = "wasm32")))'.dependencies]
100# Use same version and executor as accesskit
101zbus = { version = "4.4.0", default-features = false, features = ["async-io"] }
102futures = { version = "0.3.31" }
103
104[target.'cfg(target_os = "macos")'.dependencies]
105# For GL rendering
106objc2-app-kit = { version = "0.3.0" }
107
108[build-dependencies]
109cfg_aliases = { workspace = true }
110
111[dev-dependencies]
112slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-2", "backend-winit", "renderer-software", "raw-window-handle-06"] }
113
114[package.metadata.docs.rs]
115features = ["wayland", "renderer-software", "raw-window-handle-06"]
116