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

[package]
name = "slint-viewer"
description = "The viewer binary for Slint"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
categories = ["gui", "development-tools", "command-line-utilities"]
keywords = ["viewer", "gui", "ui", "toolkit"]

[features]
backend-default = ["slint-interpreter/backend-default"]
backend-qt = ["slint-interpreter/backend-qt"]
backend-winit = ["slint-interpreter/backend-winit"]
backend-winit-x11 = ["slint-interpreter/backend-winit-x11"]
backend-winit-wayland = ["slint-interpreter/backend-winit-wayland"]
backend-linuxkms = ["slint-interpreter/backend-linuxkms"]
backend-linuxkms-noseat = ["slint-interpreter/backend-linuxkms-noseat"]

renderer-femtovg = ["slint-interpreter/renderer-femtovg"]
renderer-femtovg-wgpu = ["slint-interpreter/renderer-femtovg-wgpu"]
renderer-skia = ["slint-interpreter/renderer-skia"]
renderer-skia-opengl = ["slint-interpreter/renderer-skia-opengl"]
renderer-skia-vulkan = ["slint-interpreter/renderer-skia-vulkan"]
renderer-software = ["slint-interpreter/renderer-software"]

# Compat
backend-gl-all = ["backend-winit", "renderer-femtovg"]
backend-gl-wayland = ["backend-winit-wayland", "renderer-femtovg"]
backend-gl-x11 = ["backend-winit-x11", "renderer-femtovg"]
eventloop-qt = ["backend-qt"]
renderer-winit-qt = ["backend-qt"]
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 the translations using [gettext](https://www.gnu.org/software/gettext/gettext)
##
## the `@tr(...)` code from .slint files will be transformed into call to `dgettext`.
## You should pass --translation-domain and --translation-dir command line argument
## so that the viewer can find the translation
gettext = ["i-slint-core/gettext-rs"]

default = ["backend-default", "renderer-femtovg", "renderer-software"]

[dependencies]
i-slint-compiler = { workspace = true }
i-slint-core = { workspace = true }
slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-2", "internal", "accessibility", "image-default-formats", "internal-json"] }
i-slint-backend-selector = { workspace = true }

clap = { workspace = true }
notify = { version = "8.0.0", default-features = false, features = ["macos_kqueue"] }
shlex = "1"
spin_on = { workspace = true }
env_logger = "0.11.0"
itertools = { workspace = true }
serde_json = { workspace = true }
smol_str = { workspace = true }

[target.'cfg(not(any(target_os = "openbsd", target_os = "windows", all(target_arch = "aarch64", target_os = "linux"))))'.dependencies]
tikv-jemallocator = { workspace = true }

[[bin]]
name = "slint-viewer"
path = "main.rs"
