[package] name = "rustfig-os" version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true publish = false # The workspace lints, except `unsafe_code`: `deny` here (the workspace says `forbid`), # allowed only on the few functions that make OS calls: read a pixel off the screen (E4b), # show the system's print dialog (B5b). # Keep in step with [workspace.lints] in the root Cargo.toml. [lints.rust] unsafe_code = "deny" [lints.clippy] unwrap_used = "deny" expect_used = "deny" panic = "deny" unreachable = "deny" todo = "deny" unimplemented = "deny" field_reassign_with_default = "allow" [target.'cfg(target_os = "macos")'.dependencies] # NSColorSampler, the system colour sampler (versions already in the lock through winit and rfd). objc2 = "0.6" objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSColor", "NSColorSampler", "NSColorSpace", "NSPrintInfo", "NSPrintOperation", "NSPrintPanel", "block2", "objc2-core-foundation"] } block2 = "0.6" # The print dialog: PDFKit's print operation (NSPrintOperation) on the main thread. objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSData", "NSString", "NSURL"] } objc2-pdf-kit = { version = "0.3", default-features = false, features = ["std", "PDFDocument", "objc2-app-kit"] } [target.'cfg(target_os = "windows")'.dependencies] windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Graphics_Gdi", "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_WindowsAndMessaging", "Win32_UI_Controls_Dialogs", "Win32_UI_Shell", "Win32_System_Com", "Win32_System_Memory"] } [target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies] # The portal's PickColor and Print (the same ashpd and pollster rfd already uses); no unsafe. ashpd = { version = "0.11", default-features = false, features = ["async-std"] } pollster = "0.4" [target.'cfg(target_arch = "wasm32")'.dependencies] # Browser print: the PDF loads in a hidden iframe (blob URL) that calls print(); the tab is the fallback. No handwritten JS. web-sys = { workspace = true, features = ["Window", "Blob", "BlobPropertyBag", "Url", "Document", "Element", "HtmlElement", "HtmlIFrameElement", "Node", "CssStyleDeclaration"] } wasm-bindgen = "0.2" js-sys = "0.3"