[package]
name = "libcosmic"
version = "0.1.0"
edition = "2021"
rust-version = "1.71"

[lib]
name = "cosmic"

[features]
default = ["iced_sctk?/clipboard"]
# Accessibility support
a11y = ["iced/a11y", "iced_accessibility"]
# Builds support for animated images
animated-image = ["image", "dep:async-fs", "tokio?/io-util", "tokio?/fs"]
# XXX Use "a11y"; which is causing a panic currently
applet = ["wayland", "tokio", "cosmic-panel-config", "ron"]
applet-token = []
# Use the cosmic-settings-daemon for config handling
dbus-config = ["cosmic-config/dbus", "dep:zbus", "cosmic-settings-daemon"]
# Debug features
debug = ["iced/debug"]
# Enables pipewire support in ashpd, if ashpd is enabled
pipewire = ["ashpd?/pipewire"]
# Enables process spawning helper
process = ["dep:nix"]
# Use rfd for file dialogs
rfd = ["dep:rfd"]
# Enables desktop files helpers
desktop = ["process", "dep:freedesktop-desktop-entry", "dep:mime", "dep:shlex"]
# Enables keycode serialization
serde-keycode = ["iced_core/serde"]
# Prevents multiple separate process instances.
single-instance = ["dep:zbus", "serde", "ron"]
# smol async runtime
smol = ["iced/smol", "zbus?/async-io"]
tokio = [
    "dep:tokio",
    "ashpd?/tokio",
    "iced/tokio",
    "rfd?/tokio",
    "zbus?/tokio",
    "cosmic-config/tokio",
]
# Tokio async runtime
# Wayland window support
wayland = [
    "ashpd?/wayland",
    "iced_runtime/wayland",
    "iced/wayland",
    "iced_sctk",
    "cctk",
]
# multi-window support
multi-window = ["iced/multi-window"]
# Render with wgpu
wgpu = ["iced/wgpu", "iced_wgpu"]
# X11 window support via winit
winit = ["iced/winit", "iced_winit"]
winit_debug = ["winit", "debug"]
winit_tokio = ["winit", "tokio"]
winit_wgpu = ["winit", "wgpu"]
# Enables XDG portal integrations
xdg-portal = ["ashpd"]

[dependencies]
apply = "0.3.0"
ashpd = { version = "0.8.1", default-features = false, optional = true }
async-fs = { version = "2.1", optional = true }
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "e4e6f8c", optional = true }
chrono = "0.4.35"
cosmic-config = { path = "cosmic-config" }
cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
css-color = "0.2.5"
derive_setters = "0.1.5"
fraction = "0.14.0"
image = { version = "0.25.1", optional = true }
lazy_static = "1.4.0"
mime = { version = "0.3.17", optional = true }
nix = { version = "0.27", features = ["process"], optional = true }
palette = "0.7.3"
rfd = { version = "0.14.0", optional = true }
serde = { version = "1.0.180", optional = true }
slotmap = "1.0.6"
thiserror = "1.0.44"
tokio = { version = "1.24.2", optional = true }
tracing = "0.1"
unicode-segmentation = "1.6"
url = "2.4.0"
zbus = { version = "4.2.1", default-features = false, optional = true }

[target.'cfg(unix)'.dependencies]
freedesktop-icons = "0.2.5"
freedesktop-desktop-entry = { version = "0.5.1", optional = true }
shlex = { version = "1.3.0", optional = true }

[dependencies.cosmic-theme]
path = "cosmic-theme"

[dependencies.iced]
path = "./iced"
default-features = false
features = ["advanced", "image", "lazy", "svg", "web-colors"]

[dependencies.iced_runtime]
path = "./iced/runtime"

[dependencies.iced_renderer]
path = "./iced/renderer"

[dependencies.iced_core]
path = "./iced/core"
features = ["serde"]

[dependencies.iced_widget]
path = "./iced/widget"
features = ["canvas"]

[dependencies.iced_futures]
path = "./iced/futures"

[dependencies.iced_accessibility]
path = "./iced/accessibility"
optional = true

[dependencies.iced_tiny_skia]
path = "./iced/tiny_skia"

[dependencies.iced_style]
path = "./iced/style"

[dependencies.iced_sctk]
path = "./iced/sctk"
optional = true

[dependencies.iced_winit]
path = "./iced/winit"
optional = true

[dependencies.iced_wgpu]
path = "./iced/wgpu"
optional = true

[dependencies.cosmic-panel-config]
git = "https://github.com/pop-os/cosmic-panel"
optional = true

[dependencies.ron]
version = "0.8"
optional = true

[dependencies.taffy]
git = "https://github.com/DioxusLabs/taffy"
rev = "7781c70"
features = ["grid"]

[workspace]
members = [
    "cosmic-config",
    "cosmic-config-derive",
    "cosmic-theme",
    "examples/*",
]
exclude = ["examples/design-demo", "iced"]

[workspace.dependencies]
dirs = "5.0.1"


[patch."https://github.com/pop-os/libcosmic"]
libcosmic = { path = "./" }
