[package]
name = "druid-shell"
version = "0.6.0"
license = "Apache-2.0"
authors = ["Raph Levien <raph.levien@gmail.com>"]
description = "Platform abstracting application shell used for druid toolkit."
repository = "https://github.com/xi-editor/druid"
readme = "README.md"
categories = ["os::macos-apis", "os::windows-apis", "gui"]
edition = "2018"

[features]
x11 = ["xcb", "cairo-sys-rs"]

[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"

[dependencies]
# NOTE: When changing the piet or kurbo versions, ensure that
#       the kurbo version included in piet is compatible with the kurbo version specified here.
piet-common = "0.1.1"
kurbo = "0.6.1"

log = "0.4.8"
lazy_static = "1.4.0"
time = "0.2.16"
cfg-if = "0.1.10"
instant = { version = "0.1.4", features = ["wasm-bindgen"] }
anyhow = "1.0.31"

# Optional dependencies
cairo-rs = { version = "0.8.1", default_features = false, optional = true }
cairo-sys-rs = { version = "0.9.2", default_features = false, optional = true }
gio = { version = "0.8.1", optional = true }
gdk = { version = "0.12.1", optional = true }
gdk-sys = { version = "0.9.1", optional = true }
gtk = { version = "0.8.1", optional = true }
glib = { version = "0.9.3", optional = true }
glib-sys = { version = "0.9.1", optional = true }
gtk-sys = { version = "0.9.2", optional = true }
xcb = { version = "0.9.0", features = ["thread", "xlib_xcb", "randr"], optional = true }

[target.'cfg(target_os="windows")'.dependencies]
wio = "0.2.2"

[target.'cfg(target_os="windows")'.dependencies.winapi]
version = "0.3.8"
features = ["d2d1_1", "dwrite", "winbase", "libloaderapi", "errhandlingapi", "winuser",
            "shellscalingapi", "shobjidl", "combaseapi", "synchapi", "dxgi1_3", "dcomp",
            "d3d11", "dwmapi", "wincon", "fileapi", "processenv", "winbase", "handleapi"]

[target.'cfg(target_os="macos")'.dependencies]
cocoa = "0.20.1"
objc = "0.2.7"
core-graphics = "0.19.0"
foreign-types = "0.3.2"
bitflags = "1.2.1"

# TODO(x11/dependencies): only use feature "xcb" if using XCB
[target.'cfg(target_os="linux")'.dependencies]
cairo-rs = { version = "0.8.1", default_features = false, features = ["xcb"] }
gio = "0.8.1"
gdk = "0.12.1"
gdk-sys = "0.9.1"
glib = "0.9.3"
glib-sys = "0.9.1"
gtk-sys = "0.9.2"
gtk = { version = "0.8.1", features = ["v3_20"] }

[target.'cfg(target_arch="wasm32")'.dependencies]
wasm-bindgen = "0.2.63"
js-sys = "0.3.40"

[target.'cfg(target_arch="wasm32")'.dependencies.web-sys]
version = "0.3.40"
features = ["Window", "MouseEvent", "CssStyleDeclaration", "WheelEvent", "KeyEvent", "KeyboardEvent"]

[dev-dependencies]
piet-common = { version = "0.1.1", features = ["png"] }
