# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial

[package]
name = "slint-interpreter"
description = "Interpreter library for Slint"
authors.workspace = true
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
categories = ["gui", "rendering::engine", "development-tools"]

[lib]
path = "lib.rs"

[features]

default = ["backend-default", "renderer-femtovg", "accessibility", "compat-1-2"]

## Mandatory feature:
## This feature is required to keep the compatibility with Slint 1.2
## Newer patch version may put current functionality behind a new feature
## that would be enabled by default only if this feature was added
"compat-1-2" = []
"compat-1-0" = ["compat-1-2"]

## enable the [`print_diagnostics`] function to show diagnostic in the console output
display-diagnostics = ["i-slint-compiler/display-diagnostics"]

# (internal) export C++ FFI functions
ffi = ["spin_on", "i-slint-core/ffi"]

# (internal) Draw an highlight on a specified element
# NOTE: this is not a semver compatible feature
highlight = []

# unused (std is mandatory for the interpreter)
std = []

#! ### Backends

#! See the documentation of the [`slint` crate](https://docs.rs/slint/latest/slint/#backends)

## The Qt backend feature uses Qt for the windowing system integration and rendering.
## This backend also provides the `native` style.
## It requires Qt 5.15 or later to be installed. If Qt is not installed, the
## backend will not be operational
backend-qt = ["i-slint-backend-selector/i-slint-backend-qt", "std"]

## The [winit](https://crates.io/crates/log) crate is used for the event loop and windowing system integration.
## With this feature, both x11 and wayland windowing systems are supported. For a smaller build, omit
## this feature and select one of the other specific `backend-winit-XX` features.
backend-winit = ["i-slint-backend-selector/backend-winit", "std"]

## Simliar to `backend-winit` this enables the winit based event loop but only
## with support for the X Window System on Unix.
backend-winit-x11 = ["i-slint-backend-selector/backend-winit-x11", "std"]

## Simliar to `backend-winit` this enables the winit based event loop but only
## with support for the Wayland window system on Unix.
backend-winit-wayland = ["i-slint-backend-selector/backend-winit-wayland", "std"]

## KMS with Vulkan or EGL and libinput on Linux are used to render the application in full screen mode, without any
## windowing system. Requires libseat. If you don't have libseat, select `backend-linuxkms-noseat` instead. (Experimental)
backend-linuxkms = ["i-slint-backend-selector/backend-linuxkms", "std"]

## KMS with Vulkan or EGL and libinput on Linux are used to render the application in full screen mode, without any
## windowing system. Requires libseat. (Experimental)
backend-linuxkms-noseat = ["i-slint-backend-selector/backend-linuxkms-noseat", "std"]

## Alias to a backend and renderer that depends on the platform.
## Will select the Qt backend on linux if present, and the winit otherwise
backend-default = ["i-slint-backend-selector/default", "i-slint-backend-qt"]


## Make the winit backend capable of rendering using the [femtovg](https://crates.io/crates/femtovg) crate.
renderer-femtovg = ["i-slint-backend-selector/renderer-femtovg", "std"]

## Make the winit backend capable of rendering using [Skia](https://skia.org/).
## Must be used in combination with `backend-winit`, `backend-winit-x11`, or `backend-winit-wayland`.
renderer-skia = ["i-slint-backend-selector/renderer-skia", "std"]

## Same as `renderer-skia`, but Skia will always use OpenGL.
renderer-skia-opengl = ["i-slint-backend-selector/renderer-skia-opengl", "std"]

## Same as `renderer-skia`, but Skia will always use Vulkan.
renderer-skia-vulkan = ["i-slint-backend-selector/renderer-skia-vulkan", "std"]

## Make the winit backend capable of rendering using the software renderer.
renderer-software = ["i-slint-backend-selector/renderer-software"]

# deprecated aliases
renderer-winit-femtovg = ["renderer-femtovg"]
renderer-winit-skia = ["renderer-skia"]
renderer-winit-skia-opengl= ["renderer-skia-opengl"]
renderer-winit-skia-vulkan= ["renderer-skia-vulkan"]
renderer-winit-software = ["renderer-software"]

## Enable integration with operating system provided accessibility APIs (default: enabled)
##
## Enabling this feature will try to expose the tree of UI elements to OS provided accessibility
## APIs to support screen readers and other assistive technologies.
accessibility = ["i-slint-backend-selector/accessibility"]

## Enable integration with [raw-window-handle](raw_window_handle_06) version 0.6. This provides a
## [`Window::window_handle()`] function that returns a struct that implements
## [HasWindowHandle](raw_window_handle_06::HasWindowHandle) and
## [HasDisplayHandle](raw_window_handle_06::HasDisplayHandle) implementation.
raw-window-handle-06 = ["dep:raw-window-handle-06", "i-slint-backend-selector/raw-window-handle-06"]

## Features used internally by Slint tooling that are not stable and come without
## any stability guarantees whatsoever.
internal = []

[dependencies]
i-slint-compiler = { workspace = true  }
i-slint-common = { workspace = true }
i-slint-core = { workspace = true, features = ["default", "rtti"] }
i-slint-backend-selector = { workspace = true, features = ["rtti"] }

vtable = { workspace = true }

derive_more = "0.99.5"
generativity = "1"
lyon_path = { version = "1.0" }
once_cell = "1.5"
thiserror = "1"
document-features = { version = "0.2.0", optional = true }
spin_on = { version = "0.1", optional = true }
raw-window-handle-06 = { workspace = true, optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
i-slint-backend-winit = { workspace = true }

[target.'cfg(target_os = "linux")'.dependencies]
# this line is there to add the "enable" feature by default, but only on linux
i-slint-backend-qt = { workspace = true, features = [ "enable" ], optional = true }


[dev-dependencies]
i-slint-backend-testing = { path = "../../internal/backends/testing" }
spin_on = "0.1"

[package.metadata.docs.rs]
features = ["display-diagnostics", "document-features", "raw-window-handle-06"]
