# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 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-winit", "renderer-femtovg", "backend-qt", "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"]

## Vulkan/EGL and libinput on Linux are used to render the application in full screen mode, without any
## windowing system.
backend-linuxkms = ["i-slint-backend-selector/backend-linuxkms", "std"]

## 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"]

## 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 = { version = "0.1.6", path="../../helper_crates/vtable" }

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 }

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

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

[package.metadata.docs.rs]
features = ["display-diagnostics", "document-features"]
