On the first launch that hasn't answered it yet, the app shows a small
dialog offering to become the default handler for .dwg and .dxf files.
The choice is persisted (default_assoc_prompted) so the prompt never
reappears.
The platform plumbing lives in io/file_association.rs:
* Windows — opens the OS's own per-app default-programs dialog via
IApplicationAssociationRegistrationUI::LaunchAdvancedAssociationUI,
passing the "Open CAD Studio" RegisteredApplications name the MSI
registers. Modern Windows guards the actual default behind a
UserChoice hash, so this is the supported consent path.
* Linux — xdg-mime default against the installed .desktop file, whose
MimeType entries already cover image/vnd.dwg and image/vnd.dxf.
* macOS — LSSetDefaultRoleHandlerForContentType binds the DWG/DXF UTIs
declared in Info.plist to the app bundle id.
The work runs on a dedicated thread (the Windows dialog is modal) with
the result delivered back through a oneshot channel and surfaced in the
command line.
https://claude.ai/code/session_01DFVSKgViFaxEjZD2KsTdtt
46 lines
2.1 KiB
TOML
46 lines
2.1 KiB
TOML
[package]
|
|
name = "OpenCADStudio"
|
|
version = "0.5.3"
|
|
edition = "2021"
|
|
build = "build.rs"
|
|
|
|
[dependencies]
|
|
# vtkio (pulled in transitively via truck-meshalgo) depends on xz2 → lzma-sys,
|
|
# which by default links the system liblzma dynamically. On macOS that bakes a
|
|
# Homebrew dylib path (/opt/homebrew/.../liblzma.5.dylib) into the binary, so
|
|
# the .app crashes on launch on machines without that exact library (#56).
|
|
# Forcing the `static` feature builds liblzma from the bundled source, making
|
|
# the binary self-contained on every platform.
|
|
lzma-sys = { version = "0.1", features = ["static"] }
|
|
iced = { version = "0.14", features = ["debug", "image", "svg", "advanced", "canvas", "smol"] }
|
|
bytemuck = { version = "1.25", features = ["derive"] }
|
|
glam = { version = "0.33", features = ["bytemuck"] }
|
|
truck-modeling = "0.6"
|
|
truck-meshalgo = { version = "0.4", default-features = false, features = ["tessellation"] }
|
|
truck-polymesh = "0.6"
|
|
rfd = "0.17"
|
|
acadrust = "0.3.4"
|
|
open = "5"
|
|
printpdf = "0.9.1"
|
|
flate2 = "1"
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] }
|
|
rayon = "1"
|
|
ureq = { version = "3", default-features = false, features = ["rustls"] }
|
|
inventory = "0.3"
|
|
truck-shapeops = "0.4"
|
|
# Fast non-cryptographic hasher. Handle/u64 keys dominate the hot block,
|
|
# hatch, draw-depth and wire caches; the default SipHash is overkill there.
|
|
rustc-hash = "2"
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
# Win32_System_Com is needed for the COM calls behind "Set as default app"
|
|
# (CoCreateInstance → IApplicationAssociationRegistrationUI), which opens
|
|
# Windows' own per-app default-programs dialog.
|
|
windows-sys = { version = "0.61", features = ["Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", "Win32_System_Com"] }
|
|
|
|
[patch.crates-io]
|
|
# Tracks HakanSeven12/acadrust main, which carries the hatch
|
|
# boundary-handle cap, raster-image/wipeout clip-vertex fix, 3DFACE
|
|
# Z-decode fix, and CANNOSCALE/CANNOSCALEVALUE header support on top of
|
|
# upstream. Revert to upstream once those PRs land.
|
|
acadrust = { git = "https://github.com/HakanSeven12/acadrust", branch = "main" }
|