From b0052d2da4765a7355b8a88989472aed5f0e5490 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Wed, 15 Jun 2022 13:19:02 +0200 Subject: [PATCH] feat: pass an `AppHandle` to the callback --- Cargo.toml | 4 +- examples/vanilla/package.json | 2 +- examples/vanilla/src-tauri/Cargo.lock | 713 +++++++++++-------------- examples/vanilla/src-tauri/Cargo.toml | 4 +- examples/vanilla/src-tauri/src/main.rs | 4 +- src/lib.rs | 7 +- src/platform_impl/linux.rs | 17 +- src/platform_impl/windows.rs | 28 +- 8 files changed, 357 insertions(+), 422 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d3dfe908..c31277f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,10 +8,10 @@ rust-version = "1.57" exclude = ["/examples"] [dependencies] -tauri = { version = "1.0.0-rc.10" } +tauri = { version = "1.0.0-rc.16" } [target.'cfg(target_os = "windows")'.dependencies.windows-sys] -version = "0.35" +version = "0.36" features = [ "Win32_System_Threading", "Win32_System_DataExchange", diff --git a/examples/vanilla/package.json b/examples/vanilla/package.json index 27ac8890..cf72118b 100644 --- a/examples/vanilla/package.json +++ b/examples/vanilla/package.json @@ -9,6 +9,6 @@ "author": "", "license": "MIT", "dependencies": { - "@tauri-apps/cli": "^1.0.0-rc.0" + "@tauri-apps/cli": "^1.0.0-rc.15" } } diff --git a/examples/vanilla/src-tauri/Cargo.lock b/examples/vanilla/src-tauri/Cargo.lock index 12faf941..42655ef2 100644 --- a/examples/vanilla/src-tauri/Cargo.lock +++ b/examples/vanilla/src-tauri/Cargo.lock @@ -175,17 +175,17 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", ] [[package]] name = "attohttpc" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69e13a99a7e6e070bb114f7ff381e58c7ccc188630121fc4c2fe4bcf24cd072" +checksum = "262c3f7f5d61249d8c00e5546e2685cd15ebeeb1bc0f3cc5449350a1cb07319e" dependencies = [ "flate2", "http", @@ -211,15 +211,6 @@ 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 = "1.3.2" @@ -277,6 +268,12 @@ version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +[[package]] +name = "bytemuck" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" + [[package]] name = "byteorder" version = "1.4.3" @@ -314,7 +311,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" dependencies = [ - "glib-sys 0.15.10", + "glib-sys", "libc", "system-deps 6.0.2", ] @@ -349,16 +346,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74f89d248799e3f15f91b70917f65381062a01bb8e222700ea0e5a7ff9785f9c" 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", + "uuid 0.8.2", ] [[package]] @@ -385,12 +373,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cocoa" version = "0.24.0" @@ -422,6 +404,12 @@ dependencies = [ "objc", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "combine" version = "4.6.3" @@ -579,38 +567,14 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core 0.10.2", - "darling_macro 0.10.2", -] - [[package]] name = "darling" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[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", - "strsim 0.9.3", - "syn", + "darling_core", + "darling_macro", ] [[package]] @@ -623,30 +587,30 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", + "strsim", "syn", ] [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core 0.10.2", + "darling_core", "quote", "syn", ] [[package]] -name = "darling_macro" -version = "0.13.4" +name = "dbus" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "de0a745c25b32caa56b82a3950f5fec7893a960f4c10ca3b02060b0c38d8c2ce" dependencies = [ - "darling_core 0.13.4", - "quote", - "syn", + "libc", + "libdbus-sys", + "winapi", ] [[package]] @@ -750,12 +714,6 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6907e25393cdcc1f4f3f513d9aac1e840eb1cc341a0fccb01171f7d14d10b946" -[[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.2" @@ -1027,9 +985,9 @@ version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" dependencies = [ - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", ] @@ -1042,9 +1000,9 @@ checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "pkg-config", @@ -1058,7 +1016,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" dependencies = [ "gdk-sys", - "glib-sys 0.15.10", + "glib-sys", "libc", "system-deps 6.0.2", "x11", @@ -1119,34 +1077,21 @@ dependencies = [ "futures-channel", "futures-core", "futures-io", - "gio-sys 0.15.10", + "gio-sys", "glib", "libc", "once_cell", "thiserror", ] -[[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 = "gio-sys" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", "winapi", @@ -1164,8 +1109,8 @@ dependencies = [ "futures-executor", "futures-task", "glib-macros", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "once_cell", "smallvec", @@ -1180,23 +1125,13 @@ checksum = "dac4d47c544af67747652ab1865ace0ffa1155709723ac4f32e97587dd4735b2" dependencies = [ "anyhow", "heck 0.4.0", - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", "syn", ] -[[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 = "glib-sys" version = "0.15.10" @@ -1226,24 +1161,13 @@ dependencies = [ "regex", ] -[[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 = "gobject-sys" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" dependencies = [ - "glib-sys 0.15.10", + "glib-sys", "libc", "system-deps 6.0.2", ] @@ -1281,9 +1205,9 @@ dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "system-deps 6.0.2", @@ -1296,7 +1220,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" dependencies = [ "anyhow", - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", @@ -1349,9 +1273,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -1409,6 +1333,20 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "image" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28edd9d7bc256be2502e325ac0628bde30b7001b9b52e0abe31a1a9dc2701212" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "infer" version = "0.7.0" @@ -1436,15 +1374,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "0.4.8" @@ -1474,8 +1403,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 5.0.0", ] @@ -1494,6 +1423,20 @@ dependencies = [ "walkdir", ] +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -1544,6 +1487,15 @@ version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" +[[package]] +name = "libdbus-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" +dependencies = [ + "pkg-config", +] + [[package]] name = "lock_api" version = "0.4.7" @@ -1689,9 +1641,9 @@ dependencies = [ [[package]] name = "ndk" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" dependencies = [ "bitflags", "jni-sys", @@ -1707,39 +1659,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e3c5cc68637e21fe8f077f6a1c9e0b9ca495bb74895226b476310f613325884" [[package]] -name = "ndk-glue" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1454575120e3265d2442222299c711ace58ba417532ee4f0fc71b860016b93" -dependencies = [ - "lazy_static", - "libc", - "log", - "ndk", - "ndk-context", - "ndk-macro", - "ndk-sys", -] - -[[package]] -name = "ndk-macro" -version = "0.2.0" +name = "ndk-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" dependencies = [ - "darling 0.10.2", - "proc-macro-crate 0.1.5", - "proc-macro2", - "quote", - "syn", + "jni-sys", ] -[[package]] -name = "ndk-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -1771,12 +1698,9 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a995a3d2834cefa389218e7a35156e8ce544bc95f836900da01ee0b26a07e9d4" dependencies = [ + "dbus", "mac-notification-sys", - "serde", "winrt-notification", - "zbus", - "zvariant", - "zvariant_derive", ] [[package]] @@ -1800,6 +1724,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.14" @@ -1834,7 +1769,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1890,18 +1825,18 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "open" -version = "2.1.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9213e7b66aa06a7722828ee2980c1adff22a3922b582baaa1e62e30ca2a6c018" +checksum = "360bcc8316bf6363aa3954c3ccc4de8add167b087e0259190a043c9514f910fe" dependencies = [ "pathdiff", - "winapi", + "windows-sys 0.36.1", ] [[package]] @@ -1949,9 +1884,9 @@ dependencies = [ [[package]] name = "os_info" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "023df84d545ef479cf67fd2f4459a613585c9db4852c2fad12ab70587859d340" +checksum = "0eca3ecae1481e12c3d9379ec541b238a16f0b75c9a409942daa8ec20dbfdb62" dependencies = [ "log", "serde", @@ -1987,8 +1922,8 @@ version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" dependencies = [ - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "libc", "system-deps 6.0.2", ] @@ -2047,6 +1982,12 @@ dependencies = [ "windows-sys 0.34.0", ] +[[package]] +name = "paste" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" + [[package]] name = "pathdiff" version = "0.2.1" @@ -2233,15 +2174,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.1.3" @@ -2449,9 +2381,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "aho-corasick", "memchr", @@ -2469,9 +2401,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "remove_dir_all" @@ -2490,8 +2422,8 @@ checksum = "e7ca9214be1b6d296d4d539a31e795e556cdb43e60cbf0b77003be5b01075c13" dependencies = [ "block", "dispatch", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "gtk-sys", "js-sys", "lazy_static", @@ -2624,6 +2556,9 @@ name = "semver" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -2705,7 +2640,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12e47be9471c72889ebafb5e14d5ff930d89ae7a67bbdb5f8abb564f845a927e" dependencies = [ - "darling 0.13.4", + "darling", "proc-macro2", "quote", "syn", @@ -2816,16 +2751,30 @@ dependencies = [ "winapi", ] +[[package]] +name = "soup2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +dependencies = [ + "bitflags", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + [[package]] name = "soup2-sys" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f056675eda9a7417163e5f742bb119e8e1d385edd2ada8f7031a7230a3ec10a" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" dependencies = [ "bitflags", - "gio-sys 0.14.0", - "glib-sys 0.14.0", - "gobject-sys 0.14.0", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "system-deps 5.0.0", ] @@ -2877,43 +2826,19 @@ dependencies = [ "quote", ] -[[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strum" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" - [[package]] name = "strum" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" dependencies = [ - "strum_macros 0.22.0", -] - -[[package]] -name = "strum_macros" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn", + "strum_macros", ] [[package]] @@ -2939,24 +2864,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "system-deps" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6" -dependencies = [ - "anyhow", - "cfg-expr 0.8.1", - "heck 0.3.3", - "itertools", - "pkg-config", - "strum 0.21.0", - "strum_macros 0.21.1", - "thiserror", - "toml", - "version-compare 0.0.11", -] - [[package]] name = "system-deps" version = "5.0.0" @@ -2985,9 +2892,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.7.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6a3359088d4c4735a13f933202f4ecd91f5991b41a8eb757f2449c044ce925" +checksum = "3bfe4c782f0543f667ee3b732d026b2f1c64af39cd52e726dec1ea1f2d8f6b80" dependencies = [ "bitflags", "cairo-rs", @@ -3003,24 +2910,30 @@ dependencies = [ "gdkx11-sys", "gio", "glib", - "glib-sys 0.15.10", + "glib-sys", "gtk", + "image", "instant", + "jni 0.19.0", "lazy_static", "libc", "log", "ndk", - "ndk-glue", + "ndk-context", "ndk-sys", "objc", + "once_cell", "parking_lot 0.11.2", + "paste", + "png 0.17.5", "raw-window-handle", "scopeguard", "serde", "tao-core-video-sys", "unicode-segmentation", - "windows 0.30.0", - "windows_macros", + "uuid 0.8.2", + "windows 0.37.0", + "windows-implement", "x11-dl", ] @@ -3049,16 +2962,14 @@ dependencies = [ [[package]] name = "tauri" -version = "1.0.0-rc.6" +version = "1.0.0-rc.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d514a34b3f9a07e2002d95e1371b42a446636e3d571a59e974b21d6acf3007" +checksum = "3c7576f2ebdf713c74678345b7ea240a7456c3a3bfd400e81edce10e2d3e42f6" dependencies = [ "anyhow", "attohttpc", - "bincode", - "cfg_aliases", + "cocoa", "dirs-next", - "either", "embed_plist", "flate2", "futures", @@ -3066,10 +2977,11 @@ dependencies = [ "glib", "glob", "gtk", + "heck 0.4.0", "http", "ignore", - "memchr", "notify-rust", + "objc", "once_cell", "open", "os_info", @@ -3095,18 +3007,22 @@ dependencies = [ "thiserror", "tokio", "url", - "uuid", - "windows 0.30.0", + "uuid 1.1.2", + "webkit2gtk", + "webview2-com", + "windows 0.37.0", ] [[package]] name = "tauri-build" -version = "1.0.0-rc.5" +version = "1.0.0-rc.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede6462a4692e2fd5030497ad576264dc90eea5fa337182492e77291d45fc78b" +checksum = "f5e9c826e2107048c2e97d14522cfba8706c6051ea75386b338b42e545b61dc8" dependencies = [ "anyhow", "cargo_toml", + "heck 0.4.0", + "semver 1.0.7", "serde_json", "tauri-utils", "winres", @@ -3114,9 +3030,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.0.0-rc.4" +version = "1.0.0-rc.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54193ebdb010e85824301ce5f0940742b680d66376203f6425d549d2f32ad499" +checksum = "eba70f986da0fdb18c84b02248757e1a380809c4fa61a9f2ab4a8fa4dfe2d7ed" dependencies = [ "base64", "brotli", @@ -3125,20 +3041,21 @@ dependencies = [ "proc-macro2", "quote", "regex", + "semver 1.0.7", "serde", "serde_json", "sha2", "tauri-utils", "thiserror", - "uuid", + "uuid 1.1.2", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.0.0-rc.4" +version = "1.0.0-rc.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b867ef4703cb8e50f128ee3c941895d94c01e0ebd9007a7b45ecca52516dbf" +checksum = "7ba24b67e25134d0b26ab2980aca3dcec6954a0ac1a541d96d102acb2b6bd2f3" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -3153,15 +3070,15 @@ name = "tauri-plugin-single-instance" version = "0.0.0" dependencies = [ "tauri", - "windows-sys 0.35.0", + "windows-sys 0.36.1", "zbus", ] [[package]] name = "tauri-runtime" -version = "0.3.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b289ac8eafc52a36425fcaf3de23febd0b2606d3cce2b39ac412a1817fae537" +checksum = "3663622fade645f2bf14f4ba6aebea16a59200c9c03c315bfae03c6f36388531" dependencies = [ "gtk", "http", @@ -3171,32 +3088,35 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", - "uuid", + "uuid 1.1.2", "webview2-com", - "windows 0.30.0", + "windows 0.37.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.3.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8bf16e0476a8249aa2c75e7b49ec4c059be5fb27d9f6514e30ed327e8e9fa2" +checksum = "78e96355f2ea391c6c36c60417eea8511ec9828599d7ae0f285b62bd2a1a9cda" dependencies = [ + "cocoa", "gtk", + "percent-encoding", "rand 0.8.5", "tauri-runtime", "tauri-utils", - "uuid", + "uuid 1.1.2", + "webkit2gtk", "webview2-com", - "windows 0.30.0", + "windows 0.37.0", "wry", ] [[package]] name = "tauri-utils" -version = "1.0.0-rc.4" +version = "1.0.0-rc.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67fcf8fdd1340de4e75c01966fceab03057a8b0e97864eb39a21e420deed503" +checksum = "b09e7ec7933a833f3b64e932a9d32d94705687aa5caa3cacf43222876a6d7e24" dependencies = [ "brotli", "ctor", @@ -3205,13 +3125,14 @@ dependencies = [ "html5ever", "json-patch", "kuchiki", + "memchr", "phf 0.10.1", "proc-macro2", "quote", + "semver 1.0.7", "serde", "serde_json", "serde_with", - "serialize-to-javascript", "thiserror", "url", "walkdir", @@ -3314,13 +3235,14 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.17.0" +version = "1.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" dependencies = [ "bytes", "memchr", "num_cpus", + "once_cell", "pin-project-lite", ] @@ -3481,6 +3403,15 @@ dependencies = [ "getrandom 0.2.6", ] +[[package]] +name = "uuid" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +dependencies = [ + "getrandom 0.2.6", +] + [[package]] name = "valuable" version = "0.1.0" @@ -3618,67 +3549,68 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cbd39499e917de9dad36eb11c09f665eb984d432638ae7971feed98eb96df88" +checksum = "29952969fb5e10fe834a52eb29ad0814ccdfd8387159b0933edf1344a1c9cdcc" dependencies = [ "bitflags", "cairo-rs", "gdk", "gdk-sys", "gio", - "gio-sys 0.15.10", + "gio-sys", "glib", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "glib-sys", + "gobject-sys", "gtk", "gtk-sys", "javascriptcore-rs", "libc", "once_cell", + "soup2", "webkit2gtk-sys", ] [[package]] name = "webkit2gtk-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddcce6f1e0fc7715d651dba29875741509f5fc12f4e2976907272a74405f2b01" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" dependencies = [ "atk-sys", "bitflags", "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys 0.15.10", - "glib-sys 0.15.10", - "gobject-sys 0.15.10", + "gio-sys", + "glib-sys", + "gobject-sys", "gtk-sys", "javascriptcore-rs-sys", "libc", "pango-sys", "pkg-config", "soup2-sys", - "system-deps 5.0.0", + "system-deps 6.0.2", ] [[package]] name = "webview2-com" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8e90ac2d9ce39cdb70017aaec641be09fbdd702b7b332b9896d053eb469524" +checksum = "a489a9420acabb3c2ed0434b6f71f6b56b9485ec32665a28dec1ee186d716e0f" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.30.0", - "windows_macros", + "windows 0.37.0", + "windows-implement", ] [[package]] name = "webview2-com-macros" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515c6c82fcee93f6edaacc72c8e233dbe4ff3ca569dce1901dfc36c404a3e99" +checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" dependencies = [ "proc-macro2", "quote", @@ -3687,15 +3619,15 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92160310b3322397e4ff8a8285a7429d73a07a68fda44ee80879605b93e53f76" +checksum = "0258c53ee9adc0a4f8ba1c8c317588f7a58c7048a55b621d469ba75ab3709ca1" dependencies = [ "regex", "serde", "serde_json", "thiserror", - "windows 0.30.0", + "windows 0.37.0", "windows-bindgen", ] @@ -3757,19 +3689,6 @@ dependencies = [ "windows_x86_64_msvc 0.24.0", ] -[[package]] -name = "windows" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b749ebd2304aa012c5992d11a25d07b406bdbe5f79d371cb7a918ce501a19eb0" -dependencies = [ - "windows_aarch64_msvc 0.30.0", - "windows_i686_gnu 0.30.0", - "windows_i686_msvc 0.30.0", - "windows_x86_64_gnu 0.30.0", - "windows_x86_64_msvc 0.30.0", -] - [[package]] name = "windows" version = "0.33.0" @@ -3783,16 +3702,46 @@ dependencies = [ "windows_x86_64_msvc 0.33.0", ] +[[package]] +name = "windows" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +dependencies = [ + "windows-implement", + "windows_aarch64_msvc 0.37.0", + "windows_i686_gnu 0.37.0", + "windows_i686_msvc 0.37.0", + "windows_x86_64_gnu 0.37.0", + "windows_x86_64_msvc 0.37.0", +] + [[package]] name = "windows-bindgen" -version = "0.30.0" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bed7be31ade0af08fec9b5343e9edcc005d22b1f11859b8a59b24797f5858e8" +dependencies = [ + "windows-metadata", + "windows-tokens", +] + +[[package]] +name = "windows-implement" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "944c545fcae9dd66488308f8b69aa3ba34f53714416ecfcdcbbfa4b6821e27c6" +checksum = "67a1062e555f7d9d66fd1130ed4f7c6ec41a47529ee0850cd0e926d95b26bb14" dependencies = [ - "windows_quote", - "windows_reader", + "syn", + "windows-tokens", ] +[[package]] +name = "windows-metadata" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f33f2b90a6664e369c41ab5ff262d06f048fc9685d9bf8a0e99a47750bb0463" + [[package]] name = "windows-sys" version = "0.34.0" @@ -3808,22 +3757,22 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c700bb45cfcbdb738ce92c41fc13e512514d4eaf6a99e8c87e2260a227175c16" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc 0.35.0", - "windows_i686_gnu 0.35.0", - "windows_i686_msvc 0.35.0", - "windows_x86_64_gnu 0.35.0", - "windows_x86_64_msvc 0.35.0", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.30.0" +name = "windows-tokens" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca" +checksum = "3263d25f1170419995b78ff10c06b949e8a986c35c208dc24333c64753a87169" [[package]] name = "windows_aarch64_msvc" @@ -3839,19 +3788,15 @@ checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] -name = "windows_gen" -version = "0.30.0" +name = "windows_aarch64_msvc" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30dff4d91d22520628bb94b66f2bb313cb16a09a515a32320a84a1b449bc94c0" -dependencies = [ - "windows_quote", - "windows_reader", -] +checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" [[package]] name = "windows_i686_gnu" @@ -3859,12 +3804,6 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0866510a3eca9aed73a077490bbbf03e5eaac4e1fd70849d89539e5830501fd" -[[package]] -name = "windows_i686_gnu" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8" - [[package]] name = "windows_i686_gnu" version = "0.33.0" @@ -3879,21 +3818,21 @@ checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] -name = "windows_i686_msvc" -version = "0.24.0" +name = "windows_i686_gnu" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0ffed56b7e9369a29078d2ab3aaeceea48eb58999d2cff3aa2494a275b95c6" +checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" [[package]] name = "windows_i686_msvc" -version = "0.30.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6" +checksum = "bf0ffed56b7e9369a29078d2ab3aaeceea48eb58999d2cff3aa2494a275b95c6" [[package]] name = "windows_i686_msvc" @@ -3909,33 +3848,15 @@ checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] -name = "windows_macros" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ae44ab917e9005fe710d99d52d227ca0164b10a09be90649142cc3fab825d3" -dependencies = [ - "syn", - "windows_gen", - "windows_quote", - "windows_reader", -] - -[[package]] -name = "windows_quote" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f02c51a77e6248c1206aaa920802c32d50a05205e229b118d7f3afd3036667" - -[[package]] -name = "windows_reader" -version = "0.30.0" +name = "windows_i686_msvc" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44e6df0da993cda589c5ac852272fbb2a0ead67a031a017dd3eac11528a2d72" +checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" [[package]] name = "windows_x86_64_gnu" @@ -3943,12 +3864,6 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384a173630588044205a2993b6864a2f56e5a8c1e7668c07b93ec18cf4888dc4" -[[package]] -name = "windows_x86_64_gnu" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a" - [[package]] name = "windows_x86_64_gnu" version = "0.33.0" @@ -3963,21 +3878,21 @@ checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] -name = "windows_x86_64_msvc" -version = "0.24.0" +name = "windows_x86_64_gnu" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd8f062d8ca5446358159d79a90be12c543b3a965c847c8f3eedf14b321d399" +checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" [[package]] name = "windows_x86_64_msvc" -version = "0.30.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08cabc9f0066848fef4bc6a1c1668e6efce38b661d2aeec75d18d8617eebb5f1" +checksum = "9bd8f062d8ca5446358159d79a90be12c543b3a965c847c8f3eedf14b321d399" [[package]] name = "windows_x86_64_msvc" @@ -3993,9 +3908,15 @@ checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" -version = "0.35.0" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" +checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" [[package]] name = "winres" @@ -4012,16 +3933,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "007a0353840b23e0c6dc73e5b962ff58ed7f6bc9ceff3ce7fe6fbad8d496edf4" dependencies = [ - "strum 0.22.0", + "strum", "windows 0.24.0", "xml-rs", ] [[package]] name = "wry" -version = "0.14.0" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd09ffc86ecea0a0d5f50cc8e4a8121a1bfc0b0825a160f86ac39e86979344c" +checksum = "26b1ba327c7dd4292f46bf8e6ba8e6ec2db4443b2973c9d304a359d95e0aa856" dependencies = [ "block", "cocoa", @@ -4031,7 +3952,7 @@ dependencies = [ "glib", "gtk", "http", - "jni", + "jni 0.18.0", "libc", "log", "objc", @@ -4045,8 +3966,8 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.30.0", - "windows_macros", + "windows 0.37.0", + "windows-implement", ] [[package]] @@ -4129,7 +4050,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7174ebe6722c280d6d132d694bb5664ce50a788cb70eeb518e7fc1ca095a114" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "regex", @@ -4167,7 +4088,7 @@ version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c2cecc5a61c2a053f7f653a24cd15b3b0195d7f7ddb5042c837fb32e161fb7a" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn", diff --git a/examples/vanilla/src-tauri/Cargo.toml b/examples/vanilla/src-tauri/Cargo.toml index 0f68ed0d..5ef02633 100644 --- a/examples/vanilla/src-tauri/Cargo.toml +++ b/examples/vanilla/src-tauri/Cargo.toml @@ -10,11 +10,11 @@ rust-version = "1.57" [dependencies] serde_json = "1.0" serde = { version = "1.0", features = [ "derive" ] } -tauri = { version = "1.0.0-rc.6", features = ["api-all"] } +tauri = { version = "1.0.0-rc.16", features = ["api-all"] } tauri-plugin-single-instance = { path = "../../../" } [build-dependencies] -tauri-build = { version = "1.0.0-rc.5", features = [] } +tauri-build = { version = "1.0.0-rc.14", features = [] } [features] default = [ "custom-protocol" ] diff --git a/examples/vanilla/src-tauri/src/main.rs b/examples/vanilla/src-tauri/src/main.rs index 3ef29d9b..a6260a7f 100644 --- a/examples/vanilla/src-tauri/src/main.rs +++ b/examples/vanilla/src-tauri/src/main.rs @@ -5,8 +5,8 @@ fn main() { tauri::Builder::default() - .plugin(tauri_plugin_single_instance::init(|argv, cwd| { - println!("{argv:?}, {cwd}"); + .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| { + println!("{}, {argv:?}, {cwd}", app.package_info().name); })) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src/lib.rs b/src/lib.rs index 0221a0b4..1cc9488a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -use tauri::{plugin::TauriPlugin, Runtime}; +use tauri::{plugin::TauriPlugin, AppHandle, Runtime}; #[cfg(target_os = "windows")] #[path = "platform_impl/windows.rs"] @@ -10,9 +10,10 @@ mod platform_impl; #[path = "platform_impl/macos.rs"] mod platform_impl; -pub(crate) type SingleInstanceCallback = dyn FnMut(Vec, String) + Send + Sync + 'static; +pub(crate) type SingleInstanceCallback = + dyn FnMut(&AppHandle, Vec, String) + Send + Sync + 'static; -pub fn init, String) + Send + Sync + 'static>( +pub fn init, Vec, String) + Send + Sync + 'static>( f: F, ) -> TauriPlugin { platform_impl::init(Box::new(f)) diff --git a/src/platform_impl/linux.rs b/src/platform_impl/linux.rs index fbf743b0..752de87e 100644 --- a/src/platform_impl/linux.rs +++ b/src/platform_impl/linux.rs @@ -2,6 +2,7 @@ use crate::SingleInstanceCallback; use tauri::{ + AppHandle, plugin::{self, TauriPlugin}, Manager, RunEvent, Runtime, }; @@ -12,22 +13,26 @@ use zbus::{ struct ConnectionHandle(Connection); -struct SingleInstanceDBus { - callback: Box, +struct SingleInstanceDBus { + callback: Box>, + app_handle: AppHandle, } #[dbus_interface(name = "org.SingleInstance.DBus")] -impl SingleInstanceDBus { +impl SingleInstanceDBus { fn execute_callback(&mut self, argv: Vec, cwd: String) { - (self.callback)(argv, cwd); + (self.callback)(&self.app_handle, argv, cwd); } } -pub fn init(f: Box) -> TauriPlugin { +pub fn init(f: Box>) -> TauriPlugin { plugin::Builder::new("single-instance") .setup(|app| { let app_name = app.package_info().name.clone(); - let single_instance_dbus = SingleInstanceDBus { callback: f }; + let single_instance_dbus = SingleInstanceDBus { + callback: f, + app_handle: app.clone(), + }; let dbus_name = format!("org.{}.SingleInstance", app_name); let dbus_path = format!("/org/{}/SingleInstance", app_name); diff --git a/src/platform_impl/windows.rs b/src/platform_impl/windows.rs index dcfe8ddb..bae016e0 100644 --- a/src/platform_impl/windows.rs +++ b/src/platform_impl/windows.rs @@ -4,7 +4,7 @@ use crate::SingleInstanceCallback; use std::ffi::CStr; use tauri::{ plugin::{self, TauriPlugin}, - Manager, RunEvent, Runtime, + AppHandle, Manager, RunEvent, Runtime, }; use windows_sys::Win32::{ Foundation::{CloseHandle, GetLastError, ERROR_ALREADY_EXISTS, HWND, LPARAM, LRESULT, WPARAM}, @@ -26,7 +26,7 @@ struct TargetWindowHandle(isize); const WMCOPYDATA_SINGLE_INSTANCE_DATA: usize = 1542; -pub fn init(f: Box) -> TauriPlugin { +pub fn init(f: Box>) -> TauriPlugin { plugin::Builder::new("single-instance") .setup(|app| { let app_name = &app.package_info().name; @@ -70,8 +70,14 @@ pub fn init(f: Box) -> TauriPlugin { } else { app.manage(MutexHandle(hmutex)); - let hwnd = create_event_target_window(&class_name, &window_name); - unsafe { SetWindowLongPtrW(hwnd, GWL_USERDATA, Box::into_raw(Box::new(f)) as _) }; + let hwnd = create_event_target_window::(&class_name, &window_name); + unsafe { + SetWindowLongPtrW( + hwnd, + GWL_USERDATA, + Box::into_raw(Box::new((app.clone(), f))) as _, + ) + }; app.manage(TargetWindowHandle(hwnd)); } @@ -94,13 +100,15 @@ pub fn init(f: Box) -> TauriPlugin { .build() } -unsafe extern "system" fn single_instance_window_proc( +unsafe extern "system" fn single_instance_window_proc( hwnd: HWND, msg: u32, wparam: WPARAM, lparam: LPARAM, ) -> LRESULT { - let callback_ptr = GetWindowLongPtrW(hwnd, GWL_USERDATA) as *mut Box; + let data_ptr = GetWindowLongPtrW(hwnd, GWL_USERDATA) + as *mut (AppHandle, Box>); + let (app_handle, callback) = &mut *data_ptr; match msg { WM_COPYDATA => { @@ -110,25 +118,25 @@ unsafe extern "system" fn single_instance_window_proc( let mut s = data.split("|"); let cwd = s.next().unwrap(); let args = s.into_iter().map(|s| s.to_string()).collect(); - (*callback_ptr)(args, cwd.to_string()); + callback(&app_handle, args, cwd.to_string()); } 1 } WM_DESTROY => { - let _ = Box::from_raw(callback_ptr); + let _ = Box::from_raw(data_ptr); 0 } _ => DefWindowProcW(hwnd, msg, wparam, lparam), } } -fn create_event_target_window(class_name: &str, window_name: &str) -> HWND { +fn create_event_target_window(class_name: &str, window_name: &str) -> HWND { unsafe { let class = WNDCLASSEXW { cbSize: std::mem::size_of::() as u32, style: 0, - lpfnWndProc: Some(single_instance_window_proc), + lpfnWndProc: Some(single_instance_window_proc::), cbClsExtra: 0, cbWndExtra: 0, hInstance: GetModuleHandleW(std::ptr::null()),