| 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 = "slint-interpreter" |
| 6 | description = "Interpreter library for Slint" |
| 7 | authors.workspace = true |
| 8 | documentation.workspace = true |
| 9 | edition.workspace = true |
| 10 | homepage.workspace = true |
| 11 | keywords.workspace = true |
| 12 | license.workspace = true |
| 13 | repository.workspace = true |
| 14 | rust-version.workspace = true |
| 15 | version.workspace = true |
| 16 | categories = ["gui" , "rendering::engine" , "development-tools" ] |
| 17 | |
| 18 | [lib] |
| 19 | path = "lib.rs" |
| 20 | |
| 21 | [features] |
| 22 | |
| 23 | default = ["backend-default" , "renderer-femtovg" , "renderer-software" , "accessibility" , "compat-1-2" ] |
| 24 | |
| 25 | ## Mandatory feature: |
| 26 | ## This feature is required to keep the compatibility with Slint 1.2 |
| 27 | ## Newer patch version may put current functionality behind a new feature |
| 28 | ## that would be enabled by default only if this feature was added |
| 29 | "compat-1-2" = [] |
| 30 | "compat-1-0" = ["compat-1-2" ] |
| 31 | |
| 32 | ## enable the [`print_diagnostics`] function to show diagnostic in the console output |
| 33 | display-diagnostics = ["i-slint-compiler/display-diagnostics" ] |
| 34 | |
| 35 | ## Enable the default image formats from the `image` crate, to support additional image formats in [`Image::load_from_path`] |
| 36 | ## and `@image-url`. When this feature is disabled, only PNG and JPEG are supported. When enabled, |
| 37 | ## the following image formats are supported: |
| 38 | ## AVIF, BMP, DDS, Farbfeld, GIF, HDR, ICO, JPEG, EXR, PNG, PNM, QOI, TGA, TIFF, WebP. |
| 39 | image-default-formats = ["i-slint-core/image-default-formats" ] |
| 40 | |
| 41 | |
| 42 | # (internal) export C++ FFI functions |
| 43 | ffi = ["spin_on" , "i-slint-core/ffi" ] |
| 44 | |
| 45 | # unused (std is mandatory for the interpreter) |
| 46 | std = [] |
| 47 | |
| 48 | #! ### Backends |
| 49 | |
| 50 | #! See the documentation of the [`slint` crate](https://docs.rs/slint/latest/slint/#backends) |
| 51 | |
| 52 | ## The Qt backend feature uses Qt for the windowing system integration and rendering. |
| 53 | ## This backend also provides the `native` style. |
| 54 | ## It requires Qt 5.15 or later to be installed. If Qt is not installed, the |
| 55 | ## backend will not be operational |
| 56 | backend-qt = ["i-slint-backend-selector/backend-qt" , "std" ] |
| 57 | |
| 58 | ## The [winit](https://crates.io/crates/log) crate is used for the event loop and windowing system integration. |
| 59 | ## With this feature, both x11 and wayland windowing systems are supported. For a smaller build, omit |
| 60 | ## this feature and select one of the other specific `backend-winit-XX` features. |
| 61 | backend-winit = ["i-slint-backend-selector/backend-winit" , "std" ] |
| 62 | |
| 63 | ## Simliar to `backend-winit` this enables the winit based event loop but only |
| 64 | ## with support for the X Window System on Unix. |
| 65 | backend-winit-x11 = ["i-slint-backend-selector/backend-winit-x11" , "std" ] |
| 66 | |
| 67 | ## Simliar to `backend-winit` this enables the winit based event loop but only |
| 68 | ## with support for the Wayland window system on Unix. |
| 69 | backend-winit-wayland = ["i-slint-backend-selector/backend-winit-wayland" , "std" ] |
| 70 | |
| 71 | ## KMS with Vulkan or EGL and libinput on Linux are used to render the application in full screen mode, without any |
| 72 | ## windowing system. Requires libseat. If you don't have libseat, select `backend-linuxkms-noseat` instead. (Experimental) |
| 73 | backend-linuxkms = ["i-slint-backend-selector/backend-linuxkms" , "std" ] |
| 74 | |
| 75 | ## KMS with Vulkan or EGL and libinput on Linux are used to render the application in full screen mode, without any |
| 76 | ## windowing system. Requires libseat. (Experimental) |
| 77 | backend-linuxkms-noseat = ["i-slint-backend-selector/backend-linuxkms-noseat" , "std" ] |
| 78 | |
| 79 | ## Alias to a backend and renderer that depends on the platform. |
| 80 | ## Will select the Qt backend on linux if present, and the winit otherwise |
| 81 | backend-default = ["i-slint-backend-selector/default" , "dep:i-slint-backend-qt" ] |
| 82 | |
| 83 | |
| 84 | ## Make the winit backend capable of rendering using the [femtovg](https://crates.io/crates/femtovg) crate. |
| 85 | renderer-femtovg = ["i-slint-backend-selector/renderer-femtovg" , "std" ] |
| 86 | |
| 87 | ## Make the winit backend capable of rendering using [Skia](https://skia.org/). |
| 88 | ## Must be used in combination with `backend-winit`, `backend-winit-x11`, or `backend-winit-wayland`. |
| 89 | renderer-skia = ["i-slint-backend-selector/renderer-skia" , "std" ] |
| 90 | |
| 91 | ## Same as `renderer-skia`, but Skia will always use OpenGL. |
| 92 | renderer-skia-opengl = ["i-slint-backend-selector/renderer-skia-opengl" , "std" ] |
| 93 | |
| 94 | ## Same as `renderer-skia`, but Skia will always use Vulkan. |
| 95 | renderer-skia-vulkan = ["i-slint-backend-selector/renderer-skia-vulkan" , "std" ] |
| 96 | |
| 97 | ## Make the winit backend capable of rendering using the software renderer. |
| 98 | renderer-software = ["i-slint-backend-selector/renderer-software" ] |
| 99 | |
| 100 | # deprecated aliases |
| 101 | renderer-winit-femtovg = ["renderer-femtovg" ] |
| 102 | renderer-winit-skia = ["renderer-skia" ] |
| 103 | renderer-winit-skia-opengl = ["renderer-skia-opengl" ] |
| 104 | renderer-winit-skia-vulkan = ["renderer-skia-vulkan" ] |
| 105 | renderer-winit-software = ["renderer-software" ] |
| 106 | |
| 107 | ## Enable integration with operating system provided accessibility APIs (default: enabled) |
| 108 | ## |
| 109 | ## Enabling this feature will try to expose the tree of UI elements to OS provided accessibility |
| 110 | ## APIs to support screen readers and other assistive technologies. |
| 111 | accessibility = ["i-slint-backend-selector/accessibility" ] |
| 112 | |
| 113 | ## Enable integration with [raw-window-handle](raw_window_handle_06) version 0.6. This provides a |
| 114 | ## [`Window::window_handle()`] function that returns a struct that implements |
| 115 | ## [HasWindowHandle](raw_window_handle_06::HasWindowHandle) and |
| 116 | ## [HasDisplayHandle](raw_window_handle_06::HasDisplayHandle) implementation. |
| 117 | raw-window-handle-06 = ["dep:raw-window-handle-06" , "i-slint-backend-selector/raw-window-handle-06" ] |
| 118 | |
| 119 | ## Features used internally by Slint tooling that are not stable and come without |
| 120 | ## any stability guarantees whatsoever. |
| 121 | internal = [] |
| 122 | |
| 123 | # (internal) Draw an highlight on a specified element |
| 124 | # NOTE: this is not a semver compatible feature |
| 125 | internal-highlight = [] |
| 126 | |
| 127 | # (internal) Serialize and deserialize Values to JSON, needs other internal API |
| 128 | # NOTE: this is not a semver compatible feature |
| 129 | internal-json = ["dep:serde_json" ] |
| 130 | |
| 131 | |
| 132 | [dependencies] |
| 133 | i-slint-compiler = { workspace = true } |
| 134 | i-slint-common = { workspace = true } |
| 135 | i-slint-core = { workspace = true, features = ["default" , "rtti" ] } |
| 136 | i-slint-backend-selector = { workspace = true, features = ["rtti" ] } |
| 137 | |
| 138 | vtable = { workspace = true } |
| 139 | |
| 140 | derive_more = { workspace = true, features = ["std" , "error" ] } |
| 141 | generativity = "1" |
| 142 | lyon_path = { version = "1.0" } |
| 143 | once_cell = "1.5" |
| 144 | serde_json = { workspace = true, optional = true } |
| 145 | document-features = { version = "0.2.0" , optional = true } |
| 146 | spin_on = { workspace = true, optional = true } |
| 147 | raw-window-handle-06 = { workspace = true, optional = true } |
| 148 | itertools = { workspace = true } |
| 149 | smol_str = { workspace = true } |
| 150 | unicode-segmentation = { workspace = true } |
| 151 | |
| 152 | [target.'cfg(target_arch = "wasm32")'.dependencies] |
| 153 | i-slint-backend-winit = { workspace = true } |
| 154 | web-sys = { workspace = true, features = ["Navigator" ] } |
| 155 | |
| 156 | [target.'cfg(target_os = "linux")'.dependencies] |
| 157 | # this line is there to add the "enable" feature by default, but only on linux |
| 158 | i-slint-backend-qt = { workspace = true, features = ["enable" ], optional = true } |
| 159 | |
| 160 | [dev-dependencies] |
| 161 | i-slint-backend-testing = { path = "../../internal/backends/testing" } |
| 162 | spin_on = { workspace = true } |
| 163 | |
| 164 | [package.metadata.docs.rs] |
| 165 | features = ["display-diagnostics" , "document-features" , "raw-window-handle-06" ] |
| 166 | |