[package] name = "druid-shell" version = "0.8.3" license = "Apache-2.0" authors = ["Raph Levien "] description = "Platform abstracting application shell used for Druid toolkit." repository = "https://github.com/linebender/druid" readme = "README.md" categories = ["os::macos-apis", "os::windows-apis", "gui"] edition = "2021" [package.metadata.docs.rs] features = ["raw-win-handle", "image"] rustdoc-args = ["--cfg", "docsrs"] default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] [features] default = ["gtk"] gtk = ["gdk-sys", "glib-sys", "gtk-sys", "gtk-rs"] x11 = [ "ashpd", "bindgen", "cairo-sys-rs", "futures", "nix", "pkg-config", "x11rb", ] wayland = [ "wayland-client", "wayland-protocols/client", "wayland-protocols/unstable_protocols", "nix", "cairo-sys-rs", "rand", "calloop", "wayland-cursor", "log", "im", "bindgen", "pkg-config", ] # Implement HasRawWindowHandle for WindowHandle raw-win-handle = ["raw-window-handle"] # passing on all the image features. AVIF is not supported because it does not # support decoding, and that's all we use `Image` for. image = ["piet-common/image"] image_png = ["piet-common/image_png"] jpeg = ["piet-common/jpeg"] jpeg_rayon = ["piet-common/jpeg_rayon"] gif = ["piet-common/gif"] bmp = ["piet-common/bmp"] ico = ["piet-common/ico"] tiff = ["piet-common/tiff"] webp = ["piet-common/webp"] pnm = ["piet-common/pnm"] dds = ["piet-common/dds"] tga = ["piet-common/tga"] farbfeld = ["piet-common/farbfeld"] dxt = ["piet-common/dxt"] hdr = ["piet-common/hdr"] serde = ["piet-common/serde"] [dependencies] piet-common = "0.6.2" tracing = "0.1.37" once_cell = "1.17.1" time = "0.3.20" cfg-if = "1.0.0" instant = { version = "0.1.12", features = ["wasm-bindgen"] } anyhow = "1.0.69" keyboard-types = { version = "0.6.2", default-features = false } # Optional dependencies raw-window-handle = { version = "0.5.0", optional = true, default-features = false } [target.'cfg(target_os="windows")'.dependencies] scopeguard = "1.1.0" wio = "0.2.2" [target.'cfg(target_os="windows")'.dependencies.winapi] version = "0.3.9" features = ["d2d1_1", "dwrite", "winbase", "libloaderapi", "errhandlingapi", "winuser", "shellscalingapi", "shobjidl", "combaseapi", "synchapi", "dxgi1_3", "dcomp", "d3d11", "dwmapi", "wincon", "fileapi", "processenv", "winbase", "handleapi", "shellapi", "winnls"] [target.'cfg(target_os="macos")'.dependencies] block = "0.1.6" cocoa = "0.24.1" objc = "0.2.7" core-graphics = "0.22.3" foreign-types = "0.3.2" bitflags = "1.3.2" [target.'cfg(any(target_os = "freebsd", target_os="linux", target_os="openbsd"))'.dependencies] ashpd = { version = "0.3.2", optional = true } # TODO(x11/dependencies): only use feature "xcb" if using X11 cairo-rs = { version = "0.16.7", default-features = false, features = ["xcb"] } cairo-sys-rs = { version = "0.16.3", default-features = false, optional = true } futures = { version = "0.3.26", optional = true, features = ["executor"]} gdk-sys = { version = "0.16.0", optional = true } # `gtk` gets renamed to `gtk-rs` so that we can use `gtk` as the feature name. gtk-rs = { version = "0.16.2", package = "gtk", optional = true } glib-sys = { version = "0.16.3", optional = true } gtk-sys = { version = "0.16.0", optional = true } nix = { version = "0.24.3", optional = true } x11rb = { version = "0.10.1", features = ["allow-unsafe-code", "present", "render", "randr", "xfixes", "xkb", "resource_manager", "cursor"], optional = true } wayland-client = { version = "0.29.5", optional = true } wayland-protocols = { version = "0.29.5", optional = true } wayland-cursor = { version = "0.29.5", optional = true } rand = { version = "0.8.5", optional = true } calloop = { version = "0.7.2", optional = true } log = { version = "0.4.17", optional = true } im = { version = "15.1.0", optional = true } [target.'cfg(target_arch="wasm32")'.dependencies] wasm-bindgen = "0.2.84" js-sys = "0.3.61" [target.'cfg(target_arch="wasm32")'.dependencies.web-sys] version = "0.3.61" features = ["Window", "MouseEvent", "CssStyleDeclaration", "WheelEvent", "KeyEvent", "KeyboardEvent", "Navigator"] [dev-dependencies] piet-common = { version = "0.6.2", features = ["png"] } static_assertions = "1.1.0" test-log = { version = "0.2.11", features = ["trace"], default-features = false } tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } unicode-segmentation = "1.10.1" [build-dependencies] bindgen = { version = "0.61.0", optional = true } pkg-config = { version = "0.3.26", optional = true } [[example]] name = "shello" # This actually enables scraping for all examples, not just `shello`. # However it is possible to add another [[example]] entry to disable it for a specific example. doc-scrape-examples = true