commit 7cb90d862575c12d94bbfa3fbfad3c5c12c5ea9d Author: Noah Bartlett Date: Sun Mar 8 12:38:39 2026 -0600 Initial commit (v0.1.0) diff --git a/repos/singularity/.gitignore b/repos/singularity/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/repos/singularity/.gitignore @@ -0,0 +1 @@ +/target diff --git a/repos/singularity/Cargo.lock b/repos/singularity/Cargo.lock new file mode 100644 index 0000000..3540c62 --- /dev/null +++ b/repos/singularity/Cargo.lock @@ -0,0 +1,5015 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ab_glyph" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-activity" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" +dependencies = [ + "android-properties", + "bitflags 2.10.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk 0.8.0", + "ndk-context", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum", + "thiserror 1.0.69", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + +[[package]] +name = "ash" +version = "0.37.3+1.3.251" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +dependencies = [ + "libloading 0.7.4", +] + +[[package]] +name = "ashpd" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd884d7c72877a94102c3715f3b1cd09ff4fac28221add3e57cfbe25c236d093" +dependencies = [ + "async-fs", + "async-net", + "enumflags2", + "futures-channel", + "futures-util", + "rand", + "serde", + "serde_repr", + "url", + "zbus", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix 1.1.3", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix 1.1.3", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "async-signal" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 1.1.3", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "block2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" +dependencies = [ + "block-sys", + "objc2 0.4.1", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.2", +] + +[[package]] +name = "blocking" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + +[[package]] +name = "bytemuck" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.13+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "calloop" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" +dependencies = [ + "bitflags 2.10.0", + "log", + "polling", + "rustix 0.38.44", + "slab", + "thiserror 1.0.69", +] + +[[package]] +name = "calloop" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e" +dependencies = [ + "bitflags 2.10.0", + "polling", + "rustix 1.1.3", + "slab", + "tracing", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop 0.12.4", + "rustix 0.38.44", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" +dependencies = [ + "calloop 0.14.3", + "rustix 1.1.3", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "cc" +version = "1.2.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clipboard-win" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" +dependencies = [ + "error-code", +] + +[[package]] +name = "clipboard_macos" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7f4aaa047ba3c3630b080bb9860894732ff23e2aee290a418909aa6d5df38f" +dependencies = [ + "objc2 0.5.2", + "objc2-app-kit", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "clipboard_wayland" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003f886bc4e2987729d10c1db3424e7f80809f3fc22dbc16c685738887cb37b8" +dependencies = [ + "smithay-clipboard", +] + +[[package]] +name = "clipboard_x11" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd63e33452ffdafd39924c4f05a5dd1e94db646c779c6bd59148a3d95fff5ad4" +dependencies = [ + "thiserror 2.0.17", + "x11rb", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cosmic-text" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75acbfb314aeb4f5210d379af45ed1ec2c98c7f1790bf57b8a4c562ac0c51b71" +dependencies = [ + "fontdb", + "libm", + "log", + "rangemap", + "rustc-hash", + "rustybuzz 0.11.0", + "self_cell", + "swash", + "sys-locale", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f791803201ab277ace03903de1594460708d2d54df6053f2d9e82f592b19e3b" + +[[package]] +name = "cursor-icon" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" + +[[package]] +name = "d3d12" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" +dependencies = [ + "bitflags 2.10.0", + "libloading 0.8.9", + "winapi", +] + +[[package]] +name = "data-url" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dispatch2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" +dependencies = [ + "bitflags 2.10.0", + "objc2 0.6.3", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading 0.8.9", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "drm" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f" +dependencies = [ + "bitflags 2.10.0", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "libc", + "rustix 0.38.44", +] + +[[package]] +name = "drm-ffi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e41459d99a9b529845f6d2c909eb9adf3b6d2f82635ae40be8de0601726e8b" +dependencies = [ + "drm-sys", + "rustix 0.38.44", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafb66c8dbc944d69e15cfcc661df7e703beffbaec8bd63151368b06c5f9858c" +dependencies = [ + "libc", + "linux-raw-sys 0.6.5", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "error-code" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" + +[[package]] +name = "etagere" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc89bf99e5dc15954a60f707c1e09d7540e5cd9af85fa75caa0b510bc08c5342" +dependencies = [ + "euclid", + "svg_fmt", +] + +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" + +[[package]] +name = "flate2" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "font-types" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3971f9a5ca983419cdc386941ba3b9e1feba01a0ab888adf78739feb2798492" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "fontconfig-parser" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646" +dependencies = [ + "roxmltree 0.20.0", +] + +[[package]] +name = "fontdb" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2 0.8.0", + "slotmap", + "tinyvec", + "ttf-parser 0.19.2", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" +dependencies = [ + "rustix 1.1.3", + "windows-link", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glam" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" + +[[package]] +name = "glow" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "glyphon" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a62d0338e4056db6a73221c2fb2e30619452f6ea9651bac4110f51b0f7a7581" +dependencies = [ + "cosmic-text", + "etagere", + "lru", + "wgpu", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.10.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" +dependencies = [ + "log", + "presser", + "thiserror 1.0.69", + "winapi", + "windows", +] + +[[package]] +name = "gpu-descriptor" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" +dependencies = [ + "bitflags 2.10.0", + "gpu-descriptor-types", + "hashbrown 0.14.5", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "guillotiere" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" +dependencies = [ + "euclid", + "svg_fmt", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "hassle-rs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" +dependencies = [ + "bitflags 2.10.0", + "com", + "libc", + "libloading 0.8.9", + "thiserror 1.0.69", + "widestring", + "winapi", +] + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "iced" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d4eb0fbbefb8c428b70680e77ed9013887b17c1d6be366b40f264f956d1a096" +dependencies = [ + "iced_core", + "iced_futures", + "iced_renderer", + "iced_widget", + "iced_winit", + "thiserror 1.0.69", +] + +[[package]] +name = "iced_core" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d7e6bbd197f311ed3d8b71651876b0ce01318fde52cda862a9a7a4373c9b930" +dependencies = [ + "bitflags 2.10.0", + "glam", + "log", + "num-traits", + "palette", + "raw-window-handle", + "smol_str", + "thiserror 1.0.69", + "web-time", + "xxhash-rust", +] + +[[package]] +name = "iced_futures" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "370bad88fb3832cbeeb3fa6c486b4701fb7e8da32a753b3101d4ce81fc1d9497" +dependencies = [ + "futures", + "iced_core", + "log", + "tokio", + "wasm-bindgen-futures", + "wasm-timer", +] + +[[package]] +name = "iced_graphics" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a044c193ef0840eacabfa05424717331d1fc5b3ecb9a89316200c75da2ba9a4" +dependencies = [ + "bitflags 2.10.0", + "bytemuck", + "cosmic-text", + "half", + "iced_core", + "iced_futures", + "log", + "once_cell", + "raw-window-handle", + "rustc-hash", + "thiserror 1.0.69", + "unicode-segmentation", + "xxhash-rust", +] + +[[package]] +name = "iced_renderer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c281e03001d566058f53dec9325bbe61c62da715341206d2627f57a3ecc7f69" +dependencies = [ + "iced_graphics", + "iced_tiny_skia", + "iced_wgpu", + "log", + "thiserror 1.0.69", +] + +[[package]] +name = "iced_runtime" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a79f852c01cc6d61663c94379cb3974ac3ad315a28c504e847d573e094f46822" +dependencies = [ + "iced_core", + "iced_futures", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "iced_style" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea42a740915d2a5a9ff9c3aa0bca28b16e9fb660bc8f675eed71d186cadb579" +dependencies = [ + "iced_core", + "once_cell", + "palette", +] + +[[package]] +name = "iced_tiny_skia" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2228781f4d381a1cbbd7905a9f077351aa8d37269094021d5d9e779f130aff" +dependencies = [ + "bytemuck", + "cosmic-text", + "iced_graphics", + "kurbo 0.10.4", + "log", + "resvg", + "rustc-hash", + "softbuffer", + "tiny-skia", + "xxhash-rust", +] + +[[package]] +name = "iced_wgpu" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c243b6700452886aac1ee1987e84d9fb43b56b53fea9a1eb67713fd0fde244" +dependencies = [ + "bitflags 2.10.0", + "bytemuck", + "futures", + "glam", + "glyphon", + "guillotiere", + "iced_graphics", + "log", + "once_cell", + "resvg", + "wgpu", +] + +[[package]] +name = "iced_widget" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e01b2212adecf1cb80e2267f302c0e0c263e55f97812056949199ccf9f0b908" +dependencies = [ + "iced_renderer", + "iced_runtime", + "iced_style", + "num-traits", + "thiserror 1.0.69", + "unicode-segmentation", +] + +[[package]] +name = "iced_winit" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63f66831d0e399b93f631739121a6171780d344b275d56808b9504d8ca75c7d2" +dependencies = [ + "iced_graphics", + "iced_runtime", + "iced_style", + "log", + "thiserror 1.0.69", + "tracing", + "web-sys", + "winapi", + "window_clipboard", + "winit", +] + +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2 0.3.0", + "dispatch", + "objc2 0.4.1", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "imagesize" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" + +[[package]] +name = "js-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading 0.8.9", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "kurbo" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "kurbo" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" +dependencies = [ + "arrayvec", + "smallvec", +] + +[[package]] +name = "libc" +version = "0.2.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +dependencies = [ + "bitflags 2.10.0", + "libc", + "redox_syscall 0.7.0", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "memmap2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" +dependencies = [ + "bitflags 2.10.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "naga" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" +dependencies = [ + "bit-set", + "bitflags 2.10.0", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "num-traits", + "rustc-hash", + "spirv", + "termcolor", + "thiserror 1.0.69", + "unicode-xid", +] + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.10.0", + "jni-sys", + "log", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.10.0", + "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", + "memoffset", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" +dependencies = [ + "objc-sys", + "objc2-encode 3.0.0", +] + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode 4.1.0", +] + +[[package]] +name = "objc2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05" +dependencies = [ + "objc2-encode 4.1.0", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.10.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation 0.2.2", + "objc2-quartz-core 0.2.2", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.10.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.10.0", + "dispatch2", + "objc2 0.6.3", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.10.0", + "dispatch2", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.10.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.10.0", + "objc2 0.6.3", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.10.0", + "objc2 0.6.3", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.10.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.10.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.10.0", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "orbclient" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ad2c6bae700b7aa5d1cc30c59bdd3a1c180b09dbaea51e2ae2b8e1cf211fdd" +dependencies = [ + "libc", + "libredox", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser 0.25.1", +] + +[[package]] +name = "palette" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +dependencies = [ + "approx", + "fast-srgb8", + "palette_derive", + "phf", +] + +[[package]] +name = "palette_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +dependencies = [ + "by_address", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.12", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.1", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 1.1.3", + "windows-sys 0.61.2", +] + +[[package]] +name = "pollster" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit 0.23.10+spec-1.0.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" + +[[package]] +name = "quick-xml" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "range-alloc" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" + +[[package]] +name = "rangemap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "rctree" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" + +[[package]] +name = "read-fonts" +version = "0.22.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69aacb76b5c29acfb7f90155d39759a29496aebb49395830e928a9703d2eec2f" +dependencies = [ + "bytemuck", + "font-types", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_syscall" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "resvg" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7980f653f9a7db31acff916a262c3b78c562919263edea29bf41a056e20497" +dependencies = [ + "gif", + "jpeg-decoder", + "log", + "pico-args", + "png", + "rgb", + "svgtypes", + "tiny-skia", + "usvg", +] + +[[package]] +name = "rfd" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a73a7337fc24366edfca76ec521f51877b114e42dab584008209cca6719251" +dependencies = [ + "ashpd", + "block", + "dispatch", + "js-sys", + "log", + "objc", + "objc-foundation", + "objc_id", + "pollster", + "raw-window-handle", + "urlencoding", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rgb" +version = "0.8.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "roxmltree" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "roxmltree" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rustybuzz" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71cd15fef9112a1f94ac64b58d1e4628192631ad6af4dc69997f995459c874e7" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "smallvec", + "ttf-parser 0.19.2", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "rustybuzz" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee8fe2a8461a0854a37101fe7a1b13998d0cfa987e43248e81d2a5f4570f6fa" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "libm", + "smallvec", + "ttf-parser 0.20.0", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sctk-adwaita" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70b31447ca297092c5a9916fc3b955203157b37c19ca8edde4f52e9843e602c7" +dependencies = [ + "ab_glyph", + "log", + "memmap2 0.9.9", + "smithay-client-toolkit 0.18.1", + "tiny-skia", +] + +[[package]] +name = "self_cell" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "simplecss" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c" +dependencies = [ + "log", +] + +[[package]] +name = "singularity" +version = "0.1.0" +dependencies = [ + "anyhow", + "directories", + "iced", + "resvg", + "rfd", + "serde", + "tiny-skia", + "toml", + "uuid", + "walkdir", + "which", + "zip", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "skrifa" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1c44ad1f6c5bdd4eefed8326711b7dbda9ea45dfd36068c427d332aa382cbe" +dependencies = [ + "bytemuck", + "read-fonts", +] + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smithay-client-toolkit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" +dependencies = [ + "bitflags 2.10.0", + "calloop 0.12.4", + "calloop-wayland-source 0.2.0", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.9", + "rustix 0.38.44", + "thiserror 1.0.69", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols 0.31.2", + "wayland-protocols-wlr 0.2.0", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0" +dependencies = [ + "bitflags 2.10.0", + "calloop 0.14.3", + "calloop-wayland-source 0.4.1", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.9", + "rustix 1.1.3", + "thiserror 2.0.17", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols 0.32.10", + "wayland-protocols-experimental", + "wayland-protocols-misc", + "wayland-protocols-wlr 0.3.10", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smithay-clipboard" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71704c03f739f7745053bde45fa203a46c58d25bc5c4efba1d9a60e9dba81226" +dependencies = [ + "libc", + "smithay-client-toolkit 0.20.0", + "wayland-backend", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "as-raw-xcb-connection", + "bytemuck", + "drm", + "fastrand", + "js-sys", + "memmap2 0.9.9", + "ndk 0.9.0", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", + "raw-window-handle", + "redox_syscall 0.5.18", + "rustix 1.1.3", + "tiny-xlib", + "tracing", + "wasm-bindgen", + "wayland-backend", + "wayland-client", + "wayland-sys", + "web-sys", + "windows-sys 0.61.2", + "x11rb", +] + +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "svg_fmt" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb" + +[[package]] +name = "svgtypes" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71499ff2d42f59d26edb21369a308ede691421f79ebc0f001e2b1fd3a7c9e52" +dependencies = [ + "kurbo 0.9.5", + "siphasher 0.3.11", +] + +[[package]] +name = "swash" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd59f3f359ddd2c95af4758c18270eddd9c730dde98598023cdabff472c2ca2" +dependencies = [ + "skrifa", + "yazi", + "zeno", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "tempfile" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix 1.1.3", + "windows-sys 0.61.2", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "time" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" + +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "png", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tiny-xlib" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0324504befd01cab6e0c994f34b2ffa257849ee019d3fb3b64fb2c858887d89e" +dependencies = [ + "as-raw-xcb-connection", + "ctor-lite", + "libloading 0.8.9", + "pkg-config", + "tracing", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "ttf-parser" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" + +[[package]] +name = "ttf-parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-bidi-mirroring" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" + +[[package]] +name = "unicode-ccc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" + +[[package]] +name = "unicode-script" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "usvg" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51daa774fe9ee5efcf7b4fec13019b8119cda764d9a8b5b06df02bb1445c656" +dependencies = [ + "base64", + "log", + "pico-args", + "usvg-parser", + "usvg-text-layout", + "usvg-tree", + "xmlwriter", +] + +[[package]] +name = "usvg-parser" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c88a5ffaa338f0e978ecf3d4e00d8f9f493e29bed0752e1a808a1db16afc40" +dependencies = [ + "data-url", + "flate2", + "imagesize", + "kurbo 0.9.5", + "log", + "roxmltree 0.18.1", + "simplecss", + "siphasher 0.3.11", + "svgtypes", + "usvg-tree", +] + +[[package]] +name = "usvg-text-layout" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d2374378cb7a3fb8f33894e0fdb8625e1bbc4f25312db8d91f862130b541593" +dependencies = [ + "fontdb", + "kurbo 0.9.5", + "log", + "rustybuzz 0.10.0", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "usvg-tree", +] + +[[package]] +name = "usvg-tree" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cacb0c5edeaf3e80e5afcf5b0d4004cc1d36318befc9a7c6606507e5d0f4062" +dependencies = [ + "rctree", + "strict-num", + "svgtypes", + "tiny-skia-path", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" +dependencies = [ + "getrandom 0.3.4", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.114", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wayland-backend" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9" +dependencies = [ + "cc", + "downcast-rs", + "rustix 1.1.3", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec" +dependencies = [ + "bitflags 2.10.0", + "rustix 1.1.3", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.10.0", + "cursor-icon", + "wayland-backend", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078" +dependencies = [ + "rustix 1.1.3", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-experimental" +version = "20250721.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.32.10", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-misc" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791c58fdeec5406aa37169dd815327d1e47f334219b523444bc26d70ceb4c34e" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.32.10", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.31.2", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.31.2", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.32.10", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + +[[package]] +name = "wgpu" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" +dependencies = [ + "arrayvec", + "cfg-if", + "cfg_aliases 0.1.1", + "js-sys", + "log", + "naga", + "parking_lot 0.12.5", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.10.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot 0.12.5", + "profiling", + "raw-window-handle", + "rustc-hash", + "smallvec", + "thiserror 1.0.69", + "web-sys", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfabcfc55fd86611a855816326b2d54c3b2fd7972c27ce414291562650552703" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.10.0", + "block", + "cfg_aliases 0.1.1", + "core-graphics-types", + "d3d12", + "glow", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hassle-rs", + "js-sys", + "khronos-egl", + "libc", + "libloading 0.8.9", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot 0.12.5", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror 1.0.69", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" +dependencies = [ + "bitflags 2.10.0", + "js-sys", + "web-sys", +] + +[[package]] +name = "which" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" +dependencies = [ + "either", + "home", + "rustix 0.38.44", + "winsafe", +] + +[[package]] +name = "widestring" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window_clipboard" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d" +dependencies = [ + "clipboard-win", + "clipboard_macos", + "clipboard_wayland", + "clipboard_x11", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winit" +version = "0.29.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.10.0", + "bytemuck", + "calloop 0.12.4", + "cfg_aliases 0.1.1", + "core-foundation", + "core-graphics", + "cursor-icon", + "icrate", + "js-sys", + "libc", + "log", + "memmap2 0.9.9", + "ndk 0.8.0", + "ndk-sys 0.5.0+25.2.9519653", + "objc2 0.4.1", + "once_cell", + "orbclient", + "percent-encoding", + "raw-window-handle", + "redox_syscall 0.3.5", + "rustix 0.38.44", + "sctk-adwaita", + "smithay-client-toolkit 0.18.1", + "smol_str", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.31.2", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.48.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.8.9", + "once_cell", + "rustix 1.1.3", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" + +[[package]] +name = "xcursor" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.10.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + +[[package]] +name = "xml-rs" +version = "0.8.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" + +[[package]] +name = "xmlparser" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" + +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "xxhash-rust" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + +[[package]] +name = "yazi" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", + "synstructure", +] + +[[package]] +name = "zbus" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.114", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zeno" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697" + +[[package]] +name = "zerocopy" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.16+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "zvariant" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "url", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.114", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] diff --git a/repos/singularity/Cargo.toml b/repos/singularity/Cargo.toml new file mode 100644 index 0000000..e80886e --- /dev/null +++ b/repos/singularity/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "singularity" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1" +directories = "5" +iced = { version = "0.12", features = ["advanced", "tokio", "multi-window", "svg"] } +resvg = "0.36" +tiny-skia = "0.11" +rfd = "0.14" +serde = { version = "1", features = ["derive"] } +toml = "0.8" +uuid = { version = "1", features = ["v4", "serde"] } +walkdir = "2" +which = "6" +zip = "0.6" diff --git a/repos/singularity/icons/close.svg b/repos/singularity/icons/close.svg new file mode 100644 index 0000000..1c8329f --- /dev/null +++ b/repos/singularity/icons/close.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/icons/download.svg b/repos/singularity/icons/download.svg new file mode 100644 index 0000000..0b3ca44 --- /dev/null +++ b/repos/singularity/icons/download.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/icons/drag-up-down.svg b/repos/singularity/icons/drag-up-down.svg new file mode 100644 index 0000000..d4f574c --- /dev/null +++ b/repos/singularity/icons/drag-up-down.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/repos/singularity/icons/folder-open.svg b/repos/singularity/icons/folder-open.svg new file mode 100644 index 0000000..5c14477 --- /dev/null +++ b/repos/singularity/icons/folder-open.svg @@ -0,0 +1,4 @@ + + + + diff --git a/repos/singularity/icons/package.svg b/repos/singularity/icons/package.svg new file mode 100644 index 0000000..76e587d --- /dev/null +++ b/repos/singularity/icons/package.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/icons/refresh.svg b/repos/singularity/icons/refresh.svg new file mode 100644 index 0000000..aa9536f --- /dev/null +++ b/repos/singularity/icons/refresh.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/repos/singularity/icons/save.svg b/repos/singularity/icons/save.svg new file mode 100644 index 0000000..894f536 --- /dev/null +++ b/repos/singularity/icons/save.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/repos/singularity/icons/settings-cog.svg b/repos/singularity/icons/settings-cog.svg new file mode 100644 index 0000000..767f92a --- /dev/null +++ b/repos/singularity/icons/settings-cog.svg @@ -0,0 +1,4 @@ + + + + diff --git a/repos/singularity/icons/singularity.svg b/repos/singularity/icons/singularity.svg new file mode 100644 index 0000000..179772a --- /dev/null +++ b/repos/singularity/icons/singularity.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + diff --git a/repos/singularity/icons/singularity.svg.1 b/repos/singularity/icons/singularity.svg.1 new file mode 100644 index 0000000..e068fca --- /dev/null +++ b/repos/singularity/icons/singularity.svg.1 @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/icons/singularity.svg.2 b/repos/singularity/icons/singularity.svg.2 new file mode 100644 index 0000000..ee474b7 --- /dev/null +++ b/repos/singularity/icons/singularity.svg.2 @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/icons/upload.svg b/repos/singularity/icons/upload.svg new file mode 100644 index 0000000..d653214 --- /dev/null +++ b/repos/singularity/icons/upload.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/icons/warning.svg b/repos/singularity/icons/warning.svg new file mode 100644 index 0000000..ac6e881 --- /dev/null +++ b/repos/singularity/icons/warning.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/repos/singularity/src/app.rs b/repos/singularity/src/app.rs new file mode 100644 index 0000000..65332d7 --- /dev/null +++ b/repos/singularity/src/app.rs @@ -0,0 +1,2827 @@ +use crate::config::{self, AppConfig, GameEntry, ThemeChoice}; +use crate::drag_overlay::DragOverlay; +use crate::fs::{self, GameDirs}; +use crate::mods::{self, ConflictDecision, EnableOutcome, LayoutDecision, ModImportSummary}; +use crate::state::{self, GameState}; +use crate::steam; +use anyhow::{Context, Result}; +use iced::theme::{self, Palette}; +use iced::widget::container::Appearance as ContainerAppearance; +use iced::widget::{ + button, checkbox, column, container, mouse_area, pick_list, row, scrollable, svg, text, + tooltip, +}; +use iced::{ + event, window, Alignment, Border, Color, Command, Element, Length, Point, Shadow, + Subscription, Size, Theme, Vector, +}; +use std::collections::{HashMap, HashSet}; +use std::path::{Path, PathBuf}; +use uuid::Uuid; + +#[derive(Debug, Clone)] +pub enum Message { + ConfigLoaded(Result), + ConfigSaved(Result<(), String>), + OpenSettings, + CloseSettings, + ThemeSelected(ThemeChoice), + WindowClosed(window::Id), + WindowOpened(window::Id, Size), + WindowResized(window::Id, Size), + DragStart { + game_id: Uuid, + mod_name: String, + }, + DragMove { + game_id: Uuid, + mod_name: String, + cursor_y: f32, + }, + DragExit { + game_id: Uuid, + mod_name: String, + }, + DragRelease, + DragCursorMoved { + game_id: Uuid, + position: Point, + }, + PickBaseDir, + BaseDirPicked(Option), + PickSteamDir, + SteamDirPicked(Option), + ScanSteam, + SteamScanFinished(Result), + AddGame, + GameDirPicked(Option), + SelectGame(Uuid), + GameStateLoaded(Uuid, Result), + ModsListLoaded(Uuid, Result, String>), + AddMods(Uuid), + ModsPicked(Uuid, Option>), + ModsImported(Uuid, Result), + ToggleMod { + game_id: Uuid, + mod_name: String, + enable: bool, + }, + ModApplied(Result), + SymlinksCleared(Uuid, Result<(), String>), + ApplyQueueNext, + BackupsRestored(Result), + ConflictUseNew, + ConflictKeepExisting, + ConflictAutoResolve, + ConflictCancel, + LayoutUseRoot, + LayoutMoveToData, + LayoutApplyData, + LayoutKeepOriginal, + LayoutCancel, + LayoutPickSubdir, + LayoutSubdirPicked(Option), + LayoutSubdirProcessed(Result), + LayoutApplied(Result), + VariantSelected(String), + VariantApply, + VariantApplied(Result), + ApplyLoadOrder(Uuid), + ApplyProfile(Uuid), + Rollback(Uuid), + RestoreGame(Uuid), + AddProfile(Uuid), + ProfileSelected(Uuid, String), + RecordLaunch(Uuid), + VerifyLinked(Result), + GameStateSaved(Uuid, Result<(), String>), + DismissStatus, +} + +#[derive(Debug, Clone)] +pub struct SteamScanResult { + pub config: AppConfig, + pub added: usize, + pub found: usize, +} + +#[derive(Debug, Clone)] +pub struct ApplyResult { + pub game_id: Uuid, + pub mod_name: String, + pub outcome: EnableOutcome, + pub backups: Vec, + pub from_queue: bool, + pub created_dirs: Vec, + pub linked_files: usize, +} + +#[derive(Debug, Clone)] +pub struct RestoreResult { + pub game_id: Uuid, + pub backups: Vec, + pub restored: usize, + pub cleaned_dirs: usize, + pub updated_dirs: HashMap>, +} + +#[derive(Debug, Clone)] +pub struct LayoutApplyResult { + pub mod_name: String, +} + +#[derive(Debug, Clone)] +pub struct VariantApplyResult { + pub game_id: Uuid, + pub mod_name: String, +} + +#[derive(Debug, Clone)] +pub struct LayoutSubdirResult { + pub game_id: Uuid, + pub mod_name: String, + pub plan: Option, +} + +#[derive(Debug, Clone)] +pub struct VerifyLinkResult { + pub game_id: Uuid, + pub mod_name: String, + pub linked: bool, +} + +#[derive(Debug, Clone)] +struct ApplyQueue { + game_id: Uuid, + mods: Vec, + index: usize, + cleanup_mods: Vec, +} + +#[derive(Debug, Clone)] +struct PendingConflict { + game_id: Uuid, + mod_name: String, + conflicts: Vec, + index: usize, + decisions: HashMap, + resume_queue: Option, +} + +#[derive(Debug, Clone)] +struct PendingVariant { + game_id: Uuid, + mod_name: String, + variants: Vec, + selected: Option, +} + +#[derive(Debug, Clone)] +struct LayoutQueueItem { + game_id: Uuid, + mod_name: String, +} + +#[derive(Debug, Clone)] +struct PendingLayout { + game_id: Uuid, + mod_name: String, + plan: mods::LayoutPlan, +} + +#[derive(Debug, Clone)] +struct DragState { + game_id: Uuid, + mod_name: String, +} + +pub struct SingularityApp { + config: AppConfig, + status: Option, + settings_open: bool, + main_window_size: Option, + selected_game: Option, + game_states: HashMap, + mods_by_game: HashMap>, + dragging_mod: Option, + drag_hover: Option, + drag_target: Option, + drag_cursor: Option, + pending_conflict: Option, + pending_variant: Option, + pending_queue: Option, + resume_queue: Option, + variant_queue: Vec, + pending_layout: Option, + layout_queue: Vec, +} + +const RECENT_GAME_LIMIT: usize = 250; +const DROP_PLACEHOLDER_HEIGHT: f32 = 40.0; +const DRAG_DROP_MIDPOINT: f32 = 20.0; +const DRAG_HANDLE_ICON_SIZE: f32 = 20.0; +const DRAG_GHOST_ICON_SIZE: f32 = 22.0; +const DRAG_GHOST_TEXT_SIZE: u16 = 16; +const DRAG_GHOST_OFFSET_X: f32 = 0.0; +const DRAG_GHOST_PADDING: [u16; 4] = [10, 10, 10, 28]; + +fn singularity_theme() -> Theme { + Theme::custom( + "Singularity Dark".to_string(), + Palette { + background: Color::from_rgb8(12, 16, 22), + text: Color::from_rgb8(226, 236, 246), + primary: Color::from_rgb8(106, 195, 255), + success: Color::from_rgb8(110, 210, 140), + danger: Color::from_rgb8(231, 94, 94), + }, + ) +} + +fn steam_theme() -> Theme { + Theme::custom( + "Steam Slate".to_string(), + Palette { + background: Color::from_rgb8(18, 24, 33), + text: Color::from_rgb8(218, 230, 242), + primary: Color::from_rgb8(88, 166, 225), + success: Color::from_rgb8(104, 206, 140), + danger: Color::from_rgb8(224, 92, 92), + }, + ) +} + +fn theme_for_choice(choice: ThemeChoice) -> Theme { + match choice { + ThemeChoice::SingularityDark => singularity_theme(), + ThemeChoice::SteamDark => steam_theme(), + ThemeChoice::Nord => Theme::Nord, + ThemeChoice::TokyoNightStorm => Theme::TokyoNightStorm, + ThemeChoice::Oxocarbon => Theme::Oxocarbon, + } +} + +fn muted_text(theme: &Theme) -> Color { + let palette = theme.extended_palette(); + palette.background.strong.text +} + +fn icon_style(theme: &Theme) -> svg::Appearance { + svg::Appearance { + color: Some(muted_text(theme)), + } +} + +fn warning_icon_style(theme: &Theme) -> svg::Appearance { + svg::Appearance { + color: Some(theme.extended_palette().danger.base.color), + } +} + +fn svg_icon(bytes: &'static [u8], size: f32) -> svg::Svg { + svg::Svg::new(svg::Handle::from_memory(bytes)) + .width(Length::Fixed(size)) + .height(Length::Fixed(size)) + .style(theme::Svg::custom_fn(icon_style)) +} + +fn warning_icon(size: f32) -> svg::Svg { + svg::Svg::new(svg::Handle::from_memory(include_bytes!("../icons/warning.svg"))) + .width(Length::Fixed(size)) + .height(Length::Fixed(size)) + .style(theme::Svg::custom_fn(warning_icon_style)) +} + +pub fn window_icon() -> Option { + use resvg::usvg::{self, TreeParsing}; + + let tree = usvg::Tree::from_data( + include_bytes!("../icons/singularity.svg"), + &usvg::Options::default(), + ) + .ok()?; + let size = tree.size.to_int_size(); + let width = size.width(); + let height = size.height(); + let mut pixmap = tiny_skia::Pixmap::new(width, height)?; + let mut pixmap_mut = pixmap.as_mut(); + resvg::Tree::from_usvg(&tree) + .render(tiny_skia::Transform::identity(), &mut pixmap_mut); + window::icon::from_rgba(pixmap.data().to_vec(), width, height).ok() +} + +fn shadow(opacity: f32, offset_y: f32, blur: f32) -> Shadow { + Shadow { + color: Color::from_rgba(0.0, 0.0, 0.0, opacity), + offset: Vector::new(0.0, offset_y), + blur_radius: blur, + } +} + +fn darken(color: Color, factor: f32) -> Color { + let scale = 1.0 - factor.clamp(0.0, 1.0); + Color::from_rgba(color.r * scale, color.g * scale, color.b * scale, color.a) +} + +fn app_background(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(darken(palette.background.base.color, 0.2).into()), + border: Border::default(), + shadow: Shadow::default(), + } +} + +fn header_bar(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(palette.background.strong.color.into()), + border: Border { + color: palette.background.strong.color, + width: 1.0, + radius: 14.0.into(), + }, + shadow: shadow(0.35, 3.0, 14.0), + } +} + +fn panel(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(palette.background.base.color.into()), + border: Border { + color: palette.background.strong.color, + width: 1.0, + radius: 14.0.into(), + }, + shadow: shadow(0.3, 2.0, 12.0), + } +} + +fn card(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(palette.background.weak.color.into()), + border: Border { + color: palette.background.strong.color, + width: 1.0, + radius: 10.0.into(), + }, + shadow: shadow(0.25, 1.0, 8.0), + } +} + +fn list_item(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(palette.background.strong.color.into()), + border: Border { + color: palette.background.weak.color, + width: 1.0, + radius: 8.0.into(), + }, + shadow: shadow(0.2, 1.0, 6.0), + } +} + +fn selected_card(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: Some(palette.primary.weak.text), + background: Some(palette.primary.weak.color.into()), + border: Border { + color: palette.primary.strong.color, + width: 1.0, + radius: 10.0.into(), + }, + shadow: shadow(0.3, 2.0, 10.0), + } +} + +fn status_badge(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: Some(palette.primary.weak.text), + background: Some(palette.primary.weak.color.into()), + border: Border { + color: palette.primary.base.color, + width: 1.0, + radius: 999.0.into(), + }, + shadow: Shadow::default(), + } +} + +fn overlay_card(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(palette.background.strong.color.into()), + border: Border { + color: palette.primary.strong.color, + width: 1.0, + radius: 12.0.into(), + }, + shadow: shadow(0.35, 2.0, 12.0), + } +} + +fn danger_card(theme: &Theme) -> ContainerAppearance { + let palette = theme.extended_palette(); + + ContainerAppearance { + text_color: None, + background: Some(palette.background.strong.color.into()), + border: Border { + color: palette.danger.base.color, + width: 1.0, + radius: 12.0.into(), + }, + shadow: shadow(0.35, 2.0, 12.0), + } +} + +fn map_event(event: iced::Event, _status: event::Status) -> Option { + match event { + iced::Event::Window(id, iced::window::Event::Closed) + | iced::Event::Window(id, iced::window::Event::CloseRequested) => { + Some(Message::WindowClosed(id)) + } + iced::Event::Window(id, iced::window::Event::Opened { size, .. }) => { + Some(Message::WindowOpened(id, size)) + } + iced::Event::Window(id, iced::window::Event::Resized { width, height }) => Some( + Message::WindowResized(id, Size::new(width as f32, height as f32)), + ), + iced::Event::Mouse(iced::mouse::Event::ButtonReleased( + iced::mouse::Button::Left, + )) => Some(Message::DragRelease), + _ => None, + } +} + +fn truncate_middle(value: &str, max_len: usize) -> String { + let total = value.chars().count(); + if total <= max_len { + return value.to_string(); + } + if max_len <= 4 { + return value.chars().take(max_len).collect(); + } + let left_len = (max_len - 3) / 2; + let right_len = max_len - 3 - left_len; + let left: String = value.chars().take(left_len).collect(); + let right: String = value + .chars() + .rev() + .take(right_len) + .collect::>() + .into_iter() + .rev() + .collect(); + format!("{left}...{right}") +} + +fn truncate_tail(value: &str, max_len: usize) -> String { + let total = value.chars().count(); + if total <= max_len { + return value.to_string(); + } + if max_len <= 3 { + return value.chars().take(max_len).collect(); + } + let keep = max_len - 3; + let head: String = value.chars().take(keep).collect(); + format!("{head}...") +} + +fn path_tooltip<'a>(theme: &Theme, path: &Path, size: u16, max_len: usize) -> Element<'a, Message> { + let full = path.display().to_string(); + let short = truncate_middle(&full, max_len); + let label = text(short).size(size).style(muted_text(theme)); + let tip = container(text(full).size(size)) + .padding([6, 10]) + .style(overlay_card); + tooltip(label, tip, iced::widget::tooltip::Position::Top).into() +} + +fn move_mod_to(mods: &mut Vec, dragged: &str, target_index: usize) -> bool { + let Some(from) = mods.iter().position(|name| name == dragged) else { + return false; + }; + let mut target = target_index.min(mods.len()); + if target > from { + target = target.saturating_sub(1); + } + if from == target { + return false; + } + let moved = mods.remove(from); + mods.insert(target, moved); + true +} + +impl SingularityApp { + fn game_by_id(&self, game_id: Uuid) -> Option<&GameEntry> { + self.config.games.iter().find(|game| game.id == game_id) + } + + fn mod_label_max_len(&self) -> usize { + let Some(size) = self.main_window_size else { + return 48; + }; + let content_width = (size.width - 16.0).max(0.0) * 2.0 / 3.0; + let available = (content_width - 200.0).max(40.0); + let approx_chars = (available / 7.5) as usize; + approx_chars.clamp(12, 90) + } + + fn mod_list_width(&self) -> f32 { + let Some(size) = self.main_window_size else { + return 420.0; + }; + let content_width = (size.width - 32.0).max(0.0); + let details_width = ((content_width - 16.0).max(0.0)) * 2.0 / 3.0; + let inner_width = details_width - 48.0; + inner_width.max(220.0) + } + + fn update_status(&mut self, message: impl Into) { + self.status = Some(message.into()); + } + + fn start_apply_queue( + &mut self, + game_id: Uuid, + mods_to_clear: Vec, + target_mods: Vec, + cleanup_mods: Vec, + ) -> Command { + if self.pending_conflict.is_some() + || self.pending_variant.is_some() + || self.pending_queue.is_some() + || self.pending_layout.is_some() + { + self.update_status("Finish the current operation before applying mods."); + return Command::none(); + } + let Some(game) = self.game_by_id(game_id).cloned() else { + self.update_status("Missing game for apply."); + return Command::none(); + }; + self.pending_queue = Some(ApplyQueue { + game_id, + mods: target_mods, + index: 0, + cleanup_mods, + }); + let base_dir = self.config.base_dir.clone(); + Command::perform( + async move { + clear_symlinks_task(base_dir, game, mods_to_clear) + .await + .map_err(|err| err.to_string()) + }, + move |result| Message::SymlinksCleared(game_id, result), + ) + } + + fn resolve_conflict(&mut self, decision: ConflictDecision) -> Command { + let Some(conflict_state) = self.pending_conflict.as_mut() else { + return Command::none(); + }; + if let Some(conflict) = conflict_state.conflicts.get(conflict_state.index) { + conflict_state + .decisions + .insert(conflict.dest.clone(), decision); + conflict_state.index += 1; + } + if conflict_state.index >= conflict_state.conflicts.len() { + return self.apply_conflict_decisions(); + } + Command::none() + } + + fn auto_resolve_conflicts(&mut self) -> Command { + let Some(conflict_state) = self.pending_conflict.as_mut() else { + return Command::none(); + }; + while conflict_state.index < conflict_state.conflicts.len() { + if let Some(conflict) = conflict_state.conflicts.get(conflict_state.index) { + conflict_state + .decisions + .insert(conflict.dest.clone(), ConflictDecision::UseNew); + } + conflict_state.index += 1; + } + self.apply_conflict_decisions() + } + + fn apply_conflict_decisions(&mut self) -> Command { + let Some(conflict_state) = self.pending_conflict.take() else { + return Command::none(); + }; + let Some(game) = self.game_by_id(conflict_state.game_id).cloned() else { + self.update_status("Missing game for conflict resolution."); + return Command::none(); + }; + let backups = self + .game_states + .get(&conflict_state.game_id) + .map(|state| state.backups.clone()) + .unwrap_or_default(); + let from_queue = conflict_state.resume_queue.is_some(); + self.resume_queue = conflict_state.resume_queue; + let base_dir = self.config.base_dir.clone(); + Command::perform( + async move { + enable_mod_with_decisions_task( + base_dir, + game, + conflict_state.mod_name, + conflict_state.decisions, + backups, + from_queue, + ) + .await + .map_err(|err| err.to_string()) + }, + Message::ModApplied, + ) + } + + fn ensure_skyrim_layout(&mut self, game: &GameEntry, mod_name: &str) -> bool { + let Ok(dirs) = fs::ensure_game_dirs(&self.config.base_dir, game.id) else { + self.update_status("Failed to prepare game folders."); + return false; + }; + let status = mods::get_layout_status(&dirs.mods, mod_name).ok().flatten(); + if status.as_deref() == Some("pending") { + self.layout_queue.push(LayoutQueueItem { + game_id: game.id, + mod_name: mod_name.to_string(), + }); + self.process_next_layout_queue(); + return false; + } + if status.as_deref() == Some("applied") || status.as_deref() == Some("original") { + return true; + } + + let mod_root = mod_root_for_game(&dirs, &game.name, mod_name); + match mods::skyrim_layout_plan(&game.path, &mod_root) { + Ok(plan) => { + if plan.prompt.is_some() { + let _ = mods::set_layout_status(&dirs.mods, mod_name, "pending"); + if self.pending_layout.is_some() { + self.layout_queue.push(LayoutQueueItem { + game_id: game.id, + mod_name: mod_name.to_string(), + }); + } else { + self.pending_layout = Some(PendingLayout { + game_id: game.id, + mod_name: mod_name.to_string(), + plan, + }); + } + return false; + } + if !plan.moves.is_empty() { + let _ = mods::apply_layout_plan( + &game.path, + &mod_root, + &plan, + LayoutDecision::UseRoot, + ); + } + let _ = mods::set_layout_status(&dirs.mods, mod_name, "applied"); + true + } + Err(err) => { + self.update_status(format!("Layout check failed: {}", err)); + false + } + } + } + + fn process_next_layout_queue(&mut self) { + while self.pending_layout.is_none() && !self.layout_queue.is_empty() { + let next = self.layout_queue.remove(0); + let Some(game) = self.game_by_id(next.game_id).cloned() else { + continue; + }; + if let Ok(dirs) = fs::ensure_game_dirs(&self.config.base_dir, game.id) { + let mod_root = mod_root_for_game(&dirs, &game.name, &next.mod_name); + if let Ok(plan) = mods::skyrim_layout_plan(&game.path, &mod_root) { + if plan.prompt.is_some() { + let _ = mods::set_layout_status(&dirs.mods, &next.mod_name, "pending"); + self.pending_layout = Some(PendingLayout { + game_id: next.game_id, + mod_name: next.mod_name, + plan, + }); + break; + } + if !plan.moves.is_empty() { + let _ = mods::apply_layout_plan( + &game.path, + &mod_root, + &plan, + LayoutDecision::UseRoot, + ); + } + let _ = mods::set_layout_status(&dirs.mods, &next.mod_name, "applied"); + } + } + } + } + + fn apply_layout_decision(&mut self, decision: LayoutDecision) -> Command { + let Some(layout) = self.pending_layout.clone() else { + return Command::none(); + }; + let Some(game) = self.game_by_id(layout.game_id).cloned() else { + self.update_status("Missing game for layout update."); + return Command::none(); + }; + let base_dir = self.config.base_dir.clone(); + Command::perform( + async move { + apply_layout_task(base_dir, game, layout, decision) + .await + .map_err(|err| err.to_string()) + }, + Message::LayoutApplied, + ) + } + + fn view_main(&self, theme: &Theme) -> Element<'_, Message> { + let header_title = column![ + text("Singularity").size(28), + text("Mod Manager").size(14).style(muted_text(theme)), + ] + .spacing(2) + .width(Length::Fill); + + let mut header_actions = row![].spacing(8).align_items(Alignment::Center); + if let Some(status) = &self.status { + let status_chip = container(text(status.clone()).size(14)) + .padding([4, 10]) + .style(status_badge); + header_actions = header_actions.push(status_chip); + } + let settings_icon = svg_icon(include_bytes!("../icons/settings-cog.svg"), 22.0); + let settings_button = button(settings_icon) + .style(theme::Button::Secondary) + .on_press(Message::OpenSettings); + + header_actions = header_actions + .push(settings_button) + .push( + button("Clear Message") + .style(theme::Button::Secondary) + .on_press(Message::DismissStatus), + ); + + let header = container( + row![header_title, header_actions] + .spacing(16) + .align_items(Alignment::Center) + .width(Length::Fill), + ) + .padding(16) + .style(header_bar) + .width(Length::Fill); + + let sorted_games = sort_games( + &self.config.games, + self.config.last_selected_game, + &self.config.recent_games, + ); + let visible_games = sorted_games + .into_iter() + .filter(|game| !is_hidden_game(&game.name, &game.path)); + let mut games_column = column![ + row![ + text("Library").size(18).width(Length::Fill), + button("Add Game") + .style(theme::Button::Primary) + .on_press(Message::AddGame), + ] + .spacing(8) + .align_items(Alignment::Center) + ] + .spacing(10); + + for game in visible_games { + let selected = self.selected_game == Some(game.id); + let select_label = if selected { "Selected" } else { "Select" }; + let select_style = if selected { + theme::Button::Primary + } else { + theme::Button::Secondary + }; + + let select_button = button(select_label) + .style(select_style) + .on_press(Message::SelectGame(game.id)); + + let mut name_row = row![text(game.name.clone()).size(16)].spacing(6); + if !is_supported_game(&game.name) { + let tip = container(text("Game is currently unsupported").size(12)) + .padding([6, 10]) + .style(overlay_card); + let warning = tooltip( + warning_icon(14.0), + tip, + iced::widget::tooltip::Position::Top, + ); + name_row = name_row.push(warning); + } + let game_info = column![name_row, path_tooltip(theme, &game.path, 12, 46)] + .spacing(2) + .width(Length::Fill); + + let game_row = row![game_info, select_button] + .spacing(12) + .align_items(Alignment::Center); + + let style = if selected { selected_card } else { list_item }; + games_column = games_column.push( + container(game_row) + .padding(10) + .style(style) + .width(Length::Fill), + ); + } + + let right_panel: Element = + match self.selected_game.and_then(|id| self.game_by_id(id)) { + Some(game) => { + let game_id = game.id; + let mods = self + .mods_by_game + .get(&game_id) + .cloned() + .unwrap_or_default(); + let state = self.game_states.get(&game_id); + let mut enabled = state + .and_then(|s| s.active_profile()) + .map(|p| p.enabled_mods.clone()) + .unwrap_or_default(); + let profile_name = state + .map(|s| s.active_profile.clone()) + .unwrap_or_else(|| "default".to_string()); + let profile_names = state + .map(|s| s.profiles.iter().map(|p| p.name.clone()).collect::>()) + .unwrap_or_default(); + let mods_set: HashSet = mods.iter().cloned().collect(); + enabled.retain(|name| mods_set.contains(name)); + let disabled_mods: Vec = mods + .iter() + .filter(|name| !enabled.contains(*name)) + .cloned() + .collect(); + + let header_row = row![ + column![ + text(game.name.clone()).size(22), + path_tooltip(theme, &game.path, 12, 72), + ] + .spacing(2) + .width(Length::Fill), + button("Add Mods") + .style(theme::Button::Primary) + .on_press(Message::AddMods(game_id)), + ] + .spacing(8) + .align_items(Alignment::Center); + + let profile_row = row![ + text("Active Profile").size(12).style(muted_text(theme)), + pick_list( + profile_names.clone(), + Some(profile_name.clone()), + move |name| Message::ProfileSelected(game_id, name), + ) + .width(Length::Fill), + button("New Profile") + .style(theme::Button::Secondary) + .on_press(Message::AddProfile(game_id)), + button("Save Launch State") + .style(theme::Button::Secondary) + .on_press(Message::RecordLaunch(game_id)), + ] + .spacing(8) + .align_items(Alignment::Center); + + let action_row = row![ + button("Apply Profile") + .style(theme::Button::Primary) + .on_press(Message::ApplyProfile(game_id)), + button("Apply Order") + .style(theme::Button::Secondary) + .on_press(Message::ApplyLoadOrder(game_id)), + button("Rollback") + .style(theme::Button::Destructive) + .on_press(Message::Rollback(game_id)), + button("Restore Originals") + .style(theme::Button::Destructive) + .on_press(Message::RestoreGame(game_id)), + ] + .spacing(8) + .align_items(Alignment::Center); + + let actions_panel = container( + column![header_row, profile_row, action_row].spacing(10), + ) + .padding(12) + .style(card) + .width(Length::Fill); + + let mod_label_len = self.mod_label_max_len(); + let dragging = self + .dragging_mod + .as_ref() + .filter(|drag| drag.game_id == game_id); + let drag_name = dragging.map(|drag| drag.mod_name.as_str()); + let drag_index = drag_name + .and_then(|name| enabled.iter().position(|mod_name| mod_name == name)); + let placeholder_index = drag_name.map(|_| { + let target = self.drag_target.or(drag_index).unwrap_or(0); + let mut adjusted = target.min(enabled.len()); + if let Some(drag_index) = drag_index { + if adjusted > drag_index { + adjusted = adjusted.saturating_sub(1); + } + } + adjusted + }); + let mut mod_column: iced::widget::Column<'_, Message> = column![ + text("Enabled Mods (Order)").size(16) + ] + .spacing(8); + + let mut render_index = 0usize; + for mod_name in enabled.iter() { + if drag_name == Some(mod_name.as_str()) { + continue; + } + if placeholder_index == Some(render_index) { + mod_column = mod_column.push( + container(column![]) + .height(Length::Fixed(DROP_PLACEHOLDER_HEIGHT)) + .width(Length::Fill), + ); + } + let handle_icon = svg_icon( + include_bytes!("../icons/drag-up-down.svg"), + DRAG_HANDLE_ICON_SIZE, + ); + let handle = mouse_area(container(handle_icon).padding([4, 8])) + .on_press(Message::DragStart { + game_id, + mod_name: mod_name.clone(), + }) + .interaction(iced::mouse::Interaction::Grab); + + let label = truncate_tail(mod_name, mod_label_len); + let toggle = checkbox(label, true) + .style(theme::Checkbox::Primary) + .on_toggle({ + let mod_name = mod_name.clone(); + move |value| Message::ToggleMod { + game_id, + mod_name: mod_name.clone(), + enable: value, + } + }); + + let is_target = self.drag_hover.as_deref() == Some(mod_name.as_str()); + let item_style = if is_target { selected_card } else { list_item }; + + let row_content = container( + row![handle, toggle] + .spacing(8) + .align_items(Alignment::Center), + ) + .padding(8) + .style(item_style) + .width(Length::Fill); + + let row_area = mouse_area(row_content) + .on_move({ + let mod_name = mod_name.clone(); + move |position| Message::DragMove { + game_id, + mod_name: mod_name.clone(), + cursor_y: position.y, + } + }) + .on_exit(Message::DragExit { + game_id, + mod_name: mod_name.clone(), + }); + + mod_column = mod_column.push(row_area); + render_index += 1; + } + if placeholder_index == Some(render_index) { + mod_column = mod_column.push( + container(column![]) + .height(Length::Fixed(DROP_PLACEHOLDER_HEIGHT)) + .width(Length::Fill), + ); + } + + mod_column = mod_column.push(text("Disabled Mods").size(16)); + + for mod_name in disabled_mods { + let label = truncate_tail(&mod_name, mod_label_len); + let toggle = checkbox(label, false) + .style(theme::Checkbox::Secondary) + .on_toggle({ + let mod_name = mod_name.clone(); + move |value| Message::ToggleMod { + game_id, + mod_name: mod_name.clone(), + enable: value, + } + }); + mod_column = mod_column.push( + container(toggle) + .padding(8) + .style(list_item) + .width(Length::Fill), + ); + } + + let mods_panel = container(mod_column) + .padding(12) + .style(card) + .width(Length::Fill); + let mods_panel = mouse_area(mods_panel) + .on_move(move |position| Message::DragCursorMoved { + game_id, + position, + }); + let mods_panel: Element = if let (Some(drag), Some(cursor)) = + (dragging, self.drag_cursor) + { + let ghost_label = truncate_tail(&drag.mod_name, mod_label_len); + let ghost_width = self.mod_list_width().max(220.0); + let ghost_row = container( + row![ + svg_icon( + include_bytes!("../icons/drag-up-down.svg"), + DRAG_GHOST_ICON_SIZE, + ), + text(ghost_label).size(DRAG_GHOST_TEXT_SIZE) + ] + .spacing(8) + .align_items(Alignment::Center) + .width(Length::Fill), + ) + .padding(DRAG_GHOST_PADDING) + .style(selected_card) + .width(Length::Fixed(ghost_width)); + DragOverlay::new(mods_panel) + .ghost(ghost_row, cursor, DRAG_GHOST_OFFSET_X) + .into() + } else { + mods_panel.into() + }; + + column![actions_panel, mods_panel] + .spacing(12) + .width(Length::Fill) + .into() + } + None => container( + column![text("Select a game to manage mods.") + .size(16) + .style(muted_text(theme))] + .spacing(4), + ) + .padding(12) + .style(card) + .into(), + }; + + let games_panel = container(games_column.width(Length::Fill)) + .padding(12) + .style(panel) + .width(Length::Fill); + let games_scroll = scrollable(games_panel).width(Length::FillPortion(1)); + + let details_panel = container(right_panel) + .padding(12) + .style(panel) + .width(Length::Fill); + let details_scroll = scrollable(details_panel).width(Length::FillPortion(2)); + + let content = row![games_scroll, details_scroll] + .spacing(16) + .height(Length::Fill); + + let mut main_column = column![header].spacing(12); + + if let Some(variant) = &self.pending_variant { + let selection = variant + .selected + .clone() + .or_else(|| variant.variants.first().cloned()); + let variant_panel = container( + column![ + text(format!("Select a variant for {}", variant.mod_name)).size(18), + pick_list(variant.variants.clone(), selection, Message::VariantSelected), + row![button("Apply Variant") + .style(theme::Button::Primary) + .on_press(Message::VariantApply)] + .spacing(8) + .align_items(Alignment::Center) + ] + .spacing(8), + ) + .padding(12) + .style(overlay_card) + .width(Length::Fill); + main_column = main_column.push(variant_panel); + } else if let Some(layout) = &self.pending_layout { + let prompt = layout.plan.prompt.clone().unwrap_or(mods::LayoutPrompt::RootFiles); + let (title, files, actions) = match prompt { + mods::LayoutPrompt::RootFiles => { + let files = preview_paths(&layout.plan.root_files, 8); + let actions = row![ + button("Use Root") + .style(theme::Button::Secondary) + .on_press(Message::LayoutUseRoot), + button("Move to Data") + .style(theme::Button::Primary) + .on_press(Message::LayoutMoveToData), + button("Cancel") + .style(theme::Button::Secondary) + .on_press(Message::LayoutCancel) + ] + .spacing(8) + .align_items(Alignment::Center); + (format!("Root files in {}", layout.mod_name), files, actions) + } + mods::LayoutPrompt::DataWrap => { + let files = preview_paths(&layout.plan.data_files, 8); + let actions = row![ + button("Move to Data (recommended)") + .style(theme::Button::Primary) + .on_press(Message::LayoutApplyData), + button("Keep Layout (advanced)") + .style(theme::Button::Secondary) + .on_press(Message::LayoutKeepOriginal), + button("Choose Subdir (advanced)") + .style(theme::Button::Secondary) + .on_press(Message::LayoutPickSubdir), + button("Cancel") + .style(theme::Button::Secondary) + .on_press(Message::LayoutCancel) + ] + .spacing(8) + .align_items(Alignment::Center); + (format!("Data layout for {}", layout.mod_name), files, actions) + } + }; + + let layout_panel = container( + column![text(title).size(18), files, actions].spacing(8), + ) + .padding(12) + .style(overlay_card) + .width(Length::Fill); + main_column = main_column.push(layout_panel); + } else if let Some(conflict) = &self.pending_conflict { + let current = &conflict.conflicts[conflict.index]; + let existing = current + .existing_target + .as_ref() + .and_then(|path| existing_mod_name(&self.config.base_dir, conflict.game_id, path)) + .unwrap_or_else(|| "Game file or unknown mod".to_string()); + let conflict_panel = container( + column![ + text("Conflict Detected").size(18), + text(format!( + "Conflict {} of {}", + conflict.index + 1, + conflict.conflicts.len() + )), + text(format!("Mod: {}", conflict.mod_name)), + text(format!("File: {}", current.rel_path.display())), + text(format!("Existing: {}", existing)), + row![ + button("Use This Mod") + .style(theme::Button::Primary) + .on_press(Message::ConflictUseNew), + button("Use Original") + .style(theme::Button::Secondary) + .on_press(Message::ConflictKeepExisting), + button("Use This Mod (All)") + .style(theme::Button::Primary) + .on_press(Message::ConflictAutoResolve), + button("Cancel") + .style(theme::Button::Secondary) + .on_press(Message::ConflictCancel) + ] + .spacing(8) + .align_items(Alignment::Center) + ] + .spacing(8), + ) + .padding(12) + .style(danger_card) + .width(Length::Fill); + main_column = main_column.push(conflict_panel); + } + + main_column = main_column.push(content); + + container(main_column.padding(16)) + .style(app_background) + .width(Length::Fill) + .height(Length::Fill) + .into() + } + + fn view_settings(&self, theme: &Theme) -> Element<'_, Message> { + let header = container( + row![ + text("Settings").size(22).width(Length::Fill), + button("Close") + .style(theme::Button::Secondary) + .on_press(Message::CloseSettings) + ] + .spacing(8) + .align_items(Alignment::Center), + ) + .padding(16) + .style(header_bar) + .width(Length::Fill); + + let theme_options = ThemeChoice::ALL.to_vec(); + let theme_picker = pick_list( + theme_options, + Some(self.config.theme), + Message::ThemeSelected, + ) + .width(Length::Fixed(240.0)); + + let theme_card = container( + row![ + text("Theme") + .size(12) + .style(muted_text(theme)) + .width(Length::Fill), + theme_picker + ] + .spacing(8) + .align_items(Alignment::Center) + .width(Length::Fill), + ) + .padding(12) + .style(card) + .width(Length::Fill); + + let base_path = path_tooltip(theme, &self.config.base_dir, 13, 58); + let base_row = row![ + container(base_path).width(Length::Fill), + button("Set Base Folder") + .style(theme::Button::Secondary) + .on_press(Message::PickBaseDir) + ] + .spacing(8) + .align_items(Alignment::Center) + .width(Length::Fill); + let base_card = container( + column![ + text("Base Folder").size(12).style(muted_text(theme)), + base_row + ] + .spacing(6), + ) + .padding(12) + .style(card) + .width(Length::Fill); + + let steam_path: Element = match &self.config.steam_dir { + Some(path) => path_tooltip(theme, path, 13, 58), + None => text("Not set").size(13).style(muted_text(theme)).into(), + }; + let steam_row = row![ + container(steam_path).width(Length::Fill), + row![ + button("Set Steam Folder") + .style(theme::Button::Secondary) + .on_press(Message::PickSteamDir), + button("Scan Steam") + .style(theme::Button::Primary) + .on_press(Message::ScanSteam), + ] + .spacing(8) + .align_items(Alignment::Center) + ] + .spacing(8) + .align_items(Alignment::Center) + .width(Length::Fill); + + let steam_card = container( + column![ + text("Steam Library").size(12).style(muted_text(theme)), + steam_row, + ] + .spacing(6), + ) + .padding(12) + .style(card) + .width(Length::Fill); + + let content = column![header, theme_card, base_card, steam_card] + .spacing(12) + .width(Length::Fill); + + container(content) + .padding(16) + .style(app_background) + .width(Length::Fill) + .height(Length::Fill) + .into() + } +} + +impl iced::multi_window::Application for SingularityApp { + type Executor = iced::executor::Default; + type Message = Message; + type Theme = Theme; + type Flags = (); + + fn new(_flags: ()) -> (Self, Command) { + let command = Command::perform( + async { config::load_config().map_err(|err| err.to_string()) }, + Message::ConfigLoaded, + ); + ( + Self { + config: AppConfig::default(), + status: None, + settings_open: false, + main_window_size: None, + selected_game: None, + game_states: HashMap::new(), + mods_by_game: HashMap::new(), + dragging_mod: None, + drag_hover: None, + drag_target: None, + drag_cursor: None, + pending_conflict: None, + pending_variant: None, + pending_queue: None, + resume_queue: None, + variant_queue: Vec::new(), + pending_layout: None, + layout_queue: Vec::new(), + }, + command, + ) + } + + fn title(&self, _window: window::Id) -> String { + "Singularity Mod Manager".to_string() + } + + fn theme(&self, _window: window::Id) -> Theme { + theme_for_choice(self.config.theme) + } + + fn subscription(&self) -> Subscription { + event::listen_with(map_event) + } + + fn update(&mut self, message: Message) -> Command { + match message { + Message::ConfigLoaded(result) => { + match result { + Ok(config) => { + self.config = config; + if let Err(err) = fs::ensure_base_dir(&self.config.base_dir) { + self.update_status(format!("Failed to create base dir: {}", err)); + } + } + Err(err) => self.update_status(format!("Failed to load config: {}", err)), + } + Command::none() + } + Message::ConfigSaved(result) => { + if let Err(err) = result { + self.update_status(format!("Failed to save config: {}", err)); + } + Command::none() + } + Message::OpenSettings => { + self.settings_open = true; + Command::none() + } + Message::CloseSettings => { + self.settings_open = false; + Command::none() + } + Message::ThemeSelected(choice) => { + if self.config.theme == choice { + return Command::none(); + } + self.config.theme = choice; + let config = self.config.clone(); + Command::perform( + async move { config::save_config(&config).map_err(|err| err.to_string()) }, + Message::ConfigSaved, + ) + } + Message::WindowClosed(id) => { + let _ = id; + Command::none() + } + Message::WindowOpened(id, size) => { + if id == window::Id::MAIN { + self.main_window_size = Some(size); + } + Command::none() + } + Message::WindowResized(id, size) => { + if id == window::Id::MAIN { + self.main_window_size = Some(size); + } + Command::none() + } + Message::DragStart { game_id, mod_name } => { + let mod_name_clone = mod_name.clone(); + self.dragging_mod = Some(DragState { game_id, mod_name: mod_name.clone() }); + self.drag_hover = Some(mod_name_clone); + self.drag_cursor = None; + self.drag_target = self + .game_states + .get(&game_id) + .and_then(|state| state.active_profile()) + .and_then(|profile| profile.enabled_mods.iter().position(|name| name == &mod_name)); + Command::none() + } + Message::DragMove { + game_id, + mod_name, + cursor_y, + } => { + let Some(drag) = self.dragging_mod.as_ref() else { + return Command::none(); + }; + if drag.game_id != game_id { + return Command::none(); + } + self.drag_hover = Some(mod_name.clone()); + if let Some(state) = self.game_states.get(&game_id) { + if let Some(profile) = state.active_profile() { + if let Some(index) = + profile.enabled_mods.iter().position(|name| name == &mod_name) + { + let target = if cursor_y > DRAG_DROP_MIDPOINT { + index + 1 + } else { + index + }; + self.drag_target = Some(target); + } + } + } + Command::none() + } + Message::DragExit { game_id, mod_name } => { + if self + .dragging_mod + .as_ref() + .is_some_and(|drag| drag.game_id == game_id) + && self.drag_hover.as_deref() == Some(mod_name.as_str()) + { + self.drag_hover = None; + } + Command::none() + } + Message::DragRelease => { + let Some(drag) = self.dragging_mod.take() else { + self.drag_hover = None; + self.drag_target = None; + self.drag_cursor = None; + return Command::none(); + }; + self.drag_hover = None; + let target = self.drag_target.take(); + self.drag_cursor = None; + let base_dir = self.config.base_dir.clone(); + if let Some(state) = self.game_states.get_mut(&drag.game_id) { + let mut changed = false; + if let Some(profile) = state.active_profile_mut() { + if let Some(target) = target { + changed = move_mod_to(&mut profile.enabled_mods, &drag.mod_name, target); + } + } + if changed { + let state_copy = state.clone(); + return Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, drag.game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(drag.game_id, result), + ); + } + } + Command::none() + } + Message::DragCursorMoved { game_id, position } => { + let Some(drag) = self.dragging_mod.as_ref() else { + return Command::none(); + }; + if drag.game_id == game_id { + self.drag_cursor = Some(position); + } + Command::none() + } + Message::PickBaseDir => Command::perform(pick_folder(), Message::BaseDirPicked), + Message::BaseDirPicked(path) => { + if let Some(path) = path { + self.config.base_dir = path; + if let Err(err) = fs::ensure_base_dir(&self.config.base_dir) { + self.update_status(format!("Failed to create base dir: {}", err)); + } + let config = self.config.clone(); + return Command::perform( + async move { config::save_config(&config).map_err(|err| err.to_string()) }, + Message::ConfigSaved, + ); + } + Command::none() + } + Message::PickSteamDir => Command::perform(pick_folder(), Message::SteamDirPicked), + Message::SteamDirPicked(path) => { + if let Some(path) = path { + let normalized = steam::normalize_steam_root(&path).unwrap_or(path); + self.config.steam_dir = Some(normalized); + let config = self.config.clone(); + return Command::perform( + async move { config::save_config(&config).map_err(|err| err.to_string()) }, + Message::ConfigSaved, + ); + } + Command::none() + } + Message::ScanSteam => { + let Some(steam_dir) = self.config.steam_dir.clone() else { + self.update_status("Set your Steam directory first."); + return Command::none(); + }; + let config = self.config.clone(); + Command::perform( + async move { scan_steam(config, steam_dir).map_err(|err| err.to_string()) }, + Message::SteamScanFinished, + ) + } + Message::SteamScanFinished(result) => { + match result { + Ok(summary) => { + self.config = summary.config; + if summary.found == 0 { + self.update_status( + "No Steam games found. Check that the Steam folder contains steamapps.", + ); + } else { + self.update_status(format!( + "Added {} of {} Steam games.", + summary.added, summary.found + )); + } + let config = self.config.clone(); + return Command::perform( + async move { + config::save_config(&config).map_err(|err| err.to_string()) + }, + Message::ConfigSaved, + ); + } + Err(err) => self.update_status(format!("Steam scan failed: {}", err)), + } + Command::none() + } + Message::AddGame => Command::perform(pick_folder(), Message::GameDirPicked), + Message::GameDirPicked(path) => { + if let Some(path) = path { + match register_game(&mut self.config, path) { + Ok(Some(game_id)) => { + if let Err(err) = ensure_game_tree(&self.config, game_id) { + self.update_status(format!("Failed to prepare game: {}", err)); + } + let config = self.config.clone(); + return Command::perform( + async move { + config::save_config(&config).map_err(|err| err.to_string()) + }, + Message::ConfigSaved, + ); + } + Ok(None) => self.update_status("Game already registered."), + Err(err) => self.update_status(format!("Failed to add game: {}", err)), + } + } + Command::none() + } + Message::SelectGame(game_id) => { + self.selected_game = Some(game_id); + record_game_selection(&mut self.config, game_id); + let base_dir = self.config.base_dir.clone(); + let base_dir_for_state = base_dir.clone(); + let base_dir_for_mods = base_dir.clone(); + let command_state = Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir_for_state, game_id) + .map_err(|err| err.to_string())?; + state::load_game_state(&dirs.state).map_err(|err| err.to_string()) + }, + move |result| Message::GameStateLoaded(game_id, result), + ); + let command_mods = Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir_for_mods, game_id) + .map_err(|err| err.to_string())?; + mods::list_mods(&dirs.mods).map_err(|err| err.to_string()) + }, + move |result| Message::ModsListLoaded(game_id, result), + ); + let config = self.config.clone(); + let command_save = Command::perform( + async move { + config::save_config(&config).map_err(|err| err.to_string()) + }, + Message::ConfigSaved, + ); + Command::batch(vec![command_state, command_mods, command_save]) + } + Message::GameStateLoaded(game_id, result) => { + match result { + Ok(state) => { + if !self.game_states.contains_key(&game_id) { + self.game_states.insert(game_id, state); + } + } + Err(err) => self.update_status(format!("Failed to load game state: {}", err)), + } + Command::none() + } + Message::ModsListLoaded(game_id, result) => { + match result { + Ok(mods) => { + self.mods_by_game.insert(game_id, mods); + } + Err(err) => self.update_status(format!("Failed to list mods: {}", err)), + } + Command::none() + } + Message::AddMods(game_id) => Command::perform( + pick_archives(), + move |paths| Message::ModsPicked(game_id, paths), + ), + Message::ModsPicked(game_id, paths) => { + let Some(paths) = paths else { + return Command::none(); + }; + let Some(game) = self.game_by_id(game_id).cloned() else { + self.update_status("Missing game for import."); + return Command::none(); + }; + let is_skyrim = is_skyrim_game(&game.name); + let base_dir = self.config.base_dir.clone(); + Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game.id) + .map_err(|err| err.to_string())?; + mods::import_archives(&game.name, &game.path, &dirs, is_skyrim, paths) + .map_err(|err| err.to_string()) + }, + move |result| Message::ModsImported(game_id, result), + ) + } + Message::ModsImported(game_id, result) => { + match result { + Ok(summary) => { + if !summary.missing_tools.is_empty() { + self.update_status(format!( + "Missing extractors: {}", + summary.missing_tools.join(", ") + )); + } else { + self.update_status(format!( + "Imported {} mods.", + summary.imported.len() + )); + } + if !summary.variants.is_empty() { + for request in summary.variants { + let pending = PendingVariant { + game_id, + mod_name: request.mod_name, + variants: request.variants, + selected: None, + }; + self.variant_queue.push(pending); + } + if self.pending_variant.is_none() { + if !self.variant_queue.is_empty() { + self.pending_variant = Some(self.variant_queue.remove(0)); + } + } + } + if !summary.layout_requests.is_empty() { + for mod_name in summary.layout_requests { + self.layout_queue.push(LayoutQueueItem { game_id, mod_name }); + } + self.process_next_layout_queue(); + } + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + mods::list_mods(&dirs.mods).map_err(|err| err.to_string()) + }, + move |result| Message::ModsListLoaded(game_id, result), + ); + } + Err(err) => self.update_status(format!("Import failed: {}", err)), + } + Command::none() + } + Message::ToggleMod { + game_id, + mod_name, + enable, + } => { + if self.pending_conflict.is_some() + || self.pending_variant.is_some() + || self.pending_queue.is_some() + || self.pending_layout.is_some() + { + self.update_status("Finish the current operation before toggling mods."); + return Command::none(); + } + let Some(game) = self.game_by_id(game_id).cloned() else { + self.update_status("Missing game for toggle."); + return Command::none(); + }; + if enable && is_skyrim_game(&game.name) { + if !self.ensure_skyrim_layout(&game, &mod_name) { + return Command::none(); + } + } + let base_dir = self.config.base_dir.clone(); + if enable { + let backups = self + .game_states + .get(&game_id) + .map(|state| state.backups.clone()) + .unwrap_or_default(); + return Command::perform( + async move { + enable_mod_task(base_dir, game, mod_name, backups, false) + .await + .map_err(|err| err.to_string()) + }, + Message::ModApplied, + ); + } + + let (mods_to_clear, target_mods, state_copy) = match self + .game_states + .get_mut(&game_id) + { + Some(state) => { + let current = state + .active_profile() + .map(|profile| profile.enabled_mods.clone()) + .unwrap_or_default(); + if let Some(profile) = state.active_profile_mut() { + profile.enabled_mods.retain(|name| name != &mod_name); + } + let target = state + .active_profile() + .map(|profile| profile.enabled_mods.clone()) + .unwrap_or_default(); + (current, target, state.clone()) + } + None => { + self.update_status("Missing game state for disable."); + return Command::none(); + } + }; + + let save_cmd = Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(game_id, result), + ); + let cleanup_mods = compute_cleanup_mods(&mods_to_clear, &target_mods); + let queue_cmd = + self.start_apply_queue(game_id, mods_to_clear, target_mods, cleanup_mods); + Command::batch(vec![save_cmd, queue_cmd]) + } + Message::ModApplied(result) => match result { + Ok(apply) => { + if let Some(state) = self.game_states.get_mut(&apply.game_id) { + state.backups = apply.backups.clone(); + if !apply.created_dirs.is_empty() { + let entry = state + .created_dirs + .entry(apply.mod_name.clone()) + .or_default(); + let mut set: HashSet = + entry.iter().cloned().collect(); + for dir in &apply.created_dirs { + set.insert(dir.clone()); + } + *entry = set.into_iter().collect(); + } + } + let should_record = !apply.from_queue && apply.linked_files > 0; + match apply.outcome { + EnableOutcome::Applied => { + if apply.from_queue { + if let Some(queue) = self.pending_queue.as_mut() { + queue.index += 1; + } else if let Some(queue) = self.resume_queue.take() { + self.pending_queue = Some(queue); + } + return Command::perform(async {}, |_| Message::ApplyQueueNext); + } + let state = self + .game_states + .entry(apply.game_id) + .or_insert_with(GameState::default); + state.ensure_default_profile(); + if let Some(profile) = state.active_profile_mut() { + if !profile.enabled_mods.contains(&apply.mod_name) { + profile.enabled_mods.push(apply.mod_name.clone()); + } + } + let state_copy = state.clone(); + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + let dirs = + fs::ensure_game_dirs(&base_dir, apply.game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(apply.game_id, result), + ); + } + EnableOutcome::Skipped => { + if should_record { + let state = self + .game_states + .entry(apply.game_id) + .or_insert_with(GameState::default); + state.ensure_default_profile(); + if let Some(profile) = state.active_profile_mut() { + if !profile.enabled_mods.contains(&apply.mod_name) { + profile.enabled_mods.push(apply.mod_name.clone()); + } + } + let state_copy = state.clone(); + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + let dirs = + fs::ensure_game_dirs(&base_dir, apply.game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(apply.game_id, result), + ); + } + if !apply.from_queue { + let Some(game) = self.game_by_id(apply.game_id).cloned() else { + self.update_status("No files linked for this mod."); + return Command::none(); + }; + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + verify_mod_links_task(base_dir, game, apply.mod_name) + .await + .map_err(|err| err.to_string()) + }, + Message::VerifyLinked, + ); + } + self.update_status("No files linked for this mod."); + if apply.from_queue { + if let Some(queue) = self.pending_queue.as_mut() { + queue.index += 1; + } else if let Some(queue) = self.resume_queue.take() { + self.pending_queue = Some(queue); + } + return Command::perform(async {}, |_| Message::ApplyQueueNext); + } + } + EnableOutcome::Conflicts(conflicts) => { + let resume_queue = if apply.from_queue { + self.pending_queue.take().map(|mut queue| { + queue.index += 1; + queue + }) + } else { + None + }; + self.pending_conflict = Some(PendingConflict { + game_id: apply.game_id, + mod_name: apply.mod_name, + conflicts, + index: 0, + decisions: HashMap::new(), + resume_queue, + }); + } + } + Command::none() + } + Err(err) => { + self.update_status(format!("Mod apply failed: {}", err)); + Command::none() + } + }, + Message::SymlinksCleared(_game_id, result) => match result { + Ok(()) => Command::perform(async {}, |_| Message::ApplyQueueNext), + Err(err) => { + self.update_status(format!("Failed to clear links: {}", err)); + self.pending_queue = None; + Command::none() + } + }, + Message::ApplyQueueNext => { + let Some(queue) = self.pending_queue.clone() else { + return Command::none(); + }; + if self.pending_layout.is_some() { + return Command::none(); + } + if queue.index >= queue.mods.len() { + let Some(game) = self.game_by_id(queue.game_id).cloned() else { + self.update_status("Missing game for restore."); + self.pending_queue = None; + return Command::none(); + }; + let backups = self + .game_states + .get(&queue.game_id) + .map(|state| state.backups.clone()) + .unwrap_or_default(); + let cleanup_mods = queue.cleanup_mods.clone(); + let mut cleanup_dirs: HashMap> = HashMap::new(); + if !cleanup_mods.is_empty() { + if let Some(state) = self.game_states.get(&queue.game_id) { + for mod_name in &cleanup_mods { + if let Some(dirs) = state.created_dirs.get(mod_name) { + cleanup_dirs.insert(mod_name.clone(), dirs.clone()); + } + } + } + } + self.pending_queue = None; + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + restore_backups_task( + base_dir, + game, + queue.mods, + backups, + cleanup_mods, + cleanup_dirs, + ) + .await + .map_err(|err| err.to_string()) + }, + Message::BackupsRestored, + ); + } + if let Some(game) = self.game_by_id(queue.game_id).cloned() { + let backups = self + .game_states + .get(&queue.game_id) + .map(|state| state.backups.clone()) + .unwrap_or_default(); + let mod_name = queue.mods[queue.index].clone(); + if is_skyrim_game(&game.name) && !self.ensure_skyrim_layout(&game, &mod_name) { + return Command::none(); + } + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + enable_mod_task(base_dir, game, mod_name, backups, true) + .await + .map_err(|err| err.to_string()) + }, + Message::ModApplied, + ); + } + Command::none() + } + Message::BackupsRestored(result) => match result { + Ok(result) => { + let mut save_state = None; + if let Some(state) = self.game_states.get_mut(&result.game_id) { + state.backups = result.backups; + for (mod_name, dirs) in result.updated_dirs { + if dirs.is_empty() { + state.created_dirs.remove(&mod_name); + } else { + state.created_dirs.insert(mod_name, dirs); + } + } + save_state = Some(state.clone()); + } + if result.cleaned_dirs > 0 { + self.update_status(format!( + "Restored {} files, cleaned {} empty folders.", + result.restored, result.cleaned_dirs + )); + } else { + self.update_status(format!("Restored {} files.", result.restored)); + } + if let Some(state_copy) = save_state { + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, result.game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |save_result| Message::GameStateSaved(result.game_id, save_result), + ); + } + Command::none() + } + Err(err) => { + self.update_status(format!("Restore failed: {}", err)); + Command::none() + } + }, + Message::ConflictUseNew => self.resolve_conflict(ConflictDecision::UseNew), + Message::ConflictKeepExisting => self.resolve_conflict(ConflictDecision::KeepExisting), + Message::ConflictAutoResolve => self.auto_resolve_conflicts(), + Message::ConflictCancel => { + self.pending_conflict = None; + self.resume_queue = None; + self.pending_queue = None; + self.update_status("Conflict resolution cancelled."); + Command::none() + } + Message::LayoutUseRoot => self.apply_layout_decision(LayoutDecision::UseRoot), + Message::LayoutMoveToData => self.apply_layout_decision(LayoutDecision::MoveRootToData), + Message::LayoutApplyData => self.apply_layout_decision(LayoutDecision::ApplyDataWrap), + Message::LayoutKeepOriginal => self.apply_layout_decision(LayoutDecision::KeepOriginal), + Message::LayoutCancel => { + self.pending_layout = None; + self.update_status("Layout update cancelled."); + self.process_next_layout_queue(); + Command::none() + } + Message::LayoutPickSubdir => { + let Some(layout) = &self.pending_layout else { + return Command::none(); + }; + let Some(game) = self.game_by_id(layout.game_id).cloned() else { + self.update_status("Missing game for layout update."); + return Command::none(); + }; + let Ok(dirs) = fs::ensure_game_dirs(&self.config.base_dir, game.id) else { + self.update_status("Failed to prepare game folders."); + return Command::none(); + }; + let mod_root = mod_root_for_game(&dirs, &game.name, &layout.mod_name); + Command::perform(pick_layout_subdir(mod_root), Message::LayoutSubdirPicked) + } + Message::LayoutSubdirPicked(path) => { + let Some(path) = path else { + self.update_status("No folder selected."); + return Command::none(); + }; + let Some(layout) = self.pending_layout.clone() else { + return Command::none(); + }; + let Some(game) = self.game_by_id(layout.game_id).cloned() else { + self.update_status("Missing game for layout update."); + return Command::none(); + }; + let base_dir = self.config.base_dir.clone(); + Command::perform( + async move { + apply_layout_subdir_task(base_dir, game, layout, path) + .await + .map_err(|err| err.to_string()) + }, + Message::LayoutSubdirProcessed, + ) + } + Message::LayoutSubdirProcessed(result) => match result { + Ok(result) => { + if let Some(plan) = result.plan { + self.pending_layout = Some(PendingLayout { + game_id: result.game_id, + mod_name: result.mod_name, + plan, + }); + } else { + self.pending_layout = None; + self.update_status(format!("Layout updated for {}.", result.mod_name)); + self.process_next_layout_queue(); + } + Command::none() + } + Err(err) => { + self.update_status(format!("Layout update failed: {}", err)); + Command::none() + } + }, + Message::LayoutApplied(result) => match result { + Ok(result) => { + self.update_status(format!("Layout updated for {}.", result.mod_name)); + self.pending_layout = None; + self.process_next_layout_queue(); + if self.pending_layout.is_none() && self.pending_queue.is_some() { + return Command::perform(async {}, |_| Message::ApplyQueueNext); + } + Command::none() + } + Err(err) => { + self.update_status(format!("Layout update failed: {}", err)); + self.pending_layout = None; + self.process_next_layout_queue(); + if self.pending_layout.is_none() && self.pending_queue.is_some() { + return Command::perform(async {}, |_| Message::ApplyQueueNext); + } + Command::none() + } + }, + Message::VariantSelected(selection) => { + if let Some(variant) = self.pending_variant.as_mut() { + variant.selected = Some(selection); + } + Command::none() + } + Message::VariantApply => { + let Some(variant) = self.pending_variant.clone() else { + return Command::none(); + }; + let Some(game) = self.game_by_id(variant.game_id).cloned() else { + self.update_status("Missing game for variant."); + return Command::none(); + }; + let selected = variant + .selected + .clone() + .or_else(|| variant.variants.first().cloned()); + let Some(selected) = selected else { + self.update_status("Select a variant to apply."); + return Command::none(); + }; + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + apply_variant_task(base_dir, game, variant, selected) + .await + .map_err(|err| err.to_string()) + }, + Message::VariantApplied, + ); + } + Message::VariantApplied(result) => match result { + Ok(result) => { + self.update_status(format!("Applied variant for {}.", result.mod_name)); + if !self.variant_queue.is_empty() { + self.pending_variant = Some(self.variant_queue.remove(0)); + } else { + self.pending_variant = None; + } + if let Some(game) = self.game_by_id(result.game_id) { + if is_skyrim_game(&game.name) { + self.layout_queue.push(LayoutQueueItem { + game_id: result.game_id, + mod_name: result.mod_name.clone(), + }); + self.process_next_layout_queue(); + } + } + Command::none() + } + Err(err) => { + self.update_status(format!("Variant apply failed: {}", err)); + Command::none() + } + }, + Message::VerifyLinked(result) => match result { + Ok(result) => { + if result.linked { + let state = self + .game_states + .entry(result.game_id) + .or_insert_with(GameState::default); + state.ensure_default_profile(); + if let Some(profile) = state.active_profile_mut() { + if !profile.enabled_mods.contains(&result.mod_name) { + profile.enabled_mods.push(result.mod_name.clone()); + } + } + let state_copy = state.clone(); + let base_dir = self.config.base_dir.clone(); + return Command::perform( + async move { + let dirs = + fs::ensure_game_dirs(&base_dir, result.game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |save_result| { + Message::GameStateSaved(result.game_id, save_result) + }, + ); + } + self.update_status("No files linked for this mod."); + Command::none() + } + Err(err) => { + self.update_status(format!("Link check failed: {}", err)); + Command::none() + } + }, + Message::ApplyLoadOrder(game_id) | Message::ApplyProfile(game_id) => { + let Some(state) = self.game_states.get(&game_id) else { + self.update_status("Missing game state."); + return Command::none(); + }; + let mods_to_clear = state + .active_profile() + .map(|profile| profile.enabled_mods.clone()) + .unwrap_or_default(); + let target_mods = mods_to_clear.clone(); + let cleanup_mods = compute_cleanup_mods(&mods_to_clear, &target_mods); + self.start_apply_queue(game_id, mods_to_clear, target_mods, cleanup_mods) + } + Message::Rollback(game_id) => { + let Some(state) = self.game_states.get_mut(&game_id) else { + self.update_status("Missing game state."); + return Command::none(); + }; + let previous = match state.previous_launch.clone() { + Some(snapshot) => snapshot, + None => { + self.update_status("No previous launch snapshot available."); + return Command::none(); + } + }; + let mods_to_clear = state + .active_profile() + .map(|profile| profile.enabled_mods.clone()) + .unwrap_or_default(); + state.active_profile = previous.name.clone(); + if state.active_profile().is_none() { + state.profiles.push(state::Profile { + name: previous.name.clone(), + enabled_mods: previous.enabled_mods.clone(), + }); + } + if let Some(profile) = state.active_profile_mut() { + profile.enabled_mods = previous.enabled_mods.clone(); + } + let target_mods = previous.enabled_mods.clone(); + let state_copy = state.clone(); + let base_dir = self.config.base_dir.clone(); + let save_cmd = Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(game_id, result), + ); + let cleanup_mods = compute_cleanup_mods(&mods_to_clear, &target_mods); + let queue_cmd = + self.start_apply_queue(game_id, mods_to_clear, target_mods, cleanup_mods); + Command::batch(vec![save_cmd, queue_cmd]) + } + Message::RestoreGame(game_id) => { + let Some(state) = self.game_states.get_mut(&game_id) else { + self.update_status("Missing game state."); + return Command::none(); + }; + let mods_to_clear = state + .active_profile() + .map(|profile| profile.enabled_mods.clone()) + .unwrap_or_default(); + if let Some(profile) = state.active_profile_mut() { + profile.enabled_mods.clear(); + } + let state_copy = state.clone(); + let base_dir = self.config.base_dir.clone(); + let save_cmd = Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(game_id, result), + ); + let cleanup_mods = mods_to_clear.clone(); + let queue_cmd = self.start_apply_queue( + game_id, + mods_to_clear, + Vec::new(), + cleanup_mods, + ); + Command::batch(vec![save_cmd, queue_cmd]) + } + Message::AddProfile(game_id) => { + let base_dir = self.config.base_dir.clone(); + if let Some(state) = self.game_states.get_mut(&game_id) { + let mut counter = state.profiles.len() + 1; + let mut name = format!("Profile {}", counter); + while state.profiles.iter().any(|p| p.name == name) { + counter += 1; + name = format!("Profile {}", counter); + } + state.profiles.push(state::Profile { + name: name.clone(), + enabled_mods: Vec::new(), + }); + state.active_profile = name; + let state_copy = state.clone(); + return Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(game_id, result), + ); + } + Command::none() + } + Message::ProfileSelected(game_id, name) => { + let base_dir = self.config.base_dir.clone(); + if let Some(state) = self.game_states.get_mut(&game_id) { + state.active_profile = name; + let state_copy = state.clone(); + return Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(game_id, result), + ); + } + Command::none() + } + Message::RecordLaunch(game_id) => { + let base_dir = self.config.base_dir.clone(); + if let Some(state) = self.game_states.get_mut(&game_id) { + state.record_launch_snapshot(); + let state_copy = state.clone(); + return Command::perform( + async move { + let dirs = fs::ensure_game_dirs(&base_dir, game_id) + .map_err(|err| err.to_string())?; + state::save_game_state(&dirs.state, &state_copy) + .map_err(|err| err.to_string()) + }, + move |result| Message::GameStateSaved(game_id, result), + ); + } + Command::none() + } + Message::GameStateSaved(_game_id, result) => { + if let Err(err) = result { + self.update_status(format!("Failed to save game state: {}", err)); + } + Command::none() + } + Message::DismissStatus => { + self.status = None; + Command::none() + } + } + } + + fn view(&self, window: window::Id) -> Element<'_, Message> { + let theme = theme_for_choice(self.config.theme); + let _ = window; + if self.settings_open { + self.view_settings(&theme) + } else { + self.view_main(&theme) + } + } +} + +fn pick_folder() -> impl std::future::Future> { + async { rfd::FileDialog::new().pick_folder() } +} + +fn pick_archives() -> impl std::future::Future>> { + async { + let mut dialog = rfd::FileDialog::new().add_filter("Archives", &["zip", "7z", "rar"]); + if let Ok(home) = std::env::var("HOME") { + let downloads = PathBuf::from(home).join("Downloads"); + if downloads.is_dir() { + dialog = dialog.set_directory(downloads); + } + } + dialog.pick_files() + } +} + +fn pick_layout_subdir(root: PathBuf) -> impl std::future::Future> { + async { rfd::FileDialog::new().set_directory(root).pick_folder() } +} + +fn register_game(config: &mut AppConfig, path: PathBuf) -> Result> { + if let Some(_existing) = config.games.iter().find(|game| game.path == path) { + return Ok(None); + } + let name = path + .file_name() + .and_then(|name| name.to_str()) + .unwrap_or("Game") + .to_string(); + let entry = GameEntry::new(name, path); + let id = entry.id; + config.games.push(entry); + Ok(Some(id)) +} + +fn ensure_game_tree(config: &AppConfig, game_id: Uuid) -> Result<()> { + let game = config + .games + .iter() + .find(|game| game.id == game_id) + .context("missing game")?; + let dirs = fs::ensure_game_dirs(&config.base_dir, game_id)?; + fs::clone_directory_tree(&game.path, &dirs.staging)?; + Ok(()) +} + +fn scan_steam(config: AppConfig, steam_dir: PathBuf) -> Result { + let mut config = config; + fs::ensure_base_dir(&config.base_dir)?; + let normalized = steam::normalize_steam_root(&steam_dir).unwrap_or(steam_dir); + config.steam_dir = Some(normalized.clone()); + let candidates = steam::discover_games(&normalized)?; + let found = candidates.len(); + let mut added = 0; + for game in candidates { + if is_hidden_game(&game.name, &game.path) { + continue; + } + if config.games.iter().any(|entry| entry.path == game.path) { + continue; + } + let entry = GameEntry::new(game.name, game.path.clone()); + let game_id = entry.id; + config.games.push(entry); + let dirs = fs::ensure_game_dirs(&config.base_dir, game_id)?; + fs::clone_directory_tree(&game.path, &dirs.staging)?; + added += 1; + } + Ok(SteamScanResult { + config, + added, + found, + }) +} + +fn mod_root_for_game(dirs: &GameDirs, game_name: &str, mod_name: &str) -> PathBuf { + dirs.mods + .join(mod_name) + .join(mods::game_dir_name(game_name)) +} + +async fn enable_mod_task( + base_dir: PathBuf, + game: GameEntry, + mod_name: String, + backups: Vec, + from_queue: bool, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mod_root = mod_root_for_game(&dirs, &game.name, &mod_name); + let mut backup_set: HashSet = backups.into_iter().collect(); + let report = mods::enable_mod(&game.path, &mod_root, &dirs.backups, &mut backup_set)?; + Ok(ApplyResult { + game_id: game.id, + mod_name, + outcome: report.outcome, + backups: backup_set.into_iter().collect(), + from_queue, + created_dirs: report.created_dirs, + linked_files: report.linked_files, + }) +} + +async fn enable_mod_with_decisions_task( + base_dir: PathBuf, + game: GameEntry, + mod_name: String, + decisions: HashMap, + backups: Vec, + from_queue: bool, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mod_root = mod_root_for_game(&dirs, &game.name, &mod_name); + let mut backup_set: HashSet = backups.into_iter().collect(); + let report = mods::enable_mod_with_decisions( + &game.path, + &mod_root, + &decisions, + &dirs.backups, + &mut backup_set, + )?; + Ok(ApplyResult { + game_id: game.id, + mod_name, + outcome: report.outcome, + backups: backup_set.into_iter().collect(), + from_queue, + created_dirs: report.created_dirs, + linked_files: report.linked_files, + }) +} + +async fn clear_symlinks_task( + base_dir: PathBuf, + game: GameEntry, + mods_to_clear: Vec, +) -> Result<()> { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + for mod_name in mods_to_clear { + let mod_root = mod_root_for_game(&dirs, &game.name, &mod_name); + let _ = mods::disable_mod(&game.path, &mod_root); + } + Ok(()) +} + +async fn restore_backups_task( + base_dir: PathBuf, + game: GameEntry, + enabled_mods: Vec, + backups: Vec, + cleanup_mods: Vec, + cleanup_dirs: HashMap>, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mut desired = HashSet::new(); + for mod_name in enabled_mods.iter() { + let mod_root = mod_root_for_game(&dirs, &game.name, mod_name); + let mod_dests = mods::mod_destinations(&game.path, &mod_root)?; + desired.extend(mod_dests); + } + let mut backup_set: HashSet = backups.into_iter().collect(); + let restored = mods::restore_backups(&game.path, &dirs.backups, &mut backup_set, &desired)?; + let mut cleaned_dirs = 0; + let mut updated_dirs: HashMap> = HashMap::new(); + for mod_name in cleanup_mods { + if let Some(dirs) = cleanup_dirs.get(&mod_name) { + let (removed, remaining) = mods::cleanup_empty_dirs(&game.path, dirs)?; + cleaned_dirs += removed; + updated_dirs.insert(mod_name, remaining); + } + } + Ok(RestoreResult { + game_id: game.id, + backups: backup_set.into_iter().collect(), + restored, + cleaned_dirs, + updated_dirs, + }) +} + +async fn apply_variant_task( + base_dir: PathBuf, + game: GameEntry, + variant: PendingVariant, + selected: String, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mod_root = mod_root_for_game(&dirs, &game.name, &variant.mod_name); + mods::apply_variant_selection(&game.path, &mod_root, &selected, &variant.variants)?; + + let mut metadata = mods::load_mod_metadata(&dirs.mods, &variant.mod_name)? + .unwrap_or_default(); + metadata.variant = Some(selected); + metadata.variants = variant.variants; + mods::save_mod_metadata(&dirs.mods, &variant.mod_name, &metadata)?; + + Ok(VariantApplyResult { + game_id: game.id, + mod_name: variant.mod_name, + }) +} + +async fn apply_layout_task( + base_dir: PathBuf, + game: GameEntry, + layout: PendingLayout, + decision: LayoutDecision, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mod_root = mod_root_for_game(&dirs, &game.name, &layout.mod_name); + match decision { + LayoutDecision::KeepOriginal => { + mods::apply_layout_plan(&game.path, &mod_root, &layout.plan, decision)?; + mods::set_layout_status(&dirs.mods, &layout.mod_name, "original")?; + } + _ => { + mods::apply_layout_plan(&game.path, &mod_root, &layout.plan, decision)?; + mods::set_layout_status(&dirs.mods, &layout.mod_name, "applied")?; + } + } + + Ok(LayoutApplyResult { + mod_name: layout.mod_name, + }) +} + +async fn apply_layout_subdir_task( + base_dir: PathBuf, + game: GameEntry, + layout: PendingLayout, + selected: PathBuf, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mod_root = mod_root_for_game(&dirs, &game.name, &layout.mod_name); + mods::apply_subdir_choice(&mod_root, &selected)?; + let plan = mods::skyrim_layout_plan(&game.path, &mod_root)?; + if plan.prompt.is_some() { + mods::set_layout_status(&dirs.mods, &layout.mod_name, "pending")?; + return Ok(LayoutSubdirResult { + game_id: game.id, + mod_name: layout.mod_name, + plan: Some(plan), + }); + } + if !plan.moves.is_empty() { + mods::apply_layout_plan(&game.path, &mod_root, &plan, LayoutDecision::UseRoot)?; + } else { + mods::apply_layout_plan(&game.path, &mod_root, &plan, LayoutDecision::KeepOriginal)?; + } + mods::set_layout_status(&dirs.mods, &layout.mod_name, "applied")?; + Ok(LayoutSubdirResult { + game_id: game.id, + mod_name: layout.mod_name, + plan: None, + }) +} + +async fn verify_mod_links_task( + base_dir: PathBuf, + game: GameEntry, + mod_name: String, +) -> Result { + let dirs = fs::ensure_game_dirs(&base_dir, game.id)?; + let mod_root = mod_root_for_game(&dirs, &game.name, &mod_name); + let linked = mods::mod_has_links(&game.path, &mod_root)?; + Ok(VerifyLinkResult { + game_id: game.id, + mod_name, + linked, + }) +} + +fn existing_mod_name(base_dir: &Path, game_id: Uuid, target: &Path) -> Option { + let mods_root = base_dir + .join("games") + .join(game_id.to_string()) + .join("mods"); + let rel = target.strip_prefix(mods_root).ok()?; + let mut components = rel.components(); + let first = components.next()?; + match first { + std::path::Component::Normal(name) => Some(name.to_string_lossy().to_string()), + _ => None, + } +} + +fn is_skyrim_game(name: &str) -> bool { + name.to_ascii_lowercase().contains("skyrim") +} + +fn is_supported_game(name: &str) -> bool { + is_skyrim_game(name) +} + +fn is_hidden_game(name: &str, path: &Path) -> bool { + let name_lower = name.to_ascii_lowercase(); + if name_lower.contains("proton") { + return true; + } + let path_lower = path.to_string_lossy().to_ascii_lowercase(); + if path_lower.contains("proton") { + return true; + } + matches_blocklist(&name_lower, &["eve online"]) +} + +fn matches_blocklist(name: &str, blocklist: &[&str]) -> bool { + blocklist.iter().any(|entry| name.contains(entry)) +} + +fn compute_cleanup_mods(mods_to_clear: &[String], target_mods: &[String]) -> Vec { + let target: HashSet<&String> = target_mods.iter().collect(); + mods_to_clear + .iter() + .filter(|mod_name| !target.contains(mod_name)) + .cloned() + .collect() +} + +fn record_game_selection(config: &mut AppConfig, game_id: Uuid) { + config.last_selected_game = Some(game_id); + config.recent_games.insert(0, game_id); + if config.recent_games.len() > RECENT_GAME_LIMIT { + config.recent_games.truncate(RECENT_GAME_LIMIT); + } +} + +fn sort_games<'a>( + games: &'a [GameEntry], + last_selected: Option, + recent: &[Uuid], +) -> Vec<&'a GameEntry> { + let mut counts: HashMap = HashMap::new(); + for id in recent { + *counts.entry(*id).or_default() += 1; + } + let mut sorted: Vec<&GameEntry> = games.iter().collect(); + sorted.sort_by(|a, b| { + let a_last = last_selected == Some(a.id); + let b_last = last_selected == Some(b.id); + if a_last != b_last { + return b_last.cmp(&a_last); + } + let a_count = counts.get(&a.id).copied().unwrap_or(0); + let b_count = counts.get(&b.id).copied().unwrap_or(0); + if a_count != b_count { + return b_count.cmp(&a_count); + } + let a_name = a.name.to_ascii_lowercase(); + let b_name = b.name.to_ascii_lowercase(); + a_name.cmp(&b_name).then_with(|| a.id.cmp(&b.id)) + }); + sorted +} + +fn preview_paths(paths: &[PathBuf], limit: usize) -> iced::widget::Column<'_, Message> { + let mut column = column![]; + for path in paths.iter().take(limit) { + column = column.push(text(path.display().to_string()).size(12)); + } + if paths.len() > limit { + column = column.push(text("...").size(12)); + } + column +} diff --git a/repos/singularity/src/config.rs b/repos/singularity/src/config.rs new file mode 100644 index 0000000..fc3503e --- /dev/null +++ b/repos/singularity/src/config.rs @@ -0,0 +1,123 @@ +use anyhow::{Context, Result}; +use directories::{BaseDirs, ProjectDirs}; +use serde::{Deserialize, Serialize}; +use std::fs; +use std::path::{PathBuf}; +use uuid::Uuid; + +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +pub enum ThemeChoice { + SingularityDark, + SteamDark, + Nord, + TokyoNightStorm, + Oxocarbon, +} + +impl ThemeChoice { + pub const ALL: [ThemeChoice; 5] = [ + ThemeChoice::SingularityDark, + ThemeChoice::SteamDark, + ThemeChoice::Nord, + ThemeChoice::TokyoNightStorm, + ThemeChoice::Oxocarbon, + ]; +} + +impl Default for ThemeChoice { + fn default() -> Self { + ThemeChoice::SingularityDark + } +} + +impl std::fmt::Display for ThemeChoice { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + ThemeChoice::SingularityDark => write!(f, "Singularity Dark"), + ThemeChoice::SteamDark => write!(f, "Steam Slate"), + ThemeChoice::Nord => write!(f, "Nord"), + ThemeChoice::TokyoNightStorm => write!(f, "Tokyo Night Storm"), + ThemeChoice::Oxocarbon => write!(f, "Oxocarbon"), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AppConfig { + pub base_dir: PathBuf, + pub steam_dir: Option, + pub games: Vec, + #[serde(default)] + pub theme: ThemeChoice, + #[serde(default)] + pub last_selected_game: Option, + #[serde(default)] + pub recent_games: Vec, +} + +impl Default for AppConfig { + fn default() -> Self { + Self { + base_dir: default_base_dir(), + steam_dir: None, + games: Vec::new(), + theme: ThemeChoice::default(), + last_selected_game: None, + recent_games: Vec::new(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct GameEntry { + pub id: Uuid, + pub name: String, + pub path: PathBuf, +} + +impl GameEntry { + pub fn new(name: String, path: PathBuf) -> Self { + Self { + id: Uuid::new_v4(), + name, + path, + } + } +} + +pub fn default_base_dir() -> PathBuf { + if let Some(base_dirs) = BaseDirs::new() { + base_dirs.home_dir().join(".mods") + } else { + PathBuf::from(".mods") + } +} + +pub fn config_path() -> Result { + if let Some(project_dirs) = ProjectDirs::from("com", "singularity", "singularity") { + let dir = project_dirs.config_dir(); + fs::create_dir_all(dir).context("create config directory")?; + Ok(dir.join("config.toml")) + } else { + let fallback = default_base_dir(); + fs::create_dir_all(&fallback).context("create fallback config directory")?; + Ok(fallback.join("config.toml")) + } +} + +pub fn load_config() -> Result { + let path = config_path()?; + if !path.exists() { + return Ok(AppConfig::default()); + } + let contents = fs::read_to_string(&path).context("read config")?; + let config = toml::from_str(&contents).context("parse config")?; + Ok(config) +} + +pub fn save_config(config: &AppConfig) -> Result<()> { + let path = config_path()?; + let contents = toml::to_string_pretty(config).context("serialize config")?; + fs::write(&path, contents).context("write config")?; + Ok(()) +} diff --git a/repos/singularity/src/drag_overlay.rs b/repos/singularity/src/drag_overlay.rs new file mode 100644 index 0000000..0f75fd2 --- /dev/null +++ b/repos/singularity/src/drag_overlay.rs @@ -0,0 +1,256 @@ +use iced::advanced::layout; +use iced::advanced::mouse; +use iced::advanced::overlay; +use iced::advanced::renderer; +use iced::advanced::widget; +use iced::advanced::{Clipboard, Layout, Shell, Widget}; +use iced::{Element, Length, Point, Rectangle, Renderer, Size, Theme, Vector}; + +pub struct DragOverlay<'a, Message> { + content: Element<'a, Message>, + ghost: Element<'a, Message>, + show_ghost: bool, + cursor: Option, + ghost_offset_x: f32, +} + +impl<'a, Message: 'a> DragOverlay<'a, Message> { + pub fn new(content: impl Into>) -> Self { + Self { + content: content.into(), + ghost: iced::widget::space::Space::new(Length::Shrink, Length::Shrink).into(), + show_ghost: false, + cursor: None, + ghost_offset_x: 0.0, + } + } + + pub fn ghost( + mut self, + ghost: impl Into>, + cursor: Point, + offset_x: f32, + ) -> Self { + self.ghost = ghost.into(); + self.show_ghost = true; + self.cursor = Some(cursor); + self.ghost_offset_x = offset_x; + self + } +} + +impl<'a, Message> Widget for DragOverlay<'a, Message> { + fn children(&self) -> Vec { + vec![widget::Tree::new(&self.content), widget::Tree::new(&self.ghost)] + } + + fn diff(&self, tree: &mut widget::Tree) { + tree.diff_children(&[self.content.as_widget(), self.ghost.as_widget()]); + } + + fn size(&self) -> Size { + self.content.as_widget().size() + } + + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.content + .as_widget() + .layout(&mut tree.children[0], renderer, limits) + } + + fn operate( + &self, + tree: &mut widget::Tree, + layout: Layout<'_>, + renderer: &Renderer, + operation: &mut dyn widget::Operation, + ) { + self.content.as_widget().operate( + &mut tree.children[0], + layout, + renderer, + operation, + ); + } + + fn on_event( + &mut self, + tree: &mut widget::Tree, + event: iced::Event, + layout: Layout<'_>, + cursor: mouse::Cursor, + renderer: &Renderer, + clipboard: &mut dyn Clipboard, + shell: &mut Shell<'_, Message>, + viewport: &Rectangle, + ) -> iced::event::Status { + self.content.as_widget_mut().on_event( + &mut tree.children[0], + event, + layout, + cursor, + renderer, + clipboard, + shell, + viewport, + ) + } + + fn mouse_interaction( + &self, + tree: &widget::Tree, + layout: Layout<'_>, + cursor: mouse::Cursor, + viewport: &Rectangle, + renderer: &Renderer, + ) -> mouse::Interaction { + self.content.as_widget().mouse_interaction( + &tree.children[0], + layout, + cursor, + viewport, + renderer, + ) + } + + fn draw( + &self, + tree: &widget::Tree, + renderer: &mut Renderer, + theme: &Theme, + style: &renderer::Style, + layout: Layout<'_>, + cursor: mouse::Cursor, + viewport: &Rectangle, + ) { + self.content.as_widget().draw( + &tree.children[0], + renderer, + theme, + style, + layout, + cursor, + viewport, + ); + } + + fn overlay<'b>( + &'b mut self, + tree: &'b mut widget::Tree, + layout: Layout<'_>, + renderer: &Renderer, + translation: Vector, + ) -> Option> { + let mut overlays = Vec::new(); + let (content_tree, ghost_tree) = tree.children.split_at_mut(1); + let content_tree = &mut content_tree[0]; + let ghost_tree = &mut ghost_tree[0]; + let content_overlay = + self.content + .as_widget_mut() + .overlay(content_tree, layout, renderer, translation); + if let Some(overlay) = content_overlay { + overlays.push(overlay); + } + if self.show_ghost { + if let Some(cursor) = self.cursor { + let bounds = layout.bounds(); + let position = Point::new(bounds.x + translation.x, bounds.y + translation.y); + overlays.push(overlay::Element::new(Box::new(GhostOverlay { + ghost: &self.ghost, + state: ghost_tree, + cursor, + position, + content_size: bounds.size(), + offset_x: self.ghost_offset_x, + }))); + } + } + if overlays.is_empty() { + None + } else { + Some(overlay::Group::with_children(overlays).overlay()) + } + } +} + +impl<'a, Message: 'a> From> for Element<'a, Message> { + fn from(overlay: DragOverlay<'a, Message>) -> Self { + Element::new(overlay) + } +} + +struct GhostOverlay<'a, Message> { + ghost: &'a Element<'a, Message>, + state: &'a mut widget::Tree, + cursor: Point, + position: Point, + content_size: Size, + offset_x: f32, +} + +impl<'a, Message> overlay::Overlay for GhostOverlay<'a, Message> { + fn layout(&mut self, renderer: &Renderer, bounds: Size) -> layout::Node { + let ghost_layout = self.ghost.as_widget().layout( + self.state, + renderer, + &layout::Limits::new(Size::ZERO, bounds), + ); + let size = ghost_layout.bounds().size(); + let mut x = self.position.x + (self.content_size.width - size.width) / 2.0 + self.offset_x; + let mut y = self.position.y + self.cursor.y - size.height / 2.0; + let max_x = self.position.x + self.content_size.width - size.width; + if max_x >= self.position.x { + x = x.clamp(self.position.x, max_x); + } else { + x = self.position.x; + } + let max_y = self.position.y + self.content_size.height - size.height; + if max_y >= self.position.y { + y = y.clamp(self.position.y, max_y); + } else { + y = self.position.y; + } + if x + size.width > bounds.width { + x = (bounds.width - size.width).max(0.0); + } + if y + size.height > bounds.height { + y = (bounds.height - size.height).max(0.0); + } + layout::Node::with_children(size, vec![ghost_layout]) + .translate(Vector::new(x, y)) + } + + fn draw( + &self, + renderer: &mut Renderer, + theme: &Theme, + style: &renderer::Style, + layout: Layout<'_>, + cursor_position: mouse::Cursor, + ) { + self.ghost.as_widget().draw( + self.state, + renderer, + theme, + style, + layout.children().next().unwrap(), + cursor_position, + &Rectangle::with_size(Size::INFINITY), + ); + } + + fn is_over( + &self, + _layout: Layout<'_>, + _renderer: &Renderer, + _cursor_position: Point, + ) -> bool { + false + } +} diff --git a/repos/singularity/src/fs.rs b/repos/singularity/src/fs.rs new file mode 100644 index 0000000..766779a --- /dev/null +++ b/repos/singularity/src/fs.rs @@ -0,0 +1,102 @@ +use anyhow::{Context, Result}; +use std::fs; +use std::path::{Path, PathBuf}; +use uuid::Uuid; +use walkdir::WalkDir; + +#[derive(Debug, Clone)] +#[allow(dead_code)] +pub struct GameDirs { + pub root: PathBuf, + pub downloads: PathBuf, + pub zips: PathBuf, + pub mods: PathBuf, + pub staging: PathBuf, + pub profiles: PathBuf, + pub backups: PathBuf, + pub state: PathBuf, +} + +pub fn game_root(base_dir: &Path, game_id: Uuid) -> PathBuf { + base_dir.join("games").join(game_id.to_string()) +} + +pub fn ensure_base_dir(base_dir: &Path) -> Result<()> { + fs::create_dir_all(base_dir).context("create base dir")?; + fs::create_dir_all(base_dir.join("games")).context("create games dir")?; + Ok(()) +} + +pub fn ensure_game_dirs(base_dir: &Path, game_id: Uuid) -> Result { + let root = game_root(base_dir, game_id); + let downloads = root.join("downloads"); + let zips = root.join("zips"); + let mods = root.join("mods"); + let staging = root.join("staging"); + let profiles = root.join("profiles"); + let backups = root.join("backups"); + let state = root.join("game_state.toml"); + + for dir in [&root, &downloads, &zips, &mods, &staging, &profiles, &backups] { + fs::create_dir_all(dir).context("create game dir")?; + } + + Ok(GameDirs { + root, + downloads, + zips, + mods, + staging, + profiles, + backups, + state, + }) +} + +pub fn clone_directory_tree(src: &Path, dest: &Path) -> Result<()> { + if !src.is_dir() { + return Ok(()); + } + fs::create_dir_all(dest).context("create staging root")?; + for entry in WalkDir::new(src).min_depth(1) { + let entry = entry.context("walk game tree")?; + if entry.file_type().is_dir() { + let rel = entry.path().strip_prefix(src).context("strip prefix")?; + let target = dest.join(rel); + fs::create_dir_all(&target).context("create staging dir")?; + } + } + Ok(()) +} + +pub fn case_match_path(game_root: &Path, rel_path: &Path) -> Result { + let mut resolved = PathBuf::new(); + let mut current = game_root.to_path_buf(); + + for component in rel_path.components() { + let segment = component.as_os_str().to_string_lossy().to_string(); + let matched = match_case_in_dir(¤t, &segment); + let final_segment = matched.unwrap_or(segment); + resolved.push(&final_segment); + current = current.join(&final_segment); + } + + Ok(resolved) +} + +fn match_case_in_dir(dir: &Path, name: &str) -> Option { + if !dir.is_dir() { + return None; + } + let target = name.to_lowercase(); + let entries = fs::read_dir(dir).ok()?; + for entry in entries { + let entry = entry.ok()?; + let file_name = entry.file_name(); + let file_name_str = file_name.to_string_lossy(); + if file_name_str.to_lowercase() == target { + return Some(file_name_str.to_string()); + } + } + None +} diff --git a/repos/singularity/src/main.rs b/repos/singularity/src/main.rs new file mode 100644 index 0000000..ea804dc --- /dev/null +++ b/repos/singularity/src/main.rs @@ -0,0 +1,16 @@ +mod app; +mod config; +mod drag_overlay; +mod fs; +mod mods; +mod state; +mod steam; + +use iced::multi_window::Application; + +fn main() -> iced::Result { + let mut settings = iced::Settings::default(); + settings.window.icon = app::window_icon(); + settings.default_font = iced::Font::with_name("Sans"); + app::SingularityApp::run(settings) +} diff --git a/repos/singularity/src/mods.rs b/repos/singularity/src/mods.rs new file mode 100644 index 0000000..dbe6d20 --- /dev/null +++ b/repos/singularity/src/mods.rs @@ -0,0 +1,1351 @@ +use crate::fs::{case_match_path, GameDirs}; +use anyhow::{anyhow, Context, Result}; +use std::collections::{HashMap, HashSet}; +use std::ffi::OsStr; +use std::fs; +use std::io; +use std::path::{Path, PathBuf}; +use std::process::Command; +use walkdir::WalkDir; +use which::which; +use zip::ZipArchive; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Default)] +pub struct ModImportSummary { + pub imported: Vec, + pub skipped: Vec, + pub missing_tools: Vec, + pub variants: Vec, + pub layout_requests: Vec, +} + +#[derive(Debug, Clone)] +pub struct VariantRequest { + pub mod_name: String, + pub variants: Vec, +} + +#[derive(Debug, Clone)] +#[allow(dead_code)] +pub struct Conflict { + pub dest: PathBuf, + pub rel_path: PathBuf, + pub existing_target: Option, +} + +#[derive(Debug, Clone)] +pub enum ConflictDecision { + UseNew, + KeepExisting, +} + +#[derive(Debug, Clone)] +pub enum EnableOutcome { + Applied, + Skipped, + Conflicts(Vec), +} + +#[derive(Debug, Clone)] +pub struct EnableReport { + pub outcome: EnableOutcome, + pub created_dirs: Vec, + pub linked_files: usize, +} + +#[derive(Debug, Clone)] +pub struct LayoutMove { + pub source: PathBuf, + pub dest_rel: PathBuf, +} + +#[derive(Debug, Clone)] +pub struct LayoutPlan { + pub moves: Vec, + pub root_files: Vec, + pub data_files: Vec, + pub prompt: Option, +} + +#[derive(Debug, Clone)] +pub enum LayoutPrompt { + RootFiles, + DataWrap, +} + +#[derive(Debug, Clone)] +pub enum LayoutDecision { + UseRoot, + MoveRootToData, + ApplyDataWrap, + KeepOriginal, +} + +#[derive(Debug, Clone)] +struct FileLink { + source: PathBuf, + dest: PathBuf, + rel_path: PathBuf, +} + +#[derive(Debug, Clone)] +pub enum ExtractOutcome { + Ok, + MissingTool(String), +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ModMetadata { + pub variant: Option, + pub variants: Vec, + #[serde(default)] + pub layout_status: Option, +} + +pub fn list_mods(mods_dir: &Path) -> Result> { + let mut mods = Vec::new(); + if !mods_dir.is_dir() { + return Ok(mods); + } + for entry in fs::read_dir(mods_dir).context("read mods dir")? { + let entry = entry.context("mod entry")?; + if entry.file_type().context("mod entry type")?.is_dir() { + if let Some(name) = entry.file_name().to_str() { + mods.push(name.to_string()); + } + } + } + mods.sort(); + Ok(mods) +} + +pub fn import_archives( + game_name: &str, + game_root: &Path, + game_dirs: &GameDirs, + is_skyrim: bool, + archives: Vec, +) -> Result { + let mut summary = ModImportSummary::default(); + let game_root_dirs = list_root_dirs(game_root)?; + + for archive in archives { + let Some(file_name) = archive.file_name().and_then(|name| name.to_str()) else { + summary.skipped.push("unknown".to_string()); + continue; + }; + let download_copy = unique_destination(&game_dirs.downloads, file_name); + fs::copy(&archive, &download_copy).with_context(|| { + format!("copy download {}", download_copy.display()) + })?; + + let dest_archive = unique_destination(&game_dirs.zips, file_name); + fs::copy(&download_copy, &dest_archive).with_context(|| { + format!("copy archive {}", dest_archive.display()) + })?; + + let mod_name = unique_mod_name(&game_dirs.mods, sanitize_mod_name(file_name)); + let mod_root = game_dirs + .mods + .join(&mod_name) + .join(game_dir_name(game_name)); + fs::create_dir_all(&mod_root).context("create mod root")?; + + match extract_archive(&dest_archive, &mod_root)? { + ExtractOutcome::Ok => { + flatten_mod_root(&mod_root, &game_root_dirs)?; + if let Some(variants) = detect_variants(&mod_root)? { + let mut metadata = load_mod_metadata(&game_dirs.mods, &mod_name)? + .unwrap_or_default(); + metadata.variant = None; + metadata.variants = variants.clone(); + save_mod_metadata(&game_dirs.mods, &mod_name, &metadata)?; + summary.variants.push(VariantRequest { + mod_name: mod_name.clone(), + variants, + }); + } else if is_skyrim { + let plan = skyrim_layout_plan(game_root, &mod_root)?; + if plan.prompt.is_some() { + set_layout_status(&game_dirs.mods, &mod_name, "pending")?; + summary.layout_requests.push(mod_name.clone()); + } else { + if !plan.moves.is_empty() { + apply_layout_plan(game_root, &mod_root, &plan, LayoutDecision::UseRoot)?; + } else { + normalize_mod_case(game_root, &mod_root)?; + } + set_layout_status(&game_dirs.mods, &mod_name, "applied")?; + } + } else { + normalize_mod_case(game_root, &mod_root)?; + } + summary.imported.push(mod_name) + } + ExtractOutcome::MissingTool(tool) => { + summary.missing_tools.push(tool); + summary.skipped.push(file_name.to_string()); + } + } + } + + Ok(summary) +} + +pub fn enable_mod( + game_root: &Path, + mod_root: &Path, + backups_dir: &Path, + backups: &mut HashSet, +) -> Result { + let links = compute_links(game_root, mod_root)?; + let conflicts = detect_conflicts(&links)?; + if !conflicts.is_empty() { + return Ok(EnableReport { + outcome: EnableOutcome::Conflicts(conflicts), + created_dirs: Vec::new(), + linked_files: 0, + }); + } + + let result = apply_links(game_root, &links, None, backups_dir, backups)?; + let linked_files = count_existing_links(&links)?; + let outcome = if linked_files == 0 { + EnableOutcome::Skipped + } else { + EnableOutcome::Applied + }; + Ok(EnableReport { + outcome, + created_dirs: result.created_dirs, + linked_files, + }) +} + +pub fn disable_mod(game_root: &Path, mod_root: &Path) -> Result<()> { + let links = compute_links(game_root, mod_root)?; + for link in links { + if let Ok(metadata) = fs::symlink_metadata(&link.dest) { + if metadata.file_type().is_symlink() { + if let Ok(target) = fs::read_link(&link.dest) { + if target == link.source { + let _ = fs::remove_file(&link.dest); + } + } + } + } + } + Ok(()) +} + +pub fn enable_mod_with_decisions( + game_root: &Path, + mod_root: &Path, + decisions: &HashMap, + backups_dir: &Path, + backups: &mut HashSet, +) -> Result { + let links = compute_links(game_root, mod_root)?; + let result = apply_links(game_root, &links, Some(decisions), backups_dir, backups)?; + let linked_files = count_existing_links(&links)?; + let outcome = if linked_files == 0 { + EnableOutcome::Skipped + } else { + EnableOutcome::Applied + }; + Ok(EnableReport { + outcome, + created_dirs: result.created_dirs, + linked_files, + }) +} + +fn compute_links(game_root: &Path, mod_root: &Path) -> Result> { + let mut links = Vec::new(); + if !mod_root.is_dir() { + return Ok(links); + } + + for entry in WalkDir::new(mod_root).min_depth(1) { + let entry = entry.context("walk mod")?; + if !entry.file_type().is_file() { + continue; + } + let rel = entry + .path() + .strip_prefix(mod_root) + .context("strip mod root")?; + let matched_rel = case_match_path(game_root, rel)?; + let dest = game_root.join(&matched_rel); + links.push(FileLink { + source: entry.path().to_path_buf(), + dest, + rel_path: matched_rel, + }); + } + + Ok(links) +} + +fn detect_conflicts(links: &[FileLink]) -> Result> { + let mut conflicts = Vec::new(); + + for link in links { + if !link.dest.exists() { + continue; + } + let metadata = fs::symlink_metadata(&link.dest).context("link metadata")?; + if metadata.file_type().is_symlink() { + let target = fs::read_link(&link.dest).context("read symlink")?; + if target != link.source { + conflicts.push(Conflict { + dest: link.dest.clone(), + rel_path: link.rel_path.clone(), + existing_target: Some(target), + }); + } + } else { + conflicts.push(Conflict { + dest: link.dest.clone(), + rel_path: link.rel_path.clone(), + existing_target: None, + }); + } + } + + Ok(conflicts) +} + +#[derive(Debug, Clone)] +struct ApplyLinksResult { + created_dirs: Vec, +} + +fn apply_links( + game_root: &Path, + links: &[FileLink], + decisions: Option<&HashMap>, + backups_dir: &Path, + backups: &mut HashSet, +) -> Result { + let mut created_dirs: HashSet = HashSet::new(); + + for link in links { + for dir in ensure_rel_dirs(game_root, &link.rel_path)? { + created_dirs.insert(dir); + } + + if link.dest.exists() { + let metadata = fs::symlink_metadata(&link.dest).context("link metadata")?; + if metadata.file_type().is_symlink() { + let target = fs::read_link(&link.dest).context("read symlink")?; + if target == link.source { + continue; + } + match decisions.and_then(|map| map.get(&link.dest)) { + Some(ConflictDecision::UseNew) => { + fs::remove_file(&link.dest).context("remove conflicting symlink")?; + } + Some(ConflictDecision::KeepExisting) => continue, + None => return Err(anyhow!("missing conflict decision")), + } + } else { + if metadata.is_dir() { + return Err(anyhow!("conflict with directory")); + } + match decisions.and_then(|map| map.get(&link.dest)) { + Some(ConflictDecision::UseNew) => { + if backups.contains(&link.rel_path) { + fs::remove_file(&link.dest).context("remove conflicting file")?; + } else { + backup_original( + game_root, + backups_dir, + &link.dest, + &link.rel_path, + backups, + )?; + } + } + Some(ConflictDecision::KeepExisting) => continue, + None => return Err(anyhow!("missing conflict decision")), + } + } + } + + if !link.dest.exists() { + std::os::unix::fs::symlink(&link.source, &link.dest) + .context("create symlink")?; + } + } + + Ok(ApplyLinksResult { + created_dirs: created_dirs.into_iter().collect(), + }) +} + +fn count_existing_links(links: &[FileLink]) -> Result { + let mut count = 0; + for link in links { + let metadata = match fs::symlink_metadata(&link.dest) { + Ok(metadata) => metadata, + Err(err) if err.kind() == io::ErrorKind::NotFound => continue, + Err(err) => return Err(err.into()), + }; + if metadata.file_type().is_symlink() { + if let Ok(target) = fs::read_link(&link.dest) { + if target == link.source { + count += 1; + } + } + } + } + Ok(count) +} + +fn ensure_rel_dirs(game_root: &Path, rel_path: &Path) -> Result> { + let Some(parent) = rel_path.parent() else { + return Ok(Vec::new()); + }; + let mut created = Vec::new(); + let mut current_rel = PathBuf::new(); + for component in parent.components() { + current_rel.push(component); + let dir = game_root.join(¤t_rel); + if dir.exists() { + continue; + } + fs::create_dir(&dir).context("create target dir")?; + created.push(current_rel.clone()); + } + Ok(created) +} + +fn backup_original( + game_root: &Path, + backups_dir: &Path, + dest: &Path, + rel_path: &Path, + backups: &mut HashSet, +) -> Result<()> { + if backups.contains(rel_path) { + return Ok(()); + } + let backup_path = backups_dir.join(rel_path); + if let Some(parent) = backup_path.parent() { + fs::create_dir_all(parent).context("create backup dir")?; + } + if dest == game_root { + return Err(anyhow!("refusing to backup game root")); + } + if backup_path.exists() { + fs::remove_file(dest).context("remove original file")?; + backups.insert(rel_path.to_path_buf()); + return Ok(()); + } + match fs::rename(dest, &backup_path) { + Ok(()) => { + backups.insert(rel_path.to_path_buf()); + Ok(()) + } + Err(_) => { + // Best-effort: allow overwrite without backup if rename fails. + fs::remove_file(dest).context("remove original file after backup failure")?; + Ok(()) + } + } +} + +fn extract_archive(archive: &Path, dest: &Path) -> Result { + let ext = archive + .extension() + .and_then(OsStr::to_str) + .unwrap_or("") + .to_lowercase(); + + match ext.as_str() { + "zip" => { + extract_zip(archive, dest)?; + Ok(ExtractOutcome::Ok) + } + "7z" => { + if which("7z").is_ok() { + extract_with_7z(archive, dest)?; + Ok(ExtractOutcome::Ok) + } else { + Ok(ExtractOutcome::MissingTool("7z".to_string())) + } + } + "rar" => { + if which("unrar").is_ok() { + extract_with_unrar(archive, dest)?; + Ok(ExtractOutcome::Ok) + } else if which("7z").is_ok() { + extract_with_7z(archive, dest)?; + Ok(ExtractOutcome::Ok) + } else { + Ok(ExtractOutcome::MissingTool("unrar".to_string())) + } + } + _ => Err(anyhow!("unsupported archive type")), + } +} + +fn extract_zip(archive: &Path, dest: &Path) -> Result<()> { + let file = fs::File::open(archive).context("open zip")?; + let mut archive = ZipArchive::new(file).context("read zip")?; + + for i in 0..archive.len() { + let mut file = archive.by_index(i).context("zip entry")?; + let Some(path) = file.enclosed_name() else { + continue; + }; + let outpath = dest.join(path); + if file.name().ends_with('/') { + fs::create_dir_all(&outpath).context("create zip dir")?; + } else { + if let Some(parent) = outpath.parent() { + fs::create_dir_all(parent).context("create zip parent")?; + } + let mut outfile = fs::File::create(&outpath).context("create zip file")?; + io::copy(&mut file, &mut outfile).context("write zip file")?; + } + } + + Ok(()) +} + +fn extract_with_7z(archive: &Path, dest: &Path) -> Result<()> { + fs::create_dir_all(dest).context("create extract dest")?; + let output = Command::new("7z") + .arg("x") + .arg(archive) + .arg(format!("-o{}", dest.display())) + .output() + .context("run 7z")?; + + if !output.status.success() { + let stderr = String::from_utf8_lossy(&output.stderr); + return Err(anyhow!("extract failed: {}", stderr)); + } + + Ok(()) +} + +fn extract_with_unrar(archive: &Path, dest: &Path) -> Result<()> { + fs::create_dir_all(dest).context("create extract dest")?; + let output = Command::new("unrar") + .arg("x") + .arg("-o+") + .arg(archive) + .arg(dest) + .output() + .context("run unrar")?; + + if !output.status.success() { + let stderr = String::from_utf8_lossy(&output.stderr); + return Err(anyhow!("extract failed: {}", stderr)); + } + + Ok(()) +} + +fn sanitize_mod_name(file_name: &str) -> String { + let stem = Path::new(file_name) + .file_stem() + .and_then(OsStr::to_str) + .unwrap_or("mod"); + stem + .chars() + .map(|ch| if ch.is_ascii_alphanumeric() { ch } else { '_' }) + .collect::() + .trim_matches('_') + .to_string() +} + +pub fn game_dir_name(game_name: &str) -> String { + sanitize_dir_component(game_name) +} + +fn sanitize_dir_component(name: &str) -> String { + let cleaned = name + .chars() + .map(|ch| if ch == '/' || ch == '\\' || ch.is_control() { '_' } else { ch }) + .collect::(); + cleaned.trim().to_string() +} + +fn unique_mod_name(mods_dir: &Path, base: String) -> String { + let base = if base.is_empty() { "mod".to_string() } else { base }; + let mut name = base.clone(); + let mut counter = 1; + while mods_dir.join(&name).exists() { + name = format!("{}_{}", base, counter); + counter += 1; + } + name +} + +fn unique_destination(dir: &Path, file_name: &str) -> PathBuf { + let mut candidate = dir.join(file_name); + if !candidate.exists() { + return candidate; + } + + let stem = Path::new(file_name) + .file_stem() + .and_then(OsStr::to_str) + .unwrap_or("file"); + let ext = Path::new(file_name) + .extension() + .and_then(OsStr::to_str) + .unwrap_or(""); + + let mut counter = 1; + loop { + let next_name = if ext.is_empty() { + format!("{}_{}", stem, counter) + } else { + format!("{}_{}.{}", stem, counter, ext) + }; + candidate = dir.join(next_name); + if !candidate.exists() { + break candidate; + } + counter += 1; + } +} + +fn list_root_dirs(root: &Path) -> Result> { + let mut dirs = HashSet::new(); + if !root.is_dir() { + return Ok(dirs); + } + for entry in fs::read_dir(root).context("read game root")? { + let entry = entry.context("game root entry")?; + if entry.file_type().context("game root type")?.is_dir() { + if let Some(name) = entry.file_name().to_str() { + dirs.insert(name.to_string()); + } + } + } + Ok(dirs) +} + +fn flatten_mod_root(mod_root: &Path, game_root_dirs: &HashSet) -> Result<()> { + loop { + let entries = fs::read_dir(mod_root).context("read mod root")?; + let mut dirs = Vec::new(); + let mut files = Vec::new(); + + for entry in entries { + let entry = entry.context("mod root entry")?; + let name = entry.file_name().to_string_lossy().to_string(); + if name == "__MACOSX" { + let _ = fs::remove_dir_all(entry.path()); + continue; + } + if entry.file_type().context("mod root entry type")?.is_dir() { + dirs.push(entry.path()); + } else { + files.push(entry.path()); + } + } + + if files.is_empty() && dirs.len() == 1 { + let dir = dirs.pop().expect("dir exists"); + let Some(dir_name) = dir.file_name().and_then(|name| name.to_str()) else { + break; + }; + if game_root_dirs + .iter() + .any(|entry| entry.eq_ignore_ascii_case(dir_name)) + { + break; + } + move_dir_contents(&dir, mod_root)?; + let _ = fs::remove_dir_all(&dir); + continue; + } + + break; + } + + Ok(()) +} + +fn move_dir_contents(source: &Path, dest: &Path) -> Result<()> { + for entry in fs::read_dir(source).context("read dir contents")? { + let entry = entry.context("dir entry")?; + let file_name = entry.file_name(); + let target = dest.join(file_name); + if target.exists() { + continue; + } + fs::rename(entry.path(), target).context("move entry")?; + } + Ok(()) +} + +fn detect_variants(mod_root: &Path) -> Result>> { + let mut candidates = Vec::new(); + if !mod_root.is_dir() { + return Ok(None); + } + for entry in fs::read_dir(mod_root).context("read mod root")? { + let entry = entry.context("mod root entry")?; + if !entry.file_type().context("entry type")?.is_dir() { + continue; + } + let name = entry.file_name().to_string_lossy().to_string(); + if name.starts_with('.') || name == "__MACOSX" { + continue; + } + let files = collect_file_list(&entry.path())?; + if files.is_empty() { + continue; + } + candidates.push((name, files)); + } + + if candidates.len() < 2 { + return Ok(None); + } + + let mut groups: HashMap, Vec> = HashMap::new(); + for (name, mut files) in candidates { + files.sort(); + groups.entry(files).or_default().push(name); + } + + let mut best: Option> = None; + for group in groups.values() { + if group.len() < 2 { + continue; + } + if best.as_ref().map_or(true, |current| group.len() > current.len()) { + let mut names = group.clone(); + names.sort(); + best = Some(names); + } + } + + Ok(best) +} + +fn collect_file_list(root: &Path) -> Result> { + let mut files = Vec::new(); + for entry in WalkDir::new(root).min_depth(1) { + let entry = entry.context("walk variant")?; + if entry.file_type().is_file() { + let rel = entry + .path() + .strip_prefix(root) + .context("strip variant root")?; + files.push(rel.to_string_lossy().to_string()); + } + } + Ok(files) +} + +pub fn apply_variant_selection( + game_root: &Path, + mod_root: &Path, + selected: &str, + variants: &[String], +) -> Result<()> { + let variants_dir = mod_root.join(".variants"); + fs::create_dir_all(&variants_dir).context("create variants dir")?; + + for variant in variants { + let variant_path = mod_root.join(variant); + if !variant_path.is_dir() { + continue; + } + if variant == selected { + move_dir_contents(&variant_path, mod_root)?; + let _ = fs::remove_dir_all(&variant_path); + } else { + let target = variants_dir.join(variant); + if target.exists() { + let _ = fs::remove_dir_all(&target); + } + fs::rename(&variant_path, &target).context("stash variant")?; + } + } + + normalize_mod_case(game_root, mod_root)?; + Ok(()) +} + +fn normalize_mod_case(game_root: &Path, mod_root: &Path) -> Result<()> { + let mut moves = Vec::new(); + for entry in WalkDir::new(mod_root).min_depth(1) { + let entry = entry.context("walk mod for case")?; + if !entry.file_type().is_file() { + continue; + } + let rel = entry + .path() + .strip_prefix(mod_root) + .context("strip mod root")?; + let matched = case_match_path(game_root, rel)?; + if matched != rel { + moves.push((entry.path().to_path_buf(), mod_root.join(matched))); + } + } + + for (source, dest) in moves { + if dest.exists() { + continue; + } + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).context("create case dir")?; + } + fs::rename(&source, &dest).context("rename for case")?; + } + + clean_empty_dirs(mod_root)?; + Ok(()) +} + +fn clean_empty_dirs(root: &Path) -> Result<()> { + if !root.is_dir() { + return Ok(()); + } + for entry in WalkDir::new(root).contents_first(true) { + let entry = entry.context("walk cleanup")?; + if entry.file_type().is_dir() { + let path = entry.path(); + if path == root { + continue; + } + if fs::read_dir(path).map(|mut r| r.next().is_none()).unwrap_or(false) { + let _ = fs::remove_dir(path); + } + } + } + Ok(()) +} + +pub fn skyrim_layout_plan(_game_root: &Path, mod_root: &Path) -> Result { + let root_entries = fs::read_dir(mod_root).context("read mod root")?; + let mut root_dirs = Vec::new(); + + for entry in root_entries { + let entry = entry.context("mod root entry")?; + let file_type = entry.file_type().context("mod root entry type")?; + let name = entry.file_name().to_string_lossy().to_string(); + if name == ".variants" || name == "__MACOSX" { + continue; + } + if file_type.is_dir() { + root_dirs.push(name); + } + } + + let wrapper_prefix = detect_wrapper_prefix(mod_root, &root_dirs); + + let mut files = Vec::new(); + let mut all_files_flat = true; + let mut all_data_root_exts = true; + let mut has_data_dir = false; + let mut has_data_child_root = false; + + for entry in WalkDir::new(mod_root).min_depth(1) { + let entry = entry.context("walk mod for layout")?; + if !entry.file_type().is_file() { + continue; + } + let rel = entry + .path() + .strip_prefix(mod_root) + .context("strip mod root")? + .to_path_buf(); + if rel.components().next().is_none() { + continue; + } + if rel.components().next().and_then(|c| c.as_os_str().to_str()) == Some(".variants") { + continue; + } + let rel_effective = strip_wrapper_prefix(&rel, wrapper_prefix.as_deref()); + if rel_effective.components().count() > 1 { + all_files_flat = false; + } + if let Some(first) = rel_effective.components().next() { + let name = first.as_os_str().to_string_lossy(); + if name.eq_ignore_ascii_case("data") { + has_data_dir = true; + } else if is_data_child_dir(&name) { + has_data_child_root = true; + } + } + let ext = file_ext_lowercase(&rel_effective); + if !is_data_root_ext(&ext) { + all_data_root_exts = false; + } + files.push(rel); + } + + let force_data_root = has_data_dir && !has_data_child_root; + let data_wrap_candidate = + !has_data_dir && !has_data_child_root && all_files_flat && all_data_root_exts && !files.is_empty(); + + let mut moves = Vec::new(); + let mut root_targets = Vec::new(); + let mut data_targets = Vec::new(); + + for rel in files { + let rel_effective = strip_wrapper_prefix(&rel, wrapper_prefix.as_deref()); + let dest_rel = if data_wrap_candidate { + PathBuf::from("Data").join(rel_effective.file_name().unwrap_or_default()) + } else { + skyrim_destination(&rel, force_data_root, wrapper_prefix.as_deref()) + }; + + if dest_rel.parent().is_none() { + root_targets.push(dest_rel.clone()); + } + if dest_rel.starts_with("Data") { + data_targets.push(dest_rel.clone()); + } + + if dest_rel != rel { + moves.push(LayoutMove { + source: mod_root.join(&rel), + dest_rel, + }); + } + } + + let prompt = if !root_targets.is_empty() { + Some(LayoutPrompt::RootFiles) + } else if data_wrap_candidate { + Some(LayoutPrompt::DataWrap) + } else { + None + }; + + Ok(LayoutPlan { + moves, + root_files: root_targets, + data_files: data_targets, + prompt, + }) +} + +pub fn apply_layout_plan( + game_root: &Path, + mod_root: &Path, + plan: &LayoutPlan, + decision: LayoutDecision, +) -> Result<()> { + let apply_moves = !matches!(decision, LayoutDecision::KeepOriginal); + if apply_moves { + for layout in &plan.moves { + let mut dest_rel = layout.dest_rel.clone(); + if matches!(decision, LayoutDecision::MoveRootToData) && dest_rel.parent().is_none() { + dest_rel = PathBuf::from("Data").join(dest_rel); + } + let dest = mod_root.join(&dest_rel); + if dest == layout.source { + continue; + } + if dest.exists() { + continue; + } + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).context("create layout dir")?; + } + fs::rename(&layout.source, &dest).context("apply layout move")?; + } + } + + clean_empty_dirs(mod_root)?; + normalize_mod_case(game_root, mod_root)?; + Ok(()) +} + +fn skyrim_destination(rel: &Path, force_data_root: bool, wrapper_prefix: Option<&str>) -> PathBuf { + let rel = strip_wrapper_prefix(rel, wrapper_prefix); + + if force_data_root { + if let Some(stripped) = strip_prefix_case_insensitive(&rel, "data") { + return PathBuf::from("Data").join(stripped); + } + let ext = file_ext_lowercase(&rel); + if is_root_ext(&ext) && !contains_data_anchor(&rel) { + return PathBuf::from(rel.file_name().unwrap_or_default()); + } + return PathBuf::from("Data").join(rel); + } + + if let Some(stripped) = strip_prefix_case_insensitive(&rel, "data") { + return PathBuf::from("Data").join(stripped); + } + if let Some(first) = rel.components().next().and_then(|c| c.as_os_str().to_str()) { + if is_data_child_dir(first) { + return PathBuf::from("Data").join(rel); + } + } + + let ext = file_ext_lowercase(&rel); + if is_root_ext(&ext) && !contains_data_anchor(&rel) { + return PathBuf::from(rel.file_name().unwrap_or_default()); + } + + if is_data_root_ext(&ext) { + return PathBuf::from("Data").join(rel.file_name().unwrap_or_default()); + } + + if ext == "pex" { + if let Some(subpath) = anchor_subpath(&rel, &["scripts"]) { + return PathBuf::from("Data").join(subpath); + } + return PathBuf::from("Data").join("Scripts").join(rel.file_name().unwrap_or_default()); + } + + if ext == "psc" { + if let Some(subpath) = anchor_subpath(&rel, &["scripts", "source"]) { + return PathBuf::from("Data").join(subpath); + } + return PathBuf::from("Data") + .join("Scripts") + .join("Source") + .join(rel.file_name().unwrap_or_default()); + } + + if is_mesh_ext(&ext) { + if let Some(subpath) = anchor_subpath(&rel, &["animations"]) { + return PathBuf::from("Data").join(subpath); + } + if let Some(subpath) = anchor_subpath(&rel, &["meshes"]) { + return PathBuf::from("Data").join(subpath); + } + return PathBuf::from("Data").join("Meshes").join(rel.file_name().unwrap_or_default()); + } + + if is_texture_ext(&ext) { + if let Some(subpath) = anchor_subpath(&rel, &["textures"]) { + return PathBuf::from("Data").join(subpath); + } + return PathBuf::from("Data").join("Textures").join(rel.file_name().unwrap_or_default()); + } + + if is_sound_ext(&ext) { + if let Some(subpath) = anchor_subpath(&rel, &["sound"]) { + return PathBuf::from("Data").join(subpath); + } + return PathBuf::from("Data").join("Sound").join(rel.file_name().unwrap_or_default()); + } + + if is_interface_ext(&ext) { + if let Some(subpath) = anchor_subpath(&rel, &["interface"]) { + return PathBuf::from("Data").join(subpath); + } + return PathBuf::from("Data").join("Interface").join(rel.file_name().unwrap_or_default()); + } + + rel +} + +fn detect_wrapper_prefix(mod_root: &Path, root_dirs: &[String]) -> Option { + let mut candidates = Vec::new(); + for name in root_dirs { + if name.starts_with('.') { + continue; + } + if name.eq_ignore_ascii_case("data") || is_data_child_dir(name) { + continue; + } + if is_meta_dir(name) { + continue; + } + let candidate_path = mod_root.join(name); + if wrapper_contains_data_layout(&candidate_path) { + candidates.push(name.clone()); + } + } + + if candidates.len() == 1 { + Some(candidates.remove(0)) + } else { + None + } +} + +fn wrapper_contains_data_layout(dir: &Path) -> bool { + if !dir.is_dir() { + return false; + } + for entry in WalkDir::new(dir).min_depth(1).max_depth(3) { + let Ok(entry) = entry else { + continue; + }; + if !entry.file_type().is_dir() { + continue; + } + let name = entry.file_name().to_string_lossy(); + if name.eq_ignore_ascii_case("data") || is_data_child_dir(&name) { + return true; + } + } + false +} + +fn is_meta_dir(name: &str) -> bool { + matches_ignore_ascii(name, &["fomod", "docs", "doc", "readme"]) +} + +fn strip_wrapper_prefix(rel: &Path, wrapper_prefix: Option<&str>) -> PathBuf { + let Some(prefix) = wrapper_prefix else { + return rel.to_path_buf(); + }; + if let Some(stripped) = strip_prefix_case_insensitive(rel, prefix) { + if stripped.as_os_str().is_empty() { + rel.to_path_buf() + } else { + stripped + } + } else { + rel.to_path_buf() + } +} + +fn strip_prefix_case_insensitive(rel: &Path, prefix: &str) -> Option { + let mut components = rel.components(); + let first = components.next()?; + let first_name = first.as_os_str().to_string_lossy(); + if first_name.eq_ignore_ascii_case(prefix) { + Some(components.collect()) + } else { + None + } +} + +fn anchor_subpath(rel: &Path, anchors: &[&str]) -> Option { + let mut components = rel.components().peekable(); + while let Some(component) = components.next() { + let name = component.as_os_str().to_string_lossy(); + if anchors.iter().any(|anchor| name.eq_ignore_ascii_case(anchor)) { + let mut path = PathBuf::new(); + path.push(component.as_os_str()); + for remainder in components { + path.push(remainder.as_os_str()); + } + return Some(path); + } + } + None +} + +fn contains_data_anchor(rel: &Path) -> bool { + rel.components().any(|component| { + let name = component.as_os_str().to_string_lossy(); + name.eq_ignore_ascii_case("data") || is_data_child_dir(&name) + }) +} + +fn file_ext_lowercase(path: &Path) -> String { + path.extension() + .and_then(OsStr::to_str) + .unwrap_or("") + .to_ascii_lowercase() +} + +fn is_data_child_dir(name: &str) -> bool { + matches_ignore_ascii(name, &DATA_CHILD_DIRS) +} + +fn is_data_root_ext(ext: &str) -> bool { + matches_ignore_ascii(ext, &DATA_ROOT_EXTS) +} + +fn is_root_ext(ext: &str) -> bool { + matches_ignore_ascii(ext, &ROOT_EXTS) +} + +fn is_mesh_ext(ext: &str) -> bool { + matches_ignore_ascii(ext, &MESH_EXTS) +} + +fn is_texture_ext(ext: &str) -> bool { + matches_ignore_ascii(ext, &TEXTURE_EXTS) +} + +fn is_sound_ext(ext: &str) -> bool { + matches_ignore_ascii(ext, &SOUND_EXTS) +} + +fn is_interface_ext(ext: &str) -> bool { + matches_ignore_ascii(ext, &INTERFACE_EXTS) +} + +fn matches_ignore_ascii(value: &str, list: &[&str]) -> bool { + list.iter().any(|item| value.eq_ignore_ascii_case(item)) +} + +const DATA_CHILD_DIRS: &[&str] = &[ + "meshes", + "textures", + "scripts", + "sound", + "interface", + "skse", + "calientetools", + "animations", + "materials", + "shaders", + "grass", + "lodsettings", + "seq", + "strings", +]; + +const DATA_ROOT_EXTS: &[&str] = &[ + "esp", + "esm", + "esl", + "bsa", + "seq", + "strings", + "dlstrings", + "ilstrings", +]; + +const ROOT_EXTS: &[&str] = &["dll", "exe", "asi"]; +const MESH_EXTS: &[&str] = &["nif", "tri", "hkx"]; +const TEXTURE_EXTS: &[&str] = &["dds", "tga", "png", "jpg", "jpeg"]; +const SOUND_EXTS: &[&str] = &["wav", "xwm", "fuz", "lip"]; +const INTERFACE_EXTS: &[&str] = &["swf"]; + +pub fn mod_metadata_path(mods_dir: &Path, mod_name: &str) -> PathBuf { + mods_dir.join(mod_name).join("mod.toml") +} + +pub fn load_mod_metadata(mods_dir: &Path, mod_name: &str) -> Result> { + let path = mod_metadata_path(mods_dir, mod_name); + if !path.exists() { + return Ok(None); + } + let contents = fs::read_to_string(&path).context("read mod metadata")?; + let metadata = toml::from_str(&contents).context("parse mod metadata")?; + Ok(Some(metadata)) +} + +pub fn save_mod_metadata(mods_dir: &Path, mod_name: &str, metadata: &ModMetadata) -> Result<()> { + let path = mod_metadata_path(mods_dir, mod_name); + let contents = toml::to_string_pretty(metadata).context("serialize mod metadata")?; + fs::write(&path, contents).context("write mod metadata")?; + Ok(()) +} + +pub fn get_layout_status(mods_dir: &Path, mod_name: &str) -> Result> { + Ok(load_mod_metadata(mods_dir, mod_name)? + .and_then(|metadata| metadata.layout_status)) +} + +pub fn set_layout_status(mods_dir: &Path, mod_name: &str, status: &str) -> Result<()> { + let mut metadata = load_mod_metadata(mods_dir, mod_name)?.unwrap_or_default(); + metadata.layout_status = Some(status.to_string()); + save_mod_metadata(mods_dir, mod_name, &metadata) +} + +pub fn mod_destinations(game_root: &Path, mod_root: &Path) -> Result> { + let mut dests = HashSet::new(); + for link in compute_links(game_root, mod_root)? { + dests.insert(link.rel_path); + } + Ok(dests) +} + +pub fn mod_has_links(game_root: &Path, mod_root: &Path) -> Result { + let links = compute_links(game_root, mod_root)?; + Ok(count_existing_links(&links)? > 0) +} + +pub fn apply_subdir_choice(mod_root: &Path, selected: &Path) -> Result<()> { + if !mod_root.is_dir() || !selected.is_dir() { + return Err(anyhow!("invalid subdir selection")); + } + let mod_root_real = mod_root.canonicalize().context("resolve mod root")?; + let selected_real = selected.canonicalize().context("resolve selection")?; + if !selected_real.starts_with(&mod_root_real) { + return Err(anyhow!("selected folder is outside mod root")); + } + if selected_real == mod_root_real { + return Ok(()); + } + move_dir_contents(&selected_real, &mod_root_real)?; + if fs::read_dir(&selected_real) + .map(|mut r| r.next().is_none()) + .unwrap_or(false) + { + let _ = fs::remove_dir_all(&selected_real); + } + clean_empty_dirs(&mod_root_real)?; + Ok(()) +} + +pub fn cleanup_empty_dirs(game_root: &Path, created_dirs: &[PathBuf]) -> Result<(usize, Vec)> { + let mut removed = 0; + let mut remaining = Vec::new(); + let mut dirs: Vec = created_dirs.to_vec(); + dirs.sort_by(|a, b| b.components().count().cmp(&a.components().count())); + + for rel in dirs { + let path = game_root.join(&rel); + if !path.exists() { + continue; + } + if !path.is_dir() { + remaining.push(rel); + continue; + } + if fs::read_dir(&path).map(|mut r| r.next().is_none()).unwrap_or(false) { + fs::remove_dir(&path).context("remove empty dir")?; + removed += 1; + } else { + remaining.push(rel); + } + } + + Ok((removed, remaining)) +} + +pub fn restore_backups( + game_root: &Path, + backups_dir: &Path, + backups: &mut HashSet, + desired: &HashSet, +) -> Result { + let mut restored = 0; + let mut remaining = HashSet::new(); + for rel_path in backups.iter() { + if desired.contains(rel_path) { + remaining.insert(rel_path.clone()); + continue; + } + let dest = game_root.join(rel_path); + if let Ok(metadata) = fs::symlink_metadata(&dest) { + if metadata.file_type().is_symlink() { + let _ = fs::remove_file(&dest); + } + } + if dest.exists() { + remaining.insert(rel_path.clone()); + continue; + } + let backup_path = backups_dir.join(rel_path); + if backup_path.exists() { + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).context("create restore dir")?; + } + fs::rename(&backup_path, &dest).context("restore backup")?; + restored += 1; + } + } + *backups = remaining; + Ok(restored) +} diff --git a/repos/singularity/src/state.rs b/repos/singularity/src/state.rs new file mode 100644 index 0000000..a5672f3 --- /dev/null +++ b/repos/singularity/src/state.rs @@ -0,0 +1,99 @@ +use anyhow::{Context, Result}; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::fs; +use std::path::Path; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct GameState { + pub active_profile: String, + pub profiles: Vec, + pub last_launch: Option, + pub previous_launch: Option, + #[serde(default)] + pub backups: Vec, + #[serde(default)] + pub created_dirs: HashMap>, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Profile { + pub name: String, + pub enabled_mods: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ProfileSnapshot { + pub name: String, + pub enabled_mods: Vec, +} + +impl Default for GameState { + fn default() -> Self { + Self { + active_profile: "default".to_string(), + profiles: vec![Profile { + name: "default".to_string(), + enabled_mods: Vec::new(), + }], + last_launch: None, + previous_launch: None, + backups: Vec::new(), + created_dirs: HashMap::new(), + } + } +} + +impl GameState { + pub fn active_profile_mut(&mut self) -> Option<&mut Profile> { + self.profiles + .iter_mut() + .find(|profile| profile.name == self.active_profile) + } + + pub fn active_profile(&self) -> Option<&Profile> { + self.profiles + .iter() + .find(|profile| profile.name == self.active_profile) + } + + pub fn ensure_default_profile(&mut self) { + if self.active_profile.is_empty() { + self.active_profile = "default".to_string(); + } + if self.active_profile().is_none() { + self.profiles.push(Profile { + name: self.active_profile.clone(), + enabled_mods: Vec::new(), + }); + } + } + + pub fn record_launch_snapshot(&mut self) { + if let Some(profile) = self.active_profile() { + let snapshot = ProfileSnapshot { + name: profile.name.clone(), + enabled_mods: profile.enabled_mods.clone(), + }; + self.previous_launch = self.last_launch.take(); + self.last_launch = Some(snapshot); + } + } + +} + +pub fn load_game_state(path: &Path) -> Result { + if !path.exists() { + return Ok(GameState::default()); + } + let contents = fs::read_to_string(path).context("read game state")?; + let mut state: GameState = toml::from_str(&contents).context("parse game state")?; + state.ensure_default_profile(); + Ok(state) +} + +pub fn save_game_state(path: &Path, state: &GameState) -> Result<()> { + let contents = toml::to_string_pretty(state).context("serialize game state")?; + fs::write(path, contents).context("write game state")?; + Ok(()) +} diff --git a/repos/singularity/src/steam.rs b/repos/singularity/src/steam.rs new file mode 100644 index 0000000..c5bd2f5 --- /dev/null +++ b/repos/singularity/src/steam.rs @@ -0,0 +1,95 @@ +use anyhow::{Context, Result}; +use std::collections::HashSet; +use std::fs; +use std::path::{Path, PathBuf}; + +#[derive(Debug, Clone)] +pub struct GameCandidate { + pub name: String, + pub path: PathBuf, +} + +pub fn normalize_steam_root(input: &Path) -> Option { + let mut candidates = Vec::new(); + candidates.push(input.to_path_buf()); + candidates.push(input.join("steam")); + candidates.push(input.join("root")); + + for candidate in candidates { + if candidate.join("steamapps").is_dir() { + return Some(candidate); + } + } + + if input.file_name().and_then(|name| name.to_str()) == Some("steamapps") { + if input.join("common").is_dir() { + return input.parent().map(PathBuf::from); + } + } + + if input.file_name().and_then(|name| name.to_str()) == Some("common") { + if let Some(parent) = input.parent() { + if parent.join("libraryfolders.vdf").is_file() || parent.join("common").is_dir() { + if let Some(root) = parent.parent() { + if root.join("steamapps").is_dir() { + return Some(root.to_path_buf()); + } + } + } + } + } + + None +} + +pub fn discover_games(steam_dir: &Path) -> Result> { + let library_paths = discover_library_paths(steam_dir)?; + let mut games = Vec::new(); + + for library in library_paths { + let common = library.join("steamapps").join("common"); + if !common.is_dir() { + continue; + } + for entry in fs::read_dir(&common).context("read steam common")? { + let entry = entry.context("steam entry")?; + if !entry.file_type().context("entry type")?.is_dir() { + continue; + } + let path = entry.path(); + let name = entry + .file_name() + .to_string_lossy() + .to_string(); + games.push(GameCandidate { name, path }); + } + } + + Ok(games) +} + +fn discover_library_paths(steam_dir: &Path) -> Result> { + let mut libraries = HashSet::new(); + libraries.insert(steam_dir.to_path_buf()); + + let vdf_path = steam_dir + .join("steamapps") + .join("libraryfolders.vdf"); + if vdf_path.is_file() { + let contents = fs::read_to_string(&vdf_path).context("read libraryfolders")?; + for line in contents.lines() { + let line = line.trim(); + if !line.starts_with('"') || !line.contains("\"path\"") { + continue; + } + let parts: Vec<&str> = line.split('"').collect(); + if parts.len() >= 4 { + let raw_path = parts[3]; + let normalized = raw_path.replace("\\\\", "\\"); + libraries.insert(PathBuf::from(normalized)); + } + } + } + + Ok(libraries.into_iter().collect()) +}