[package] name = "photocraft-tablet" version.workspace = true edition.workspace = true license.workspace = true description = "Pen tablet pressure, tilt, rotation and eraser end on macOS (AppKit), Linux X11 (XInput2) and Windows (WinTab), and barrel button and eraser end on Windows (Windows Ink)" # The one isolated `unsafe` helper crate (see AGENTS.md, Never crash): the AppKit event # monitor on macOS and the WH_GETMESSAGE and WH_CALLWNDPROC pointer hooks on Windows need # platform interop. Only `src/macos.rs` and `src/windows.rs` allow `unsafe`; everything else is # denied, and every other crate keeps the workspace's `unsafe_code = "forbid"`. [lints.rust] unsafe_code = "deny" [lints.clippy] cognitive_complexity = "deny" too_many_arguments = "deny" wildcard_imports = "deny" dbg_macro = "warn" todo = "warn" # Already in Cargo.lock (eframe/wgpu/fmv-macos-events and winit pull them in); pinned exactly: # review the diff before bumping. [target.'cfg(target_os = "macos")'.dependencies] objc2 = "=0.6.5" block2 = "=0.6.2" objc2-foundation = { version = "=0.3.2", default-features = false, features = ["std", "NSGeometry"] } objc2-app-kit = { version = "=0.3.2", default-features = false, features = ["std", "block2", "NSEvent"] } # Pure-Rust X11 client (no unsafe in the RustConnection path we use). [target.'cfg(target_os = "linux")'.dependencies] x11rb = { version = "=0.13.2", default-features = false, features = ["xinput"] } # WinTab 1.4: a system context on PhotoCraft's real window supplies pressure, tilt, rotation and # the eraser end while Windows Ink is disabled. `wintab` safely wraps the vendor's wintab32.dll, # loaded at run time; only the Windows target builds it. `windows` is pinned to the version # `wintab` uses. [target.'cfg(target_os = "windows")'.dependencies] log = { workspace = true } wintab = "=0.1.1" windows = { version = "=0.62.2", features = ["Win32_Foundation"] } # Tests build real tablet NSEvents (from CGEvents) and read them through the monitor's path. [target.'cfg(target_os = "macos")'.dev-dependencies] objc2-app-kit = { version = "=0.3.2", default-features = false, features = ["std", "block2", "NSEvent", "NSGraphicsContext", "objc2-core-graphics", "NSApplication", "NSResponder"] } objc2-core-graphics = { version = "=0.3.2", default-features = false, features = ["std", "CGEvent", "CGEventTypes"] } [[test]] name = "monitor_macos" harness = false