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 = "slint-interpreter"
6description = "Interpreter library for Slint"
7authors.workspace = true
8documentation.workspace = true
9edition.workspace = true
10homepage.workspace = true
11keywords.workspace = true
12license.workspace = true
13repository.workspace = true
14rust-version.workspace = true
15version.workspace = true
16categories = ["gui", "rendering::engine", "development-tools"]
17
18[lib]
19path = "lib.rs"
20
21[features]
22
23default = ["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
33display-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.
39image-default-formats = ["i-slint-core/image-default-formats"]
40
41
42# (internal) export C++ FFI functions
43ffi = ["spin_on", "i-slint-core/ffi"]
44
45# unused (std is mandatory for the interpreter)
46std = []
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
56backend-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.
61backend-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.
65backend-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.
69backend-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)
73backend-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)
77backend-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
81backend-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.
85renderer-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`.
89renderer-skia = ["i-slint-backend-selector/renderer-skia", "std"]
90
91## Same as `renderer-skia`, but Skia will always use OpenGL.
92renderer-skia-opengl = ["i-slint-backend-selector/renderer-skia-opengl", "std"]
93
94## Same as `renderer-skia`, but Skia will always use Vulkan.
95renderer-skia-vulkan = ["i-slint-backend-selector/renderer-skia-vulkan", "std"]
96
97## Make the winit backend capable of rendering using the software renderer.
98renderer-software = ["i-slint-backend-selector/renderer-software"]
99
100# deprecated aliases
101renderer-winit-femtovg = ["renderer-femtovg"]
102renderer-winit-skia = ["renderer-skia"]
103renderer-winit-skia-opengl = ["renderer-skia-opengl"]
104renderer-winit-skia-vulkan = ["renderer-skia-vulkan"]
105renderer-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.
111accessibility = ["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.
117raw-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.
121internal = []
122
123# (internal) Draw an highlight on a specified element
124# NOTE: this is not a semver compatible feature
125internal-highlight = []
126
127# (internal) Serialize and deserialize Values to JSON, needs other internal API
128# NOTE: this is not a semver compatible feature
129internal-json = ["dep:serde_json"]
130
131
132[dependencies]
133i-slint-compiler = { workspace = true }
134i-slint-common = { workspace = true }
135i-slint-core = { workspace = true, features = ["default", "rtti"] }
136i-slint-backend-selector = { workspace = true, features = ["rtti"] }
137
138vtable = { workspace = true }
139
140derive_more = { workspace = true, features = ["std", "error"] }
141generativity = "1"
142lyon_path = { version = "1.0" }
143once_cell = "1.5"
144serde_json = { workspace = true, optional = true }
145document-features = { version = "0.2.0", optional = true }
146spin_on = { workspace = true, optional = true }
147raw-window-handle-06 = { workspace = true, optional = true }
148itertools = { workspace = true }
149smol_str = { workspace = true }
150unicode-segmentation = { workspace = true }
151
152[target.'cfg(target_arch = "wasm32")'.dependencies]
153i-slint-backend-winit = { workspace = true }
154web-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
158i-slint-backend-qt = { workspace = true, features = ["enable"], optional = true }
159
160[dev-dependencies]
161i-slint-backend-testing = { path = "../../internal/backends/testing" }
162spin_on = { workspace = true }
163
164[package.metadata.docs.rs]
165features = ["display-diagnostics", "document-features", "raw-window-handle-06"]
166