From 19f67e8b77d4afa290592d90b20e76432015fb99 Mon Sep 17 00:00:00 2001 From: Revertron Date: Mon, 27 Oct 2025 20:36:37 +0100 Subject: [PATCH] Moved from webview crate to "wry" to fix Linux's inability to maintain compatibility. --- Cargo.lock | 2063 +++++++++++++++++++++++++++++++++++++--- Cargo.toml | 6 +- src/web_ui.rs | 647 +++++++------ src/webview/scripts.js | 19 +- 4 files changed, 2293 insertions(+), 442 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4d17ae..5a96018 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,7 +52,7 @@ dependencies = [ "byteorder", "chacha20poly1305", "chrono", - "derive_more", + "derive_more 2.0.1", "ecies-ed25519-ng", "ed25519-dalek", "getopts", @@ -63,7 +63,7 @@ dependencies = [ "num-bigint", "num_cpus", "open", - "rand", + "rand 0.8.5", "serde", "serde_cbor", "serde_json", @@ -71,16 +71,17 @@ dependencies = [ "simplelog", "spmc", "sqlite", + "tao", "thread-priority", "time", "tinyfiledialogs", "toml 0.9.8", "ureq", "uuid", - "web-view", "winapi", "windows-service", "winres", + "wry", "x25519-dalek", ] @@ -100,10 +101,21 @@ dependencies = [ ] [[package]] -name = "atk-sys" -version = "0.10.0" +name = "atk" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f530e4af131d94cc4fa15c5c9d0348f0ef28bac64ba660b6b2a1cf2605dedfce" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" dependencies = [ "glib-sys", "gobject-sys", @@ -192,10 +204,13 @@ dependencies = [ ] [[package]] -name = "boxfnonce" -version = "0.1.1" +name = "block2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5988cb1d626264ac94100be357308f29ff7cbdd3b36bda27f450a4ee3f713426" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] [[package]] name = "bumpalo" @@ -216,11 +231,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] -name = "cairo-sys-rs" -version = "0.10.0" +name = "cairo-rs" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ed2639b9ad5f1d6efa76de95558e11339e7318426d84ac4890b86c03e828ca7" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ + "bitflags 2.10.0", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", "libc", "system-deps", ] @@ -235,6 +265,22 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.4" @@ -290,18 +336,78 @@ dependencies = [ "zeroize", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +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.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "libc", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -320,6 +426,21 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + [[package]] name = "crypto-common" version = "0.1.6" @@ -327,7 +448,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "typenum", ] @@ -341,6 +462,33 @@ dependencies = [ "subtle", ] +[[package]] +name = "cssparser" +version = "0.29.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.10.1", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.108", +] + [[package]] name = "ctr" version = "0.9.2" @@ -396,6 +544,19 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.108", +] + [[package]] name = "derive_more" version = "2.0.1" @@ -437,6 +598,104 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[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", +] + +[[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.108", +] + +[[package]] +name = "dlopen2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b54f373ccf864bf587a89e880fb7610f8d73f3045f13580948ccbcaff26febff" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "788160fb30de9cdd857af31c6a2675904b16ece8fc2737b2c7127ba368c9d0f4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" + +[[package]] +name = "dtoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "ecies-ed25519-ng" version = "0.5.3" @@ -447,9 +706,9 @@ dependencies = [ "digest 0.10.7", "hex", "hkdf", - "rand", + "rand 0.8.5", "sha2", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -489,6 +748,16 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + [[package]] name = "find-msvc-tools" version = "0.1.4" @@ -518,10 +787,156 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] -name = "gdk-pixbuf-sys" -version = "0.10.0" +name = "foreign-types" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bfe468a7f43e97b8d193a762b6c5cf67a7d36cacbc0b9291dbcae24bfea1e8f" +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.108", +] + +[[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 = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[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", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[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.108", +] + +[[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-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ "gio-sys", "glib-sys", @@ -532,9 +947,9 @@ dependencies = [ [[package]] name = "gdk-sys" -version = "0.10.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a9653cfc500fd268015b1ac055ddbc3df7a5c9ea3f4ccef147b3957bd140d69" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -547,6 +962,47 @@ dependencies = [ "system-deps", ] +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + [[package]] name = "generic-array" version = "0.14.9" @@ -566,6 +1022,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.16" @@ -574,7 +1041,7 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] @@ -600,10 +1067,29 @@ dependencies = [ ] [[package]] -name = "gio-sys" -version = "0.10.1" +name = "gio" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e24fb752f8f5d2cf6bbc2c606fd2bc989c81c5e2fe321ab974d54f8b6344eac" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ "glib-sys", "gobject-sys", @@ -613,10 +1099,47 @@ dependencies = [ ] [[package]] -name = "glib-sys" -version = "0.10.1" +name = "glib" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.10.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", "system-deps", @@ -624,9 +1147,9 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.10.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ "glib-sys", "libc", @@ -634,10 +1157,31 @@ dependencies = [ ] [[package]] -name = "gtk-sys" -version = "0.10.0" +name = "gtk" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89acda6f084863307d948ba64a4b1ef674e8527dddab147ee4cdcc194c880457" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -651,6 +1195,19 @@ dependencies = [ "system-deps", ] +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.108", +] + [[package]] name = "half" version = "1.8.3" @@ -670,12 +1227,15 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -707,6 +1267,18 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "html5ever" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" +dependencies = [ + "log", + "mac", + "markup5ever", + "match_token", +] + [[package]] name = "http" version = "1.3.1" @@ -748,6 +1320,113 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "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 = "indexmap" version = "2.12.0" @@ -793,14 +1472,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] -name = "javascriptcore-rs-sys" -version = "0.2.0" +name = "javascriptcore-rs" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f46ada8a08dcd75a10afae872fbfb51275df4a8ae0d46b8cc7c708f08dd2998" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" dependencies = [ - "libc", + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", ] +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[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 = "js-sys" version = "0.3.81" @@ -811,6 +1526,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kuchikiki" +version = "0.8.8-speedreader" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" +dependencies = [ + "cssparser", + "html5ever", + "indexmap", + "selectors", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -823,6 +1550,31 @@ version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +[[package]] +name = "libredox" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +dependencies = [ + "bitflags 2.10.0", + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[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.28" @@ -838,12 +1590,58 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18" +dependencies = [ + "log", + "phf 0.11.3", + "phf_codegen 0.11.3", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "match_token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "memchr" version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -862,10 +1660,52 @@ checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.61.2", ] +[[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", + "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.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "num-bigint" version = "0.4.6" @@ -910,6 +1750,28 @@ dependencies = [ "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 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.108", +] + [[package]] name = "num_threads" version = "0.1.7" @@ -919,6 +1781,91 @@ dependencies = [ "libc", ] +[[package]] +name = "objc2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[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", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[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", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.10.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -943,10 +1890,29 @@ dependencies = [ ] [[package]] -name = "pango-sys" -version = "0.10.0" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d2650c8b62d116c020abd0cea26a4ed96526afda89b1c4ea567131fdefc890" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ "glib-sys", "gobject-sys", @@ -954,6 +1920,29 @@ dependencies = [ "system-deps", ] +[[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", +] + +[[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", + "smallvec", + "windows-link 0.2.1", +] + [[package]] name = "pathdiff" version = "0.2.3" @@ -966,6 +1955,138 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_shared 0.8.0", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.11", +] + +[[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 = "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 = "pkcs8" version = "0.10.2" @@ -1005,6 +2126,15 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "potential_utf" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -1020,6 +2150,71 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[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.7", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.103" @@ -1044,6 +2239,20 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + [[package]] name = "rand" version = "0.8.5" @@ -1051,8 +2260,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -1062,7 +2281,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -1074,6 +2302,50 @@ dependencies = [ "getrandom 0.2.16", ] +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[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_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 2.0.17", +] + [[package]] name = "ring" version = "0.17.14" @@ -1153,6 +2425,39 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[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 = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more 0.99.20", + "fxhash", + "log", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", +] + [[package]] name = "semver" version = "1.0.27" @@ -1212,6 +2517,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + [[package]] name = "serde_spanned" version = "1.0.3" @@ -1221,6 +2535,16 @@ dependencies = [ "serde_core", ] +[[package]] +name = "servo_arc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + [[package]] name = "sha2" version = "0.10.9" @@ -1244,7 +2568,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1265,17 +2589,52 @@ dependencies = [ ] [[package]] -name = "soup-sys" -version = "0.10.0" +name = "siphasher" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7adf08565630bbb71f955f11f8a68464817ded2703a3549747c235b58a13e" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" dependencies = [ - "bitflags 1.3.2", "gio-sys", "glib-sys", "gobject-sys", "libc", - "pkg-config", "system-deps", ] @@ -1324,21 +2683,34 @@ dependencies = [ ] [[package]] -name = "strum" -version = "0.18.0" +name = "stable_deref_trait" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] -name = "strum_macros" -version = "0.18.0" +name = "string_cache" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ - "heck", + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.11.3", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 1.0.109", ] [[package]] @@ -1370,20 +2742,97 @@ dependencies = [ ] [[package]] -name = "system-deps" -version = "1.3.2" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "heck", + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", "pkg-config", - "strum", - "strum_macros", - "thiserror", - "toml 0.5.11", + "toml 0.8.2", "version-compare", ] +[[package]] +name = "tao" +version = "0.34.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a753bdc39c07b192151523a3f77cd0394aa75413802c883a0f6f6a0e5ee2e7" +dependencies = [ + "bitflags 2.10.0", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "parking_lot", + "raw-window-handle", + "scopeguard", + "tao-macros", + "unicode-segmentation", + "url", + "windows", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -1399,7 +2848,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "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]] @@ -1413,6 +2871,17 @@ dependencies = [ "syn 2.0.108", ] +[[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.108", +] + [[package]] name = "thread-priority" version = "3.0.0" @@ -1470,6 +2939,16 @@ dependencies = [ "libc", ] +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "toml" version = "0.5.11" @@ -1479,6 +2958,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + [[package]] name = "toml" version = "0.9.8" @@ -1487,11 +2978,20 @@ checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" dependencies = [ "indexmap", "serde_core", - "serde_spanned", - "toml_datetime", + "serde_spanned 1.0.3", + "toml_datetime 0.7.3", "toml_parser", "toml_writer", - "winnow", + "winnow 0.7.13", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", ] [[package]] @@ -1503,13 +3003,49 @@ dependencies = [ "serde_core", ] +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +dependencies = [ + "indexmap", + "toml_datetime 0.7.3", + "toml_parser", + "winnow 0.7.13", +] + [[package]] name = "toml_parser" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" dependencies = [ - "winnow", + "winnow 0.7.13", ] [[package]] @@ -1601,10 +3137,16 @@ dependencies = [ ] [[package]] -name = "urlencoding" -version = "1.3.3" +name = "url" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1f0175e03a0973cf4afd476bef05c26e228520400eb1fd473ad417b1c00ffb" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] [[package]] name = "utf-8" @@ -1612,6 +3154,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[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.18.1" @@ -1626,9 +3174,9 @@ dependencies = [ [[package]] name = "version-compare" -version = "0.0.10" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" @@ -1642,6 +3190,22 @@ version = "0.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" +[[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.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -1717,26 +3281,37 @@ dependencies = [ ] [[package]] -name = "web-view" -version = "0.7.3" -source = "git+https://github.com/Boscop/web-view#82d7cbce6228b1a964673cc0f22944ad808eab42" +name = "webkit2gtk" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" dependencies = [ - "boxfnonce", - "tinyfiledialogs", - "urlencoding", - "webview-sys", + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", ] [[package]] name = "webkit2gtk-sys" -version = "0.12.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389e5138c85a0d111b9bda05b59efa8562315e1d657d72451410e12c858f0619" +checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" dependencies = [ - "atk-sys", "bitflags 1.3.2", "cairo-sys-rs", - "gdk-pixbuf-sys", "gdk-sys", "gio-sys", "glib-sys", @@ -1744,9 +3319,9 @@ dependencies = [ "gtk-sys", "javascriptcore-rs-sys", "libc", - "pango-sys", "pkg-config", - "soup-sys", + "soup3-sys", + "system-deps", ] [[package]] @@ -1759,20 +3334,39 @@ dependencies = [ ] [[package]] -name = "webview-sys" -version = "0.6.2" -source = "git+https://github.com/Boscop/web-view#82d7cbce6228b1a964673cc0f22944ad808eab42" +name = "webview2-com" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ba622a989277ef3886dd5afb3e280e3dd6d974b766118950a08f8f678ad6a4" dependencies = [ - "cc", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "gtk-sys", - "javascriptcore-rs-sys", - "libc", - "pkg-config", - "webkit2gtk-sys", + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-core 0.61.2", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c" +dependencies = [ + "thiserror 2.0.17", + "windows", + "windows-core 0.61.2", ] [[package]] @@ -1962,13 +3556,22 @@ dependencies = [ "windows-link 0.2.1", ] +[[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.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1977,7 +3580,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1989,20 +3592,35 @@ dependencies = [ "windows-link 0.2.1", ] +[[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.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "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]] @@ -2014,18 +3632,45 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[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.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.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.52.6" @@ -2038,35 +3683,71 @@ 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.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.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.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.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] [[package]] name = "winres" @@ -2083,6 +3764,78 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wry" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728b7d4c8ec8d81cab295e0b5b8a4c263c0d41a785fb8f8c4df284e5411140a2" +dependencies = [ + "base64", + "block2", + "cookie", + "crossbeam-channel", + "dirs", + "dpi", + "dunce", + "gdkx11", + "gtk", + "html5ever", + "http", + "javascriptcore-rs", + "jni", + "kuchikiki", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2", + "soup3", + "tao-macros", + "thiserror 2.0.17", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[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 = "x25519-dalek" version = "2.0.1" @@ -2090,11 +3843,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek", - "rand_core", + "rand_core 0.6.4", "serde", "zeroize", ] +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.8.27" @@ -2115,6 +3892,27 @@ dependencies = [ "syn 2.0.108", ] +[[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.108", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.2" @@ -2134,3 +3932,36 @@ dependencies = [ "quote", "syn 2.0.108", ] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] diff --git a/Cargo.toml b/Cargo.toml index 054217a..1c3b387 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,8 @@ spmc = "0.3.0" thread-priority = "3.0.0" # Optional dependencies regulated by features -web-view = { git = "https://github.com/Boscop/web-view", features = [], optional = true } +wry = { version = "0.53", optional = true } +tao = { version = "0.34", optional = true } tinyfiledialogs = { version = "3.9.1", optional = true } open = { version = "5.3.0", optional = true } @@ -69,7 +70,6 @@ ProductName="ALFIS" FileDescription="Alternative Free Identity System" [features] -webgui = ["web-view", "tinyfiledialogs", "open"] -edge = ["webgui", "web-view/edge"] +webgui = ["wry", "tao", "tinyfiledialogs", "open"] doh = ["ureq"] default = ["webgui", "doh"] diff --git a/src/web_ui.rs b/src/web_ui.rs index ee8fd2a..38c7ac8 100644 --- a/src/web_ui.rs +++ b/src/web_ui.rs @@ -2,11 +2,10 @@ extern crate open; extern crate serde; extern crate serde_json; extern crate tinyfiledialogs as tfd; -extern crate web_view; use std::sync::{Arc, Mutex, MutexGuard}; use std::thread; -use std::time::{Duration, Instant}; +use std::time::Duration; use alfis::blockchain::transaction::DomainData; use alfis::blockchain::types::MineResult; @@ -17,14 +16,18 @@ use alfis::event::Event; use alfis::eventbus::{post, register}; use alfis::miner::Miner; use alfis::{keystore, Block, Bytes, Context, Keystore, Transaction}; -use chrono::{DateTime, Local, Utc}; +use chrono::{Local, Utc}; #[allow(unused_imports)] use log::{debug, error, info, trace, warn, LevelFilter}; use serde::{Deserialize, Serialize}; -use web_view::Content; use Cmd::*; -use self::web_view::{Handle, WebView}; +use tao::{ + event::{Event as TaoEvent, WindowEvent}, + event_loop::{ControlFlow, EventLoopBuilder, EventLoopProxy}, + window::WindowBuilder, +}; +use wry::WebViewBuilder; pub fn run_interface(context: Arc>, miner: Arc>) { let file_content = include_str!("webview/index.html"); @@ -33,213 +36,141 @@ pub fn run_interface(context: Arc>, miner: Arc>) { styles.push_str(&inline_style(include_str!("webview/busy_indicator.css"))); let scripts = inline_script(include_str!("webview/scripts.js")); - let html = Content::Html(file_content.to_owned().replace("{styles}", &styles).replace("{scripts}", &scripts)); + let html = file_content.to_owned().replace("{styles}", &styles).replace("{scripts}", &scripts); let title = format!("ALFIS {}", env!("CARGO_PKG_VERSION")); - let mut interface = web_view::builder() - .title(&title) - .content(html) - .size(1023, 720) - .min_size(773, 350) - .resizable(true) - .debug(false) - .user_data(()) - .invoke_handler(|web_view, arg| { - debug!("Command {}", arg); - match serde_json::from_str(arg).unwrap() { - Loaded => { action_loaded(&context, web_view); } - LoadKey => { action_load_key(&context, web_view); } - CreateKey => { keystore::create_key(Arc::clone(&context)); } - SaveKey => { action_save_key(&context); } - SelectKey { index } => { action_select_key(&context, web_view, index); } - CheckRecord { data } => { action_check_record(web_view, data); } - CheckDomain { name } => { action_check_domain(&context, web_view, name); } - MineDomain { name, data, signing, encryption, renewal } => { - action_create_domain(Arc::clone(&context), Arc::clone(&miner), web_view, name, data, signing, encryption, renewal); - } - TransferDomain { name, owner} => { info!("Transferring '{name}' to '{owner}'"); } - StopMining => { post(Event::ActionStopMining); } - Open { link } => { - if open::that(&link).is_err() { - show_warning(web_view, "Something wrong, I can't open the link 😢"); + + // Create event loop and window + let event_loop = EventLoopBuilder::::with_user_event().build(); + let proxy = event_loop.create_proxy(); + + let window = WindowBuilder::new() + .with_title(&title) + .with_inner_size(tao::dpi::LogicalSize::new(1023, 720)) + .with_min_inner_size(tao::dpi::LogicalSize::new(773, 350)) + .with_resizable(true) + .with_visible(true) + .build(&event_loop) + .expect("Failed to create window"); + + #[cfg(windows)] + { + use tao::platform::windows::WindowExtWindows; + use winapi::um::shellscalingapi::SetProcessDpiAwareness; + unsafe { + SetProcessDpiAwareness(2); + } + } + + // Clone for the IPC handler + let context_ipc = Arc::clone(&context); + let miner_ipc = Arc::clone(&miner); + let proxy_ipc = proxy.clone(); + + // Create webview + let builder = WebViewBuilder::new() + .with_transparent(false) + .with_visible(true) + .with_devtools(true) + .with_html(html) // Using test HTML to verify wry works + .with_ipc_handler(move |request| { + let body = request.body(); + debug!("Command {}", body); + + match serde_json::from_str(body) { + Ok(cmd) => { + match cmd { + Loaded => { + let _ = proxy_ipc.send_event(UserEvent::Loaded); + } + LoadKey => { + action_load_key(&context_ipc, &proxy_ipc); + } + CreateKey => { + keystore::create_key(Arc::clone(&context_ipc)); + } + SaveKey => { + action_save_key(&context_ipc); + } + SelectKey { index } => { + action_select_key(&context_ipc, &proxy_ipc, index); + } + CheckRecord { data } => { + let result = check_record(&data); + let _ = proxy_ipc.send_event(UserEvent::EvalJs(format!("recordOkay({})", result))); + } + CheckDomain { name } => { + let available = check_domain_available(&context_ipc, &name); + let _ = proxy_ipc.send_event(UserEvent::EvalJs(format!("domainAvailable({})", available))); + } + MineDomain { name, data, signing, encryption, renewal } => { + action_create_domain(Arc::clone(&context_ipc), Arc::clone(&miner_ipc), &proxy_ipc, name, data, signing, encryption, renewal); + } + TransferDomain { name, owner } => { + info!("Transferring '{name}' to '{owner}'"); + } + StopMining => { + post(Event::ActionStopMining); + } + Open { link } => { + if open::that(&link).is_err() { + let _ = proxy_ipc.send_event(UserEvent::ShowWarning("Something wrong, I can't open the link 😢".to_string())); + } + } } } - } - Ok(()) - }) - .build() - .expect("Error building GUI"); - - run_interface_loop(&mut interface); -} - -/// Indefinitely loops through WebView steps -fn run_interface_loop(interface: &mut WebView<()>) { - // We use this ugly loop to lower CPU usage a lot. - // If we use .run() or only .step() in a loop without sleeps it will try - // to support 60FPS and uses more CPU than it should. - let pause = Duration::from_millis(25); - let mut start = Instant::now(); - loop { - match interface.step() { - None => { - info!("Interface closed, exiting"); - post(Event::ActionQuit); - thread::sleep(Duration::from_millis(100)); - break; - } - Some(result) => { - match result { - Ok(_) => {} - Err(_) => { - error!("Something wrong with webview, exiting"); - break; - } + Err(e) => { + error!("Error parsing command: {}", e); } } - } - if start.elapsed().as_millis() > 1 { - thread::sleep(pause); - start = Instant::now(); - } - } -} + }); -fn action_check_record(web_view: &mut WebView<()>, data: String) { - match serde_json::from_str::(&data) { - Ok(record) => { - if let Some(string) = record.get_data() { - if string.len() > MAX_DATA_LEN { - web_view.eval("recordOkay(false)").expect("Error evaluating!"); - } else { - web_view.eval("recordOkay(true)").expect("Error evaluating!"); - } - } - } - Err(e) => { - web_view.eval("recordOkay(false)").expect("Error evaluating!"); - dbg!(e); - } - } -} + #[cfg(not(target_os = "linux"))] + let webview = builder.build(&window).unwrap(); + #[cfg(target_os = "linux")] + let webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox).expect("Failed to build webview gtk object") + }; -fn action_check_domain(context: &Arc>, web_view: &mut WebView<()>, name: String) { - let c = context.lock().unwrap(); - if let Some(keystore) = c.get_keystore() { - let name = name.to_lowercase(); - let available = match c.chain.can_mine_domain(c.chain.get_height(), &name, &keystore.get_public()) { - MineResult::Fine => true, - _ => false - }; - web_view.eval(&format!("domainAvailable({})", available)).expect("Error evaluating!"); - } -} + let webview = Arc::new(Mutex::new(webview)); + let webview_clone = Arc::clone(&webview); -fn action_save_key(context: &Arc>) { - if !context.lock().unwrap().has_keys() { - return; - } - let result = tfd::save_file_dialog_with_filter("Save keys file", "", &["*.toml"], "Key files (*.toml)"); - match result { - None => {} - Some(mut new_path) => { - if !new_path.ends_with(".toml") { - new_path.push_str(".toml"); - } - let path = new_path.clone(); - if let Some(keystore) = context.lock().unwrap().get_keystore_mut() { - let public = keystore.get_public().to_string(); - let hash = keystore.get_hash().to_string(); - keystore.save(&new_path, ""); - info!("Key file saved to {}", &path); - post(Event::KeySaved { path, public, hash }); - } - } - } -} - -fn action_select_key(context: &Arc>, web_view: &mut WebView<()>, index: usize) { - if context.lock().unwrap().select_key_by_index(index) { - let (path, public, hash) = { - let keystore = context.lock().unwrap().get_keystore().cloned().unwrap(); - let path = keystore.get_path().to_owned(); - let public = keystore.get_public().to_string(); - let hash = keystore.get_hash().to_string(); - (path, public, hash) - }; - post(Event::KeyLoaded { path, public, hash }); - web_view.eval(&format!("keySelected({})", index)).expect("Error evaluating!"); - } -} - -fn action_load_key(context: &Arc>, web_view: &mut WebView<()>) { - let result = tfd::open_file_dialog("Open keys file", "", Some((&["*.key", "*.toml"], "Key files"))); - match result { - None => {} - Some(file_name) => { - match Keystore::from_file(&file_name, "") { - None => { - error!("Error loading keystore '{}'!", &file_name); - show_warning(web_view, "Error loading key!
Key cannot be loaded or its difficulty is not enough."); - event_fail(web_view, &format!("Error loading key from \\'{}\\'!", &file_name)); - } - Some(keystore) => { - info!("Loaded keystore with keys: {:?}, {:?}", &keystore.get_public(), &keystore.get_encryption_public()); - let path = keystore.get_path().to_owned(); - let public = keystore.get_public().to_string(); - let hash = keystore.get_hash().to_string(); - post(Event::KeyLoaded { path, public, hash }); - - if !context.lock().unwrap().select_key_by_public(&keystore.get_public()) { - context.lock().unwrap().add_keystore(keystore); - } else { - warn!("This key is already loaded!"); - } - } - } - } - } -} - -fn action_loaded(context: &Arc>, web_view: &mut WebView<()>) { - info!("Interface loaded"); - web_view.eval("showMiningIndicator(false, false);").expect("Error evaluating!"); - let handle: Handle<()> = web_view.handle(); + // Setup event bus listener + let proxy_events = proxy.clone(); let threads = context.lock().unwrap().settings.mining.threads; let threads = match threads { 0 => num_cpus::get(), _ => threads }; let status = Arc::new(Mutex::new(UiStatus::new(threads))); - let context_copy = Arc::clone(context); - let c = context.lock().unwrap(); register(move |_uuid, e| { - //debug!("Got event from bus {:?}", &e); let status = Arc::clone(&status); - let handle = handle.clone(); - let context_copy = Arc::clone(&context_copy); - let _ = thread::Builder::new().name(String::from("webui")).spawn(move || { + let proxy = proxy_events.clone(); + + thread::Builder::new().name(String::from("webui")).spawn(move || { let mut status = status.lock().unwrap(); - let mut context = context_copy.lock().unwrap(); let eval = match e { Event::KeyCreated { path, public, hash } => { - load_domains(&mut context, &handle); - send_keys_to_ui(&context, &handle); - event_handle_luck(&handle, "Key successfully created! Don\\'t forget to save it!"); + let _ = proxy.send_event(UserEvent::LoadDomains); + let _ = proxy.send_event(UserEvent::SendKeysToUi); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('luck', '{}', 'Key successfully created! Don\\'t forget to save it!');", Local::now().format("%d.%m.%y %X")))); let mut s = format!("keystoreChanged('{}', '{}', '{}');", &path, &public, &hash); s.push_str(" showSuccess('New key mined successfully! Save it to a safe place!')"); s } Event::KeyLoaded { path, public, hash } | Event::KeySaved { path, public, hash } => { - load_domains(&mut context, &handle); - send_keys_to_ui(&context, &handle); + let _ = proxy.send_event(UserEvent::LoadDomains); + let _ = proxy.send_event(UserEvent::SendKeysToUi); format!("keystoreChanged('{}', '{}', '{}');", &path, &public, &hash) } Event::MinerStarted | Event::KeyGeneratorStarted => { status.mining = true; status.max_diff = 0; - event_handle_info(&handle, "Mining started"); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'Mining started');", Local::now().format("%d.%m.%y %X")))); String::from("setLeftStatusBarText('Mining...'); showMiningIndicator(true, false);") } Event::MinerStopped { success, full } => { @@ -253,12 +184,12 @@ fn action_loaded(context: &Arc>, web_view: &mut WebView<()>) { if full { match success { true => { - load_domains(&mut context, &handle); - event_handle_luck(&handle, "Mining is successful!"); + let _ = proxy.send_event(UserEvent::LoadDomains); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('luck', '{}', 'Mining is successful!');", Local::now().format("%d.%m.%y %X")))); s.push_str(" showSuccess('Block successfully mined!')"); } false => { - event_handle_info(&handle, "Mining finished without result."); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'Mining finished without result.');", Local::now().format("%d.%m.%y %X")))); s.push_str(" showWarning('Mining unsuccessful, sorry.')"); } } @@ -288,7 +219,7 @@ fn action_loaded(context: &Arc>, web_view: &mut WebView<()>) { status.syncing = true; status.synced_blocks = have; if height != status.sync_height { - event_handle_info(&handle, "Syncing started..."); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'Syncing started...');", Local::now().format("%d.%m.%y %X")))); status.sync_height = height; } if status.mining { @@ -298,8 +229,8 @@ fn action_loaded(context: &Arc>, web_view: &mut WebView<()>) { } } Event::SyncFinished => { - load_domains(&mut context, &handle); - event_handle_info(&handle, "Syncing finished."); + let _ = proxy.send_event(UserEvent::LoadDomains); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'Syncing finished.');", Local::now().format("%d.%m.%y %X")))); status.syncing = false; if status.mining { String::from("setLeftStatusBarText('Mining...'); showMiningIndicator(true, false);") @@ -316,49 +247,197 @@ fn action_loaded(context: &Arc>, web_view: &mut WebView<()>) { } Event::BlockchainChanged { index } => { debug!("Current blockchain height is {}", index); - event_handle_info(&handle, &format!("Blockchain changed, current block count is {} now.", index)); - String::new() // Nothing + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'Blockchain changed, current block count is {} now.');", Local::now().format("%d.%m.%y %X"), index))); + String::new() } Event::Error { text } => format!("showError('{}')", &text), _ => String::new() }; if !eval.is_empty() { - handle.dispatch(move |web_view| { - web_view.eval(&eval.replace("\\", "\\\\")) - }).expect("Error dispatching!"); + let _ = proxy.send_event(UserEvent::EvalJs(eval)); } - }); + }).ok(); true }); + // Run event loop + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + TaoEvent::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => { + info!("Interface closed, exiting"); + post(Event::ActionQuit); + thread::sleep(Duration::from_millis(100)); + *control_flow = ControlFlow::Exit; + } + TaoEvent::UserEvent(user_event) => { + let wv = webview_clone.lock().unwrap(); + match user_event { + UserEvent::EvalJs(js) => { + let js_escaped = js.replace("\\", "\\\\"); + if let Err(e) = wv.evaluate_script(&js_escaped) { + error!("Error evaluating JavaScript: {}", e); + } + } + UserEvent::Loaded => { + action_loaded(&context, &wv, &proxy); + } + UserEvent::LoadDomains => { + load_domains(&mut context.lock().unwrap(), &wv); + } + UserEvent::SendKeysToUi => { + send_keys_to_ui(&context.lock().unwrap(), &wv); + } + UserEvent::ShowWarning(text) => { + show_warning(&wv, &text); + } + } + } + _ => {} + } + }); +} + +#[derive(Debug)] +enum UserEvent { + EvalJs(String), + Loaded, + LoadDomains, + SendKeysToUi, + ShowWarning(String), +} + +fn check_record(data: &str) -> bool { + match serde_json::from_str::(data) { + Ok(record) => { + if let Some(string) = record.get_data() { + string.len() <= MAX_DATA_LEN + } else { + false + } + } + Err(_) => false + } +} + +fn check_domain_available(context: &Arc>, name: &str) -> bool { + let c = context.lock().unwrap(); + if let Some(keystore) = c.get_keystore() { + let name = name.to_lowercase(); + matches!(c.chain.can_mine_domain(c.chain.get_height(), &name, &keystore.get_public()), MineResult::Fine) + } else { + false + } +} + +fn action_save_key(context: &Arc>) { + if !context.lock().unwrap().has_keys() { + return; + } + let result = tfd::save_file_dialog_with_filter("Save keys file", "", &["*.toml"], "Key files (*.toml)"); + match result { + None => {} + Some(mut new_path) => { + if !new_path.ends_with(".toml") { + new_path.push_str(".toml"); + } + let path = new_path.clone(); + if let Some(keystore) = context.lock().unwrap().get_keystore_mut() { + let public = keystore.get_public().to_string(); + let hash = keystore.get_hash().to_string(); + keystore.save(&new_path, ""); + info!("Key file saved to {}", &path); + post(Event::KeySaved { path, public, hash }); + } + } + } +} + +fn action_select_key(context: &Arc>, proxy: &EventLoopProxy, index: usize) { + if context.lock().unwrap().select_key_by_index(index) { + let (path, public, hash) = { + let keystore = context.lock().unwrap().get_keystore().cloned().unwrap(); + let path = keystore.get_path().to_owned(); + let public = keystore.get_public().to_string(); + let hash = keystore.get_hash().to_string(); + (path, public, hash) + }; + post(Event::KeyLoaded { path, public, hash }); + let _ = proxy.send_event(UserEvent::EvalJs(format!("keySelected({})", index))); + } +} + +fn action_load_key(context: &Arc>, proxy: &EventLoopProxy) { + let result = tfd::open_file_dialog("Open keys file", "", Some((&["*.key", "*.toml"], "Key files"))); + match result { + None => {} + Some(file_name) => { + match Keystore::from_file(&file_name, "") { + None => { + error!("Error loading keystore '{}'!", &file_name); + let _ = proxy.send_event(UserEvent::ShowWarning("Error loading key!
Key cannot be loaded or its difficulty is not enough.".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('fail', '{}', 'Error loading key from \\\\'{}\\\\!');", Local::now().format("%d.%m.%y %X"), &file_name))); + } + Some(keystore) => { + info!("Loaded keystore with keys: {:?}, {:?}", &keystore.get_public(), &keystore.get_encryption_public()); + let path = keystore.get_path().to_owned(); + let public = keystore.get_public().to_string(); + let hash = keystore.get_hash().to_string(); + post(Event::KeyLoaded { path, public, hash }); + + if !context.lock().unwrap().select_key_by_public(&keystore.get_public()) { + context.lock().unwrap().add_keystore(keystore); + } else { + warn!("This key is already loaded!"); + } + } + } + } + } +} + +fn action_loaded(context: &Arc>, webview: &wry::WebView, proxy: &EventLoopProxy) { + info!("Interface loaded"); + let _ = webview.evaluate_script("showMiningIndicator(false, false);"); + + let c = context.lock().unwrap(); + if let Some(keystore) = c.get_keystore() { let path = keystore.get_path().to_owned(); let public = keystore.get_public().to_string(); let hash = keystore.get_hash().to_string(); post(Event::KeyLoaded { path, public, hash }); } + let index = c.chain.get_height(); if index > 0 { post(Event::BlockchainChanged { index }); } + let zones = c.chain.get_zones(); info!("Loaded zones: {:?}", &zones); if let Ok(zones) = serde_json::to_string(&zones) { - let _ = web_view.eval(&format!("zonesChanged('{}');", &zones)); + let _ = webview.evaluate_script(&format!("zonesChanged('{}');", &zones)); } - send_keys_to_ui(&c, &web_view.handle()); + + drop(c); + let _ = proxy.send_event(UserEvent::SendKeysToUi); + + let c = context.lock().unwrap(); let command = format!("setStats({}, {}, {}, {});", c.chain.get_height(), c.chain.get_domains_count(), c.chain.get_users_count(), 0); - if let Err(e) = web_view.eval(&command) { + if let Err(e) = webview.evaluate_script(&command) { error!("Error evaluating stats: {}", e); } - event_info(web_view, "Application loaded"); + let _ = webview.evaluate_script(&format!("addEvent('info', '{}', 'Application loaded');", Local::now().format("%d.%m.%y %X"))); } -fn load_domains(context: &mut MutexGuard, handle: &Handle<()>) { - let _ = handle.dispatch(move |web_view|{ - web_view.eval("clearMyDomains();") - }); +fn load_domains(context: &mut MutexGuard, webview: &wry::WebView) { + let _ = webview.evaluate_script("clearMyDomains();"); let domains = context.chain.get_my_domains(context.get_keystore()); let mut domains = domains.iter().map(|(_, d)| d).collect::>(); domains.sort_by(|a, b| a.0.cmp(&b.0)); @@ -366,16 +445,12 @@ fn load_domains(context: &mut MutexGuard, handle: &Handle<()>) { let d = serde_json::to_string(&data).unwrap(); let d = d.replace("'", "\\'").replace("\\n", "\\\\n").replace("\"", "\\\""); let command = format!("addMyDomain('{}', {}, {}, '{}');", &domain, timestamp, timestamp + DOMAIN_LIFETIME, &d); - let _ = handle.dispatch(move |web_view|{ - web_view.eval(&command) - }); + let _ = webview.evaluate_script(&command); } - let _ = handle.dispatch(move |web_view|{ - web_view.eval("refreshMyDomains();") - }); + let _ = webview.evaluate_script("refreshMyDomains();"); } -fn send_keys_to_ui(context: &MutexGuard, handle: &Handle<()>) { +fn send_keys_to_ui(context: &MutexGuard, webview: &wry::WebView) { let keys = { let mut keys = Vec::new(); for key in context.get_keystores() { @@ -387,94 +462,101 @@ fn send_keys_to_ui(context: &MutexGuard, handle: &Handle<()>) { }; if !keys.is_empty() { let index = context.get_active_key_index(); - let _ = handle.dispatch(move |web_view| { - let command = format!("keysChanged('{}'); keySelected({});", serde_json::to_string(&keys).unwrap(), index); - web_view.eval(&command) - }); + let command = format!("keysChanged('{}'); keySelected({});", serde_json::to_string(&keys).unwrap(), index); + let _ = webview.evaluate_script(&command); } } -fn action_create_domain(context: Arc>, miner: Arc>, web_view: &mut WebView<()>, name: String, data: String, signing: String, encryption: String, renewal: bool) { +fn action_create_domain(context: Arc>, miner: Arc>, proxy: &EventLoopProxy, name: String, data: String, signing: String, encryption: String, renewal: bool) { debug!("Creating domain with data: {}", &data); let c = Arc::clone(&context); - let context = context.lock().unwrap(); - if !context.has_keys() { - show_warning(web_view, "You don't have keys loaded!
Load or mine the keys and try again."); - let _ = web_view.eval("domainMiningUnavailable();"); + let context_guard = context.lock().unwrap(); + + if !context_guard.has_keys() { + let _ = proxy.send_event(UserEvent::ShowWarning("You don't have keys loaded!
Load or mine the keys and try again.".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); return; } - if context.chain.is_waiting_signers() { - show_warning(web_view, "Waiting for last full block to be signed. Try again later."); - let _ = web_view.eval("domainMiningUnavailable();"); + + if context_guard.chain.is_waiting_signers() { + let _ = proxy.send_event(UserEvent::ShowWarning("Waiting for last full block to be signed. Try again later.".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); info!("Waiting for last full block to be signed. Try again later."); return; } - let keystore = context.get_keystore().unwrap().clone(); + + let keystore = context_guard.get_keystore().unwrap().clone(); let pub_key = keystore.get_public(); let data = match serde_json::from_str::(&data) { Ok(data) => data, Err(e) => { - show_warning(web_view, "Something wrong with domain data. I cannot mine it."); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("Something wrong with domain data. I cannot mine it.".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); warn!("Error parsing data: {}", e); return; } }; + info!("Parsed domain data:\n{:#?}", &data); + if data.records.len() > MAX_RECORDS { - show_warning(web_view, "Too many records. Mining more than 30 records not allowed."); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("Too many records. Mining more than 30 records not allowed.".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); return; } + // Check if yggdrasil only quality of zone is not violated - let zones = context.chain.get_zones(); + let zones = context_guard.chain.get_zones(); for z in zones { if z.name == data.zone && z.yggdrasil { for record in &data.records { if !is_yggdrasil_record(record) { - show_warning(web_view, &format!("Zone {} is Yggdrasil only, you cannot use IPs from clearnet!", &data.zone)); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning(format!("Zone {} is Yggdrasil only, you cannot use IPs from clearnet!", &data.zone))); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); return; } } } } + let (signing, encryption) = if signing.is_empty() || encryption.is_empty() { (keystore.get_public(), keystore.get_encryption_public()) } else { (Bytes::new(from_hex(&signing).unwrap()), Bytes::new(from_hex(&encryption).unwrap())) }; - match context.chain.can_mine_domain(context.chain.get_height(), &name, &pub_key) { + + match context_guard.chain.can_mine_domain(context_guard.chain.get_height(), &name, &pub_key) { MineResult::Fine => { - drop(context); + drop(context_guard); create_domain(c, miner, CLASS_DOMAIN, &name, data, DOMAIN_DIFFICULTY, &keystore, signing, encryption, renewal); - let _ = web_view.eval("domainMiningStarted();"); - event_info(web_view, &format!("Mining of domain \\'{}\\' has started", &name)); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningStarted();".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'Mining of domain \\\\'{}\\\\' has started');", Local::now().format("%d.%m.%y %X"), &name))); } MineResult::WrongName => { - show_warning(web_view, "You can't mine this domain!"); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("You can't mine this domain!".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); } MineResult::WrongData => { - show_warning(web_view, "You have an error in records!"); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("You have an error in records!".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); } MineResult::WrongKey => { - show_warning(web_view, "You can't mine with current key!"); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("You can't mine with current key!".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); } MineResult::WrongZone => { - show_warning(web_view, "You can't mine domain in this zone!"); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("You can't mine domain in this zone!".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); } MineResult::NotOwned => { - show_warning(web_view, "This domain is already taken, and it is not yours!"); - let _ = web_view.eval("domainMiningUnavailable();"); + let _ = proxy.send_event(UserEvent::ShowWarning("This domain is already taken, and it is not yours!".to_string())); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); } MineResult::Cooldown { time } => { - event_info(web_view, &format!("You have cooldown {}!", format_cooldown(time))); - show_warning(web_view, &format!("You have cooldown {}!", format_cooldown(time))); - let _ = web_view.eval("domainMiningUnavailable();"); + let cooldown = format_cooldown(time); + let _ = proxy.send_event(UserEvent::EvalJs(format!("addEvent('info', '{}', 'You have cooldown {}!');", Local::now().format("%d.%m.%y %X"), &cooldown))); + let _ = proxy.send_event(UserEvent::ShowWarning(format!("You have cooldown {}!", cooldown))); + let _ = proxy.send_event(UserEvent::EvalJs("domainMiningUnavailable();".to_string())); } } } @@ -490,80 +572,13 @@ fn format_cooldown(time: i64) -> String { format!("{} hours", minutes / 60) } -fn show_warning(web_view: &mut WebView<()>, text: &str) { +fn show_warning(webview: &wry::WebView, text: &str) { let str = text.replace('\'', "\\'"); - match web_view.eval(&format!("showWarning('{}');", &str)) { - Ok(_) => {} - Err(_) => { warn!("Error showing warning!"); } + if let Err(e) = webview.evaluate_script(&format!("showWarning('{}');", &str)) { + warn!("Error showing warning: {}", e); } } -#[allow(dead_code)] -fn show_success(web_view: &mut WebView<()>, text: &str) { - let str = text.replace('\'', "\\'"); - match web_view.eval(&format!("showSuccess('{}');", &str)) { - Ok(_) => {} - Err(_) => { warn!("Error showing success!"); } - } -} - -#[allow(dead_code)] -fn event_info(web_view: &mut WebView<()>, message: &str) { - let _ = web_view.eval(&format_event_now("info", message)); -} - -#[allow(dead_code)] -fn event_warn(web_view: &mut WebView<()>, message: &str) { - let _ = web_view.eval(&format_event_now("warn", message)); -} - -#[allow(dead_code)] -fn event_fail(web_view: &mut WebView<()>, message: &str) { - let _ = web_view.eval(&format_event_now("fail", message)); -} - -#[allow(dead_code)] -fn event_handle_info(handle: &Handle<()>, message: &str) { - let message = message.to_owned(); - let _ = handle.dispatch(move |web_view|{ - web_view.eval(&format_event_now("info", &message)) - }); -} - -#[allow(dead_code)] -fn event_handle_warn(handle: &Handle<()>, message: &str) { - let message = message.to_owned(); - let _ = handle.dispatch(move |web_view|{ - web_view.eval(&format_event_now("warn", &message)) - }); -} - -#[allow(dead_code)] -fn event_handle_fail(handle: &Handle<()>, message: &str) { - let message = message.to_owned(); - let _ = handle.dispatch(move |web_view|{ - web_view.eval(&format_event_now("fail", &message)) - }); -} - -#[allow(dead_code)] -fn event_handle_luck(handle: &Handle<()>, message: &str) { - let message = message.to_owned(); - let _ = handle.dispatch(move |web_view|{ - web_view.eval(&format_event_now("luck", &message)) - }); -} - -#[allow(dead_code)] -fn format_event(kind: &str, time: DateTime, message: &str) -> String { - format!("addEvent('{}', '{}', '{}');", kind, time.format("%d.%m.%y %X"), message) -} - -fn format_event_now(kind: &str, message: &str) -> String { - let time = Local::now(); - format!("addEvent('{}', '{}', '{}');", kind, time.format("%d.%m.%y %X"), message) -} - #[allow(clippy::too_many_arguments)] fn create_domain(context: Arc>, miner: Arc>, class: &str, name: &str, mut data: DomainData, difficulty: u32, keystore: &Keystore, signing: Bytes, encryption: Bytes, renewal: bool) { let name = name.to_owned(); @@ -611,7 +626,7 @@ struct UiStatus { impl UiStatus { fn new(threads: usize) -> Self { - let speed =vec![0; threads]; + let speed = vec![0; threads]; UiStatus { mining: false, syncing: false, synced_blocks: 0, sync_height: 0, max_diff: 0, speed } } diff --git a/src/webview/scripts.js b/src/webview/scripts.js index 8ce8902..8f5cd1e 100644 --- a/src/webview/scripts.js +++ b/src/webview/scripts.js @@ -47,13 +47,13 @@ function refreshRecordsList() { function makeRecord(value, index, array) { let data = value.addr; - if (value.type == "MX") { + if (value.type === "MX") { data = value.priority + " " + value.host; - } else if (value.type == "CNAME" || value.type == "NS") { + } else if (value.type === "CNAME" || value.type === "NS") { data = value.host; - } else if (value.type == "TXT" || value.type == "TLSA") { + } else if (value.type === "TXT" || value.type === "TLSA") { data = value.data.toString(); - } else if (value.type == "SRV") { + } else if (value.type === "SRV") { data = value.priority + " " + value.weight + " " + value.port + " " + value.host; } @@ -212,12 +212,17 @@ function editDomain(domain, event) { } function onLoad() { - // Workaround for Arch Linux Webkit - // https://github.com/Boscop/web-view/issues/212#issuecomment-671055663 + // Compatibility shim for wry IPC if (typeof window.external == 'undefined' || typeof window.external.invoke == 'undefined') { window.external = { invoke: function(x) { - window.webkit.messageHandlers.external.postMessage(x); + // wry uses window.ipc.postMessage + if (typeof window.ipc !== 'undefined') { + window.ipc.postMessage(x); + } else if (typeof window.webkit !== 'undefined' && typeof window.webkit.messageHandlers !== 'undefined') { + // Fallback for older webkit + window.webkit.messageHandlers.external.postMessage(x); + } } }; }