| 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] |
| 5 | name = "i-slint-backend-winit" |
| 6 | description = "Winit backend for Slint" |
| 7 | authors.workspace = true |
| 8 | edition.workspace = true |
| 9 | homepage.workspace = true |
| 10 | license.workspace = true |
| 11 | repository.workspace = true |
| 12 | rust-version.workspace = true |
| 13 | version.workspace = true |
| 14 | build = "build.rs" |
| 15 | |
| 16 | [lib] |
| 17 | path = "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] |
| 22 | wayland = [ |
| 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 | ] |
| 32 | x11 = [ |
| 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 | ] |
| 43 | renderer-femtovg = ["dep:i-slint-renderer-femtovg" , "dep:glutin" , "dep:glutin-winit" ] |
| 44 | renderer-skia = ["i-slint-renderer-skia" ] |
| 45 | renderer-skia-opengl = ["renderer-skia" , "i-slint-renderer-skia/opengl" ] |
| 46 | renderer-skia-vulkan = ["renderer-skia" , "i-slint-renderer-skia/vulkan" ] |
| 47 | renderer-software = [ |
| 48 | "dep:softbuffer" , |
| 49 | "dep:imgref" , |
| 50 | "dep:rgb" , |
| 51 | "i-slint-core/software-renderer-systemfonts" , |
| 52 | "dep:bytemuck" , |
| 53 | ] |
| 54 | accessibility = ["dep:accesskit" , "dep:accesskit_winit" ] |
| 55 | raw-window-handle-06 = ["i-slint-core/raw-window-handle-06" ] |
| 56 | default = [] |
| 57 | |
| 58 | [dependencies] |
| 59 | i-slint-core = { workspace = true, features = ["default" ] } |
| 60 | i-slint-core-macros = { workspace = true, features = ["default" ] } |
| 61 | i-slint-common = { workspace = true, features = ["default" ] } |
| 62 | |
| 63 | cfg-if = "1" |
| 64 | derive_more = { workspace = true } |
| 65 | lyon_path = "1.0" |
| 66 | pin-weak = "1" |
| 67 | scoped-tls-hkt = "0.1" |
| 68 | winit = { version = "0.30.2" , default-features = false, features = ["rwh_06" ] } |
| 69 | raw-window-handle = { version = "0.6" , features = ["alloc" ] } |
| 70 | scopeguard = { version = "1.1.0" , default-features = false } |
| 71 | |
| 72 | # For the FemtoVG renderer |
| 73 | i-slint-renderer-femtovg = { workspace = true, features = ["default" ], optional = true } |
| 74 | |
| 75 | # For the Skia renderer |
| 76 | i-slint-renderer-skia = { workspace = true, features = ["default" ], optional = true } |
| 77 | |
| 78 | # For the software renderer |
| 79 | softbuffer = { workspace = true, optional = true, default-features = false } |
| 80 | imgref = { version = "1.6.1" , optional = true } |
| 81 | rgb = { version = "0.8.27" , optional = true } |
| 82 | bytemuck = { workspace = true, optional = true, features = ["derive" ] } |
| 83 | |
| 84 | [target.'cfg(any(target_os = "macos", target_family = "windows"))'.dependencies] |
| 85 | muda = { version = "0.16.0" , optional = true } |
| 86 | vtable = { workspace = true } |
| 87 | |
| 88 | [target.'cfg(target_arch = "wasm32")'.dependencies] |
| 89 | web-sys = { workspace = true, features = ["HtmlInputElement" , "HtmlCanvasElement" , "Window" , "Document" , "Event" , "KeyboardEvent" , "InputEvent" , "CompositionEvent" , "DomStringMap" , "ClipboardEvent" , "DataTransfer" ] } |
| 90 | wasm-bindgen = { version = "0.2" } |
| 91 | |
| 92 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] |
| 93 | glutin = { workspace = true, optional = true, default-features = false, features = ["egl" , "wgl" ] } |
| 94 | glutin-winit = { version = "0.5" , optional = true, default-features = false, features = ["egl" , "wgl" ] } |
| 95 | accesskit = { version = "0.17" , optional = true } |
| 96 | accesskit_winit = { version = "0.23" , optional = true } |
| 97 | copypasta = { 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 |
| 101 | zbus = { version = "4.4.0" , default-features = false, features = ["async-io" ] } |
| 102 | futures = { version = "0.3.31" } |
| 103 | |
| 104 | [target.'cfg(target_os = "macos")'.dependencies] |
| 105 | # For GL rendering |
| 106 | objc2-app-kit = { version = "0.3.0" } |
| 107 | |
| 108 | [build-dependencies] |
| 109 | cfg_aliases = { workspace = true } |
| 110 | |
| 111 | [dev-dependencies] |
| 112 | slint = { 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] |
| 115 | features = ["wayland" , "renderer-software" , "raw-window-handle-06" ] |
| 116 | |