diff --git a/desktop/package.json b/desktop/package.json index a6234e4..3fb3606 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -15,7 +15,7 @@ "feather-icons": "^4.28.0", "filesize": "^6.1.0", "n-link-core": "0.0.0", - "tauri": "^0.12.0", + "@tauri-apps/api": "^1.0.0-beta.8", "vue": "^2.6.11", "vue-async-computed": "^3.9.0", "vue-class-component": "^7.2.3", @@ -38,7 +38,7 @@ "sass-loader": "^8.0.2", "typescript": "~4.0.3", "vue-cli-plugin-tailwind": "~1.5.0", - "vue-cli-plugin-tauri": "~0.12.1", + "vue-cli-plugin-tauri": "^1.0.0-beta.6", "vue-template-compiler": "^2.6.11" } } diff --git a/desktop/src-tauri/Cargo.lock b/desktop/src-tauri/Cargo.lock index 014ab5f..b6b567f 100644 --- a/desktop/src-tauri/Cargo.lock +++ b/desktop/src-tauri/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "addr2line" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler32" version = "1.2.0" @@ -68,36 +53,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "ascii" -version = "1.0.0" +name = "arrayvec" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" +checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" [[package]] name = "async-io" -version = "1.3.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" dependencies = [ "concurrent-queue", - "fastrand", "futures-lite", "libc", "log", - "nb-connect", "once_cell", "parking", "polling", - "vec-arena", + "slab", + "socket2", "waker-fn", "winapi", ] [[package]] -name = "attohttpc" -version = "0.16.3" +name = "atk" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb8867f378f33f78a811a8eb9bf108ad99430d7aad43315dd9319c827ef6247" +checksum = "a83b21d2aa75e464db56225e1bda2dd5993311ba1095acaa8fa03d1ae67026ba" +dependencies = [ + "atk-sys", + "bitflags 1.2.1", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "badcf670157c84bb8b1cf6b5f70b650fed78da2033c9eed84c4e49b11cbe83ea" +dependencies = [ + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", +] + +[[package]] +name = "attohttpc" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8bda305457262b339322106c776e3fd21df860018e566eb6a5b1aa4b6ae02d" dependencies = [ "flate2", "http", @@ -128,26 +136,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "backtrace" -version = "0.3.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" -dependencies = [ - "addr2line", - "cfg-if 1.0.0", - "libc", - "miniz_oxide 0.4.4", - "object", - "rustc-demangle", -] - [[package]] name = "base64" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "0.9.1" @@ -167,10 +170,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.5.2", "constant_time_eq", ] +[[package]] +name = "blake3" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcd555c66291d5f836dbb6883b48660ece810fe25a31f3bdfb911945dff2691f" +dependencies = [ + "arrayref", + "arrayvec 0.7.1", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", + "digest", + "rayon", +] + [[package]] name = "block" version = "0.1.6" @@ -237,6 +255,30 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" +[[package]] +name = "cairo-rs" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f859ade407c19810ae920b4fafab92189ed312adad490d08fb16b5f49f1e2207" +dependencies = [ + "bitflags 1.2.1", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c9c3928781e8a017ece15eace05230f04b647457d170d2d9641c94a444ff80" +dependencies = [ + "glib-sys 0.14.0", + "libc", + "system-deps 3.2.0", +] + [[package]] name = "cc" version = "1.0.67" @@ -246,6 +288,25 @@ dependencies = [ "jobserver", ] +[[package]] +name = "cfb" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca453e8624711b2f0f4eb47076a318feda166252a827ee25d067b43de83dcba0" +dependencies = [ + "byteorder", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b412e83326147c2bb881f8b40edfbf9905b9b8abaebd0e47ca190ba62fda8f0e" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -277,12 +338,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "chunked_transfer" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" - [[package]] name = "clap" version = "3.0.0-beta.2" @@ -295,7 +350,7 @@ dependencies = [ "indexmap", "lazy_static", "os_str_bytes", - "strsim", + "strsim 0.10.0", "termcolor", "textwrap", "unicode-width", @@ -315,12 +370,74 @@ dependencies = [ "syn 1.0.68", ] +[[package]] +name = "cocoa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +dependencies = [ + "bitflags 1.2.1", + "block", + "cocoa-foundation", + "core-foundation 0.9.1", + "core-graphics 0.22.2", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags 1.2.1", + "block", + "core-foundation 0.9.1", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + [[package]] name = "color_quant" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "com" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a30a2b2a013da986dc5cc3eda3d19c0d59d53f835be1b2356eb8d00f000c793" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7606b05842fea68ddcc89e8053b8860ebcb2a0ba8d6abfe3a148e5d5a8d3f0c1" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.68", +] + +[[package]] +name = "com_macros_support" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97e9a6d20f4ac8830e309a455d7e9416e65c6af5a97c88c55fbb4c2012e107da" +dependencies = [ + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + [[package]] name = "concurrent-queue" version = "1.2.2" @@ -351,22 +468,94 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys 0.7.0", + "libc", +] + [[package]] name = "core-foundation" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.8.2", "libc", ] +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + [[package]] name = "core-foundation-sys" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +dependencies = [ + "bitflags 1.2.1", + "core-foundation 0.7.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" +dependencies = [ + "bitflags 1.2.1", + "core-foundation 0.9.1", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags 1.2.1", + "core-foundation 0.9.1", + "foreign-types", + "libc", +] + +[[package]] +name = "core-video-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +dependencies = [ + "cfg-if 0.1.10", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", + "libc", + "objc", +] + [[package]] name = "crc32fast" version = "1.2.1" @@ -421,6 +610,88 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote 1.0.9", + "smallvec", + "syn 1.0.68", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" +dependencies = [ + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote 1.0.9", + "strsim 0.9.3", + "syn 1.0.68", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "deflate" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +dependencies = [ + "adler32", + "byteorder", +] + +[[package]] +name = "deflate" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +dependencies = [ + "adler32", + "byteorder", +] + [[package]] name = "derivative" version = "2.2.0" @@ -432,6 +703,28 @@ dependencies = [ "syn 1.0.68", ] +[[package]] +name = "derive_more" +version = "0.99.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +dependencies = [ + "convert_case", + "proc-macro2", + "quote 1.0.9", + "rustc_version", + "syn 1.0.68", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "dirs" version = "1.0.5" @@ -445,9 +738,9 @@ dependencies = [ [[package]] name = "dirs-next" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf36e65a80337bea855cd4ef9b8401ffce06a7baedf2e85ec467b1ac3f6e82b6" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ "cfg-if 1.0.0", "dirs-sys-next", @@ -464,6 +757,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + [[package]] name = "displaydoc" version = "0.1.7" @@ -475,24 +774,33 @@ dependencies = [ "syn 1.0.68", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "dtoa" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" +[[package]] +name = "dtoa-short" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03329ae10e79ede66c9ce4dc930aa8599043b0743008548680f25b91502d6" +dependencies = [ + "dtoa", +] + [[package]] name = "either" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "embed_plist" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53dd2e43a7d32952a6054141ee0d75183958620e84e5eab045de362dff13dc99" + [[package]] name = "encode_unicode" version = "0.3.6" @@ -520,25 +828,6 @@ dependencies = [ "syn 1.0.68", ] -[[package]] -name = "envmnt" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d328fc287c61314c4a61af7cfdcbd7e678e39778488c7cb13ec133ce0f4059" -dependencies = [ - "fsio", - "indexmap", -] - -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", -] - [[package]] name = "fastrand" version = "1.4.0" @@ -548,6 +837,16 @@ dependencies = [ "instant", ] +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset", + "rustc_version", +] + [[package]] name = "filetime" version = "0.2.14" @@ -556,7 +855,7 @@ checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.5", + "redox_syscall 0.2.10", "winapi", ] @@ -569,7 +868,7 @@ dependencies = [ "cfg-if 0.1.10", "crc32fast", "libc", - "miniz_oxide 0.3.7", + "miniz_oxide", ] [[package]] @@ -604,10 +903,14 @@ dependencies = [ ] [[package]] -name = "fsio" -version = "0.1.3" +name = "futf" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3" +checksum = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" +dependencies = [ + "mac", + "new_debug_unreachable", +] [[package]] name = "futures" @@ -659,9 +962,9 @@ checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" [[package]] name = "futures-lite" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ "fastrand", "futures-core", @@ -717,10 +1020,94 @@ dependencies = [ ] [[package]] -name = "gcc" -version = "0.3.55" +name = "fxhash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "679e22651cd15888e7acd01767950edca2ee9fcd6421fbf5b3c3b420d4e88bb0" +dependencies = [ + "bitflags 1.2.1", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534192cb8f01daeb8fab2c8d4baa8f9aae5b7a39130525779f5c2608e235b10f" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f097c0704201fbc8f69c1762dc58c6947c8bb188b8ed0bc7e65259f1894fe590" +dependencies = [ + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", +] + +[[package]] +name = "gdk-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e091b3d3d6696949ac3b3fb3c62090e5bfd7bd6850bef5c3c5ea701de1b1f1e" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "pango-sys", + "pkg-config", + "system-deps 3.2.0", +] + +[[package]] +name = "generator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "winapi", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] [[package]] name = "getrandom" @@ -745,10 +1132,101 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.23.0" +name = "gio" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "402a7057cd21d64bfa7ac027b344a7f50f677fb3308693df0e8c70fb55d29f0d" +dependencies = [ + "bitflags 1.2.1", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys 0.14.0", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e24fb752f8f5d2cf6bbc2c606fd2bc989c81c5e2fe321ab974d54f8b6344eac" +dependencies = [ + "glib-sys 0.10.1", + "gobject-sys 0.10.0", + "libc", + "system-deps 1.3.2", + "winapi", +] + +[[package]] +name = "gio-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0a41df66e57fcc287c4bcf74fc26b884f31901ea9792ec75607289b456f48fa" +dependencies = [ + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", + "winapi", +] + +[[package]] +name = "glib" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8fb802e3798d75b415bea8f016eed88d50106ce82f1274e80f31d80cfd4b056" +dependencies = [ + "bitflags 1.2.1", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "once_cell", + "smallvec", +] + +[[package]] +name = "glib-macros" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aad66361f66796bfc73f530c51ef123970eb895ffba991a234fcf7bea89e518" +dependencies = [ + "anyhow", + "heck", + "proc-macro-crate 1.0.0", + "proc-macro-error", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "glib-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1" +dependencies = [ + "libc", + "system-deps 1.3.2", +] + +[[package]] +name = "glib-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c1d60554a212445e2a858e42a0e48cece1bd57b311a19a9468f70376cf554ae" +dependencies = [ + "libc", + "system-deps 3.2.0", +] [[package]] name = "globset" @@ -773,6 +1251,84 @@ dependencies = [ "walkdir", ] +[[package]] +name = "gobject-sys" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" +dependencies = [ + "glib-sys 0.10.1", + "libc", + "system-deps 1.3.2", +] + +[[package]] +name = "gobject-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa92cae29759dae34ab5921d73fff5ad54b3d794ab842c117e36cafc7994c3f5" +dependencies = [ + "glib-sys 0.14.0", + "libc", + "system-deps 3.2.0", +] + +[[package]] +name = "gtk" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6603bb79ded6ac6f3bac203794383afa8b1d6a8656d34a93a88f0b22826cd46c" +dependencies = [ + "atk", + "bitflags 1.2.1", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c14c8d3da0545785a7c5a120345b3abb534010fb8ae0f2ef3f47c027fba303e" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "pango-sys", + "system-deps 3.2.0", +] + +[[package]] +name = "gtk3-macros" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21de1da96dc117443fb03c2e270b2d34b7de98d0a79a19bbb689476173745b79" +dependencies = [ + "anyhow", + "heck", + "proc-macro-crate 1.0.0", + "proc-macro-error", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + [[package]] name = "hashbrown" version = "0.9.1" @@ -807,16 +1363,52 @@ dependencies = [ ] [[package]] -name = "http" -version = "0.2.3" +name = "html5ever" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "http" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes", "fnv", "itoa", ] +[[package]] +name = "http-range" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee9694f83d9b7c09682fdb32213682939507884e5bcf227be9aff5d644b90dc" + +[[package]] +name = "ico" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a4b3331534254a9b64095ae60d3dc2a8225a7a70229cd5888be127cdc1f6804" +dependencies = [ + "byteorder", + "png 0.11.0", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.2" @@ -882,6 +1474,24 @@ dependencies = [ "regex", ] +[[package]] +name = "infer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92b41dab759f9e8427c03f519c344a14655490b8db548dac1e57a75b3258391" +dependencies = [ + "cfb", +] + +[[package]] +name = "inflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5f9f47468e9a76a6452271efadc88fe865a82be91fe75e6c0c57b87ccea59d4" +dependencies = [ + "adler32", +] + [[package]] name = "instant" version = "0.1.9" @@ -891,12 +1501,46 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "itertools" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +[[package]] +name = "javascriptcore-rs" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca9c7d1445bba2889672fbadc16c3d5007bfdcf0a15a18a3a50fe9fab2c7427" +dependencies = [ + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f46ada8a08dcd75a10afae872fbfb51275df4a8ae0d46b8cc7c708f08dd2998" +dependencies = [ + "libc", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.21" @@ -915,6 +1559,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kuchiki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" +dependencies = [ + "cssparser", + "html5ever", + "matches", + "selectors", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -923,9 +1579,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.92" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" +checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21" [[package]] name = "libflate" @@ -986,6 +1642,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +dependencies = [ + "scopeguard", +] + [[package]] name = "log" version = "0.4.14" @@ -995,6 +1660,25 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "loom" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2111607c723d7857e0d8299d5ce7a0bf4b844d3e44f8de136b13da513eaf8fc4" +dependencies = [ + "cfg-if 1.0.0", + "generator", + "scoped-tls", + "serde", + "serde_json", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + [[package]] name = "mac-notification-sys" version = "0.3.0" @@ -1016,12 +1700,32 @@ dependencies = [ "libc", ] +[[package]] +name = "markup5ever" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd" +dependencies = [ + "log", + "phf 0.8.0", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + [[package]] name = "matches" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "memchr" version = "2.3.4" @@ -1046,16 +1750,6 @@ dependencies = [ "adler32", ] -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - [[package]] name = "n-link" version = "0.1.6" @@ -1067,7 +1761,6 @@ dependencies = [ "lazy_static", "libnspire", "libusb1-sys", - "native-dialog", "rusb", "serde", "serde_json", @@ -1075,20 +1768,6 @@ dependencies = [ "winres", ] -[[package]] -name = "native-dialog" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5b69bf2d8a7adddb64521426df8c3125d27ca8da25db97efc7425d8b07c92f3" -dependencies = [ - "osascript", - "serde", - "thiserror", - "wfd", - "which 4.1.0", - "winapi", -] - [[package]] name = "native-tls" version = "0.2.7" @@ -1109,23 +1788,66 @@ dependencies = [ [[package]] name = "nb-connect" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" +checksum = "b1bb540dc6ef51cfe1916ec038ce7a620daf3a111e2502d745197cd53d6bca15" dependencies = [ "libc", "socket2", ] [[package]] -name = "nfd" -version = "0.0.4" +name = "ndk" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e752e3c216bc8a491c5b59fa46da10f1379ae450b19ac688e07f4bb55042e98" +checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" dependencies = [ - "gcc", + "bitflags 1.2.1", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", ] +[[package]] +name = "ndk-glue" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e9e94628f24e7a3cb5b96a2dc5683acd9230bf11991c2a1677b87695138420" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk", + "ndk-macro", + "ndk-sys", +] + +[[package]] +name = "ndk-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling", + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "ndk-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + [[package]] name = "nix" version = "0.17.0" @@ -1140,10 +1862,16 @@ dependencies = [ ] [[package]] -name = "notify-rust" -version = "4.3.0" +name = "nodrop" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c16afe17474a42a59062f3409a63160c63d41985b25e9e613400685b839cb6" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "notify-rust" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2ca742cd7268b60c35828d318357f0b1bb9b82088e157ccf3013eb3ce70247" dependencies = [ "mac-notification-sys", "serde", @@ -1153,15 +1881,6 @@ dependencies = [ "zvariant_derive", ] -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi", -] - [[package]] name = "num-integer" version = "0.1.44" @@ -1213,6 +1932,28 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +dependencies = [ + "derivative", + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + [[package]] name = "number_prefix" version = "0.3.0" @@ -1249,16 +1990,20 @@ dependencies = [ ] [[package]] -name = "object" -version = "0.23.0" +name = "once_cell" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] -name = "once_cell" -version = "1.7.2" +name = "open" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "b46b233de7d83bc167fe43ae2dda3b5b84e80e09cceba581e4decb958a4896bf" +dependencies = [ + "pathdiff", + "winapi", +] [[package]] name = "openssl" @@ -1300,14 +2045,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" [[package]] -name = "osascript" -version = "0.3.0" +name = "pango" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38731fa859ef679f1aec66ca9562165926b442f298467f76f5990f431efe87dc" +checksum = "e1fc88307d9797976ea62722ff2ec5de3fae279c6e20100ed3f49ca1a4bf3f96" dependencies = [ - "serde", - "serde_derive", - "serde_json", + "bitflags 1.2.1", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2367099ca5e761546ba1d501955079f097caa186bb53ce0f718dca99ac1942fe" +dependencies = [ + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", ] [[package]] @@ -1316,6 +2075,37 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall 0.2.10", + "smallvec", + "winapi", +] + +[[package]] +name = "pathdiff" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877630b3de15c0b64cc52f659345724fbf6bdad9bd9566699fc53688f3c34a34" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1337,7 +2127,20 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" dependencies = [ - "phf_shared", + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fc3db1018c4b59d7d582a739436478b6035138b6aecbce989fc91c3e98409f" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", ] [[package]] @@ -1346,8 +2149,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.8.0", + "phf_shared 0.8.0", ] [[package]] @@ -1356,10 +2159,48 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ - "phf_shared", + "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.3", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[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 1.0.9", + "syn 1.0.68", +] + [[package]] name = "phf_shared" version = "0.8.0" @@ -1369,6 +2210,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.6" @@ -1388,15 +2238,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] -name = "polling" -version = "2.0.3" +name = "png" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" +checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" +dependencies = [ + "bitflags 1.2.1", + "deflate 0.7.20", + "inflate", + "num-iter", +] + +[[package]] +name = "png" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" +dependencies = [ + "bitflags 1.2.1", + "crc32fast", + "deflate 0.8.6", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" dependencies = [ "cfg-if 1.0.0", "libc", "log", - "wepoll-sys", + "wepoll-ffi", "winapi", ] @@ -1406,6 +2280,12 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +[[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 = "0.1.5" @@ -1415,6 +2295,16 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1566,6 +2456,15 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "raw-window-handle" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +dependencies = [ + "libc", +] + [[package]] name = "rayon" version = "1.5.0" @@ -1599,9 +2498,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags 1.2.1", ] @@ -1624,7 +2523,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ "getrandom 0.2.2", - "redox_syscall 0.2.5", + "redox_syscall 0.2.10", ] [[package]] @@ -1653,22 +2552,35 @@ dependencies = [ "winapi", ] +[[package]] +name = "rfd" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cede43618603a102f37bb58244534a33de7daa6a3b77f00277675eef5f8174fe" +dependencies = [ + "block", + "dispatch", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "gtk-sys", + "js-sys", + "lazy_static", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winapi", +] + [[package]] name = "rle-decode-fast" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" -[[package]] -name = "runas" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a620b0994a180cdfa25c0439e6d58c0628272571501880d626ffff58e96a0799" -dependencies = [ - "cc", - "which 3.1.1", -] - [[package]] name = "rusb" version = "0.6.5" @@ -1692,10 +2604,19 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.18" +name = "rustc_version" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" [[package]] name = "ryu" @@ -1741,8 +2662,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" dependencies = [ "bitflags 1.2.1", - "core-foundation", - "core-foundation-sys", + "core-foundation 0.9.1", + "core-foundation-sys 0.8.2", "libc", "security-framework-sys", ] @@ -1753,10 +2674,30 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.8.2", "libc", ] +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags 1.2.1", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + [[package]] name = "semver" version = "0.11.0" @@ -1766,6 +2707,12 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + [[package]] name = "semver-parser" version = "0.10.2" @@ -1829,6 +2776,16 @@ dependencies = [ "url", ] +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + [[package]] name = "siphasher" version = "0.3.5" @@ -1842,15 +2799,88 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] -name = "socket2" -version = "0.4.0" +name = "smallvec" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" + +[[package]] +name = "socket2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad" dependencies = [ "libc", "winapi", ] +[[package]] +name = "soup-sys" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7adf08565630bbb71f955f11f8a68464817ded2703a3549747c235b58a13e" +dependencies = [ + "bitflags 1.2.1", + "gio-sys 0.10.1", + "glib-sys 0.10.1", + "gobject-sys 0.10.0", + "libc", + "pkg-config", + "system-deps 1.3.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cf4f5369e6d3044b5e365c9690f451516ac8f0954084622b49ea3fde2f6de5" +dependencies = [ + "loom", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ddb1139b5353f96e429e1a5e19fbaf663bddedaa06d1dbd49f82e352601209a" +dependencies = [ + "lazy_static", + "new_debug_unreachable", + "phf_shared 0.8.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro2", + "quote 1.0.9", +] + +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "strsim" version = "0.10.0" @@ -1863,6 +2893,18 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ca6e4730f517e041e547ffe23d29daab8de6b73af4b6ae2a002108169f5e7da" +[[package]] +name = "strum" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" + +[[package]] +name = "strum" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" + [[package]] name = "strum_macros" version = "0.8.0" @@ -1873,6 +2915,30 @@ dependencies = [ "syn 0.11.11", ] +[[package]] +name = "strum_macros" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" +dependencies = [ + "heck", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "strum_macros" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" +dependencies = [ + "heck", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + [[package]] name = "syn" version = "0.11.11" @@ -1905,18 +2971,75 @@ dependencies = [ ] [[package]] -name = "sysinfo" -version = "0.10.5" +name = "system-deps" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8834e42be61ae4f6338b216fbb69837c7f33c3d4d3a139fb073735b25af4d9e" +checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" dependencies = [ - "cfg-if 0.1.10", - "doc-comment", + "heck", + "pkg-config", + "strum 0.18.0", + "strum_macros 0.18.0", + "thiserror", + "toml", + "version-compare 0.0.10", +] + +[[package]] +name = "system-deps" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6" +dependencies = [ + "anyhow", + "cfg-expr", + "heck", + "itertools", + "pkg-config", + "strum 0.21.0", + "strum_macros 0.21.1", + "thiserror", + "toml", + "version-compare 0.0.11", +] + +[[package]] +name = "tao" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa57de7c282b68f8906278543a724ed8f5a2568f069dd0cc05fc10d1f07036b" +dependencies = [ + "bitflags 1.2.1", + "cairo-rs", + "cc", + "cocoa", + "core-foundation 0.9.1", + "core-graphics 0.22.2", + "core-video-sys", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "glib-sys 0.14.0", + "gtk", + "instant", + "lazy_static", "libc", - "ntapi", - "once_cell", - "rayon", + "log", + "ndk", + "ndk-glue", + "ndk-sys", + "objc", + "parking_lot", + "raw-window-handle", + "scopeguard", + "serde", + "unicode-segmentation", "winapi", + "x11-dl", ] [[package]] @@ -1932,109 +3055,130 @@ dependencies = [ [[package]] name = "tauri" -version = "0.11.1" +version = "1.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9af4a75d37455e128ed45fe875dd4b370d07e1d868b7a37c430b102356f6f4c" +checksum = "79a0579dcc6fb883fe90dd3c66d76b8b8f4a1786e1e915e314b2017a500ede09" dependencies = [ - "anyhow", - "base64", - "cfg_aliases", - "envmnt", - "lazy_static", - "once_cell", - "phf", - "runas", - "serde", - "serde_json", - "tauri-api", - "tauri_includedir", - "tauri_includedir_codegen", - "thiserror", - "threadpool", - "tiny_http", - "urlencoding", - "uuid", - "webbrowser", - "webview_official", -] - -[[package]] -name = "tauri-api" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f95e1384293411f899b30d131ca0d090c200245682b2a3e930b0179b836875" -dependencies = [ - "anyhow", "attohttpc", + "bincode", + "cfg_aliases", "dirs-next", "either", + "embed_plist", "flate2", + "futures", + "futures-lite", + "glib", + "gtk", "http", - "nfd", + "ignore", "notify-rust", "once_cell", - "rand 0.7.3", - "semver", + "open", + "percent-encoding", + "rand 0.8.3", + "raw-window-handle", + "rfd", + "semver 1.0.4", "serde", "serde_json", "serde_repr", + "state", "tar", - "tauri-dialog", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", "tauri-utils", "tempfile", "thiserror", + "tokio", + "url", + "uuid", "zip", ] [[package]] -name = "tauri-dialog" -version = "0.1.0" +name = "tauri-codegen" +version = "1.0.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5797e1fadcc36b32e29b9dc521abba8ebbc1847378ec96917cdcf548ba6fdc" +checksum = "1663739ab53e281919676f216fb56a031104d0d2cd1a2dd5b012d279bcdb0ea4" dependencies = [ - "tauri-dialog-sys", + "blake3", + "kuchiki", + "proc-macro2", + "quote 1.0.9", + "regex", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "walkdir", + "zstd", ] [[package]] -name = "tauri-dialog-sys" -version = "0.1.0" +name = "tauri-macros" +version = "1.0.0-beta.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eba3890c956c0234a27bc5648af00738c81e193351ce5f47faec7efc9156c02" +checksum = "bddf9f5868402323f35ef94fa6ab1d5d10b29aea9de598d829723aa1db5693b4" dependencies = [ - "cc", - "pkg-config", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", + "tauri-codegen", +] + +[[package]] +name = "tauri-runtime" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c52eccfb7f2ce5a09262bdc3671f0f07f637e27f8aa25e5f38145cddcd4e01" +dependencies = [ + "gtk", + "http", + "http-range", + "infer", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "uuid", + "winapi", +] + +[[package]] +name = "tauri-runtime-wry" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fed8dd0a448c303fa764859d6dfa1c746c4f2c6c30a83c162f8bebb12e4af4e" +dependencies = [ + "gtk", + "ico", + "infer", + "png 0.16.8", + "tauri-runtime", + "tauri-utils", + "uuid", + "winapi", + "wry", ] [[package]] name = "tauri-utils" -version = "0.5.1" +version = "1.0.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d8a4b0daeec9b0493cf894a918ba30e6768d6cca1cab757f802a9e78bc0bbfd" +checksum = "fcb9b79594f22b6ed0cc8362e0dfde5b7969962de3cd8ca683de702e59e8221b" dependencies = [ - "anyhow", - "sysinfo", + "html5ever", + "kuchiki", + "phf 0.10.0", + "proc-macro2", + "quote 1.0.9", + "serde", + "serde_json", "thiserror", -] - -[[package]] -name = "tauri_includedir" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a3644510b11203f42cf6e6384d5c46e0d20e426aa6e05b9110f5e4583a1032" -dependencies = [ - "flate2", - "phf", -] - -[[package]] -name = "tauri_includedir_codegen" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afccce834cf6062a1a19d2d0018fd2a5a2d13d75f547ed0dac2cc3d9813b6ae7" -dependencies = [ - "flate2", - "phf_codegen", - "walkdir", + "url", + "zstd", ] [[package]] @@ -2046,11 +3190,22 @@ dependencies = [ "cfg-if 1.0.0", "libc", "rand 0.8.3", - "redox_syscall 0.2.5", + "redox_syscall 0.2.10", "remove_dir_all", "winapi", ] +[[package]] +name = "tendril" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9ef557cb397a4f0a5a3a628f06515f78563f2209e64d47055d9dc6052bf5e33" +dependencies = [ + "futf", + "mac", + "utf-8", +] + [[package]] name = "termcolor" version = "1.1.2" @@ -2080,19 +3235,25 @@ dependencies = [ ] [[package]] -name = "thiserror" -version = "1.0.24" +name = "thin-slice" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + +[[package]] +name = "thiserror" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" dependencies = [ "proc-macro2", "quote 1.0.9", @@ -2108,15 +3269,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.1.43" @@ -2127,19 +3279,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "tiny_http" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ce4fc3c4cdea1a4399bb1819a539195fb69db4bbe0bde5b7c7f18fed412e02" -dependencies = [ - "ascii", - "chrono", - "chunked_transfer", - "log", - "url", -] - [[package]] name = "tinyvec" version = "1.2.0" @@ -2155,6 +3294,19 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92036be488bb6594459f2e03b60e42df6f937fe6ca5c5ffdcb539c6b84dc40f5" +dependencies = [ + "autocfg", + "bytes", + "memchr", + "num_cpus", + "pin-project-lite", +] + [[package]] name = "toml" version = "0.5.8" @@ -2164,6 +3316,12 @@ dependencies = [ "serde", ] +[[package]] +name = "typenum" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" + [[package]] name = "ucd-trie" version = "0.1.3" @@ -2190,9 +3348,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" @@ -2222,13 +3380,14 @@ dependencies = [ "idna", "matches", "percent-encoding", + "serde", ] [[package]] -name = "urlencoding" -version = "1.1.1" +name = "utf-8" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9232eb53352b4442e40d7900465dfc534e8cb2dc8f18656fcb2ac16112b5593" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" @@ -2245,18 +3404,24 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" -[[package]] -name = "vec-arena" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" - [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version-compare" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" + +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + [[package]] name = "version_check" version = "0.9.3" @@ -2323,6 +3488,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.73" @@ -2363,72 +3540,81 @@ dependencies = [ ] [[package]] -name = "webbrowser" -version = "0.5.5" +name = "webkit2gtk" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecad156490d6b620308ed411cfee90d280b3cbd13e189ea0d3fada8acc89158a" +checksum = "e3e47b7f870883fc21612d2a51b74262f7f2cc5371f1621370817292a35300a9" dependencies = [ - "web-sys", + "bitflags 1.2.1", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys 0.14.0", + "glib", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66ccc9f0cb4de7c3b92376a5bf64e7ddffb33852f092721731a039ec38dda98" +dependencies = [ + "atk-sys", + "bitflags 1.2.1", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup-sys", + "system-deps 3.2.0", +] + +[[package]] +name = "webview2" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fab1ccfdabb098b047293c8d496c1914d1c654b68fdaa3bb77cfa47c4bca2c7" +dependencies = [ + "com", + "once_cell", + "webview2-sys", "widestring", "winapi", ] [[package]] -name = "webview-official-sys" -version = "0.1.2" +name = "webview2-sys" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4aec5fdf5bc938ba5fe47d23b8e02d6beaee395a91e16f0b2eec984a9a9e1d2" +checksum = "cc5288cef1e0cbcf7a0b961e6271e33589b8989c80b2e11078504e989b5346ff" dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "webview_official" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae12c9051f4ee17195d19d170b82ad1bf5477c272fe03f73e21626475cb60b03" -dependencies = [ - "webview-official-sys", -] - -[[package]] -name = "wepoll-sys" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" -dependencies = [ - "cc", -] - -[[package]] -name = "wfd" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e713040b67aae5bf1a0ae3e1ebba8cc29ab2b90da9aa1bff6e09031a8a41d7a8" -dependencies = [ - "libc", + "com", "winapi", ] [[package]] -name = "which" -version = "3.1.1" +name = "wepoll-ffi" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" dependencies = [ - "failure", - "libc", -] - -[[package]] -name = "which" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" -dependencies = [ - "either", - "libc", + "cc", ] [[package]] @@ -2498,13 +3684,55 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57790eb281688a4682dab44df2a1ba8b78373233bd71cb291c3e75fecb1a01c4" dependencies = [ - "strum", - "strum_macros", + "strum 0.8.0", + "strum_macros 0.8.0", "winapi", "winrt", "xml-rs", ] +[[package]] +name = "wry" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9549393a3917b5303277abb0267f8eecf9fd629b25f1c04e5284aa58b61915" +dependencies = [ + "cocoa", + "core-graphics 0.22.2", + "gdk", + "gio", + "glib", + "gtk", + "http", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2", + "webview2-sys", + "winapi", +] + +[[package]] +name = "x11-dl" +version = "2.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" +dependencies = [ + "lazy_static", + "libc", + "maybe-uninit", + "pkg-config", +] + [[package]] name = "xattr" version = "0.2.2" @@ -2552,7 +3780,7 @@ version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a482c56029e48681b89b92b5db3c446db0915e8dd1052c0328a574eda38d5f93" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", "syn 1.0.68", @@ -2573,24 +3801,54 @@ dependencies = [ ] [[package]] -name = "zvariant" -version = "2.6.0" +name = "zstd" +version = "0.9.0+zstd.1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678e7262502a135f49b1ece65010526649be7ee68acb80e1fc5377fc71fef878" +checksum = "07749a5dc2cb6b36661290245e350f15ec3bbb304e493db54a1d354480522ccd" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "4.1.1+zstd.1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91c90f2c593b003603e5e0493c837088df4469da25aafff8bce42ba48caf079" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.6.1+zstd.1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "615120c7a2431d16cf1cf979e7fc31ba7a5b5e5707b29c8a99e5dbf8a8392a33" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "zvariant" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4b785b8b32b0f8433b4474e6bb4ea77b37c1960e84d7598e01dd199b2b23ef" dependencies = [ "byteorder", "enumflags2", "serde", + "static_assertions", "zvariant_derive", ] [[package]] name = "zvariant_derive" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d7c34325a35020b94343389cc9391e0f8ac245cca9155429c4022d93141241" +checksum = "b42af4ee88fb928781391216c34be77ec7cdb3546042b2947ce38d86aa5f37dd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", "syn 1.0.68", diff --git a/desktop/src-tauri/Cargo.toml b/desktop/src-tauri/Cargo.toml index 58e493f..0f9f65e 100644 --- a/desktop/src-tauri/Cargo.toml +++ b/desktop/src-tauri/Cargo.toml @@ -16,8 +16,7 @@ libnspire = "0.2.2" lazy_static = "1.4.0" rusb = "0.6.4" serde = { version = "1.0", features = [ "derive" ] } -tauri = { version = "0.11", features = [ "event", "notification", "open" ] } -native-dialog = "0.4" +tauri = { version = "1.0.0-beta.8", features = ["dialog-open", "dialog-save", "notification-all", "shell-open"] } clap = "3.0.0-beta.2" indicatif = "0.15" libusb1-sys = { version = "0.4.2", features = [ "vendored" ] } @@ -27,8 +26,8 @@ hashbrown = "0.11" winres = "0.1" [features] -embedded-server = [ "tauri/embedded-server" ] -no-server = [ "tauri/no-server" ] +custom-protocol = [ "tauri/custom-protocol" ] +default = [ "custom-protocol" ] [[bin]] name = "n-link" diff --git a/desktop/src-tauri/src/build.rs b/desktop/src-tauri/src/build.rs index 34fe92b..83fb8f4 100644 --- a/desktop/src-tauri/src/build.rs +++ b/desktop/src-tauri/src/build.rs @@ -5,7 +5,7 @@ extern crate winres; fn main() { if std::path::Path::new("icons/icon.ico").exists() { let mut res = winres::WindowsResource::new(); - res.set_icon("icons/icon.ico"); + res.set_icon_with_id("icons/icon.ico", "32512"); res.compile().expect("Unable to find visual studio tools"); } else { panic!("No Icon.ico found. Please add one or check the path"); diff --git a/desktop/src-tauri/src/cli.rs b/desktop/src-tauri/src/cli.rs index 31c3fc3..abca724 100644 --- a/desktop/src-tauri/src/cli.rs +++ b/desktop/src-tauri/src/cli.rs @@ -46,14 +46,13 @@ fn get_dev() -> Option> { rusb::devices() .unwrap() .iter() - .filter(|dev| { + .find(|dev| { let descriptor = match dev.device_descriptor() { Ok(d) => d, Err(_) => return false, }; descriptor.vendor_id() == VID && matches!(descriptor.product_id(), PID | PID_CX2) }) - .next() .map(|dev| libnspire::Handle::new(dev.open().unwrap()).unwrap()) } diff --git a/desktop/src-tauri/src/cmd.rs b/desktop/src-tauri/src/cmd.rs index 80bc631..a2ee4de 100644 --- a/desktop/src-tauri/src/cmd.rs +++ b/desktop/src-tauri/src/cmd.rs @@ -4,16 +4,10 @@ use std::time::Duration; use libnspire::{PID, PID_CX2, VID}; use rusb::GlobalContext; use serde::{Deserialize, Serialize}; +use tauri::{Runtime, Window}; -use crate::{Device, DeviceState}; -use tauri::WebviewMut; +use crate::{Device, DeviceState, SerializedError}; -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct Promise { - pub callback: String, - pub error: String, -} #[derive(Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[derive(Copy, Clone, Eq, PartialEq, Debug, Hash)] @@ -21,131 +15,6 @@ pub struct DevId { pub bus_number: u8, pub address: u8, } -#[derive(Debug, Deserialize)] -#[serde(tag = "cmd", rename_all = "camelCase")] -pub enum Cmd { - // your custom commands - // multiple arguments are allowed - // note that rename_all = "camelCase": you need to use "myCustomCommand" on JS - Enumerate { - #[serde(flatten)] - promise: Promise, - }, - #[serde(rename_all = "camelCase")] - OpenDevice { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - }, - #[serde(rename_all = "camelCase")] - CloseDevice { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - }, - #[serde(rename_all = "camelCase")] - UpdateDevice { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - }, - #[serde(rename_all = "camelCase")] - ListDir { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - path: String, - }, - #[serde(rename_all = "camelCase")] - DownloadFile { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - path: (String, u64), - dest: String, - }, - #[serde(rename_all = "camelCase")] - UploadFile { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - path: String, - src: String, - }, - #[serde(rename_all = "camelCase")] - UploadOs { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - src: String, - }, - #[serde(rename_all = "camelCase")] - DeleteFile { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - path: String, - }, - #[serde(rename_all = "camelCase")] - DeleteDir { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - path: String, - }, - #[serde(rename_all = "camelCase")] - CreateNspireDir { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - path: String, - }, - #[serde(rename_all = "camelCase")] - Move { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - src: String, - dest: String, - }, - #[serde(rename_all = "camelCase")] - Copy { - #[serde(flatten)] - promise: Promise, - #[serde(flatten)] - dev: DevId, - src: String, - dest: String, - }, - #[serde(rename_all = "camelCase")] - SelectFile { - #[serde(flatten)] - promise: Promise, - filter: Vec, - }, - #[serde(rename_all = "camelCase")] - SelectFiles { - #[serde(flatten)] - promise: Promise, - filter: Vec, - }, - #[serde(rename_all = "camelCase")] - SelectFolder { - #[serde(flatten)] - promise: Promise, - }, -} pub fn add_device(dev: Arc>) -> rusb::Result<((u8, u8), Device)> { let descriptor = dev.device_descriptor()?; @@ -185,7 +54,8 @@ pub fn add_device(dev: Arc>) -> rusb::Result<((u8, u )) } -pub fn enumerate(handle: &mut WebviewMut) -> Result, libnspire::Error> { +#[tauri::command] +pub fn enumerate(handle: Window) -> Result, SerializedError> { let devices: Vec<_> = rusb::devices()?.iter().collect(); let mut map = crate::DEVICES.write().unwrap(); map @@ -195,13 +65,12 @@ pub fn enumerate(handle: &mut WebviewMut) -> Result, libnspire::E .all(|d| d.bus_number() != k.0 || d.address() != k.1) }) .for_each(|d| { - if let Err(msg) = tauri::event::emit( - handle, + if let Err(msg) = handle.emit( "removeDevice", - Some(DevId { + DevId { bus_number: (d.0).0, address: (d.0).1, - }), + }, ) { eprintln!("{}", msg); } diff --git a/desktop/src-tauri/src/main.rs b/desktop/src-tauri/src/main.rs index 06b21b6..ba1b457 100644 --- a/desktop/src-tauri/src/main.rs +++ b/desktop/src-tauri/src/main.rs @@ -3,25 +3,20 @@ windows_subsystem = "windows" )] -use hashbrown::HashMap; -use std::fs::File; -use std::io::{Read, Write}; -use std::path::PathBuf; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, RwLock}; use std::time::Duration; -use libnspire::dir::EntryType; +use hashbrown::HashMap; use libnspire::{PID_CX2, VID}; -use native_dialog::Dialog; use rusb::{GlobalContext, Hotplug, UsbContext}; -use tauri::WebviewMut; +use serde::Serialize; +use tauri::{Runtime, Window}; -use crate::cmd::{add_device, AddDevice, DevId, FileInfo, ProgressUpdate}; -use crate::promise::promise_fn; +use crate::cmd::{add_device, AddDevice, DevId, ProgressUpdate}; mod cli; mod cmd; -mod promise; pub enum DeviceState { Open( @@ -40,13 +35,13 @@ pub struct Device { lazy_static::lazy_static! { static ref DEVICES: RwLock> = RwLock::new(HashMap::new()); } -struct DeviceMon { - handle: WebviewMut, +struct DeviceMon { + window: Window, } -impl Hotplug for DeviceMon { +impl Hotplug for DeviceMon { fn device_arrived(&mut self, device: rusb::Device) { - let mut handle = self.handle.clone(); + let handle = self.window.clone(); let is_cx_ii = device .device_descriptor() .map(|d| d.product_id() == PID_CX2) @@ -58,10 +53,9 @@ impl Hotplug for DeviceMon { let name = (dev.1).name.clone(); let needs_drivers = (dev.1).needs_drivers; DEVICES.write().unwrap().insert(dev.0, dev.1); - if let Err(msg) = tauri::event::emit( - &mut handle, + if let Err(msg) = handle.emit( "addDevice", - Some(AddDevice { + AddDevice { dev: DevId { bus_number: (dev.0).0, address: (dev.0).1, @@ -69,7 +63,7 @@ impl Hotplug for DeviceMon { name, is_cx_ii, needs_drivers, - }), + }, ) { eprintln!("{}", msg); }; @@ -93,13 +87,12 @@ impl Hotplug for DeviceMon { .unwrap() .remove_entry(&(device.bus_number(), device.address())) { - if let Err(msg) = tauri::event::emit( - &mut self.handle, + if let Err(msg) = self.window.emit( "removeDevice", - Some(DevId { + DevId { bus_number: dev.0, address: dev.1, - }), + }, ) { eprintln!("{}", msg); }; @@ -107,42 +100,41 @@ impl Hotplug for DeviceMon { } } -fn err_wrap( +fn err_wrap( res: Result, dev: DevId, - handle: &mut WebviewMut, + window: &Window, ) -> Result { if let Err(libnspire::Error::NoDevice) = res { DEVICES .write() .unwrap() .remove(&(dev.bus_number, dev.address)); - if let Err(msg) = tauri::event::emit(handle, "removeDevice", Some(dev)) { + if let Err(msg) = window.emit("removeDevice", dev) { eprintln!("{}", msg); }; } res } -fn progress_sender<'a>( - handle: &'a mut WebviewMut, +fn progress_sender( + window: &Window, dev: DevId, total: usize, -) -> impl FnMut(usize) + 'a { +) -> impl FnMut(usize) + '_ { let mut i = 0; move |remaining| { if i > 5 { i = 0; } if i == 0 || remaining == 0 { - if let Err(msg) = tauri::event::emit( - handle, + if let Err(msg) = window.emit( "progress", - Some(ProgressUpdate { + ProgressUpdate { dev, remaining, total, - }), + }, ) { eprintln!("{}", msg); }; @@ -164,321 +156,323 @@ fn get_open_dev( } } +#[derive(Serialize)] +pub struct SerializedError(String); + +impl From for SerializedError { + fn from(f: T) -> Self { + SerializedError(f.to_string()) + } +} + +mod invoked { + use std::fs::File; + use std::io::{Read, Write}; + use std::path::PathBuf; + use std::sync::{Arc, Mutex}; + + use libnspire::dir::EntryType; + use serde::Serialize; + use tauri::{Runtime, Window}; + + use crate::cmd::{DevId, FileInfo}; + use crate::{err_wrap, get_open_dev, progress_sender, DeviceState, SerializedError}; + + use super::DEVICES; + + #[tauri::command] + pub fn open_device(bus_number: u8, address: u8) -> Result { + let device = if let Some(dev) = DEVICES.read().unwrap().get(&(bus_number, address)) { + if !matches!(dev.state, DeviceState::Closed) { + return Err("Already open".into()); + }; + dev.device.clone() + } else { + return Err("Failed to find device".into()); + }; + let handle = libnspire::Handle::new(device.open()?)?; + let info = handle.info()?; + { + let mut guard = DEVICES.write().unwrap(); + let device = guard + .get_mut(&(bus_number, address)) + .ok_or_else(|| anyhow::anyhow!("Device lost"))?; + device.state = DeviceState::Open(Arc::new(Mutex::new(handle)), info.clone()); + } + Ok(info) + } + + #[tauri::command] + pub fn close_device(bus_number: u8, address: u8) -> Result { + let mut guard = DEVICES.write().unwrap(); + let device = guard + .get_mut(&(bus_number, address)) + .ok_or_else(|| anyhow::anyhow!("Device lost"))?; + device.state = DeviceState::Closed; + Ok(()) + } + + #[tauri::command] + pub fn update_device( + bus_number: u8, + address: u8, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + let info = err_wrap(handle.info(), dev, &window)?; + Ok(info) + } + + #[tauri::command] + pub fn list_dir( + bus_number: u8, + address: u8, + path: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + let dir = err_wrap(handle.list_dir(&path), dev, &window)?; + + Ok( + dir + .iter() + .map(|file| FileInfo { + path: file.name().to_string_lossy().to_string(), + is_dir: file.entry_type() == EntryType::Directory, + date: file.date(), + size: file.size(), + }) + .collect::>(), + ) + } + + #[tauri::command] + pub fn download_file( + bus_number: u8, + address: u8, + path: (String, u64), + dest: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let (file, size) = path; + let dest = PathBuf::from(dest); + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + let mut buf = vec![0; size as usize]; + err_wrap( + handle.read_file( + &file, + &mut buf, + &mut progress_sender(&window, dev, size as usize), + ), + dev, + &window, + )?; + if let Some(name) = file.split('/').last() { + File::create(dest.join(name))?.write_all(&buf)?; + } + Ok(()) + } + + #[tauri::command] + pub fn upload_file( + bus_number: u8, + address: u8, + path: String, + src: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let file = PathBuf::from(src); + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + let mut buf = vec![]; + File::open(&file)?.read_to_end(&mut buf)?; + let name = file + .file_name() + .ok_or_else(|| anyhow::anyhow!("Failed to get file name"))? + .to_string_lossy() + .to_string(); + err_wrap( + handle.write_file( + &format!("{}/{}", path, name), + &buf, + &mut progress_sender(&window, dev, buf.len()), + ), + dev, + &window, + )?; + Ok(()) + } + + #[tauri::command] + pub fn upload_os( + bus_number: u8, + address: u8, + src: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + let mut buf = vec![]; + File::open(&src)?.read_to_end(&mut buf)?; + err_wrap( + handle.send_os(&buf, &mut progress_sender(&window, dev, buf.len())), + dev, + &window, + )?; + Ok(()) + } + + #[tauri::command] + pub fn delete_file( + bus_number: u8, + address: u8, + path: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + err_wrap(handle.delete_file(&path), dev, &window)?; + Ok(()) + } + + #[tauri::command] + pub fn delete_dir( + bus_number: u8, + address: u8, + path: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + err_wrap(handle.delete_dir(&path), dev, &window)?; + Ok(()) + } + + #[tauri::command] + pub fn create_nspire_dir( + bus_number: u8, + address: u8, + path: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + err_wrap(handle.create_dir(&path), dev, &window)?; + Ok(()) + } + + #[tauri::command] + pub fn move_file( + bus_number: u8, + address: u8, + src: String, + dest: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + err_wrap(handle.move_file(&src, &dest), dev, &window)?; + Ok(()) + } + + #[tauri::command] + pub fn copy( + bus_number: u8, + address: u8, + src: String, + dest: String, + window: Window, + ) -> Result { + let dev = DevId { + bus_number, + address, + }; + let handle = get_open_dev(&dev)?; + let handle = handle.lock().unwrap(); + err_wrap(handle.copy_file(&src, &dest), dev, &window)?; + Ok(()) + } +} + fn main() { if cli::run() { return; } - let mut has_registered_callback = false; - tauri::AppBuilder::new() - .invoke_handler(move |webview, arg| { - use cmd::Cmd::*; - match serde_json::from_str(arg) { - Err(e) => Err(e.to_string()), - Ok(command) => { - let mut wv_handle = webview.as_mut(); - match command { - Enumerate { promise } => { - if !has_registered_callback { - has_registered_callback = true; - if rusb::has_hotplug() { - if let Err(msg) = GlobalContext::default().register_callback( - Some(VID), - None, - None, - Box::new(DeviceMon { - handle: webview.as_mut(), - }), - ) { - eprintln!("{}", msg); - }; - std::thread::spawn(|| loop { - GlobalContext::default().handle_events(None).unwrap(); - }); - } else { - println!("no hotplug"); - } - } - promise_fn( - webview, - move || Ok(cmd::enumerate(&mut wv_handle)?), - promise, - ); - } - OpenDevice { promise, dev } => { - promise_fn( - webview, - move || { - let device = if let Some(dev) = - DEVICES.read().unwrap().get(&(dev.bus_number, dev.address)) - { - anyhow::ensure!(matches!(dev.state, DeviceState::Closed), "Already open"); - dev.device.clone() - } else { - anyhow::bail!("Failed to find device"); - }; - let handle = libnspire::Handle::new(device.open()?)?; - let info = handle.info()?; - { - let mut guard = DEVICES.write().unwrap(); - let device = guard - .get_mut(&(dev.bus_number, dev.address)) - .ok_or_else(|| anyhow::anyhow!("Device lost"))?; - device.state = DeviceState::Open(Arc::new(Mutex::new(handle)), info.clone()); - } - Ok(info) - }, - promise, - ); - } - CloseDevice { promise, dev } => { - promise_fn( - webview, - move || { - { - let mut guard = DEVICES.write().unwrap(); - let device = guard - .get_mut(&(dev.bus_number, dev.address)) - .ok_or_else(|| anyhow::anyhow!("Device lost"))?; - device.state = DeviceState::Closed; - } - Ok(()) - }, - promise, - ); - } - UpdateDevice { promise, dev } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - let info = err_wrap(handle.info(), dev, &mut wv_handle)?; - Ok(info) - }, - promise, - ); - } - ListDir { promise, dev, path } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - let dir = err_wrap(handle.list_dir(&path), dev, &mut wv_handle)?; - - Ok( - dir - .iter() - .map(|file| FileInfo { - path: file.name().to_string_lossy().to_string(), - is_dir: file.entry_type() == EntryType::Directory, - date: file.date(), - size: file.size(), - }) - .collect::>(), - ) - }, - promise, - ); - } - DownloadFile { - promise, - dev, - path: (file, size), - dest, - } => { - promise_fn( - webview, - move || { - let dest = PathBuf::from(dest); - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - let mut buf = vec![0; size as usize]; - err_wrap( - handle.read_file( - &file, - &mut buf, - &mut progress_sender(&mut wv_handle.clone(), dev, size as usize), - ), - dev, - &mut wv_handle, - )?; - if let Some(name) = file.split('/').last() { - File::create(dest.join(name))?.write_all(&buf)?; - } - Ok(()) - }, - promise, - ); - } - UploadFile { - promise, - dev, - path, - src, - } => { - promise_fn( - webview, - move || { - let file = PathBuf::from(src); - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - let mut buf = vec![]; - File::open(&file)?.read_to_end(&mut buf)?; - let name = file - .file_name() - .ok_or_else(|| anyhow::anyhow!("Failed to get file name"))? - .to_string_lossy() - .to_string(); - err_wrap( - handle.write_file( - &format!("{}/{}", path, name), - &buf, - &mut progress_sender(&mut wv_handle.clone(), dev, buf.len()), - ), - dev, - &mut wv_handle, - )?; - Ok(()) - }, - promise, - ); - } - UploadOs { promise, dev, src } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - let mut buf = vec![]; - File::open(&src)?.read_to_end(&mut buf)?; - err_wrap( - handle.send_os( - &buf, - &mut progress_sender(&mut wv_handle.clone(), dev, buf.len()), - ), - dev, - &mut wv_handle, - )?; - Ok(()) - }, - promise, - ); - } - DeleteFile { promise, dev, path } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - err_wrap(handle.delete_file(&path), dev, &mut wv_handle)?; - Ok(()) - }, - promise, - ); - } - DeleteDir { promise, dev, path } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - err_wrap(handle.delete_dir(&path), dev, &mut wv_handle)?; - Ok(()) - }, - promise, - ); - } - CreateNspireDir { promise, dev, path } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - err_wrap(handle.create_dir(&path), dev, &mut wv_handle)?; - Ok(()) - }, - promise, - ); - } - Move { - promise, - dev, - src, - dest, - } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - err_wrap(handle.move_file(&src, &dest), dev, &mut wv_handle)?; - Ok(()) - }, - promise, - ); - } - Copy { - promise, - dev, - src, - dest, - } => { - promise_fn( - webview, - move || { - let handle = get_open_dev(&dev)?; - let handle = handle.lock().unwrap(); - err_wrap(handle.copy_file(&src, &dest), dev, &mut wv_handle)?; - Ok(()) - }, - promise, - ); - } - SelectFile { promise, filter } => { - promise_fn( - webview, - move || { - let filter = filter.iter().map(|t| t.as_str()).collect::>(); - Ok( - (native_dialog::OpenSingleFile { - filter: Some(&filter), - dir: None, - }) - .show()?, - ) - }, - promise, - ); - } - SelectFiles { promise, filter } => { - promise_fn( - webview, - move || { - let filter = filter.iter().map(|t| t.as_str()).collect::>(); - Ok( - (native_dialog::OpenMultipleFile { - filter: Some(&filter), - dir: None, - }) - .show()?, - ) - }, - promise, - ); - } - SelectFolder { promise } => { - promise_fn( - webview, - move || Ok((native_dialog::OpenSingleDir { dir: None }).show()?), - promise, - ); - } - } - Ok(()) + let has_registered_callback = AtomicBool::new(false); + tauri::Builder::default() + .on_page_load(move |window, _p| { + if !has_registered_callback.swap(true, Ordering::SeqCst) { + if rusb::has_hotplug() { + if let Err(msg) = GlobalContext::default().register_callback( + Some(VID), + None, + None, + Box::new(DeviceMon { window }), + ) { + eprintln!("{}", msg); + }; + std::thread::spawn(|| loop { + GlobalContext::default().handle_events(None).unwrap(); + }); + } else { + println!("no hotplug"); } } }) - .build() - .run(); + .invoke_handler(tauri::generate_handler![ + cmd::enumerate, + invoked::open_device, + invoked::close_device, + invoked::update_device, + invoked::list_dir, + invoked::download_file, + invoked::upload_file, + invoked::upload_os, + invoked::delete_file, + invoked::delete_dir, + invoked::create_nspire_dir, + invoked::move_file, + invoked::copy, + ]) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); } diff --git a/desktop/src-tauri/src/promise.rs b/desktop/src-tauri/src/promise.rs deleted file mode 100644 index 66d5efa..0000000 --- a/desktop/src-tauri/src/promise.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::cmd::Promise; -use serde::Serialize; -use tauri::api::rpc::{format_callback, format_callback_result}; -use tauri::Webview; - -pub fn promise_fn tauri::Result + Send + 'static>( - webview: &mut Webview<'_>, - task: F, - Promise { - callback: success_callback, - error: error_callback, - }: Promise, -) { - let mut webview = webview.as_mut(); - std::thread::spawn(move || { - let callback_string = match format_callback_result( - task().map_err(|err| err.to_string()), - success_callback, - error_callback.clone(), - ) { - Ok(callback_string) => callback_string, - Err(e) => format_callback(error_callback, e.to_string()), - }; - webview - .dispatch(move |webview_ref| webview_ref.eval(callback_string.as_str())) - .expect("Failed to dispatch promise callback"); - }); -} diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.json index 10e3d25..0277108 100644 --- a/desktop/src-tauri/tauri.conf.json +++ b/desktop/src-tauri/tauri.conf.json @@ -1,9 +1,5 @@ { - "ctx": {}, "tauri": { - "embeddedServer": { - "active": true - }, "bundle": { "active": true, "targets": ["deb", "msi", "appimage", "dmg"], @@ -21,30 +17,42 @@ "category": "Utility", "shortDescription": "Free, cross-platform, CX-II compatible computer linking program for the TI-Nspire", "longDescription": "Free, cross-platform, CX-II compatible computer linking program for the TI-Nspire", - "osx": { + "macOS": { "frameworks": [], "minimumSystemVersion": "", - "useBootstrapper": false + "useBootstrapper": false, + "exceptionDomain": "", + "signingIdentity": null, + "entitlements": null }, - "exceptionDomain": "" + "windows": { + "certificateThumbprint": null, + "digestAlgorithm": "sha256", + "timestampUrl": "" + } + }, + "updater": { + "active": false }, "allowlist": { - "event": true, - "notification": true, - "open": true - }, - "window": { - "title": "N-Link", - "width": 800, - "height": 600, - "resizable": true, - "fullscreen": false + "shell": { + "open": true + }, + "dialog": { + "open": true + } }, + "windows": [ + { + "title": "N-Link", + "width": 800, + "height": 600, + "resizable": true, + "fullscreen": false + } + ], "security": { "csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'" - }, - "inliner": { - "active": true } } } diff --git a/desktop/src/components/devices.ts b/desktop/src/components/devices.ts index 86b6a44..10cf52d 100644 --- a/desktop/src/components/devices.ts +++ b/desktop/src/components/devices.ts @@ -1,5 +1,6 @@ -import {promisified} from 'tauri/api/tauri'; -import {listen} from 'tauri/api/event'; +import {invoke} from '@tauri-apps/api/tauri'; +import {listen} from '@tauri-apps/api/event'; +import {open as openDialog} from '@tauri-apps/api/dialog'; import {Component, Vue} from 'vue-property-decorator'; import type {GenericDevices} from 'n-link-core/components/devices'; @@ -55,47 +56,47 @@ export type Device = { name: string; isCxIi: boolean; needsDrivers: boolean; inf async function downloadFile(dev: DevId | string, path: [string, number], dest: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'downloadFile', path, dest}); + await invoke('download_file', {...dev, path, dest}); } async function uploadFile(dev: DevId | string, path: string, src: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'uploadFile', path, src}); + await invoke('upload_file', {...dev, path, src}); } async function uploadOs(dev: DevId | string, src: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'uploadOs', src}); + await invoke('upload_os', {...dev, src}); } async function deleteFile(dev: DevId | string, path: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'deleteFile', path}); + await invoke('delete_file', {...dev, path}); } async function deleteDir(dev: DevId | string, path: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'deleteDir', path}); + await invoke('delete_dir', {...dev, path}); } async function createDir(dev: DevId | string, path: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'createNspireDir', path}); + await invoke('create_nspire_dir', {...dev, path}); } async function move(dev: DevId | string, src: string, dest: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'move', src, dest}); + await invoke('move_file', {...dev, src, dest}); } async function copy(dev: DevId | string, src: string, dest: string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'copy', src, dest}); + await invoke('copy', {...dev, src, dest}); } async function listDir(dev: DevId | string, path: string) { if (typeof dev === 'string') dev = stringToDev(dev); - return await promisified({...dev, cmd: 'listDir', path}) as FileInfo[]; + return await invoke('list_dir', {...dev, path}) as FileInfo[]; } async function listAll(dev: DevId | string, path: FileInfo): Promise { @@ -195,7 +196,7 @@ class Devices extends Vue implements GenericDevices { async enumerate() { this.enumerating = true; try { - for (const dev of await promisified({cmd: 'enumerate'}) as (Device & DevId)[]) { + for (const dev of await invoke('enumerate') as (Device & DevId)[]) { this.$set(this.devices, devToString(dev as DevId), dev); } } finally { @@ -205,19 +206,19 @@ class Devices extends Vue implements GenericDevices { async open(dev: DevId | string) { if (typeof dev === 'string') dev = stringToDev(dev); - const info = await promisified({...dev, cmd: 'openDevice'}); + const info = await invoke('open_device', {...dev}); this.$set(this.devices[devToString(dev)], 'info', info); } async close(dev: DevId | string) { if (typeof dev === 'string') dev = stringToDev(dev); - await promisified({...dev, cmd: 'closeDevice'}); + await invoke('close_device', {...dev}); this.$delete(this.devices[devToString(dev)], 'info'); } async update(dev: DevId | string) { if (typeof dev === 'string') dev = stringToDev(dev); - const info = await promisified({...dev, cmd: 'updateDevice'}); + const info = await invoke('update_device', {...dev}); this.$set(this.devices[devToString(dev)], 'info', info); } @@ -227,7 +228,7 @@ class Devices extends Vue implements GenericDevices { async promptUploadFiles(dev: DevId | string, path: string) { if (typeof dev !== 'string') dev = devToString(dev); - const files = await promisified({cmd: 'selectFiles', filter: ['tns']}) as string[]; + const files = await openDialog({filters:[{extensions:['tns'], name:'TNS files'}], multiple: true}); for (const src of files) { this.addToQueue(dev, {action: 'upload', path, src}); } @@ -235,14 +236,14 @@ class Devices extends Vue implements GenericDevices { async uploadOs(dev: DevId | string, filter: string) { if (typeof dev !== 'string') dev = devToString(dev); - const src = await promisified({cmd: 'selectFile', filter: [filter]}) as string | null; + const src = await openDialog({filters:[{extensions:[filter], name:'TI Nspire OS upgrade files'}]}) as string | null; if (!src) return; this.addToQueue(dev, {action: 'uploadOs', src}); } async downloadFiles(dev: DevId | string, files: [string, number][]) { if (typeof dev !== 'string') dev = devToString(dev); - const dest = await promisified({cmd: 'selectFolder'}) as string | null; + const dest = await openDialog({directory: true}) as string | null; if (!dest) return; for (const path of files) { this.addToQueue(dev, {action: 'download', path, dest}); diff --git a/desktop/src/views/Home.vue b/desktop/src/views/Home.vue index d33559b..8bbe30b 100644 --- a/desktop/src/views/Home.vue +++ b/desktop/src/views/Home.vue @@ -42,7 +42,7 @@