From d800c22399ca3e0d28dfe5a92ac9fffa92961dc4 Mon Sep 17 00:00:00 2001 From: Chad Brokaw Date: Fri, 26 Jan 2024 12:22:18 -0500 Subject: [PATCH 01/17] Update vello and parley deps... (#165) * Update vello and parley deps... ... and everything else, apparently. This pushes the new font code changes through the ecosystem. Brings everything into sync and should put us in a good place to start releasing. This works as is but depends on a vello commit that is still under review: linebender/vello#425 should land first and this should be updated with the new git rev before merging. * fmt :( * update git revs --- Cargo.lock | 386 ++++++++++++++++++------------- Cargo.toml | 12 +- src/app.rs | 6 +- src/app_main.rs | 12 +- src/id.rs | 2 +- src/text.rs | 59 +++-- src/widget/button.rs | 8 +- src/widget/piet_scene_helpers.rs | 6 +- src/widget/text.rs | 10 +- 9 files changed, 280 insertions(+), 221 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c9690a1a..78c00d714 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,24 +4,24 @@ version = 3 [[package]] name = "accesskit" -version = "0.11.2" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" +checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea" [[package]] name = "accesskit_consumer" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04bb4d9e4772fe0d47df57d0d5dbe5d85dd05e2f37ae1ddb6b105e76be58fb00" +checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" dependencies = [ "accesskit", ] [[package]] name = "accesskit_macos" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134d0acf6acb667c89d3332999b1a5df4edbc8d6113910f392ebb73f2b03bb56" +checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" dependencies = [ "accesskit", "accesskit_consumer", @@ -31,15 +31,15 @@ dependencies = [ [[package]] name = "accesskit_windows" -version = "0.14.3" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eac0a7f2d7cd7a93b938af401d3d8e8b7094217989a7c25c55a953023436e31" +checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" dependencies = [ "accesskit", "accesskit_consumer", - "arrayvec", "once_cell", "paste", + "static_assertions", "windows 0.48.0", ] @@ -198,7 +198,7 @@ dependencies = [ "polling", "rustix", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] @@ -737,6 +737,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -783,11 +789,15 @@ dependencies = [ ] [[package]] -name = "fello" -version = "0.1.0" -source = "git+https://github.com/dfrg/fount?rev=dadbcf75695f035ca46766bfd60555d05bd421b1#dadbcf75695f035ca46766bfd60555d05bd421b1" +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "read-fonts", + "futures-core", + "futures-sink", + "nanorand", + "spin", ] [[package]] @@ -798,9 +808,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-types" -version = "0.3.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6978d65d61022aa249fefdd914dc8215757f617f1a697c496ef6b42013366567" +checksum = "0bd7f3ea17572640b606b35df42cfb6ecdf003704b062580e59918692190b73d" [[package]] name = "foreign-types" @@ -853,14 +863,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fount" -version = "0.1.0" -source = "git+https://github.com/jneem/fount?rev=361c76fecf813ebc64d2634d3df7bfb6089c6414#361c76fecf813ebc64d2634d3df7bfb6089c6414" -dependencies = [ - "swash", -] - [[package]] name = "futures" version = "0.3.28" @@ -1003,8 +1005,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1013,10 +1017,21 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glazier" version = "0.1.0" -source = "git+https://github.com/linebender/glazier?rev=19a01ba8a97f15bf499ac64e6ea9690d7390deb5#19a01ba8a97f15bf499ac64e6ea9690d7390deb5" +source = "git+https://github.com/linebender/glazier?rev=ec7e0c5fafd5c106c4c67831bc829572958c671c#ec7e0c5fafd5c106c4c67831bc829572958c671c" dependencies = [ "accesskit", "accesskit_macos", @@ -1033,7 +1048,7 @@ dependencies = [ "instant", "js-sys", "keyboard-types", - "kurbo 0.9.5", + "kurbo 0.10.4", "lazy_static", "memchr", "nix 0.25.1", @@ -1105,9 +1120,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -1115,6 +1130,15 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "gpu-alloc" version = "0.6.0" @@ -1136,15 +1160,16 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad" dependencies = [ "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows 0.51.1", ] [[package]] @@ -1155,7 +1180,7 @@ checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" dependencies = [ "bitflags 1.3.2", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1192,6 +1217,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "hassle-rs" version = "0.10.0" @@ -1257,7 +1288,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", ] [[package]] @@ -1321,15 +1362,21 @@ dependencies = [ [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.0", "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kurbo" version = "0.9.5" @@ -1372,9 +1419,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -1475,9 +1522,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ "bitflags 2.3.3", "block", @@ -1505,9 +1552,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1516,15 +1563,15 @@ dependencies = [ [[package]] name = "naga" -version = "0.13.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" +checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e" dependencies = [ "bit-set", "bitflags 2.3.3", "codespan-reporting", "hexf-parse", - "indexmap", + "indexmap 2.1.0", "log", "num-traits", "rustc-hash", @@ -1534,6 +1581,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + [[package]] name = "nix" version = "0.25.1" @@ -1686,15 +1742,15 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.0", + "windows-targets", ] [[package]] name = "parley" -version = "0.1.0" -source = "git+https://github.com/dfrg/parley?rev=2371bf4b702ec91edee2d58ffb2d432539580e1e#2371bf4b702ec91edee2d58ffb2d432539580e1e" +version = "0.0.1" +source = "git+https://github.com/dfrg/parley?rev=cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9#cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9" dependencies = [ - "fount", + "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0)", "swash", ] @@ -1722,9 +1778,9 @@ dependencies = [ [[package]] name = "peniko" version = "0.1.0" -source = "git+https://github.com/linebender/peniko?rev=cafdac9a211a0fb2fec5656bd663d1ac770bcc81#cafdac9a211a0fb2fec5656bd663d1ac770bcc81" +source = "git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0#8717635681dedfab3e9f3741fcbc7f3318a82ff0" dependencies = [ - "kurbo 0.9.5", + "kurbo 0.10.4", "smallvec", ] @@ -1736,9 +1792,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1774,6 +1830,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "prettyplease" version = "0.2.12" @@ -1871,9 +1933,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "read-fonts" -version = "0.10.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d08214643b2df95b0b3955cd9f264bcfab22b73470b83df4992df523b4d6eb" +checksum = "7555e052e772f964a1c99f1434f6a2c3a47a5f8e4292236921f121a7753cb2b5" dependencies = [ "font-types", ] @@ -2051,6 +2113,15 @@ dependencies = [ "libc", ] +[[package]] +name = "skrifa" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2a68d7915f596ffbf03d30a497a91e951d16b1cb340662ab441c4b58c84e05" +dependencies = [ + "read-fonts", +] + [[package]] name = "slab" version = "0.4.8" @@ -2107,6 +2178,25 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "spirv" version = "0.2.0+1.5.4" @@ -2142,7 +2232,8 @@ dependencies = [ [[package]] name = "swash" version = "0.1.8" -source = "git+https://github.com/dfrg/swash#56ea551ac49e51580c466f03d6c75252a8c8e700" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7c73c813353c347272919aa1af2885068b05e625e5532b43049e4f641ae77f" dependencies = [ "yazi", "zeno", @@ -2276,11 +2367,11 @@ dependencies = [ [[package]] name = "tokio" -version = "1.28.2" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -2288,16 +2379,16 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", @@ -2316,7 +2407,7 @@ version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ - "indexmap", + "indexmap 1.9.3", "toml_datetime", "winnow", ] @@ -2452,13 +2543,14 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vello" version = "0.0.1" -source = "git+https://github.com/linebender/vello?rev=9d7c4f00d8db420337706771a37937e9025e089c#9d7c4f00d8db420337706771a37937e9025e089c" +source = "git+https://github.com/linebender/vello?rev=944ce63d8ff40d01f3dbbb7be096feaf6c3657fa#944ce63d8ff40d01f3dbbb7be096feaf6c3657fa" dependencies = [ "bytemuck", - "fello", "futures-intrusive", - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=cafdac9a211a0fb2fec5656bd663d1ac770bcc81)", + "kurbo 0.10.4", + "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0)", "raw-window-handle", + "skrifa", "vello_encoding", "wgpu", ] @@ -2466,12 +2558,12 @@ dependencies = [ [[package]] name = "vello_encoding" version = "0.1.0" -source = "git+https://github.com/linebender/vello?rev=9d7c4f00d8db420337706771a37937e9025e089c#9d7c4f00d8db420337706771a37937e9025e089c" +source = "git+https://github.com/linebender/vello?rev=944ce63d8ff40d01f3dbbb7be096feaf6c3657fa#944ce63d8ff40d01f3dbbb7be096feaf6c3657fa" dependencies = [ "bytemuck", - "fello", "guillotiere", - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=cafdac9a211a0fb2fec5656bd663d1ac770bcc81)", + "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0)", + "skrifa", ] [[package]] @@ -2656,12 +2748,13 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce" +checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24" dependencies = [ "arrayvec", "cfg-if", + "flume", "js-sys", "log", "naga", @@ -2680,9 +2773,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2" +checksum = "ef91c1d62d1e9e81c79e600131a258edf75c9531cbdbde09c44a011a47312726" dependencies = [ "arrayvec", "bit-vec", @@ -2703,9 +2796,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101" +checksum = "b84ecc802da3eb67b4cf3dd9ea6fe45bbb47ef13e6c49c5c3240868a9cc6cdd9" dependencies = [ "android_system_properties", "arrayvec", @@ -2716,6 +2809,7 @@ dependencies = [ "core-graphics-types", "d3d12", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -2728,6 +2822,7 @@ dependencies = [ "metal", "naga", "objc", + "once_cell", "parking_lot", "profiling", "range-alloc", @@ -2744,9 +2839,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd" dependencies = [ "bitflags 2.3.3", "js-sys", @@ -2812,22 +2907,32 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.42.2", + "windows-implement", + "windows-interface", + "windows-targets", ] [[package]] name = "windows" -version = "0.48.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-implement", - "windows-interface", - "windows-targets 0.48.0", + "windows-core", + "windows-targets", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets", ] [[package]] @@ -2858,122 +2963,65 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" @@ -3065,6 +3113,12 @@ dependencies = [ "xilem_core", ] +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + [[package]] name = "yazi" version = "0.1.6" diff --git a/Cargo.toml b/Cargo.toml index 1ffa1057d..755551e9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,19 +49,19 @@ taffy = ["dep:taffy"] [dependencies] xilem_core.workspace = true taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "7781c70241f7f572130c13106f2a869a9cf80885", optional = true } -vello = { git = "https://github.com/linebender/vello", rev = "9d7c4f00d8db420337706771a37937e9025e089c" } -wgpu = "0.17.0" -parley = { git = "https://github.com/dfrg/parley", rev = "2371bf4b702ec91edee2d58ffb2d432539580e1e" } -tokio = { version = "1.21", features = ["full"] } +vello = { git = "https://github.com/linebender/vello", rev = "944ce63d8ff40d01f3dbbb7be096feaf6c3657fa" } +wgpu = "0.18.0" +parley = { git = "https://github.com/dfrg/parley", rev = "cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9" } +tokio = { version = "1.35", features = ["full"] } futures-task = "0.3" bitflags = "2" tracing = "0.1.37" -accesskit = "0.11" +accesskit = "0.12" fnv = "1.0.7" [dependencies.glazier] git = "https://github.com/linebender/glazier" -rev = "19a01ba8a97f15bf499ac64e6ea9690d7390deb5" +rev = "ec7e0c5fafd5c106c4c67831bc829572958c671c" default-features = false features = ["accesskit"] diff --git a/src/app.rs b/src/app.rs index 1e9d55751..82c20a336 100644 --- a/src/app.rs +++ b/src/app.rs @@ -198,7 +198,11 @@ where } pub fn accessibility(&mut self) -> TreeUpdate { - let mut update = TreeUpdate::default(); + let mut update = TreeUpdate { + nodes: vec![], + tree: None, + focus: accesskit::NodeId(0), + }; self.ensure_root(); let root_pod = self.root_pod.as_mut().unwrap(); let mut window_node_builder = accesskit::NodeBuilder::new(accesskit::Role::Window); diff --git a/src/app_main.rs b/src/app_main.rs index ebcbae4ff..19fbce7a9 100644 --- a/src/app_main.rs +++ b/src/app_main.rs @@ -23,7 +23,7 @@ use vello::{ kurbo::{Affine, Size}, peniko::Color, util::{RenderContext, RenderSurface}, - RenderParams, Renderer, RendererOptions, + AaSupport, RenderParams, Renderer, RendererOptions, }; use vello::{Scene, SceneBuilder}; @@ -230,15 +230,21 @@ where let queue = &self.render_cx.devices[dev_id].queue; let renderer_options = RendererOptions { surface_format: Some(surface.format), - timestamp_period: queue.get_timestamp_period(), + use_cpu: false, + antialiasing_support: AaSupport { + area: true, + msaa8: false, + msaa16: false, + }, }; let render_params = RenderParams { base_color: Color::BLACK, width, height, + antialiasing_method: vello::AaConfig::Area, }; self.renderer - .get_or_insert_with(|| Renderer::new(device, &renderer_options).unwrap()) + .get_or_insert_with(|| Renderer::new(device, renderer_options).unwrap()) .render_to_surface(device, queue, &self.scene, &surface_texture, &render_params) .expect("failed to render to surface"); surface_texture.present(); diff --git a/src/id.rs b/src/id.rs index 8f8d2bac0..8c1bc310a 100644 --- a/src/id.rs +++ b/src/id.rs @@ -49,6 +49,6 @@ impl Id { impl From for accesskit::NodeId { fn from(id: Id) -> accesskit::NodeId { - id.to_nonzero_raw().into() + accesskit::NodeId(id.to_nonzero_raw().into()) } } diff --git a/src/text.rs b/src/text.rs index 5b1a3cc36..dc25955f0 100644 --- a/src/text.rs +++ b/src/text.rs @@ -1,24 +1,11 @@ use parley::Layout; -use vello::kurbo::Affine; use vello::{ - glyph::{fello::raw::FontRef, GlyphContext}, - peniko::{Brush, Color}, - *, + kurbo::Affine, + peniko::{Brush, Fill}, + SceneBuilder, }; -#[derive(Clone, PartialEq, Debug)] -pub struct ParleyBrush(pub Brush); - -impl Default for ParleyBrush { - fn default() -> ParleyBrush { - ParleyBrush(Brush::Solid(Color::rgb8(0, 0, 0))) - } -} - -impl parley::style::Brush for ParleyBrush {} - -pub fn render_text(builder: &mut SceneBuilder, transform: Affine, layout: &Layout) { - let mut gcx = GlyphContext::new(); +pub fn render_text(builder: &mut SceneBuilder, transform: Affine, layout: &Layout) { for line in layout.lines() { for glyph_run in line.glyph_runs() { let mut x = glyph_run.offset(); @@ -26,22 +13,32 @@ pub fn render_text(builder: &mut SceneBuilder, transform: Affine, layout: &Layou let run = glyph_run.run(); let font = run.font(); let font_size = run.font_size(); - let font_ref = font.as_ref(); - if let Ok(font_ref) = FontRef::from_index(font_ref.data, font.index()) { - let style = glyph_run.style(); - let vars: [(&str, f32); 0] = []; - let mut gp = gcx.new_provider(&font_ref, None, font_size, false, vars); - for glyph in glyph_run.glyphs() { - if let Some(fragment) = gp.get(glyph.id, Some(&style.brush.0)) { + let font = vello::peniko::Font::new(font.data().0.clone(), font.index()); + let style = glyph_run.style(); + let coords = run + .normalized_coords() + .iter() + .map(|coord| vello::skrifa::instance::NormalizedCoord::from_bits(*coord)) + .collect::>(); + builder + .draw_glyphs(&font) + .brush(&style.brush) + .transform(transform) + .font_size(font_size) + .normalized_coords(&coords) + .draw( + Fill::NonZero, + glyph_run.glyphs().map(|glyph| { let gx = x + glyph.x; let gy = y - glyph.y; - let xform = Affine::translate((gx as f64, gy as f64)) - * Affine::scale_non_uniform(1.0, -1.0); - builder.append(&fragment, Some(transform * xform)); - } - x += glyph.advance; - } - } + x += glyph.advance; + vello::glyph::Glyph { + id: glyph.id as _, + x: gx, + y: gy, + } + }), + ); } } } diff --git a/src/widget/button.rs b/src/widget/button.rs index 2c8708d9c..77aee2276 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -21,7 +21,7 @@ use vello::{ SceneBuilder, }; -use crate::{text::ParleyBrush, IdPath, Message}; +use crate::{IdPath, Message}; use super::{ contexts::LifeCycleCx, @@ -33,7 +33,7 @@ use super::{ pub struct Button { id_path: IdPath, label: String, - layout: Option>, + layout: Option>, } impl Button { @@ -96,8 +96,8 @@ impl Widget for Button { let mut lcx = parley::LayoutContext::new(); let mut layout_builder = lcx.ranged_builder(cx.font_cx(), &self.label, 1.0); - layout_builder.push_default(&parley::style::StyleProperty::Brush(ParleyBrush( - Brush::Solid(Color::rgb8(0xf0, 0xf0, 0xea)), + layout_builder.push_default(&parley::style::StyleProperty::Brush(Brush::Solid( + Color::rgb8(0xf0, 0xf0, 0xea), ))); let mut layout = layout_builder.build(); // Question for Chad: is this needed? diff --git a/src/widget/piet_scene_helpers.rs b/src/widget/piet_scene_helpers.rs index 9e80a7aac..90ad49325 100644 --- a/src/widget/piet_scene_helpers.rs +++ b/src/widget/piet_scene_helpers.rs @@ -1,5 +1,5 @@ -use vello::kurbo::{self, Affine, Rect, Shape}; -use vello::peniko::{BrushRef, Color, ColorStopsSource, Fill, Gradient, Stroke}; +use vello::kurbo::{self, Affine, Rect, Shape, Stroke}; +use vello::peniko::{BrushRef, Color, ColorStopsSource, Fill, Gradient}; use vello::SceneBuilder; #[derive(Debug, Clone, Copy)] @@ -15,7 +15,7 @@ pub fn stroke<'b>( stroke_width: f64, ) { builder.stroke( - &Stroke::new(stroke_width as f32), + &Stroke::new(stroke_width), Affine::IDENTITY, brush, None, diff --git a/src/widget/text.rs b/src/widget/text.rs index e0ebe0f04..d4e270953 100644 --- a/src/widget/text.rs +++ b/src/widget/text.rs @@ -20,8 +20,6 @@ use vello::{ SceneBuilder, }; -use crate::text::ParleyBrush; - use super::{ contexts::LifeCycleCx, BoxConstraints, ChangeFlags, Event, EventCx, LayoutCx, LifeCycle, PaintCx, UpdateCx, Widget, @@ -29,7 +27,7 @@ use super::{ pub struct TextWidget { text: Cow<'static, str>, - layout: Option>, + layout: Option>, } impl TextWidget { @@ -43,13 +41,13 @@ impl TextWidget { ChangeFlags::LAYOUT | ChangeFlags::PAINT } - fn get_layout_mut(&mut self, font_cx: &mut FontContext) -> &mut Layout { + fn get_layout_mut(&mut self, font_cx: &mut FontContext) -> &mut Layout { // Ensure Parley layout is initialised if self.layout.is_none() { let mut lcx = parley::LayoutContext::new(); let mut layout_builder = lcx.ranged_builder(font_cx, &self.text, 1.0); - layout_builder.push_default(&parley::style::StyleProperty::Brush(ParleyBrush( - Brush::Solid(Color::rgb8(255, 255, 255)), + layout_builder.push_default(&parley::style::StyleProperty::Brush(Brush::Solid( + Color::rgb8(255, 255, 255), ))); self.layout = Some(layout_builder.build()); } From cd18622d3d389d830fa59a767767d45ba3093bd7 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Tue, 6 Feb 2024 21:19:02 -0500 Subject: [PATCH 02/17] Fix compilation with nightly toolchain. (#167) --- Cargo.lock | 1198 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 717 insertions(+), 481 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78c00d714..6822681d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,9 +45,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -60,24 +60,31 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ - "getrandom", + "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -89,21 +96,21 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arrayvec" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "as-raw-xcb-connection" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5f312b0a56c5cdf967c0aeb67f6289603354951683bc97ddc595ab974ba9aa" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "ash" @@ -138,47 +145,72 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ - "event-listener", + "event-listener 2.5.3", "futures-core", ] [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.3", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.5.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock", + "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand", - "futures-lite", + "fastrand 2.0.1", + "futures-lite 2.2.0", "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.1.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.1", + "async-lock 3.3.0", "blocking", - "futures-lite", + "futures-lite 2.2.0", "once_cell", ] @@ -188,38 +220,103 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix", + "polling 2.8.0", + "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.4.0", + "rustix 0.38.31", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.31", + "windows-sys 0.48.0", ] [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", +] + +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.3.1", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.31", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", ] [[package]] @@ -228,15 +325,15 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -250,26 +347,26 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" @@ -279,9 +376,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -298,7 +395,7 @@ version = "0.66.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", @@ -311,7 +408,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.25", + "syn 2.0.48", "which", ] @@ -338,9 +435,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block" @@ -378,56 +475,57 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.1", + "async-lock 3.3.0", "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "log", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.2.0", + "piper", + "tracing", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" @@ -445,9 +543,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cexpr" @@ -466,13 +567,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading 0.8.1", ] [[package]] @@ -486,22 +587,21 @@ dependencies = [ "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types 0.5.0", + "foreign-types", "libc", "objc", ] [[package]] name = "cocoa-foundation" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" dependencies = [ "bitflags 1.3.2", "block", "core-foundation", "core-graphics-types", - "foreign-types 0.3.2", "libc", "objc", ] @@ -524,9 +624,9 @@ checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -543,9 +643,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -553,9 +653,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" @@ -566,19 +666,18 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types 0.5.0", + "foreign-types", "libc", ] [[package]] name = "core-graphics-types" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", "core-foundation", - "foreign-types 0.3.2", "libc", ] @@ -604,21 +703,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -636,8 +732,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" dependencies = [ - "bitflags 2.3.3", - "libloading 0.8.0", + "bitflags 2.4.2", + "libloading 0.8.1", "winapi", ] @@ -662,33 +758,13 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dlib" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.0", + "libloading 0.8.1", ] [[package]] @@ -699,15 +775,15 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", "serde", @@ -715,20 +791,20 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -745,23 +821,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -779,6 +844,38 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -788,6 +885,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "flume" version = "0.11.0" @@ -812,15 +915,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bd7f3ea17572640b606b35df42cfb6ecdf003704b062580e59918692190b73d" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - [[package]] name = "foreign-types" version = "0.5.0" @@ -828,7 +922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared 0.3.1", + "foreign-types-shared", ] [[package]] @@ -839,15 +933,9 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -856,18 +944,18 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -880,9 +968,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -890,15 +978,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -918,9 +1006,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -928,7 +1016,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -937,34 +1025,47 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1000,9 +1101,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -1013,9 +1114,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gl_generator" @@ -1039,7 +1140,7 @@ dependencies = [ "anyhow", "ashpd", "bindgen", - "bitflags 2.3.3", + "bitflags 2.4.2", "block", "cfg-if", "cocoa", @@ -1145,7 +1246,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "gpu-alloc-types", ] @@ -1155,7 +1256,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", ] [[package]] @@ -1174,22 +1275,22 @@ dependencies = [ [[package]] name = "gpu-descriptor" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "gpu-descriptor-types", - "hashbrown 0.12.3", + "hashbrown", ] [[package]] name = "gpu-descriptor-types" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", ] [[package]] @@ -1210,19 +1311,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - [[package]] name = "hassle-rs" version = "0.10.0" @@ -1240,18 +1336,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -1265,6 +1352,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "humantime" version = "2.1.0" @@ -1273,9 +1369,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1283,22 +1379,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.1.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1319,34 +1405,33 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys", + "hermit-abi", + "rustix 0.38.31", + "windows-sys 0.52.0", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1357,7 +1442,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", ] [[package]] @@ -1367,7 +1452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.0", + "libloading 0.8.1", "pkg-config", ] @@ -1419,9 +1504,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -1435,12 +1520,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1449,11 +1534,17 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1461,9 +1552,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] @@ -1489,9 +1580,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -1520,16 +1611,25 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "block", "core-graphics-types", - "foreign-types 0.5.0", + "foreign-types", "log", "objc", "paste", @@ -1543,9 +1643,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -1558,7 +1658,7 @@ checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1568,10 +1668,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e" dependencies = [ "bit-set", - "bitflags 2.3.3", + "bitflags 2.4.2", "codespan-reporting", "hexf-parse", - "indexmap 2.1.0", + "indexmap", "log", "num-traits", "rustc-hash", @@ -1606,15 +1706,14 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", - "static_assertions", ] [[package]] @@ -1629,20 +1728,20 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] @@ -1664,9 +1763,9 @@ checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" [[package]] name = "objc2" -version = "0.3.0-beta.3" +version = "0.3.0-beta.3.patch-leaks.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe31e5425d3d0b89a15982c024392815da40689aceb34bad364d58732bcfd649" +checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" dependencies = [ "block2", "objc-sys", @@ -1693,18 +1792,18 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "ordered-stream" @@ -1718,9 +1817,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1734,15 +1833,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -1756,9 +1855,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "peeking_take_while" @@ -1786,9 +1885,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" @@ -1802,11 +1901,22 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "polling" @@ -1821,7 +1931,21 @@ dependencies = [ "libc", "log", "pin-project-lite", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -1838,12 +1962,12 @@ checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" [[package]] name = "prettyplease" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] @@ -1858,18 +1982,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.8" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" +checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" [[package]] name = "quick-xml" @@ -1882,9 +2006,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1933,47 +2057,39 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "read-fonts" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7555e052e772f964a1c99f1434f6a2c3a47a5f8e4292236921f121a7753cb2b5" +checksum = "a1362980db95801b70031dd592dc052a44b1810ca9da8fbcf7b25983f3174ed0" dependencies = [ "font-types", ] [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] -name = "redox_users" -version = "0.4.3" +name = "regex" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ - "getrandom", - "redox_syscall 0.2.16", - "thiserror", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "regex" -version = "1.8.4" +name = "regex-automata" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1982,9 +2098,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "renderdoc-sys" @@ -2006,23 +2122,36 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", - "windows-sys", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "scoped-tls" @@ -2032,35 +2161,35 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.170" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56657f512baabca8f840542f9ca8152aecf182c473c26e46e58d6aab4f6e439" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.170" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d477848e6b23adba0db397777d5aad864555bc17fd9c89abb3b8009788b7b8" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2069,20 +2198,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2091,18 +2220,18 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" @@ -2115,36 +2244,36 @@ dependencies = [ [[package]] name = "skrifa" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2a68d7915f596ffbf03d30a497a91e951d16b1cb340662ab441c4b58c84e05" +checksum = "eff28ee3b66d43060ef9a327e0f18e4c1813f194120156b4d4524fac3ba8ce22" dependencies = [ "read-fonts", ] [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay-client-toolkit" @@ -2158,7 +2287,7 @@ dependencies = [ "lazy_static", "log", "memmap2", - "nix 0.26.2", + "nix 0.26.4", "thiserror", "wayland-backend", "wayland-client", @@ -2170,9 +2299,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -2185,7 +2314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2231,10 +2360,11 @@ dependencies = [ [[package]] name = "swash" -version = "0.1.8" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7c73c813353c347272919aa1af2885068b05e625e5532b43049e4f641ae77f" +checksum = "d06ff4664af8923625604261c645f5c4cc610cc83c84bec74b50d76237089de7" dependencies = [ + "read-fonts", "yazi", "zeno", ] @@ -2252,9 +2382,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2274,56 +2404,64 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.6.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ - "autocfg", "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys", + "fastrand 2.0.1", + "rustix 0.38.31", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "test-log" -version = "0.2.12" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +dependencies = [ + "env_logger", + "test-log-macros", +] + +[[package]] +name = "test-log-macros" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9601d162c1d77e62c1ea0bc8116cd1caf143ce3af947536c3c9052a1677fe0c" +checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] @@ -2367,9 +2505,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2381,7 +2519,7 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.5", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2392,33 +2530,32 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 1.9.3", + "indexmap", "toml_datetime", "winnow", ] [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2427,29 +2564,29 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "sharded-slab", "thread_local", @@ -2469,31 +2606,32 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uds_windows" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ + "memoffset 0.9.0", "tempfile", "winapi", ] [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -2506,9 +2644,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -2518,9 +2656,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2530,9 +2668,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" [[package]] name = "vec_map" @@ -2574,9 +2712,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "wasi" @@ -2586,9 +2724,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2596,24 +2734,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -2623,9 +2761,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2633,22 +2771,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wayland-backend" @@ -2659,7 +2797,7 @@ dependencies = [ "cc", "downcast-rs", "io-lifetimes", - "nix 0.26.2", + "nix 0.26.4", "scoped-tls", "smallvec", "wayland-sys", @@ -2673,7 +2811,7 @@ checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" dependencies = [ "bitflags 1.3.2", "calloop", - "nix 0.26.2", + "nix 0.26.4", "wayland-backend", "wayland-scanner", ] @@ -2684,7 +2822,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0c3a0d5b4b688b07b0442362d3ed6bf04724fcc16cd69ab6285b90dbc487aa" dependencies = [ - "nix 0.26.2", + "nix 0.26.4", "wayland-client", "xcursor", ] @@ -2779,7 +2917,7 @@ checksum = "ef91c1d62d1e9e81c79e600131a258edf75c9531cbdbde09c44a011a47312726" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.3.3", + "bitflags 2.4.2", "codespan-reporting", "log", "naga", @@ -2804,7 +2942,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags 2.3.3", + "bitflags 2.4.2", "block", "core-graphics-types", "d3d12", @@ -2817,7 +2955,7 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.0", + "libloading 0.8.1", "log", "metal", "naga", @@ -2843,20 +2981,21 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "js-sys", "web-sys", ] [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.31", ] [[package]] @@ -2883,9 +3022,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2913,7 +3052,7 @@ checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ "windows-implement", "windows-interface", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -2923,7 +3062,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ "windows-core", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -2932,7 +3071,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -2963,7 +3102,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -2972,13 +3120,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2987,47 +3150,89 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] @@ -3050,7 +3255,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "nix 0.26.2", + "nix 0.26.4", "winapi", "winapi-wsapoll", "x11rb-protocol", @@ -3062,16 +3267,23 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" dependencies = [ - "nix 0.26.2", + "nix 0.26.4", ] [[package]] name = "xcursor" -version = "0.3.4" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" + +[[package]] +name = "xdg-home" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" +checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" dependencies = [ - "nom", + "libc", + "winapi", ] [[package]] @@ -3079,7 +3291,7 @@ name = "xilem" version = "0.1.0" dependencies = [ "accesskit", - "bitflags 2.3.3", + "bitflags 2.4.2", "env_logger", "fnv", "futures-task", @@ -3102,7 +3314,7 @@ version = "0.1.0" name = "xilem_web" version = "0.1.0" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "gloo", "kurbo 0.9.5", "log", @@ -3127,27 +3339,29 @@ checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" [[package]] name = "zbus" -version = "3.10.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f770930448dd412a4a7131dd968a8e6df0064db4d7916fbbd2d6c3f26b566938" +checksum = "c45d06ae3b0f9ba1fb2671268b975557d8f5a84bb5ec6e43964f87e763d8bca8" dependencies = [ "async-broadcast", "async-executor", - "async-io", - "async-lock", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process", "async-recursion", "async-task", "async-trait", + "blocking", "byteorder", "derivative", - "dirs", "enumflags2", - "event-listener", + "event-listener 2.5.3", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.25.1", + "nix 0.26.4", "once_cell", "ordered-stream", "rand", @@ -3158,6 +3372,7 @@ dependencies = [ "tracing", "uds_windows", "winapi", + "xdg-home", "zbus_macros", "zbus_names", "zvariant", @@ -3165,22 +3380,23 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.10.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4832059b438689017db7340580ebabba07f114eab91bf990c6e55052408b40d8" +checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", "regex", "syn 1.0.109", + "zvariant_utils", ] [[package]] name = "zbus_names" -version = "2.5.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82441e6033be0a741157a72951a3e4957d519698f3a824439cc131c5ba77ac2a" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" dependencies = [ "serde", "static_assertions", @@ -3189,15 +3405,35 @@ dependencies = [ [[package]] name = "zeno" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701" +checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] [[package]] name = "zvariant" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622cc473f10cef1b0d73b7b34a266be30ebdcfaea40ec297dd8cbda088f9f93c" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" dependencies = [ "byteorder", "enumflags2", @@ -3210,9 +3446,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d9c1b57352c25b778257c661f3c4744b7cefb7fc09dd46909a153cce7773da2" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ "proc-macro-crate", "proc-macro2", From 0bfd6ffb427e1f77ef8ab8c0e28ccbfa9b1a5a68 Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Tue, 6 Feb 2024 21:34:31 -0500 Subject: [PATCH 03/17] Remove unnecessary Glazier dependencies. (#166) --- src/id.rs | 9 ++++++--- src/widget/switch.rs | 3 +-- src/widget/taffy_layout.rs | 9 +++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/id.rs b/src/id.rs index 8c1bc310a..77ab6ead2 100644 --- a/src/id.rs +++ b/src/id.rs @@ -21,9 +21,12 @@ pub struct Id(NonZeroU64); impl Id { /// Allocate a new, unique `Id`. pub fn next() -> Id { - use glazier::Counter; - static WIDGET_ID_COUNTER: Counter = Counter::new(); - Id(WIDGET_ID_COUNTER.next_nonzero()) + use std::sync::atomic::{AtomicU64, Ordering}; + static WIDGET_ID_COUNTER: AtomicU64 = AtomicU64::new(1); + Id(WIDGET_ID_COUNTER + .fetch_add(1, Ordering::Relaxed) + .try_into() + .unwrap()) } #[allow(unused)] diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 29af1f4aa..1dd585a79 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use glazier::kurbo::Circle; use vello::{ - kurbo::{Point, Size}, + kurbo::{Circle, Point, Size}, peniko::Color, SceneBuilder, }; diff --git a/src/widget/taffy_layout.rs b/src/widget/taffy_layout.rs index 787d9100d..ef4f085e4 100644 --- a/src/widget/taffy_layout.rs +++ b/src/widget/taffy_layout.rs @@ -15,10 +15,11 @@ use crate::geometry::Axis; use crate::widget::{AccessCx, BoxConstraints, Event}; use accesskit::NodeId; -use glazier::kurbo::Affine; -use vello::kurbo::{Point, Size}; -use vello::peniko::{Brush, Color, Fill}; -use vello::SceneBuilder; +use vello::{ + kurbo::{Affine, Point, Size}, + peniko::{Brush, Color, Fill}, + SceneBuilder, +}; use super::{contexts::LifeCycleCx, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, UpdateCx, Widget}; From 594db33094c37b901603aaeebf8068dcbb46dbeb Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 9 Feb 2024 18:17:03 +0700 Subject: [PATCH 04/17] Fix typos. (#169) --- src/view/list.rs | 2 +- src/widget/core.rs | 2 +- src/widget/raw_event.rs | 2 +- src/widget/switch.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/view/list.rs b/src/view/list.rs index 45ba196ca..073887d6f 100644 --- a/src/view/list.rs +++ b/src/view/list.rs @@ -98,7 +98,7 @@ impl, F: Fn(usize) -> VT + Send> ViewSequence state.views.push((vt, vt_state)); } - // We only check if our length changes. If one of the sub sequences changes thier size they + // We only check if our length changes. If one of the sub sequences changes their size they // have to set ChangeFlags::all() them self's. if self.items != prev.items { flags |= ChangeFlags::all(); diff --git a/src/widget/core.rs b/src/widget/core.rs index 16db18e72..0e75bea22 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -453,7 +453,7 @@ impl Pod { /// The default paint method. /// - /// It paints the this widget if neccessary and appends its SceneFragment to the provided + /// It paints the this widget if necessary and appends its SceneFragment to the provided /// `SceneBuilder`. pub fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { self.paint_impl(cx); diff --git a/src/widget/raw_event.rs b/src/widget/raw_event.rs index 66d4dec57..f4049663d 100644 --- a/src/widget/raw_event.rs +++ b/src/widget/raw_event.rs @@ -34,7 +34,7 @@ pub enum Event { pub struct MouseEvent { /// The position of the mouse in the coordinate space of the receiver. pub pos: Point, - /// The position of the mose in the window coordinate space. + /// The position of the mouse in the window coordinate space. pub window_pos: Point, pub buttons: PointerButtons, pub mods: Modifiers, diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 1dd585a79..28813d3fd 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -138,7 +138,7 @@ impl Widget for Switch { self.knob_position.x = if self.is_on { ON_POS } else { OFF_POS } } - // Paint the Swith background + // Paint the Switch background // The on/off states have different colors // The transition between the two color is controlled by the knob position and calculated using the opacity let opacity = (self.knob_position.x - OFF_POS) / (ON_POS - OFF_POS); From 93480bc98d296c90e04770d96cb6bbed057b2c12 Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Tue, 13 Feb 2024 16:36:33 -0700 Subject: [PATCH 05/17] Upgrade Vello and ditch SceneBuilder/SceneFragment. (#170) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/app.rs | 8 +++++--- src/app_main.rs | 7 +++---- src/text.rs | 6 +++--- src/widget/button.rs | 10 +++++----- src/widget/core.rs | 33 ++++++++++++++++---------------- src/widget/linear_layout.rs | 6 +++--- src/widget/piet_scene_helpers.rs | 20 ++++++++++--------- src/widget/switch.rs | 12 ++++++------ src/widget/taffy_layout.rs | 8 ++++---- src/widget/text.rs | 6 +++--- src/widget/widget.rs | 9 ++++----- 13 files changed, 67 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6822681d9..bb1c454c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2681,7 +2681,7 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vello" version = "0.0.1" -source = "git+https://github.com/linebender/vello?rev=944ce63d8ff40d01f3dbbb7be096feaf6c3657fa#944ce63d8ff40d01f3dbbb7be096feaf6c3657fa" +source = "git+https://github.com/linebender/vello?rev=adb974a2feef73ca92998af5b727a56d4caac44b#adb974a2feef73ca92998af5b727a56d4caac44b" dependencies = [ "bytemuck", "futures-intrusive", @@ -2696,7 +2696,7 @@ dependencies = [ [[package]] name = "vello_encoding" version = "0.1.0" -source = "git+https://github.com/linebender/vello?rev=944ce63d8ff40d01f3dbbb7be096feaf6c3657fa#944ce63d8ff40d01f3dbbb7be096feaf6c3657fa" +source = "git+https://github.com/linebender/vello?rev=adb974a2feef73ca92998af5b727a56d4caac44b#adb974a2feef73ca92998af5b727a56d4caac44b" dependencies = [ "bytemuck", "guillotiere", diff --git a/Cargo.toml b/Cargo.toml index 755551e9b..6ad76940a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ taffy = ["dep:taffy"] [dependencies] xilem_core.workspace = true taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "7781c70241f7f572130c13106f2a869a9cf80885", optional = true } -vello = { git = "https://github.com/linebender/vello", rev = "944ce63d8ff40d01f3dbbb7be096feaf6c3657fa" } +vello = { git = "https://github.com/linebender/vello", rev = "adb974a2feef73ca92998af5b727a56d4caac44b" } wgpu = "0.18.0" parley = { git = "https://github.com/dfrg/parley", rev = "cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9" } tokio = { version = "1.35", features = ["full"] } diff --git a/src/app.rs b/src/app.rs index 82c20a336..c332a65b3 100644 --- a/src/app.rs +++ b/src/app.rs @@ -20,8 +20,10 @@ use accesskit::TreeUpdate; use glazier::{IdleHandle, IdleToken, WindowHandle}; use parley::FontContext; use tokio::runtime::Runtime; -use vello::kurbo::{Point, Rect, Size}; -use vello::SceneFragment; +use vello::{ + kurbo::{Point, Rect, Size}, + Scene, +}; use xilem_core::{AsyncWake, MessageResult}; use crate::widget::{ @@ -381,7 +383,7 @@ where } impl> App { - pub fn fragment(&self) -> &SceneFragment { + pub fn fragment(&self) -> &Scene { &self.root_pod.as_ref().unwrap().fragment } } diff --git a/src/app_main.rs b/src/app_main.rs index 19fbce7a9..a05610892 100644 --- a/src/app_main.rs +++ b/src/app_main.rs @@ -23,9 +23,8 @@ use vello::{ kurbo::{Affine, Size}, peniko::Color, util::{RenderContext, RenderSurface}, - AaSupport, RenderParams, Renderer, RendererOptions, + AaSupport, RenderParams, Renderer, RendererOptions, Scene, }; -use vello::{Scene, SceneBuilder}; use crate::{app::App, view::View, widget::Event}; @@ -218,8 +217,8 @@ where } else { None }; - let mut builder = SceneBuilder::for_scene(&mut self.scene); - builder.append(fragment, transform); + self.scene.reset(); + self.scene.append(fragment, transform); self.counter += 1; let surface_texture = surface .surface diff --git a/src/text.rs b/src/text.rs index dc25955f0..c8947f145 100644 --- a/src/text.rs +++ b/src/text.rs @@ -2,10 +2,10 @@ use parley::Layout; use vello::{ kurbo::Affine, peniko::{Brush, Fill}, - SceneBuilder, + Scene, }; -pub fn render_text(builder: &mut SceneBuilder, transform: Affine, layout: &Layout) { +pub fn render_text(scene: &mut Scene, transform: Affine, layout: &Layout) { for line in layout.lines() { for glyph_run in line.glyph_runs() { let mut x = glyph_run.offset(); @@ -20,7 +20,7 @@ pub fn render_text(builder: &mut SceneBuilder, transform: Affine, layout: &Layou .iter() .map(|coord| vello::skrifa::instance::NormalizedCoord::from_bits(*coord)) .collect::>(); - builder + scene .draw_glyphs(&font) .brush(&style.brush) .transform(transform) diff --git a/src/widget/button.rs b/src/widget/button.rs index 77aee2276..40683ea84 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -18,7 +18,7 @@ use parley::Layout; use vello::{ kurbo::{Affine, Insets, Size}, peniko::{Brush, Color}, - SceneBuilder, + Scene, }; use crate::{IdPath, Message}; @@ -119,7 +119,7 @@ impl Widget for Button { cx.push_node(builder); } - fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { let is_hot = cx.is_hot(); let is_active = cx.is_active(); let button_border_width = 2.0; @@ -138,9 +138,9 @@ impl Widget for Button { } else { [Color::rgb8(0xa1, 0xa1, 0xa1), Color::rgb8(0x3a, 0x3a, 0x3a)] }; - piet_scene_helpers::stroke(builder, &rounded_rect, border_color, button_border_width); + piet_scene_helpers::stroke(scene, &rounded_rect, border_color, button_border_width); piet_scene_helpers::fill_lin_gradient( - builder, + scene, &rounded_rect, bg_stops, UnitPoint::TOP, @@ -150,7 +150,7 @@ impl Widget for Button { let size = Size::new(layout.width() as f64, layout.height() as f64); let offset = (cx.size().to_vec2() - size.to_vec2()) * 0.5; let transform = Affine::translate(offset); - crate::text::render_text(builder, transform, layout); + crate::text::render_text(scene, transform, layout); } } } diff --git a/src/widget/core.rs b/src/widget/core.rs index 0e75bea22..c4c727a19 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -18,8 +18,10 @@ //! widget system, particularly its core.rs. use bitflags::bitflags; -use vello::kurbo::{Affine, Point, Rect, Size}; -use vello::{SceneBuilder, SceneFragment}; +use vello::{ + kurbo::{Affine, Point, Rect, Size}, + Scene, +}; use super::widget::{AnyWidget, Widget}; use crate::Axis; @@ -91,7 +93,7 @@ bitflags! { pub struct Pod { pub(crate) state: WidgetState, pub(crate) widget: Box, - pub(crate) fragment: SceneFragment, + pub(crate) fragment: Scene, } #[derive(Debug)] @@ -180,7 +182,7 @@ impl Pod { pub fn new_from_box(widget: Box) -> Self { Pod { state: WidgetState::new(), - fragment: SceneFragment::default(), + fragment: Scene::default(), widget, } } @@ -428,12 +430,12 @@ impl Pod { } } - pub fn paint_raw(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { + pub fn paint_raw(&mut self, cx: &mut PaintCx, scene: &mut Scene) { let mut inner_cx = PaintCx { cx_state: cx.cx_state, widget_state: &mut self.state, }; - self.widget.paint(&mut inner_cx, builder); + self.widget.paint(&mut inner_cx, scene); } pub(crate) fn paint_impl(&mut self, cx: &mut PaintCx) { @@ -446,28 +448,27 @@ impl Pod { }; if needs_paint { - let mut builder = SceneBuilder::for_fragment(&mut self.fragment); - self.widget.paint(&mut inner_cx, &mut builder); + self.fragment.reset(); + self.widget.paint(&mut inner_cx, &mut self.fragment); } } /// The default paint method. /// - /// It paints the this widget if necessary and appends its SceneFragment to the provided - /// `SceneBuilder`. - pub fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { + /// It paints the this widget if necessary and appends its `Scene` to the provided `Scene`. + pub fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { self.paint_impl(cx); let transform = Affine::translate(self.state.origin.to_vec2()); - builder.append(&self.fragment, Some(transform)); + scene.append(&self.fragment, Some(transform)); } - /// Renders the widget and returns the created `SceneFragment`. + /// Renders the widget and returns the created `Scene`. /// - /// The caller of this method is responsible for translating the Fragment and appending it to - /// its own SceneBuilder. This is useful for ClipBoxes and doing animations. + /// The caller of this method is responsible for translating the fragment and appending it to + /// its own Scene. This is useful for ClipBoxes and doing animations. /// /// For the default paint behaviour call [`paint`](Pod::paint). - pub fn paint_custom(&mut self, cx: &mut PaintCx) -> &SceneFragment { + pub fn paint_custom(&mut self, cx: &mut PaintCx) -> &Scene { self.paint_impl(cx); &self.fragment } diff --git a/src/widget/linear_layout.rs b/src/widget/linear_layout.rs index 7057ecf9b..8183543c3 100644 --- a/src/widget/linear_layout.rs +++ b/src/widget/linear_layout.rs @@ -16,7 +16,7 @@ use crate::geometry::Axis; use crate::widget::{AccessCx, BoxConstraints, Event}; use accesskit::NodeId; use vello::kurbo::Size; -use vello::SceneBuilder; +use vello::Scene; use super::{contexts::LifeCycleCx, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, UpdateCx, Widget}; @@ -100,10 +100,10 @@ impl Widget for LinearLayout { } } - fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { for child in &mut self.children { // println!("paint child!"); - child.paint(cx, builder); + child.paint(cx, scene); } } } diff --git a/src/widget/piet_scene_helpers.rs b/src/widget/piet_scene_helpers.rs index 90ad49325..bdda53a5a 100644 --- a/src/widget/piet_scene_helpers.rs +++ b/src/widget/piet_scene_helpers.rs @@ -1,6 +1,8 @@ -use vello::kurbo::{self, Affine, Rect, Shape, Stroke}; -use vello::peniko::{BrushRef, Color, ColorStopsSource, Fill, Gradient}; -use vello::SceneBuilder; +use vello::{ + kurbo::{self, Affine, Rect, Shape, Stroke}, + peniko::{BrushRef, Color, ColorStopsSource, Fill, Gradient}, + Scene, +}; #[derive(Debug, Clone, Copy)] pub struct UnitPoint { @@ -9,12 +11,12 @@ pub struct UnitPoint { } pub fn stroke<'b>( - builder: &mut SceneBuilder, + scene: &mut Scene, path: &impl Shape, brush: impl Into>, stroke_width: f64, ) { - builder.stroke( + scene.stroke( &Stroke::new(stroke_width), Affine::IDENTITY, brush, @@ -63,7 +65,7 @@ impl UnitPoint { } pub fn fill_lin_gradient( - builder: &mut SceneBuilder, + scene: &mut Scene, path: &impl Shape, stops: impl ColorStopsSource, start: UnitPoint, @@ -71,9 +73,9 @@ pub fn fill_lin_gradient( ) { let rect = path.bounding_box(); let brush = Gradient::new_linear(start.resolve(rect), end.resolve(rect)).with_stops(stops); - builder.fill(Fill::NonZero, Affine::IDENTITY, &brush, None, path); + scene.fill(Fill::NonZero, Affine::IDENTITY, &brush, None, path); } -pub fn fill_color(builder: &mut SceneBuilder, path: &impl Shape, color: Color) { - builder.fill(Fill::NonZero, Affine::IDENTITY, color, None, path) +pub fn fill_color(scene: &mut Scene, path: &impl Shape, color: Color) { + scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path) } diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 28813d3fd..ca88843d2 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -15,7 +15,7 @@ use vello::{ kurbo::{Circle, Point, Size}, peniko::Color, - SceneBuilder, + Scene, }; use crate::{IdPath, Message}; @@ -131,7 +131,7 @@ impl Widget for Switch { cx.push_node(builder); } - fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { // Change the position of of the knob based on its state // If the knob is currently being dragged with the mouse use the position that was set in MouseMove if !self.is_dragging { @@ -148,8 +148,8 @@ impl Widget for Switch { let background_rect = cx.size().to_rect().to_rounded_rect(SWITCH_HEIGHT / 2.); - fill_color(builder, &background_rect, background_off_state); - fill_color(builder, &background_rect, background_on_state); + fill_color(scene, &background_rect, background_off_state); + fill_color(scene, &background_rect, background_on_state); // Paint the Switch knob let knob_border_color = Color::DIM_GRAY; @@ -177,7 +177,7 @@ impl Widget for Switch { }; let knob_circle = Circle::new(self.knob_position, knob_size); - fill_color(builder, &knob_circle, knob_color); - stroke(builder, &knob_circle, knob_border_color, 2.0); + fill_color(scene, &knob_circle, knob_color); + stroke(scene, &knob_circle, knob_border_color, 2.0); } } diff --git a/src/widget/taffy_layout.rs b/src/widget/taffy_layout.rs index ef4f085e4..e8db9c042 100644 --- a/src/widget/taffy_layout.rs +++ b/src/widget/taffy_layout.rs @@ -18,7 +18,7 @@ use accesskit::NodeId; use vello::{ kurbo::{Affine, Point, Size}, peniko::{Brush, Color, Fill}, - SceneBuilder, + Scene, }; use super::{contexts::LifeCycleCx, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, UpdateCx, Widget}; @@ -434,9 +434,9 @@ impl Widget for TaffyLayout { } } - fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { if let Some(color) = self.background_color { - builder.fill( + scene.fill( Fill::NonZero, Affine::IDENTITY, &Brush::Solid(color), @@ -445,7 +445,7 @@ impl Widget for TaffyLayout { ); } for child in &mut self.children { - child.paint(cx, builder); + child.paint(cx, scene); } } } diff --git a/src/widget/text.rs b/src/widget/text.rs index d4e270953..33aed3f71 100644 --- a/src/widget/text.rs +++ b/src/widget/text.rs @@ -17,7 +17,7 @@ use std::borrow::Cow; use vello::{ kurbo::{Affine, Size}, peniko::{Brush, Color}, - SceneBuilder, + Scene, }; use super::{ @@ -114,9 +114,9 @@ impl Widget for TextWidget { self.layout_text(cx.font_cx(), bc) } - fn paint(&mut self, _cx: &mut PaintCx, builder: &mut SceneBuilder) { + fn paint(&mut self, _cx: &mut PaintCx, scene: &mut Scene) { if let Some(layout) = &self.layout { - crate::text::render_text(builder, Affine::IDENTITY, layout); + crate::text::render_text(scene, Affine::IDENTITY, layout); } } diff --git a/src/widget/widget.rs b/src/widget/widget.rs index f82300f30..4e36c7735 100644 --- a/src/widget/widget.rs +++ b/src/widget/widget.rs @@ -16,8 +16,7 @@ use std::any::Any; use std::ops::DerefMut; use crate::geometry::Axis; -use vello::kurbo::Size; -use vello::SceneBuilder; +use vello::{kurbo::Size, Scene}; use super::box_constraints::BoxConstraints; use super::contexts::{AccessCx, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; @@ -108,7 +107,7 @@ pub trait Widget { /// /// [`PaintCtx`]: struct.PaintCtx.html /// [`RenderContext`]: trait.RenderContext.html - fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder); + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene); /* #[doc(hidden)] @@ -235,7 +234,7 @@ impl Widget for Box { self.deref_mut().accessibility(cx); } - fn paint(&mut self, cx: &mut PaintCx, builder: &mut SceneBuilder) { - self.deref_mut().paint(cx, builder); + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { + self.deref_mut().paint(cx, scene); } } From 09d3656c3a13769ef425512f0837a0c218e1c31a Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Wed, 14 Feb 2024 14:34:19 -0700 Subject: [PATCH 06/17] Bump Taffy to 0.4.0. (#172) Bump Taffy. --- Cargo.lock | 10 ++++++---- Cargo.toml | 2 +- src/widget/taffy_layout.rs | 25 ++++++++----------------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb1c454c3..f5eeaabc8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1295,9 +1295,9 @@ dependencies = [ [[package]] name = "grid" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df00eed8d1f0db937f6be10e46e8072b0671accb504cf0f959c5c52c679f5b9" +checksum = "d196ffc1627db18a531359249b2bf8416178d84b729f3cebeb278f285fb9b58c" [[package]] name = "guillotiere" @@ -2393,12 +2393,14 @@ dependencies = [ [[package]] name = "taffy" -version = "0.3.11" -source = "git+https://github.com/DioxusLabs/taffy?rev=7781c70241f7f572130c13106f2a869a9cf80885#7781c70241f7f572130c13106f2a869a9cf80885" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fddbee94e20bc4612dcb789953324236eebd4fc6a08c650ccbf7f615e59a0d6a" dependencies = [ "arrayvec", "grid", "num-traits", + "serde", "slotmap", ] diff --git a/Cargo.toml b/Cargo.toml index 6ad76940a..d534d8955 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ taffy = ["dep:taffy"] [dependencies] xilem_core.workspace = true -taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "7781c70241f7f572130c13106f2a869a9cf80885", optional = true } +taffy = { version = "0.4.0", optional = true } vello = { git = "https://github.com/linebender/vello", rev = "adb974a2feef73ca92998af5b727a56d4caac44b" } wgpu = "0.18.0" parley = { git = "https://github.com/dfrg/parley", rev = "cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9" } diff --git a/src/widget/taffy_layout.rs b/src/widget/taffy_layout.rs index e8db9c042..9549d276d 100644 --- a/src/widget/taffy_layout.rs +++ b/src/widget/taffy_layout.rs @@ -23,11 +23,6 @@ use vello::{ use super::{contexts::LifeCycleCx, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, UpdateCx, Widget}; -/// Type inference gets confused because we're just passing None for the measure function. So we give -/// it a concrete type to work with (even though we never construct the inner type) -type DummyMeasureFunction = - fn(taffy::Size>, taffy::Size) -> taffy::Size; - /// Type conversions between Xilem types and their Taffy equivalents mod convert { use crate::{widget::BoxConstraints, Axis}; @@ -163,7 +158,7 @@ impl TaffyLayout { } } -/// Iterator over the widget's children. Used in the implementation of `taffy::PartialLayoutTree`. +/// Iterator over the widget's children. Used in the implementation of `taffy::TraversePartialTree`. struct ChildIter(std::ops::Range); impl Iterator for ChildIter { type Item = taffy::NodeId; @@ -174,8 +169,8 @@ impl Iterator for ChildIter { } /// A this wrapper view over the widget (`TaffyLayout`) and the Xilem layout context (`LayoutCx`). -/// Implementing `taffy::PartialLayoutTree` for this wrapper (rather than implementing directing on -/// `TaffyLayout`) allows us to access the layout context during the layout process +/// Implementing `taffy::TraversePartialTree` and `taffy::LayoutPartialTree` for this wrapper (rather +/// than directly on `TaffyLayout`) allows us to access the layout context during the layout process struct TaffyLayoutCtx<'w, 'a, 'b> { /// A mutable reference to the widget widget: &'w mut TaffyLayout, @@ -190,7 +185,7 @@ impl<'w, 'a, 'b> TaffyLayoutCtx<'w, 'a, 'b> { } } -impl<'w, 'a, 'b> taffy::PartialLayoutTree for TaffyLayoutCtx<'w, 'a, 'b> { +impl<'w, 'a, 'b> taffy::TraversePartialTree for TaffyLayoutCtx<'w, 'a, 'b> { type ChildIter<'c> = ChildIter where Self: 'c; fn child_ids(&self, _parent_node_id: taffy::NodeId) -> Self::ChildIter<'_> { @@ -204,7 +199,9 @@ impl<'w, 'a, 'b> taffy::PartialLayoutTree for TaffyLayoutCtx<'w, 'a, 'b> { fn get_child_id(&self, _parent_node_id: taffy::NodeId, child_index: usize) -> taffy::NodeId { taffy::NodeId::from(child_index) } +} +impl<'w, 'a, 'b> taffy::LayoutPartialTree for TaffyLayoutCtx<'w, 'a, 'b> { fn get_style(&self, node_id: taffy::NodeId) -> &taffy::Style { let node_id = usize::from(node_id); if node_id == usize::MAX { @@ -342,10 +339,7 @@ impl Widget for TaffyLayout { (taffy::Display::Grid, true) => { taffy::compute_grid_layout(&mut layout_ctx, node_id, inputs) } - (_, false) => { - let measure_function: Option = None; - taffy::compute_leaf_layout(inputs, &self.style, measure_function) - } + (_, false) => taffy::compute_leaf_layout(inputs, &self.style, |_, _| taffy::Size::ZERO), }; // Save output to cache @@ -400,10 +394,7 @@ impl Widget for TaffyLayout { (taffy::Display::Grid, true) => { taffy::compute_grid_layout(&mut layout_ctx, node_id, inputs) } - (_, false) => { - let measure_function: Option = None; - taffy::compute_leaf_layout(inputs, &self.style, measure_function) - } + (_, false) => taffy::compute_leaf_layout(inputs, &self.style, |_, _| taffy::Size::ZERO), }; // Save output to cache From 9db94974207d2ed163052c8d4f7cf03836ee149e Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Wed, 14 Feb 2024 16:29:46 -0700 Subject: [PATCH 07/17] Bump kurbo and related dependencies. (#173) --- Cargo.lock | 35 ++++++++++++++++++----------------- Cargo.toml | 8 ++++---- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5eeaabc8..9d93faa3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1132,7 +1132,7 @@ dependencies = [ [[package]] name = "glazier" version = "0.1.0" -source = "git+https://github.com/linebender/glazier?rev=ec7e0c5fafd5c106c4c67831bc829572958c671c#ec7e0c5fafd5c106c4c67831bc829572958c671c" +source = "git+https://github.com/linebender/glazier?rev=8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e#8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e" dependencies = [ "accesskit", "accesskit_macos", @@ -1149,7 +1149,7 @@ dependencies = [ "instant", "js-sys", "keyboard-types", - "kurbo 0.10.4", + "kurbo 0.11.0", "lazy_static", "memchr", "nix 0.25.1", @@ -1464,18 +1464,19 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "kurbo" -version = "0.9.5" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" dependencies = [ "arrayvec", + "smallvec", ] [[package]] name = "kurbo" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" +checksum = "6e5aa9f0f96a938266bdb12928a67169e8d22c6a786fda8ed984b85e6ba93c3c" dependencies = [ "arrayvec", "smallvec", @@ -1847,9 +1848,9 @@ dependencies = [ [[package]] name = "parley" version = "0.0.1" -source = "git+https://github.com/dfrg/parley?rev=cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9#cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9" +source = "git+https://github.com/dfrg/parley?rev=1940d1ae9f2a9b44b7c18967147ffa7d345fdafd#1940d1ae9f2a9b44b7c18967147ffa7d345fdafd" dependencies = [ - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0)", + "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "swash", ] @@ -1868,16 +1869,17 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "peniko" version = "0.1.0" -source = "git+https://github.com/linebender/peniko?rev=629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa#629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caaf7fec601d640555d9a4cab7343eba1e1c7a5a71c9993ff63b4c26bc5d50c5" dependencies = [ - "kurbo 0.10.4", + "kurbo 0.11.0", "smallvec", ] [[package]] name = "peniko" version = "0.1.0" -source = "git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0#8717635681dedfab3e9f3741fcbc7f3318a82ff0" +source = "git+https://github.com/linebender/peniko?rev=629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa#629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa" dependencies = [ "kurbo 0.10.4", "smallvec", @@ -2683,12 +2685,11 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vello" version = "0.0.1" -source = "git+https://github.com/linebender/vello?rev=adb974a2feef73ca92998af5b727a56d4caac44b#adb974a2feef73ca92998af5b727a56d4caac44b" +source = "git+https://github.com/linebender/vello?rev=b1bd9e361f2944b71cef0ea8a2c71dce5182d79b#b1bd9e361f2944b71cef0ea8a2c71dce5182d79b" dependencies = [ "bytemuck", "futures-intrusive", - "kurbo 0.10.4", - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0)", + "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle", "skrifa", "vello_encoding", @@ -2698,11 +2699,11 @@ dependencies = [ [[package]] name = "vello_encoding" version = "0.1.0" -source = "git+https://github.com/linebender/vello?rev=adb974a2feef73ca92998af5b727a56d4caac44b#adb974a2feef73ca92998af5b727a56d4caac44b" +source = "git+https://github.com/linebender/vello?rev=b1bd9e361f2944b71cef0ea8a2c71dce5182d79b#b1bd9e361f2944b71cef0ea8a2c71dce5182d79b" dependencies = [ "bytemuck", "guillotiere", - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=8717635681dedfab3e9f3741fcbc7f3318a82ff0)", + "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "skrifa", ] @@ -3318,7 +3319,7 @@ version = "0.1.0" dependencies = [ "bitflags 2.4.2", "gloo", - "kurbo 0.9.5", + "kurbo 0.11.0", "log", "paste", "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa)", diff --git a/Cargo.toml b/Cargo.toml index d534d8955..9520417ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ license = "Apache-2.0" [workspace.dependencies] xilem_core = { version = "0.1.0", path = "crates/xilem_core" } -kurbo = "0.9.1" +kurbo = "0.11.0" [package] name = "xilem" @@ -49,9 +49,9 @@ taffy = ["dep:taffy"] [dependencies] xilem_core.workspace = true taffy = { version = "0.4.0", optional = true } -vello = { git = "https://github.com/linebender/vello", rev = "adb974a2feef73ca92998af5b727a56d4caac44b" } +vello = { git = "https://github.com/linebender/vello", rev = "b1bd9e361f2944b71cef0ea8a2c71dce5182d79b" } wgpu = "0.18.0" -parley = { git = "https://github.com/dfrg/parley", rev = "cf41c3ff25ae0c9c48e96b59bc4ee41571a279b9" } +parley = { git = "https://github.com/dfrg/parley", rev = "1940d1ae9f2a9b44b7c18967147ffa7d345fdafd" } tokio = { version = "1.35", features = ["full"] } futures-task = "0.3" bitflags = "2" @@ -61,7 +61,7 @@ fnv = "1.0.7" [dependencies.glazier] git = "https://github.com/linebender/glazier" -rev = "ec7e0c5fafd5c106c4c67831bc829572958c671c" +rev = "8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e" default-features = false features = ["accesskit"] From 21771ef71bd891afa045e08503022bf6b8b5e7fc Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Fri, 23 Feb 2024 10:47:10 -0500 Subject: [PATCH 08/17] basic winit port (#176) * Remove menu bar. * Add PointerCrusher * Implement basic winit event handling. * Remove now-inert accessibility and idle code. --- Cargo.lock | 817 +++++++++++++++++++++++++++++++----- Cargo.toml | 4 +- src/app.rs | 81 +--- src/app_main.rs | 262 ++++++------ src/bloom.rs | 1 + src/id.rs | 18 - src/lib.rs | 1 - src/widget/button.rs | 19 +- src/widget/contexts.rs | 76 +--- src/widget/core.rs | 32 +- src/widget/linear_layout.rs | 20 +- src/widget/mod.rs | 4 +- src/widget/raw_event.rs | 139 +++++- src/widget/switch.rs | 16 +- src/widget/taffy_layout.rs | 24 +- src/widget/text.rs | 6 - src/widget/widget.rs | 9 +- 17 files changed, 985 insertions(+), 544 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d93faa3b..282539a20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,45 +3,20 @@ version = 3 [[package]] -name = "accesskit" -version = "0.12.2" +name = "ab_glyph" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea" - -[[package]] -name = "accesskit_consumer" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" +checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" dependencies = [ - "accesskit", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] -name = "accesskit_macos" -version = "0.10.1" +name = "ab_glyph_rasterizer" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" -dependencies = [ - "accesskit", - "accesskit_consumer", - "objc2", - "once_cell", -] - -[[package]] -name = "accesskit_windows" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" -dependencies = [ - "accesskit", - "accesskit_consumer", - "once_cell", - "paste", - "static_assertions", - "windows 0.48.0", -] +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "addr2line" @@ -65,6 +40,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -85,6 +61,33 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +[[package]] +name = "android-activity" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" +dependencies = [ + "android-properties", + "bitflags 2.4.2", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -100,6 +103,12 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + [[package]] name = "arrayvec" version = "0.7.4" @@ -456,21 +465,21 @@ dependencies = [ [[package]] name = "block-sys" -version = "0.1.0-beta.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ "objc-sys", ] [[package]] name = "block2" -version = "0.2.0-alpha.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ "block-sys", - "objc2-encode", + "objc2", ] [[package]] @@ -541,15 +550,48 @@ dependencies = [ "vec_map", ] +[[package]] +name = "calloop" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" +dependencies = [ + "bitflags 2.4.2", + "log", + "polling 3.4.0", + "rustix 0.38.31", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop 0.12.4", + "rustix 0.38.31", + "wayland-backend 0.3.3", + "wayland-client 0.31.2", +] + [[package]] name = "cc" version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -565,6 +607,12 @@ 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 = "clang-sys" version = "1.7.0" @@ -622,6 +670,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "concurrent-queue" version = "2.4.0" @@ -726,6 +784,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + [[package]] name = "d3d12" version = "0.7.0" @@ -758,6 +822,12 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + [[package]] name = "dlib" version = "0.5.2" @@ -1099,6 +1169,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + [[package]] name = "getrandom" version = "0.2.12" @@ -1134,9 +1214,6 @@ name = "glazier" version = "0.1.0" source = "git+https://github.com/linebender/glazier?rev=8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e#8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e" dependencies = [ - "accesskit", - "accesskit_macos", - "accesskit_windows", "anyhow", "ashpd", "bindgen", @@ -1156,16 +1233,16 @@ dependencies = [ "objc", "once_cell", "pkg-config", - "raw-window-handle", + "raw-window-handle 0.5.2", "scopeguard", - "smithay-client-toolkit", + "smithay-client-toolkit 0.17.0", "tracing", "wasm-bindgen", - "wayland-backend", + "wayland-backend 0.1.2", "web-sys", "winapi", "wio", - "x11rb", + "x11rb 0.12.0", ] [[package]] @@ -1270,7 +1347,7 @@ dependencies = [ "presser", "thiserror", "winapi", - "windows 0.51.1", + "windows", ] [[package]] @@ -1367,6 +1444,17 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2", + "dispatch", + "objc2", +] + [[package]] name = "idna" version = "0.5.0" @@ -1427,6 +1515,37 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.68" @@ -1529,6 +1648,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1594,6 +1724,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -1691,6 +1830,37 @@ dependencies = [ "getrandom", ] +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.4.2", + "jni-sys", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + [[package]] name = "nix" version = "0.25.1" @@ -1746,6 +1916,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "objc" version = "0.2.7" @@ -1758,29 +1949,25 @@ dependencies = [ [[package]] name = "objc-sys" -version = "0.2.0-beta.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" [[package]] name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "block2", "objc-sys", "objc2-encode", ] [[package]] name = "objc2-encode" -version = "2.0.0-pre.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys", -] +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" [[package]] name = "objc_exception" @@ -1806,6 +1993,15 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "orbclient" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" +dependencies = [ + "libredox", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -1816,6 +2012,15 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "owned_ttf_parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +dependencies = [ + "ttf-parser", +] + [[package]] name = "parking" version = "2.2.0" @@ -1840,7 +2045,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] @@ -2006,6 +2211,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.35" @@ -2057,6 +2271,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "raw-window-handle" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" + [[package]] name = "read-fonts" version = "0.15.3" @@ -2066,6 +2286,15 @@ dependencies = [ "font-types", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -2155,6 +2384,15 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -2167,6 +2405,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sctk-adwaita" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" +dependencies = [ + "ab_glyph", + "log", + "memmap2 0.9.4", + "smithay-client-toolkit 0.18.1", + "tiny-skia", +] + [[package]] name = "serde" version = "1.0.196" @@ -2284,19 +2535,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1476c3d89bb67079264b88aaf4f14358353318397e083b7c4e8c14517f55de7" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "dlib", "lazy_static", "log", - "memmap2", + "memmap2 0.5.10", "nix 0.26.4", "thiserror", - "wayland-backend", - "wayland-client", - "wayland-cursor", - "wayland-protocols", - "wayland-protocols-wlr", - "wayland-scanner", + "wayland-backend 0.1.2", + "wayland-client 0.30.2", + "wayland-cursor 0.30.0", + "wayland-protocols 0.30.1", + "wayland-protocols-wlr 0.1.0", + "wayland-scanner 0.30.1", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" +dependencies = [ + "bitflags 2.4.2", + "calloop 0.12.4", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.4", + "rustix 0.38.31", + "thiserror", + "wayland-backend 0.3.3", + "wayland-client 0.31.2", + "wayland-csd-frame", + "wayland-cursor 0.31.1", + "wayland-protocols 0.31.2", + "wayland-protocols-wlr 0.2.0", + "wayland-scanner 0.31.1", + "xkeysym", +] + +[[package]] +name = "smol_str" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +dependencies = [ + "serde", ] [[package]] @@ -2344,6 +2629,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + [[package]] name = "svg_fmt" version = "0.4.1" @@ -2478,6 +2769,31 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2608,6 +2924,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "ttf-parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" + [[package]] name = "typenum" version = "1.17.0" @@ -2646,6 +2968,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unicode-width" version = "0.1.11" @@ -2690,7 +3018,7 @@ dependencies = [ "bytemuck", "futures-intrusive", "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-window-handle", + "raw-window-handle 0.5.2", "skrifa", "vello_encoding", "wgpu", @@ -2719,6 +3047,16 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2803,7 +3141,21 @@ dependencies = [ "nix 0.26.4", "scoped-tls", "smallvec", - "wayland-sys", + "wayland-sys 0.30.1", +] + +[[package]] +name = "wayland-backend" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +dependencies = [ + "cc", + "downcast-rs", + "rustix 0.38.31", + "scoped-tls", + "smallvec", + "wayland-sys 0.31.1", ] [[package]] @@ -2813,10 +3165,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "nix 0.26.4", - "wayland-backend", - "wayland-scanner", + "wayland-backend 0.1.2", + "wayland-scanner 0.30.1", +] + +[[package]] +name = "wayland-client" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +dependencies = [ + "bitflags 2.4.2", + "rustix 0.38.31", + "wayland-backend 0.3.3", + "wayland-scanner 0.31.1", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.4.2", + "cursor-icon", + "wayland-backend 0.3.3", ] [[package]] @@ -2826,7 +3201,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0c3a0d5b4b688b07b0442362d3ed6bf04724fcc16cd69ab6285b90dbc487aa" dependencies = [ "nix 0.26.4", - "wayland-client", + "wayland-client 0.30.2", + "xcursor", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" +dependencies = [ + "rustix 0.38.31", + "wayland-client 0.31.2", "xcursor", ] @@ -2837,9 +3223,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" dependencies = [ "bitflags 1.3.2", - "wayland-backend", - "wayland-client", - "wayland-scanner", + "wayland-backend 0.1.2", + "wayland-client 0.30.2", + "wayland-scanner 0.30.1", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend 0.3.3", + "wayland-client 0.31.2", + "wayland-scanner 0.31.1", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend 0.3.3", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", ] [[package]] @@ -2849,10 +3260,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce991093320e4a6a525876e6b629ab24da25f9baef0c2e0080ad173ec89588a" dependencies = [ "bitflags 1.3.2", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-scanner", + "wayland-backend 0.1.2", + "wayland-client 0.30.2", + "wayland-protocols 0.30.1", + "wayland-scanner 0.30.1", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend 0.3.3", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", ] [[package]] @@ -2862,7 +3286,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.28.2", + "quote", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +dependencies = [ + "proc-macro2", + "quick-xml 0.31.0", "quote", ] @@ -2877,6 +3312,18 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "wayland-sys" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.64" @@ -2887,6 +3334,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "wgpu" version = "0.18.0" @@ -2901,7 +3358,7 @@ dependencies = [ "naga", "parking_lot", "profiling", - "raw-window-handle", + "raw-window-handle 0.5.2", "smallvec", "static_assertions", "wasm-bindgen", @@ -2926,7 +3383,7 @@ dependencies = [ "naga", "parking_lot", "profiling", - "raw-window-handle", + "raw-window-handle 0.5.2", "rustc-hash", "smallvec", "thiserror", @@ -2967,7 +3424,7 @@ dependencies = [ "parking_lot", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.5.2", "renderdoc-sys", "rustc-hash", "smallvec", @@ -3047,17 +3504,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.51.1" @@ -3078,25 +3524,12 @@ dependencies = [ ] [[package]] -name = "windows-implement" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "windows-interface" -version = "0.48.0" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "windows-targets 0.42.2", ] [[package]] @@ -3117,6 +3550,21 @@ dependencies = [ "windows-targets 0.52.0", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -3147,6 +3595,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -3159,6 +3613,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -3171,6 +3631,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -3183,6 +3649,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -3195,6 +3667,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -3207,6 +3685,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -3219,6 +3703,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -3231,6 +3721,55 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winit" +version = "0.29.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.4.2", + "bytemuck", + "calloop 0.12.4", + "cfg_aliases", + "core-foundation", + "core-graphics", + "cursor-icon", + "icrate", + "js-sys", + "libc", + "log", + "memmap2 0.9.4", + "ndk", + "ndk-sys", + "objc2", + "once_cell", + "orbclient", + "percent-encoding", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", + "redox_syscall 0.3.5", + "rustix 0.38.31", + "sctk-adwaita", + "smithay-client-toolkit 0.18.1", + "smol_str", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend 0.3.3", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.48.0", + "x11-dl", + "x11rb 0.13.0", + "xkbcommon-dl", +] + [[package]] name = "winnow" version = "0.5.39" @@ -3249,6 +3788,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + [[package]] name = "x11rb" version = "0.12.0" @@ -3256,12 +3806,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" dependencies = [ "as-raw-xcb-connection", - "gethostname", + "gethostname 0.3.0", "libc", "nix 0.26.4", "winapi", "winapi-wsapoll", - "x11rb-protocol", + "x11rb-protocol 0.12.0", +] + +[[package]] +name = "x11rb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" +dependencies = [ + "as-raw-xcb-connection", + "gethostname 0.4.3", + "libc", + "libloading 0.8.1", + "once_cell", + "rustix 0.38.31", + "x11rb-protocol 0.13.0", ] [[package]] @@ -3273,6 +3838,12 @@ dependencies = [ "nix 0.26.4", ] +[[package]] +name = "x11rb-protocol" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" + [[package]] name = "xcursor" version = "0.3.5" @@ -3293,12 +3864,12 @@ dependencies = [ name = "xilem" version = "0.1.0" dependencies = [ - "accesskit", "bitflags 2.4.2", "env_logger", "fnv", "futures-task", "glazier", + "instant", "parley", "taffy", "test-log", @@ -3306,6 +3877,7 @@ dependencies = [ "tracing", "vello", "wgpu", + "winit", "xilem_core", ] @@ -3328,6 +3900,25 @@ dependencies = [ "xilem_core", ] +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.4.2", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" + [[package]] name = "xml-rs" version = "0.8.19" diff --git a/Cargo.toml b/Cargo.toml index 9520417ef..6a97c135e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,14 +56,14 @@ tokio = { version = "1.35", features = ["full"] } futures-task = "0.3" bitflags = "2" tracing = "0.1.37" -accesskit = "0.12" fnv = "1.0.7" +instant = { version = "0.1.6", features = ["wasm-bindgen"] } +winit = { version = "0.29", features = ["rwh_05"] } [dependencies.glazier] git = "https://github.com/linebender/glazier" rev = "8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e" default-features = false -features = ["accesskit"] [dev-dependencies] env_logger = "0.10.0" diff --git a/src/app.rs b/src/app.rs index c332a65b3..6f9e48b10 100644 --- a/src/app.rs +++ b/src/app.rs @@ -13,11 +13,8 @@ // limitations under the License. use std::collections::HashSet; -use std::sync::{Arc, Mutex}; use std::time::Duration; -use accesskit::TreeUpdate; -use glazier::{IdleHandle, IdleToken, WindowHandle}; use parley::FontContext; use tokio::runtime::Runtime; use vello::{ @@ -27,8 +24,8 @@ use vello::{ use xilem_core::{AsyncWake, MessageResult}; use crate::widget::{ - AccessCx, BoxConstraints, CxState, EventCx, LayoutCx, LifeCycle, LifeCycleCx, PaintCx, Pod, - PodFlags, UpdateCx, ViewContext, WidgetState, + BoxConstraints, CxState, EventCx, LayoutCx, LifeCycle, LifeCycleCx, PaintCx, Pod, PodFlags, + UpdateCx, ViewContext, WidgetState, }; use crate::{ view::{Cx, Id, View}, @@ -46,7 +43,6 @@ pub struct App> { return_chan: tokio::sync::mpsc::Sender<(V, V::State, HashSet)>, id: Option, events: Vec, - window_handle: WindowHandle, root_state: WidgetState, root_pod: Option, size: Size, @@ -55,11 +51,6 @@ pub struct App> { cx: Cx, font_cx: FontContext, pub(crate) rt: Runtime, - // This is allocated an id for AccessKit, but as we get multi-window, - // there should be a real window object with id. - window_id: crate::id::Id, - pub(crate) accesskit_connected: bool, - node_classes: accesskit::NodeClassSet, } /// The standard delay for waiting for async futures. @@ -79,14 +70,12 @@ struct AppTask, F: FnMut(&mut T) -> V> { app_logic: F, view: Option, state: Option, - idle_handle: Option, pending_async: HashSet, ui_state: UiState, } /// A message sent from the main UI thread ([`App`]) to the [`AppTask`]. pub(crate) enum AppReq { - SetIdleHandle(IdleHandle), Events(Vec), Wake(IdPath), // Parameter indicates whether it should be delayed for async @@ -115,9 +104,6 @@ enum UiState { WokeUI, } -#[derive(Clone, Default)] -pub struct WakeQueue(Arc>>); - impl + 'static> App where V::State: 'static, @@ -159,7 +145,6 @@ where app_logic, view: None, state: None, - idle_handle: None, pending_async: HashSet::new(), ui_state: UiState::Start, }; @@ -172,7 +157,6 @@ where id: None, root_pod: None, events: Vec::new(), - window_handle: Default::default(), root_state: WidgetState::new(), size: Default::default(), new_size: Default::default(), @@ -180,18 +164,6 @@ where cx, font_cx: FontContext::new(), rt, - window_id: crate::id::Id::next(), - accesskit_connected: false, - node_classes: accesskit::NodeClassSet::new(), - } - } - - pub fn connect(&mut self, window_handle: WindowHandle) { - self.window_handle = window_handle.clone(); - if let Some(idle_handle) = window_handle.get_idle_handle() { - let _ = self - .req_chan - .blocking_send(AppReq::SetIdleHandle(idle_handle)); } } @@ -199,37 +171,6 @@ where self.new_size = size; } - pub fn accessibility(&mut self) -> TreeUpdate { - let mut update = TreeUpdate { - nodes: vec![], - tree: None, - focus: accesskit::NodeId(0), - }; - self.ensure_root(); - let root_pod = self.root_pod.as_mut().unwrap(); - let mut window_node_builder = accesskit::NodeBuilder::new(accesskit::Role::Window); - window_node_builder.set_name("xilem window"); - window_node_builder.set_children(vec![root_pod.id().into()]); - if let Ok(scale) = self.window_handle.get_scale() { - window_node_builder.set_transform(Box::new(accesskit::Affine::scale_non_uniform( - scale.x(), - scale.y(), - ))); - } - let window_node = window_node_builder.build(&mut self.node_classes); - update.nodes.push((self.window_id.into(), window_node)); - update.tree = Some(accesskit::Tree::new(self.window_id.into())); - let mut cx_state = CxState::new(&self.window_handle, &mut self.font_cx, &mut self.events); - let mut access_cx = AccessCx { - cx_state: &mut cx_state, - widget_state: &mut self.root_state, - update: &mut update, - node_classes: &mut self.node_classes, - }; - root_pod.accessibility(&mut access_cx); - update - } - /// Run a paint cycle for the application. /// /// This is not just painting, but involves processing events, doing layout @@ -240,8 +181,7 @@ where // TODO: be more lazy re-rendering self.render(); let root_pod = self.root_pod.as_mut().unwrap(); - let mut cx_state = - CxState::new(&self.window_handle, &mut self.font_cx, &mut self.events); + let mut cx_state = CxState::new(&mut self.font_cx, &mut self.events); let mut lifecycle_cx = LifeCycleCx::new(&mut cx_state, &mut self.root_state); root_pod.lifecycle(&mut lifecycle_cx, &LifeCycle::TreeUpdate); @@ -282,16 +222,10 @@ where continue; } - if self.accesskit_connected { - let update = self.accessibility(); - // TODO: it would be cleaner to not use a closure here. - self.window_handle.update_accesskit_if_active(|| update); - } // Borrow again to avoid multiple borrows. // TODO: maybe make accessibility a method on CxState? let root_pod = self.root_pod.as_mut().unwrap(); - let mut cx_state = - CxState::new(&self.window_handle, &mut self.font_cx, &mut self.events); + let mut cx_state = CxState::new(&mut self.font_cx, &mut self.events); let mut paint_cx = PaintCx::new(&mut cx_state, &mut self.root_state); root_pod.paint_impl(&mut paint_cx); break; @@ -309,12 +243,11 @@ where Event::MouseLeft() => { self.cursor_pos = None; } - _ => {} } self.ensure_root(); let root_pod = self.root_pod.as_mut().unwrap(); - let mut cx_state = CxState::new(&self.window_handle, &mut self.font_cx, &mut self.events); + let mut cx_state = CxState::new(&mut self.font_cx, &mut self.events); let mut event_cx = EventCx::new(&mut cx_state, &mut self.root_state); root_pod.event(&mut event_cx, &event); self.send_events(); @@ -399,7 +332,6 @@ impl, F: FnMut(&mut T) -> V> AppTask { }; match req { Ok(Some(req)) => match req { - AppReq::SetIdleHandle(handle) => self.idle_handle = Some(handle), AppReq::Events(events) => { for event in events { let id_path = &event.id_path[1..]; @@ -426,9 +358,6 @@ impl, F: FnMut(&mut T) -> V> AppTask { if needs_rebuild { // request re-render from UI thread if self.ui_state == UiState::Start { - if let Some(handle) = self.idle_handle.as_mut() { - handle.schedule_idle(IdleToken::new(42)); - } self.ui_state = UiState::WokeUI; } let id = id_path.last().unwrap(); diff --git a/src/app_main.rs b/src/app_main.rs index a05610892..639bd8bca 100644 --- a/src/app_main.rs +++ b/src/app_main.rs @@ -12,21 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::any::Any; - -use accesskit::TreeUpdate; -use glazier::{ - Application, Cursor, HotKey, IdleToken, Menu, PointerEvent, Region, Scalable, SysMods, - WinHandler, WindowBuilder, WindowHandle, -}; +use glazier::{Modifiers, PointerButton}; use vello::{ - kurbo::{Affine, Size}, + kurbo::{Affine, Point, Size}, peniko::Color, util::{RenderContext, RenderSurface}, AaSupport, RenderParams, Renderer, RendererOptions, Scene, }; +use winit::{ + event::WindowEvent, + event_loop::{ControlFlow, EventLoop}, + window::{Window, WindowBuilder}, +}; -use crate::{app::App, view::View, widget::Event}; +use crate::{app::App, view::View, widget::Event, widget::PointerCrusher}; // This is a bit of a hack just to get a window launched. The real version // would deal with multiple windows and have other ways to configure things. @@ -37,17 +36,16 @@ pub struct AppLauncher> { // The logic of this struct is mostly parallel to DruidHandler in win_handler.rs. struct MainState> { - handle: WindowHandle, + window: Window, app: App, render_cx: RenderContext, surface: Option, renderer: Option, scene: Scene, counter: u64, + main_pointer: PointerCrusher, } -const QUIT_MENU_ID: u32 = 0x100; - impl + 'static> AppLauncher { pub fn new(app: App) -> Self { AppLauncher { @@ -62,148 +60,159 @@ impl + 'static> AppLauncher { } pub fn run(self) { - let glazier_app = Application::new().unwrap(); - let mut file_menu = Menu::new(); - file_menu.add_item( - QUIT_MENU_ID, - "E&xit", - Some(&HotKey::new(SysMods::Cmd, "q")), - Some(false), - true, - ); - let mut menubar = Menu::new(); - menubar.add_dropdown(Menu::new(), "Application", true); - menubar.add_dropdown(file_menu, "&File", true); + let event_loop = EventLoop::new().unwrap(); + event_loop.set_control_flow(ControlFlow::Wait); let _guard = self.app.rt.enter(); - let main_state = MainState::new(self.app); - let window = WindowBuilder::new(glazier_app.clone()) - .handler(Box::new(main_state)) - .title(self.title) - .menu(menubar) - .size(Size::new(1024., 768.)) - .build() + let window = WindowBuilder::new() + .with_inner_size(winit::dpi::LogicalSize { + width: 1024., + height: 768., + }) + .build(&event_loop) .unwrap(); - window.show(); - glazier_app.run(None); - } -} - -impl + 'static> WinHandler for MainState { - fn connect(&mut self, handle: &WindowHandle) { - self.handle = handle.clone(); - self.app.connect(handle.clone()); - } + let mut main_state = MainState::new(self.app, window); - fn prepare_paint(&mut self) {} - - fn paint(&mut self, _: &Region) { - self.app.paint(); - self.render(); - self.schedule_render(); + event_loop + .run(move |event, elwt| match event { + winit::event::Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => elwt.exit(), + winit::event::Event::WindowEvent { + event: WindowEvent::RedrawRequested, + .. + } => main_state.paint(), + winit::event::Event::WindowEvent { + event: WindowEvent::Resized(winit::dpi::PhysicalSize { width, height }), + .. + } => main_state.size(Size { + width: width.into(), + height: height.into(), + }), + winit::event::Event::WindowEvent { + event: WindowEvent::ModifiersChanged(modifiers), + .. + } => { + let mut m = Modifiers::empty(); + let ms = modifiers.state(); + if ms.contains(winit::keyboard::ModifiersState::SHIFT) { + m |= Modifiers::SHIFT; + } + if ms.contains(winit::keyboard::ModifiersState::CONTROL) { + m |= Modifiers::CONTROL; + } + if ms.contains(winit::keyboard::ModifiersState::SUPER) { + m |= Modifiers::SUPER; + } + if ms.contains(winit::keyboard::ModifiersState::ALT) { + m |= Modifiers::ALT; + } + main_state.mods(m); + } + winit::event::Event::WindowEvent { + event: + WindowEvent::CursorMoved { + position: winit::dpi::PhysicalPosition { x, y }, + .. + }, + .. + } => main_state.pointer_move(Point { x, y }), + winit::event::Event::WindowEvent { + event: WindowEvent::CursorLeft { .. }, + .. + } => main_state.pointer_leave(), + winit::event::Event::WindowEvent { + event: WindowEvent::MouseInput { state, button, .. }, + .. + } => { + let b = match button { + winit::event::MouseButton::Left => PointerButton::Primary, + winit::event::MouseButton::Right => PointerButton::Secondary, + winit::event::MouseButton::Middle => PointerButton::Auxiliary, + winit::event::MouseButton::Back => PointerButton::X1, + winit::event::MouseButton::Forward => PointerButton::X2, + winit::event::MouseButton::Other(_) => PointerButton::None, + }; + match state { + winit::event::ElementState::Pressed => main_state.pointer_down(b), + winit::event::ElementState::Released => main_state.pointer_up(b), + } + } + _ => (), + }) + .unwrap(); } +} - fn idle(&mut self, _: IdleToken) {} - - fn command(&mut self, id: u32) { - match id { - QUIT_MENU_ID => { - self.handle.close(); - Application::global().quit() - } - _ => println!("unexpected id {}", id), +impl + 'static> MainState +where + T: Send + 'static, +{ + fn new(app: App, window: Window) -> Self { + let render_cx = RenderContext::new().unwrap(); + MainState { + window, + app, + render_cx, + surface: None, + renderer: None, + scene: Scene::default(), + counter: 0, + main_pointer: PointerCrusher::new(), } } - fn accesskit_tree(&mut self) -> TreeUpdate { - self.app.accesskit_connected = true; - self.app.accessibility() - } - - fn accesskit_action(&mut self, request: accesskit::ActionRequest) { - self.app - .window_event(Event::TargetedAccessibilityAction(request)); - self.handle.invalidate(); + fn size(&mut self, size: Size) { + self.app.size(size * 1.0 / self.window.scale_factor()); } - fn pointer_down(&mut self, event: &PointerEvent) { - self.app.window_event(Event::MouseDown(event.into())); - self.handle.invalidate(); + fn mods(&mut self, mods: Modifiers) { + self.main_pointer.mods(mods); } - fn pointer_up(&mut self, event: &PointerEvent) { - self.app.window_event(Event::MouseUp(event.into())); - self.handle.invalidate(); + fn pointer_move(&mut self, pos: Point) { + let scale_coefficient = 1.0 / self.window.scale_factor(); + self.app + .window_event(Event::MouseMove(self.main_pointer.moved(Point { + x: pos.x * scale_coefficient, + y: pos.y * scale_coefficient, + }))); + self.window.request_redraw(); } - fn pointer_move(&mut self, event: &PointerEvent) { - self.app.window_event(Event::MouseMove(event.into())); - self.handle.invalidate(); - self.handle.set_cursor(&Cursor::Arrow); + fn pointer_down(&mut self, button: PointerButton) { + self.app + .window_event(Event::MouseDown(self.main_pointer.pressed(button))); + self.window.request_redraw(); } - fn wheel(&mut self, event: &PointerEvent) { - self.app.window_event(Event::MouseWheel(event.into())); - self.handle.invalidate(); + fn pointer_up(&mut self, button: PointerButton) { + self.app + .window_event(Event::MouseUp(self.main_pointer.released(button))); + self.window.request_redraw(); } fn pointer_leave(&mut self) { self.app.window_event(Event::MouseLeft()); - self.handle.invalidate(); - } - - fn size(&mut self, size: Size) { - self.app.size(size); - } - - fn request_close(&mut self) { - self.handle.close(); + self.window.request_redraw(); } - fn destroy(&mut self) { - Application::global().quit() - } - - fn as_any(&mut self) -> &mut dyn Any { - self - } -} - -impl> MainState -where - T: Send, -{ - fn new(app: App) -> Self { - let render_cx = RenderContext::new().unwrap(); - MainState { - handle: Default::default(), - app, - render_cx, - surface: None, - renderer: None, - scene: Scene::default(), - counter: 0, - } - } - - fn schedule_render(&self) { - self.handle.invalidate(); + fn paint(&mut self) { + self.app.paint(); + self.render(); } fn render(&mut self) { let fragment = self.app.fragment(); - let handle = &self.handle; - let scale = handle.get_scale().unwrap_or_default(); - let insets = handle.content_insets().to_px(scale); - let mut size = handle.get_size().to_px(scale); - size.width -= insets.x_value(); - size.height -= insets.y_value(); - let width = size.width as u32; - let height = size.height as u32; + let scale = self.window.scale_factor(); + let size = self.window.inner_size(); + let width = size.width; + let height = size.height; if self.surface.is_none() { //println!("render size: {:?}", size); self.surface = Some( tokio::runtime::Handle::current() - .block_on(self.render_cx.create_surface(handle, width, height)) + .block_on(self.render_cx.create_surface(&self.window, width, height)) .unwrap(), ); } @@ -211,9 +220,8 @@ where if surface.config.width != width || surface.config.height != height { self.render_cx.resize_surface(surface, width, height); } - let (scale_x, scale_y) = (scale.x(), scale.y()); - let transform = if scale_x != 1.0 || scale_y != 1.0 { - Some(Affine::scale_non_uniform(scale_x, scale_y)) + let transform = if scale != 1.0 { + Some(Affine::scale(scale)) } else { None }; diff --git a/src/bloom.rs b/src/bloom.rs index 1571ef330..205ed2f58 100644 --- a/src/bloom.rs +++ b/src/bloom.rs @@ -71,6 +71,7 @@ impl Bloom { /// This can return false positives, but never false negatives. /// Thus `true` means that the item may have been added - or not, /// while `false` means that the item has definitely not been added. + #[allow(unused)] pub fn may_contain(&self, item: &T) -> bool { let mask = self.make_bit_mask(item); self.bits & mask == mask diff --git a/src/id.rs b/src/id.rs index 77ab6ead2..82b61fd97 100644 --- a/src/id.rs +++ b/src/id.rs @@ -29,7 +29,6 @@ impl Id { .unwrap()) } - #[allow(unused)] pub fn to_raw(self) -> u64 { self.0.into() } @@ -37,21 +36,4 @@ impl Id { pub fn to_nonzero_raw(self) -> NonZeroU64 { self.0 } - - /// Turns an `accesskit::NodeId` id into an `Id`. - /// - /// This method will only return `Some` for `accesskit::NodeId` values which were created from - /// `Id`'s. - /// - // TODO: Maybe we should not use AccessKit Ids at all in Widget implementation and do the - // mapping in the `App`. - pub fn try_from_accesskit(id: accesskit::NodeId) -> Option { - id.0.try_into().ok().map(Id) - } -} - -impl From for accesskit::NodeId { - fn from(id: Id) -> accesskit::NodeId { - accesskit::NodeId(id.to_nonzero_raw().into()) - } } diff --git a/src/lib.rs b/src/lib.rs index d5c29c1b2..f20da417e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,6 +18,5 @@ pub use app_main::AppLauncher; pub(crate) use bloom::Bloom; pub use geometry::Axis; -pub use accesskit; pub use parley; pub use vello; diff --git a/src/widget/button.rs b/src/widget/button.rs index 40683ea84..b19c8bd9e 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::ops::Deref; - use parley::Layout; use vello::{ kurbo::{Affine, Insets, Size}, @@ -26,8 +24,7 @@ use crate::{IdPath, Message}; use super::{ contexts::LifeCycleCx, piet_scene_helpers::{self, UnitPoint}, - AccessCx, BoxConstraints, ChangeFlags, Event, EventCx, LayoutCx, LifeCycle, PaintCx, UpdateCx, - Widget, + BoxConstraints, ChangeFlags, Event, EventCx, LayoutCx, LifeCycle, PaintCx, UpdateCx, Widget, }; pub struct Button { @@ -69,13 +66,6 @@ impl Widget for Button { cx.set_active(false); cx.request_paint(); } - Event::TargetedAccessibilityAction(request) => { - if request.action == accesskit::Action::Default - && cx.is_accesskit_target(request.target) - { - cx.add_message(Message::new(self.id_path.clone(), ())); - } - } _ => (), }; } @@ -112,13 +102,6 @@ impl Widget for Button { bc.constrain(size) } - fn accessibility(&mut self, cx: &mut AccessCx) { - let mut builder = accesskit::NodeBuilder::new(accesskit::Role::Button); - builder.set_name(self.label.deref()); - builder.set_default_action_verb(accesskit::DefaultActionVerb::Click); - cx.push_node(builder); - } - fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { let is_hot = cx.is_hot(); let is_active = cx.is_active(); diff --git a/src/widget/contexts.rs b/src/widget/contexts.rs index eb5277a79..a9568cb7d 100644 --- a/src/widget/contexts.rs +++ b/src/widget/contexts.rs @@ -17,10 +17,8 @@ //! Note: the organization of this code roughly follows the existing Druid //! widget system, particularly its contexts.rs. -use accesskit::TreeUpdate; -use glazier::WindowHandle; use parley::FontContext; -use vello::kurbo::{Point, Rect, Size}; +use vello::kurbo::{Point, Size}; use super::{PodFlags, WidgetState}; use crate::Message; @@ -30,7 +28,6 @@ use crate::Message; /// Static state that is shared between most contexts. pub struct CxState<'a> { #[allow(unused)] - window: &'a WindowHandle, font_cx: &'a mut FontContext, messages: &'a mut Vec, } @@ -83,16 +80,6 @@ pub struct LayoutCx<'a, 'b> { pub(crate) widget_state: &'a mut WidgetState, } -/// A context passed to [`accessibility`] methods of widgets. -/// -/// [`accessibility`]: crate::widget::Widget::accessibility -pub struct AccessCx<'a, 'b> { - pub(crate) cx_state: &'a mut CxState<'b>, - pub(crate) widget_state: &'a mut WidgetState, - pub(crate) update: &'a mut TreeUpdate, - pub(crate) node_classes: &'a mut accesskit::NodeClassSet, -} - /// A context passed to [`paint`] methods of widgets. /// /// [`paint`]: crate::widget::Widget::paint @@ -116,16 +103,8 @@ macro_rules! impl_context_method { } impl<'a> CxState<'a> { - pub fn new( - window: &'a WindowHandle, - font_cx: &'a mut FontContext, - messages: &'a mut Vec, - ) -> Self { - CxState { - window, - font_cx, - messages, - } + pub fn new(font_cx: &'a mut FontContext, messages: &'a mut Vec) -> Self { + CxState { font_cx, messages } } pub(crate) fn has_messages(&self) -> bool { @@ -159,11 +138,6 @@ impl<'a, 'b> EventCx<'a, 'b> { pub fn is_handled(&self) -> bool { self.is_handled } - - /// Check whether this widget's id matches the given id. - pub fn is_accesskit_target(&self, id: accesskit::NodeId) -> bool { - accesskit::NodeId::from(self.widget_state.id) == id - } } impl<'a, 'b> LifeCycleCx<'a, 'b> { @@ -193,48 +167,6 @@ impl<'a, 'b> LayoutCx<'a, 'b> { } } -// This function is unfortunate but works around kurbo versioning -fn to_accesskit_rect(r: Rect) -> accesskit::Rect { - println!("{:?}", r); - accesskit::Rect::new(r.x0, r.y0, r.x1, r.y1) -} - -impl<'a, 'b> AccessCx<'a, 'b> { - /// Add a node to the tree update being built. - /// - /// The id of the node pushed is obtained from the context. The - /// bounds are set based on the layout bounds. - pub fn push_node(&mut self, mut builder: accesskit::NodeBuilder) { - builder.set_bounds(to_accesskit_rect(Rect::from_origin_size( - self.widget_state.window_origin(), - self.widget_state.size, - ))); - let node = builder.build(self.node_classes); - self.push_node_raw(node); - } - - /// Add a node to the tree update being built. - /// - /// Similar to `push_node` but it is the responsibility of the caller - /// to set bounds before calling. - pub fn push_node_raw(&mut self, node: accesskit::Node) { - let id = self.widget_state.id.into(); - self.update.nodes.push((id, node)); - } - - /// Report whether accessibility was requested on this widget. - /// - /// This method is primarily intended for containers. The `accessibility` - /// method will be called on a widget when it or any of its descendants - /// have seen a request. However, in many cases a container need not push - /// a node for itself. - pub fn is_requested(&self) -> bool { - self.widget_state - .flags - .contains(PodFlags::REQUEST_ACCESSIBILITY) - } -} - impl<'a, 'b> PaintCx<'a, 'b> { pub(crate) fn new(cx_state: &'a mut CxState<'b>, widget_state: &'a mut WidgetState) -> Self { PaintCx { @@ -252,7 +184,6 @@ impl_context_method!( UpdateCx<'_, '_>, LifeCycleCx<'_, '_>, LayoutCx<'_, '_>, - AccessCx<'_, '_>, PaintCx<'_, '_>, { /// Returns whether this widget is hot. @@ -339,7 +270,6 @@ impl_context_method!( UpdateCx<'_, '_>, LifeCycleCx<'_, '_>, LayoutCx<'_, '_>, - AccessCx<'_, '_>, PaintCx<'_, '_>, { /// The layout size. diff --git a/src/widget/core.rs b/src/widget/core.rs index c4c727a19..68e308e11 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -28,8 +28,8 @@ use crate::Axis; use crate::{id::Id, Bloom}; use super::{ - contexts::LifeCycleCx, AccessCx, BoxConstraints, CxState, Event, EventCx, LayoutCx, LifeCycle, - PaintCx, UpdateCx, + contexts::LifeCycleCx, BoxConstraints, CxState, Event, EventCx, LayoutCx, LifeCycle, PaintCx, + UpdateCx, }; bitflags! { @@ -160,10 +160,6 @@ impl WidgetState { fn request(&mut self, flags: PodFlags) { self.flags |= flags } - - pub(crate) fn window_origin(&self) -> Point { - self.parent_window_origin + self.origin.to_vec2() - } } impl Pod { @@ -285,12 +281,6 @@ impl Pod { Pod::set_hot_state(&mut self.widget, &mut self.state, cx.cx_state, None); had_active || hot_changed } - Event::TargetedAccessibilityAction(action) => { - // println!("TODO: {:?}", action); - self.state - .sub_tree - .may_contain(&Id::try_from_accesskit(action.target).unwrap()) - } }; if recurse { // This clears the has_active state. Pod needs to clear this state since merge up can @@ -412,24 +402,6 @@ impl Pod { self.widget.compute_max_intrinsic(axis, &mut child_cx, bc) } - /// - pub fn accessibility(&mut self, cx: &mut AccessCx) { - if self.state.flags.intersects( - PodFlags::REQUEST_ACCESSIBILITY | PodFlags::DESCENDANT_REQUESTED_ACCESSIBILITY, - ) { - let mut child_cx = AccessCx { - cx_state: cx.cx_state, - widget_state: &mut self.state, - update: cx.update, - node_classes: cx.node_classes, - }; - self.widget.accessibility(&mut child_cx); - self.state.flags.remove( - PodFlags::REQUEST_ACCESSIBILITY | PodFlags::DESCENDANT_REQUESTED_ACCESSIBILITY, - ); - } - } - pub fn paint_raw(&mut self, cx: &mut PaintCx, scene: &mut Scene) { let mut inner_cx = PaintCx { cx_state: cx.cx_state, diff --git a/src/widget/linear_layout.rs b/src/widget/linear_layout.rs index 8183543c3..e3a890ba1 100644 --- a/src/widget/linear_layout.rs +++ b/src/widget/linear_layout.rs @@ -13,8 +13,7 @@ // limitations under the License. use crate::geometry::Axis; -use crate::widget::{AccessCx, BoxConstraints, Event}; -use accesskit::NodeId; +use crate::widget::{BoxConstraints, Event}; use vello::kurbo::Size; use vello::Scene; @@ -83,23 +82,6 @@ impl Widget for LinearLayout { self.axis.pack(major_used, max_minor) } - fn accessibility(&mut self, cx: &mut AccessCx) { - for child in &mut self.children { - child.accessibility(cx); - } - - if cx.is_requested() { - let mut builder = accesskit::NodeBuilder::new(accesskit::Role::GenericContainer); - builder.set_children( - self.children - .iter() - .map(|pod| pod.id().into()) - .collect::>(), - ); - cx.push_node(builder); - } - } - fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { for child in &mut self.children { // println!("paint child!"); diff --git a/src/widget/mod.rs b/src/widget/mod.rs index a2b73c6c5..7da04cc9f 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -31,9 +31,9 @@ pub use self::core::{ChangeFlags, Pod}; pub(crate) use self::core::{PodFlags, WidgetState}; pub use box_constraints::BoxConstraints; pub use button::Button; -pub use contexts::{AccessCx, CxState, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; +pub use contexts::{CxState, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; pub use linear_layout::LinearLayout; -pub use raw_event::{Event, LifeCycle, MouseEvent, ViewContext}; +pub use raw_event::{Event, LifeCycle, MouseEvent, PointerCrusher, ViewContext}; pub use switch::Switch; pub use text::TextWidget; pub use widget::{AnyWidget, Widget}; diff --git a/src/widget/raw_event.rs b/src/widget/raw_event.rs index f4049663d..ec8e3754a 100644 --- a/src/widget/raw_event.rs +++ b/src/widget/raw_event.rs @@ -17,7 +17,7 @@ //! Note: arguably this module should be renamed, perhaps we should use //! "event" for this level and maybe "message" at the View level. -use glazier::{Modifiers, PointerButton, PointerButtons, PointerType}; +use glazier::{Modifiers, PointerButton, PointerButtons}; use vello::kurbo::{Point, Rect, Vec2}; #[derive(Debug, Clone)] @@ -27,7 +27,6 @@ pub enum Event { MouseMove(MouseEvent), MouseWheel(MouseEvent), MouseLeft(), - TargetedAccessibilityAction(accesskit::ActionRequest), } #[derive(Debug, Clone)] @@ -58,21 +57,17 @@ pub struct ViewContext { pub mouse_position: Option, } -impl<'a> From<&'a glazier::PointerEvent> for MouseEvent { - fn from(src: &glazier::PointerEvent) -> MouseEvent { +impl Default for MouseEvent { + fn default() -> Self { MouseEvent { - pos: src.pos, - window_pos: src.pos, - buttons: src.buttons, - mods: src.modifiers, - count: src.count, - focus: src.focus, - button: src.button, - wheel_delta: if let PointerType::Mouse(ref info) = src.pointer_type { - info.wheel_delta - } else { - Vec2::ZERO - }, + pos: Point::ZERO, + window_pos: Point::ZERO, + buttons: PointerButtons::new(), + mods: Modifiers::default(), + count: 0, + focus: false, + button: PointerButton::None, + wheel_delta: Vec2::ZERO, } } } @@ -87,3 +82,115 @@ impl ViewContext { } } } + +/// Crush all pointer events into a single pointer that counts clicks +/// and attaches positions to events that don't contain them. +#[derive(Default)] +pub struct PointerCrusher { + e: MouseEvent, + counter: ClickCounter, +} + +impl PointerCrusher { + pub fn new() -> Self { + PointerCrusher::default() + } + + pub fn mods(&mut self, mods: Modifiers) { + self.e.mods = mods; + } + + pub fn pressed(&mut self, button: PointerButton) -> MouseEvent { + self.e.wheel_delta = Vec2::ZERO; + self.e.buttons.insert(button); + self.e.count = self.counter.count_for_click(self.e.pos); + self.e.button = button; + self.e.clone() + } + + pub fn released(&mut self, button: PointerButton) -> MouseEvent { + self.e.wheel_delta = Vec2::ZERO; + self.e.buttons.remove(button); + self.e.button = button; + self.e.clone() + } + + pub fn moved(&mut self, pos: Point) -> MouseEvent { + self.e.wheel_delta = Vec2::ZERO; + self.e.button = PointerButton::None; + self.e.pos = pos; + self.e.window_pos = pos; + self.e.clone() + } + + pub fn wheel(&mut self, wheel_delta: Vec2) -> MouseEvent { + self.e.wheel_delta = wheel_delta; + self.e.button = PointerButton::None; + self.e.clone() + } +} + +use instant::Instant; +use std::cell::Cell; +use std::time::Duration; + +// This is the default timing on windows. +const MULTI_CLICK_INTERVAL: Duration = Duration::from_millis(500); +// the max distance between two clicks for them to count as a multi-click +const MULTI_CLICK_MAX_DISTANCE: f64 = 5.0; + +/// A small helper for determining the click-count of a mouse-down event. +/// +/// Click-count is incremented if both the duration and distance between a pair +/// of clicks are below some threshold. +#[derive(Debug, Clone)] +struct ClickCounter { + max_interval: Cell, + max_distance: Cell, + last_click: Cell, + last_pos: Cell, + click_count: Cell, +} + +#[allow(dead_code)] +impl ClickCounter { + /// Create a new `ClickCounter` with the given interval and distance. + pub fn new(max_interval: Duration, max_distance: f64) -> ClickCounter { + ClickCounter { + max_interval: Cell::new(max_interval), + max_distance: Cell::new(max_distance), + last_click: Cell::new(Instant::now()), + click_count: Cell::new(0), + last_pos: Cell::new(Point::new(f64::MAX, 0.0)), + } + } + + pub fn set_interval_ms(&self, millis: u64) { + self.max_interval.set(Duration::from_millis(millis)); + } + + pub fn set_distance(&self, distance: f64) { + self.max_distance.set(distance); + } + + /// Return the click count for a click occurring now, at the provided position. + pub fn count_for_click(&self, click_pos: Point) -> u8 { + let click_time = Instant::now(); + let last_time = self.last_click.replace(click_time); + let last_pos = self.last_pos.replace(click_pos); + let elapsed = click_time - last_time; + let distance = last_pos.distance(click_pos); + if elapsed > self.max_interval.get() || distance > self.max_distance.get() { + self.click_count.set(0); + } + let click_count = self.click_count.get().saturating_add(1); + self.click_count.set(click_count); + click_count + } +} + +impl Default for ClickCounter { + fn default() -> Self { + ClickCounter::new(MULTI_CLICK_INTERVAL, MULTI_CLICK_MAX_DISTANCE) + } +} diff --git a/src/widget/switch.rs b/src/widget/switch.rs index ca88843d2..21a080706 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -23,8 +23,7 @@ use crate::{IdPath, Message}; use super::{ contexts::LifeCycleCx, piet_scene_helpers::{fill_color, stroke}, - AccessCx, BoxConstraints, ChangeFlags, Event, EventCx, LayoutCx, LifeCycle, PaintCx, UpdateCx, - Widget, + BoxConstraints, ChangeFlags, Event, EventCx, LayoutCx, LifeCycle, PaintCx, UpdateCx, Widget, }; pub struct Switch { @@ -100,13 +99,6 @@ impl Widget for Switch { } cx.request_paint(); } - Event::TargetedAccessibilityAction(request) => { - if request.action == accesskit::Action::Default - && cx.is_accesskit_target(request.target) - { - cx.add_message(Message::new(self.id_path.clone(), ())); - } - } _ => (), }; } @@ -125,12 +117,6 @@ impl Widget for Switch { Size::new(SWITCH_WIDTH, SWITCH_HEIGHT) } - fn accessibility(&mut self, cx: &mut AccessCx) { - let mut builder = accesskit::NodeBuilder::new(accesskit::Role::Switch); - builder.set_default_action_verb(accesskit::DefaultActionVerb::Click); - cx.push_node(builder); - } - fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { // Change the position of of the knob based on its state // If the knob is currently being dragged with the mouse use the position that was set in MouseMove diff --git a/src/widget/taffy_layout.rs b/src/widget/taffy_layout.rs index 9549d276d..f4d54056c 100644 --- a/src/widget/taffy_layout.rs +++ b/src/widget/taffy_layout.rs @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::geometry::Axis; -use crate::widget::{AccessCx, BoxConstraints, Event}; -use accesskit::NodeId; +use crate::{ + geometry::Axis, + widget::{BoxConstraints, Event}, +}; use vello::{ kurbo::{Affine, Point, Size}, peniko::{Brush, Color, Fill}, @@ -408,23 +409,6 @@ impl Widget for TaffyLayout { output.size.get_abs(taffy_axis) as f64 } - fn accessibility(&mut self, cx: &mut AccessCx) { - for child in &mut self.children { - child.accessibility(cx); - } - - if cx.is_requested() { - let mut builder = accesskit::NodeBuilder::new(accesskit::Role::GenericContainer); - builder.set_children( - self.children - .iter() - .map(|pod| pod.id().into()) - .collect::>(), - ); - cx.push_node(builder); - } - } - fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { if let Some(color) = self.background_color { scene.fill( diff --git a/src/widget/text.rs b/src/widget/text.rs index 33aed3f71..9548da74d 100644 --- a/src/widget/text.rs +++ b/src/widget/text.rs @@ -119,10 +119,4 @@ impl Widget for TextWidget { crate::text::render_text(scene, Affine::IDENTITY, layout); } } - - fn accessibility(&mut self, cx: &mut super::AccessCx) { - let mut builder = accesskit::NodeBuilder::new(accesskit::Role::StaticText); - builder.set_value(self.text.clone()); - cx.push_node(builder); - } } diff --git a/src/widget/widget.rs b/src/widget/widget.rs index 4e36c7735..dab5032e9 100644 --- a/src/widget/widget.rs +++ b/src/widget/widget.rs @@ -19,7 +19,7 @@ use crate::geometry::Axis; use vello::{kurbo::Size, Scene}; use super::box_constraints::BoxConstraints; -use super::contexts::{AccessCx, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; +use super::contexts::{EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; use super::raw_event::{Event, LifeCycle}; /// A basic widget trait. @@ -91,9 +91,6 @@ pub trait Widget { /// [`set_origin`]: struct.WidgetPod.html#method.set_origin fn layout(&mut self, cx: &mut LayoutCx, bc: &BoxConstraints) -> Size; - /// Update the accessibility tree. - fn accessibility(&mut self, cx: &mut AccessCx); - /// Paint the widget appearance. /// /// The [`PaintCtx`] derefs to something that implements the [`RenderContext`] @@ -230,10 +227,6 @@ impl Widget for Box { self.deref_mut().compute_max_intrinsic(axis, ctx, bc) } - fn accessibility(&mut self, cx: &mut AccessCx) { - self.deref_mut().accessibility(cx); - } - fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { self.deref_mut().paint(cx, scene); } From f2454ebe77f94cdd9dfc4e93c462da52d3bf35ee Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Sat, 24 Feb 2024 12:09:33 +0100 Subject: [PATCH 09/17] Updated dependencies (notably wgpu and vello) (#177) --- Cargo.lock | 434 ++++++++++++++++++++++++++---------------------- Cargo.toml | 7 +- src/app_main.rs | 110 ++++++------ 3 files changed, 297 insertions(+), 254 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 282539a20..68af6a7ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" dependencies = [ "cfg-if", "getrandom", @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arrayref" @@ -171,13 +171,13 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 4.0.3", - "event-listener-strategy", + "event-listener 5.1.0", + "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", ] @@ -214,7 +214,7 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel 2.1.1", + "async-channel 2.2.0", "async-executor", "async-io 2.3.1", "async-lock 3.3.0", @@ -255,7 +255,7 @@ dependencies = [ "futures-io", "futures-lite 2.2.0", "parking", - "polling 3.4.0", + "polling 3.5.0", "rustix 0.38.31", "slab", "tracing", @@ -278,7 +278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", - "event-listener-strategy", + "event-listener-strategy 0.4.0", "pin-project-lite", ] @@ -307,7 +307,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -368,7 +368,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -417,7 +417,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.50", "which", ] @@ -488,7 +488,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.1", + "async-channel 2.2.0", "async-lock 3.3.0", "async-task", "fastrand 2.0.1", @@ -500,15 +500,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" dependencies = [ "bytemuck_derive", ] @@ -521,7 +521,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -558,7 +558,7 @@ checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ "bitflags 2.4.2", "log", - "polling 3.4.0", + "polling 3.5.0", "rustix 0.38.31", "slab", "thiserror", @@ -578,11 +578,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" dependencies = [ - "jobserver", "libc", ] @@ -665,10 +664,35 @@ dependencies = [ ] [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" @@ -792,9 +816,8 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" dependencies = [ "bitflags 2.4.2", "libloading 0.8.1", @@ -837,6 +860,15 @@ dependencies = [ "libloading 0.8.1", ] +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + [[package]] name = "downcast-rs" version = "1.2.0" @@ -845,15 +877,15 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "enumflags2" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" dependencies = [ "enumflags2_derive", "serde", @@ -861,13 +893,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -936,6 +968,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener-strategy" version = "0.4.0" @@ -946,6 +989,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.1.0", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -961,18 +1014,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" -[[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "spin", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1003,7 +1044,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1116,7 +1157,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1186,10 +1227,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1338,11 +1377,10 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", "presser", "thiserror", @@ -1398,14 +1436,14 @@ dependencies = [ [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.4.2", + "com", "libc", - "libloading 0.7.4", + "libloading 0.8.1", "thiserror", "widestring", "winapi", @@ -1413,9 +1451,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -1467,9 +1505,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -1500,12 +1538,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix 0.38.31", + "libc", "windows-sys 0.52.0", ] @@ -1537,15 +1575,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.68" @@ -1671,6 +1700,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.11" @@ -1803,10 +1838,10 @@ dependencies = [ [[package]] name = "naga" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" dependencies = [ + "arrayvec", "bit-set", "bitflags 2.4.2", "codespan-reporting", @@ -1821,15 +1856,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", -] - [[package]] name = "ndk" version = "0.8.0" @@ -1899,9 +1925,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -1931,10 +1957,10 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2121,9 +2147,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" @@ -2143,9 +2169,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" dependencies = [ "cfg-if", "concurrent-queue", @@ -2174,7 +2200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2184,7 +2210,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", ] [[package]] @@ -2198,9 +2233,9 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "quick-xml" @@ -2279,9 +2314,9 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "read-fonts" -version = "0.15.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1362980db95801b70031dd592dc052a44b1810ca9da8fbcf7b25983f3174ed0" +checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" dependencies = [ "font-types", ] @@ -2380,9 +2415,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -2420,29 +2455,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -2457,7 +2492,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2604,23 +2639,13 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.4.2", ] [[package]] @@ -2675,9 +2700,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -2736,34 +2761,34 @@ checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2850,7 +2875,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2870,6 +2895,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.40" @@ -2890,7 +2926,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -2961,9 +2997,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -3013,12 +3049,12 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vello" version = "0.0.1" -source = "git+https://github.com/linebender/vello?rev=b1bd9e361f2944b71cef0ea8a2c71dce5182d79b#b1bd9e361f2944b71cef0ea8a2c71dce5182d79b" +source = "git+https://github.com/linebender/vello?rev=6fa114c020f8656947e283bdf4bed96fe7a54c70#6fa114c020f8656947e283bdf4bed96fe7a54c70" dependencies = [ "bytemuck", "futures-intrusive", "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "skrifa", "vello_encoding", "wgpu", @@ -3027,7 +3063,7 @@ dependencies = [ [[package]] name = "vello_encoding" version = "0.1.0" -source = "git+https://github.com/linebender/vello?rev=b1bd9e361f2944b71cef0ea8a2c71dce5182d79b#b1bd9e361f2944b71cef0ea8a2c71dce5182d79b" +source = "git+https://github.com/linebender/vello?rev=6fa114c020f8656947e283bdf4bed96fe7a54c70#6fa114c020f8656947e283bdf4bed96fe7a54c70" dependencies = [ "bytemuck", "guillotiere", @@ -3084,7 +3120,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", "wasm-bindgen-shared", ] @@ -3118,7 +3154,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3326,9 +3362,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -3346,19 +3382,19 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" dependencies = [ "arrayvec", "cfg-if", - "flume", + "cfg_aliases", + "document-features", "js-sys", "log", "naga", "parking_lot", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "smallvec", "static_assertions", "wasm-bindgen", @@ -3371,19 +3407,22 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef91c1d62d1e9e81c79e600131a258edf75c9531cbdbde09c44a011a47312726" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.4.2", + "cfg_aliases", "codespan-reporting", + "document-features", + "indexmap", "log", "naga", + "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "rustc-hash", "smallvec", "thiserror", @@ -3394,9 +3433,8 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ecc802da3eb67b4cf3dd9ea6fe45bbb47ef13e6c49c5c3240868a9cc6cdd9" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" dependencies = [ "android_system_properties", "arrayvec", @@ -3404,6 +3442,7 @@ dependencies = [ "bit-set", "bitflags 2.4.2", "block", + "cfg_aliases", "core-graphics-types", "d3d12", "glow", @@ -3424,7 +3463,7 @@ dependencies = [ "parking_lot", "profiling", "range-alloc", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "renderdoc-sys", "rustc-hash", "smallvec", @@ -3437,9 +3476,8 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" dependencies = [ "bitflags 2.4.2", "js-sys", @@ -3506,21 +3544,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.48.5", + "windows-targets 0.52.3", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.3", ] [[package]] @@ -3547,7 +3585,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -3582,17 +3620,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -3609,9 +3647,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" @@ -3627,9 +3665,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" @@ -3645,9 +3683,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" @@ -3663,9 +3701,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" @@ -3681,9 +3719,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" @@ -3699,9 +3737,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" @@ -3717,9 +3755,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" [[package]] name = "winit" @@ -3772,9 +3810,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.5.39" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -3978,7 +4016,7 @@ version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "regex", @@ -4020,7 +4058,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -4044,7 +4082,7 @@ version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", diff --git a/Cargo.toml b/Cargo.toml index 6a97c135e..a52e422bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,8 +49,8 @@ taffy = ["dep:taffy"] [dependencies] xilem_core.workspace = true taffy = { version = "0.4.0", optional = true } -vello = { git = "https://github.com/linebender/vello", rev = "b1bd9e361f2944b71cef0ea8a2c71dce5182d79b" } -wgpu = "0.18.0" +vello = { git = "https://github.com/linebender/vello", rev = "6fa114c020f8656947e283bdf4bed96fe7a54c70" } +wgpu = "0.19.0" parley = { git = "https://github.com/dfrg/parley", rev = "1940d1ae9f2a9b44b7c18967147ffa7d345fdafd" } tokio = { version = "1.35", features = ["full"] } futures-task = "0.3" @@ -68,3 +68,6 @@ default-features = false [dev-dependencies] env_logger = "0.10.0" test-log = "0.2.11" + +[patch.crates-io] +wgpu = { git = 'https://github.com/gfx-rs/wgpu.git' } diff --git a/src/app_main.rs b/src/app_main.rs index 639bd8bca..bab0e60af 100644 --- a/src/app_main.rs +++ b/src/app_main.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::{num::NonZeroUsize, sync::Arc}; + use glazier::{Modifiers, PointerButton}; use vello::{ kurbo::{Affine, Point, Size}, @@ -35,11 +37,11 @@ pub struct AppLauncher> { } // The logic of this struct is mostly parallel to DruidHandler in win_handler.rs. -struct MainState> { - window: Window, +struct MainState<'a, T, V: View> { + window: Arc, app: App, render_cx: RenderContext, - surface: Option, + surface: RenderSurface<'a>, renderer: Option, scene: Scene, counter: u64, @@ -144,17 +146,22 @@ impl + 'static> AppLauncher { } } -impl + 'static> MainState +impl<'a, T, V: View + 'static> MainState<'a, T, V> where T: Send + 'static, { fn new(app: App, window: Window) -> Self { - let render_cx = RenderContext::new().unwrap(); + let mut render_cx = RenderContext::new().unwrap(); + let size = window.inner_size(); + let window = Arc::new(window); + let surface = tokio::runtime::Handle::current() + .block_on(render_cx.create_surface(window.clone(), size.width, size.height)) + .unwrap(); MainState { window, app, render_cx, - surface: None, + surface, renderer: None, scene: Scene::default(), counter: 0, @@ -208,54 +215,49 @@ where let size = self.window.inner_size(); let width = size.width; let height = size.height; - if self.surface.is_none() { - //println!("render size: {:?}", size); - self.surface = Some( - tokio::runtime::Handle::current() - .block_on(self.render_cx.create_surface(&self.window, width, height)) - .unwrap(), - ); - } - if let Some(surface) = self.surface.as_mut() { - if surface.config.width != width || surface.config.height != height { - self.render_cx.resize_surface(surface, width, height); - } - let transform = if scale != 1.0 { - Some(Affine::scale(scale)) - } else { - None - }; - self.scene.reset(); - self.scene.append(fragment, transform); - self.counter += 1; - let surface_texture = surface - .surface - .get_current_texture() - .expect("failed to acquire next swapchain texture"); - let dev_id = surface.dev_id; - let device = &self.render_cx.devices[dev_id].device; - let queue = &self.render_cx.devices[dev_id].queue; - let renderer_options = RendererOptions { - surface_format: Some(surface.format), - use_cpu: false, - antialiasing_support: AaSupport { - area: true, - msaa8: false, - msaa16: false, - }, - }; - let render_params = RenderParams { - base_color: Color::BLACK, - width, - height, - antialiasing_method: vello::AaConfig::Area, - }; - self.renderer - .get_or_insert_with(|| Renderer::new(device, renderer_options).unwrap()) - .render_to_surface(device, queue, &self.scene, &surface_texture, &render_params) - .expect("failed to render to surface"); - surface_texture.present(); - device.poll(wgpu::Maintain::Wait); + + if self.surface.config.width != width || self.surface.config.height != height { + self.render_cx + .resize_surface(&mut self.surface, width, height); } + let transform = if scale != 1.0 { + Some(Affine::scale(scale)) + } else { + None + }; + self.scene.reset(); + self.scene.append(fragment, transform); + self.counter += 1; + + let surface_texture = self + .surface + .surface + .get_current_texture() + .expect("failed to acquire next swapchain texture"); + let dev_id = self.surface.dev_id; + let device = &self.render_cx.devices[dev_id].device; + let queue = &self.render_cx.devices[dev_id].queue; + let renderer_options = RendererOptions { + surface_format: Some(self.surface.format), + use_cpu: false, + antialiasing_support: AaSupport { + area: true, + msaa8: false, + msaa16: false, + }, + num_init_threads: NonZeroUsize::new(1), + }; + let render_params = RenderParams { + base_color: Color::BLACK, + width, + height, + antialiasing_method: vello::AaConfig::Area, + }; + self.renderer + .get_or_insert_with(|| Renderer::new(device, renderer_options).unwrap()) + .render_to_surface(device, queue, &self.scene, &surface_texture, &render_params) + .expect("failed to render to surface"); + surface_texture.present(); + device.poll(wgpu::Maintain::Wait); } } From 277160b484806b76ceed4d088418a92fd484b42e Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Tue, 27 Feb 2024 13:06:03 +0100 Subject: [PATCH 10/17] Add fine-grained tree-structure tracking in `xilem` and effcient tree-updates in `xilem_web` (#160) * Generalize `VecSplice` that is used in the ViewSequences as `ElementsSplice` trait and optimized tree-structure diffing in `xilem_web` with it * Implement tree-structure tracking * Moved tree-structure tracking into view and added tests and comments * Deleted bloom filter * Refactor tree structure tracking using methods like `Cx::with_pod` * Add doc comments describing situations where the tree-structure will panic * Deleted bloom filter (again whoops) * Add doc comments for panic situations --- crates/xilem_core/src/sequence.rs | 141 +++++++++++++++--------- crates/xilem_core/src/vec_splice.rs | 8 ++ crates/xilem_web/src/context.rs | 33 +++++- crates/xilem_web/src/elements.rs | 163 +++++++++++++++++++--------- crates/xilem_web/src/lib.rs | 4 +- crates/xilem_web/src/one_of.rs | 12 +- crates/xilem_web/src/view.rs | 8 +- src/app.rs | 46 +++++--- src/bloom.rs | 163 ---------------------------- src/lib.rs | 2 - src/view/linear_layout.rs | 13 ++- src/view/list.rs | 18 +-- src/view/mod.rs | 4 +- src/view/taffy_layout.rs | 9 +- src/view/tree_structure_tracking.rs | 61 +++++++++++ src/view/view.rs | 58 +++++++++- src/widget/contexts.rs | 20 +++- src/widget/core.rs | 23 +--- src/widget/mod.rs | 2 + src/widget/tree_structure.rs | 143 ++++++++++++++++++++++++ 20 files changed, 594 insertions(+), 337 deletions(-) delete mode 100644 src/bloom.rs create mode 100644 src/view/tree_structure_tracking.rs create mode 100644 src/widget/tree_structure.rs diff --git a/crates/xilem_core/src/sequence.rs b/crates/xilem_core/src/sequence.rs index 60444b7c5..622cb3dce 100644 --- a/crates/xilem_core/src/sequence.rs +++ b/crates/xilem_core/src/sequence.rs @@ -4,11 +4,11 @@ #[doc(hidden)] #[macro_export] macro_rules! impl_view_tuple { - ( $viewseq:ident, $pod:ty, $cx:ty, $changeflags:ty, $( $t:ident),* ; $( $i:tt ),* ) => { + ( $viewseq:ident, $elements_splice: ident, $pod:ty, $cx:ty, $changeflags:ty, $( $t:ident),* ; $( $i:tt ),* ) => { impl ),* > $viewseq for ( $( $t, )* ) { type State = ( $( $t::State, )*); - fn build(&self, cx: &mut $cx, elements: &mut Vec<$pod>) -> Self::State { + fn build(&self, cx: &mut $cx, elements: &mut dyn $elements_splice) -> Self::State { let b = ( $( self.$i.build(cx, elements), )* ); let state = ( $( b.$i, )*); state @@ -19,7 +19,7 @@ macro_rules! impl_view_tuple { cx: &mut $cx, prev: &Self, state: &mut Self::State, - els: &mut $crate::VecSplice<$pod>, + els: &mut dyn $elements_splice, ) -> ChangeFlags { let mut changed = <$changeflags>::default(); $( @@ -53,10 +53,56 @@ macro_rules! impl_view_tuple { } } } - #[macro_export] macro_rules! generate_viewsequence_trait { - ($viewseq:ident, $view:ident, $viewmarker: ident, $bound:ident, $cx:ty, $changeflags:ty, $pod:ty; $( $ss:tt )* ) => { + ($viewseq:ident, $view:ident, $viewmarker: ident, $elements_splice: ident, $bound:ident, $cx:ty, $changeflags:ty, $pod:ty; $( $ss:tt )* ) => { + + /// A temporary "splice" to add, update, delete and monitor elements in a sequence of elements. + /// It is mainly intended for view sequences + /// + /// Usually it's backed by a collection (e.g. `Vec`) that holds all the (existing) elements. + /// It sweeps over the element collection and does updates in place. + /// Internally it works by having a pointer/index to the current/old element (0 at the beginning), + /// and the pointer is incremented by basically all methods that mutate that sequence. + pub trait $elements_splice { + /// Insert a new element at the current index in the resulting collection (and increment the index by 1) + fn push(&mut self, element: $pod, cx: &mut $cx); + /// Mutate the next existing element, and add it to the resulting collection (and increment the index by 1) + fn mutate(&mut self, cx: &mut $cx) -> &mut $pod; + // TODO(#160) this could also track view id changes (old_id, new_id) + /// Mark any changes done by `mutate` on the current element (this doesn't change the index) + fn mark(&mut self, changeflags: $changeflags, cx: &mut $cx) -> $changeflags; + /// Delete the next n existing elements (this doesn't change the index) + fn delete(&mut self, n: usize, cx: &mut $cx); + /// Current length of the elements collection + fn len(&self) -> usize; + // TODO(#160) add a skip method when it is necessary (e.g. relevant for immutable ViewSequences like ropes) + } + + impl<'a, 'b> $elements_splice for $crate::VecSplice<'a, 'b, $pod> { + fn push(&mut self, element: $pod, _cx: &mut $cx) { + self.push(element); + } + + fn mutate(&mut self, _cx: &mut $cx) -> &mut $pod + { + self.mutate() + } + + fn mark(&mut self, changeflags: $changeflags, _cx: &mut $cx) -> $changeflags + { + self.peek_mut().map(|pod| pod.mark(changeflags)).unwrap_or_default() + } + + fn delete(&mut self, n: usize, _cx: &mut $cx) { + self.delete(n) + } + + fn len(&self) -> usize { + self.len() + } + } + /// This trait represents a (possibly empty) sequence of views. /// /// It is up to the parent view how to lay out and display them. @@ -65,7 +111,10 @@ macro_rules! generate_viewsequence_trait { type State $( $ss )*; /// Build the associated widgets and initialize all states. - fn build(&self, cx: &mut $cx, elements: &mut Vec<$pod>) -> Self::State; + /// + /// To be able to monitor changes (e.g. tree-structure tracking) rather than just adding elements, + /// this takes an element splice as well (when it could be just a `Vec` otherwise) + fn build(&self, cx: &mut $cx, elements: &mut dyn $elements_splice) -> Self::State; /// Update the associated widget. /// @@ -75,7 +124,7 @@ macro_rules! generate_viewsequence_trait { cx: &mut $cx, prev: &Self, state: &mut Self::State, - element: &mut $crate::VecSplice<$pod>, + elements: &mut dyn $elements_splice, ) -> $changeflags; /// Propagate a message. @@ -100,9 +149,9 @@ macro_rules! generate_viewsequence_trait { { type State = (>::State, $crate::Id); - fn build(&self, cx: &mut $cx, elements: &mut Vec<$pod>) -> Self::State { - let (id, state, element) = >::build(self, cx); - elements.push(<$pod>::new(element)); + fn build(&self, cx: &mut $cx, elements: &mut dyn $elements_splice) -> Self::State { + let (id, state, pod) = cx.with_new_pod(|cx| >::build(self, cx)); + elements.push(pod, cx); (state, id) } @@ -111,20 +160,20 @@ macro_rules! generate_viewsequence_trait { cx: &mut $cx, prev: &Self, state: &mut Self::State, - element: &mut $crate::VecSplice<$pod>, + elements: &mut dyn $elements_splice, ) -> $changeflags { - let el = element.mutate(); - let downcast = el.downcast_mut().unwrap(); - let flags = >::rebuild( - self, - cx, - prev, - &mut state.1, - &mut state.0, - downcast, - ); - - el.mark(flags) + let pod = elements.mutate(cx); + let flags = cx.with_pod(pod, |el, cx| { + >::rebuild( + self, + cx, + prev, + &mut state.1, + &mut state.0, + el, + ) + }); + elements.mark(flags, cx) } fn message( @@ -156,7 +205,7 @@ macro_rules! generate_viewsequence_trait { impl> $viewseq for Option { type State = Option; - fn build(&self, cx: &mut $cx, elements: &mut Vec<$pod>) -> Self::State { + fn build(&self, cx: &mut $cx, elements: &mut dyn $elements_splice) -> Self::State { match self { None => None, Some(vt) => { @@ -171,20 +220,19 @@ macro_rules! generate_viewsequence_trait { cx: &mut $cx, prev: &Self, state: &mut Self::State, - element: &mut $crate::VecSplice<$pod>, + elements: &mut dyn $elements_splice, ) -> $changeflags { match (self, &mut *state, prev) { - (Some(this), Some(state), Some(prev)) => this.rebuild(cx, prev, state, element), + (Some(this), Some(state), Some(prev)) => this.rebuild(cx, prev, state, elements), (None, Some(seq_state), Some(prev)) => { let count = prev.count(&seq_state); - element.delete(count); + elements.delete(count, cx); *state = None; <$changeflags>::tree_structure() } (Some(this), None, None) => { - let seq_state = element.as_vec(|vec| this.build(cx, vec)); - *state = Some(seq_state); + *state = Some(this.build(cx, elements)); <$changeflags>::tree_structure() } @@ -219,7 +267,7 @@ macro_rules! generate_viewsequence_trait { impl> $viewseq for Vec { type State = Vec; - fn build(&self, cx: &mut $cx, elements: &mut Vec<$pod>) -> Self::State { + fn build(&self, cx: &mut $cx, elements: &mut dyn $elements_splice) -> Self::State { self.iter().map(|child| child.build(cx, elements)).collect() } @@ -228,7 +276,7 @@ macro_rules! generate_viewsequence_trait { cx: &mut $cx, prev: &Self, state: &mut Self::State, - elements: &mut $crate::VecSplice<$pod>, + elements: &mut dyn $elements_splice, ) -> $changeflags { let mut changed = <$changeflags>::default(); for ((child, child_prev), child_state) in self.iter().zip(prev).zip(state.iter_mut()) { @@ -242,16 +290,11 @@ macro_rules! generate_viewsequence_trait { .enumerate() .map(|(i, state)| prev[n + i].count(&state)) .sum(); - elements.delete(n_delete); + elements.delete(n_delete, cx); changed |= <$changeflags>::tree_structure(); } else if n > prev.len() { - let mut child_elements = vec![]; for i in prev.len()..n { - state.push(self[i].build(cx, &mut child_elements)); - } - // Discussion question: should VecSplice get an extend method? - for element in child_elements { - elements.push(element); + state.push(self[i].build(cx, elements)); } changed |= <$changeflags>::tree_structure(); } @@ -295,26 +338,26 @@ macro_rules! generate_viewsequence_trait { #[doc = concat!("`", stringify!($viewmarker), "`.")] pub trait $viewmarker {} - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, ;); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, ;); + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0; 0); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1; 0, 1); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2; 0, 1, 2); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3; 0, 1, 2, 3); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3, V4; 0, 1, 2, 3, 4); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3, V4, V5; 0, 1, 2, 3, 4, 5); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3, V4, V5, V6; 0, 1, 2, 3, 4, 5, 6); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3, V4, V5, V6, V7; 0, 1, 2, 3, 4, 5, 6, 7); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3, V4, V5, V6, V7, V8; 0, 1, 2, 3, 4, 5, 6, 7, 8); - $crate::impl_view_tuple!($viewseq, $pod, $cx, $changeflags, + $crate::impl_view_tuple!($viewseq, $elements_splice, $pod, $cx, $changeflags, V0, V1, V2, V3, V4, V5, V6, V7, V8, V9; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); }; } diff --git a/crates/xilem_core/src/vec_splice.rs b/crates/xilem_core/src/vec_splice.rs index aa0af8b75..b460744fe 100644 --- a/crates/xilem_core/src/vec_splice.rs +++ b/crates/xilem_core/src/vec_splice.rs @@ -50,6 +50,14 @@ impl<'a, 'b, T> VecSplice<'a, 'b, T> { &mut self.v[ix] } + pub fn peek(&self) -> Option<&T> { + self.v.last() + } + + pub fn peek_mut(&mut self) -> Option<&mut T> { + self.v.last_mut() + } + pub fn len(&self) -> usize { self.ix } diff --git a/crates/xilem_web/src/context.rs b/crates/xilem_web/src/context.rs index 90088edd0..8f14a8e5e 100644 --- a/crates/xilem_web/src/context.rs +++ b/crates/xilem_web/src/context.rs @@ -10,7 +10,8 @@ use crate::{ app::AppRunner, diff::{diff_kv_iterables, Diff}, vecmap::VecMap, - AttributeValue, Message, + view::DomNode, + AttributeValue, Message, Pod, }; type CowStr = std::borrow::Cow<'static, str>; @@ -106,6 +107,36 @@ impl Cx { (id, result) } + /// Run some logic within a new Pod context and return the newly created Pod, + /// + /// This logic is usually `View::build` to wrap the returned element into a Pod. + pub fn with_new_pod(&mut self, f: F) -> (Id, S, Pod) + where + E: DomNode, + F: FnOnce(&mut Cx) -> (Id, S, E), + { + let (id, state, element) = f(self); + (id, state, Pod::new(element)) + } + + /// Run some logic within the context of a given Pod, + /// + /// This logic is usually `View::rebuild` + /// + /// # Panics + /// + /// When the element type `E` is not the same type as the inner `DomNode` of the `Pod` + pub fn with_pod(&mut self, pod: &mut Pod, f: F) -> T + where + E: DomNode, + F: FnOnce(&mut E, &mut Cx) -> T, + { + let element = pod + .downcast_mut() + .expect("Element type has changed, this should never happen!"); + f(element, self) + } + pub fn document(&self) -> &Document { &self.document } diff --git a/crates/xilem_web/src/elements.rs b/crates/xilem_web/src/elements.rs index eb5e82bbc..10111bb97 100644 --- a/crates/xilem_web/src/elements.rs +++ b/crates/xilem_web/src/elements.rs @@ -5,7 +5,7 @@ use xilem_core::{Id, MessageResult, VecSplice}; use crate::{ interfaces::sealed::Sealed, vecmap::VecMap, view::DomNode, AttributeValue, ChangeFlags, Cx, - Pod, View, ViewMarker, ViewSequence, HTML_NS, + ElementsSplice, Pod, View, ViewMarker, ViewSequence, HTML_NS, }; use super::interfaces::Element; @@ -19,6 +19,9 @@ pub struct ElementState { pub(crate) children_states: ViewSeqState, pub(crate) attributes: VecMap, pub(crate) child_elements: Vec, + /// This is temporary cache for elements while updating/diffing, + /// after usage it shouldn't contain any elements, + /// and is mainly here to avoid unnecessary allocations pub(crate) scratch: Vec, } @@ -49,6 +52,90 @@ impl CustomElement { } } +/// An `ElementsSplice` that does DOM updates in place +struct ChildrenSplice<'a, 'b, 'c> { + children: VecSplice<'a, 'b, Pod>, + child_idx: u32, + parent: &'c web_sys::Node, + node_list: Option, + prev_element_count: usize, +} + +impl<'a, 'b, 'c> ChildrenSplice<'a, 'b, 'c> { + fn new( + children: &'a mut Vec, + scratch: &'b mut Vec, + parent: &'c web_sys::Node, + ) -> Self { + let prev_element_count = children.len(); + Self { + children: VecSplice::new(children, scratch), + child_idx: 0, + parent, + node_list: None, + prev_element_count, + } + } +} + +impl<'a, 'b, 'c> ElementsSplice for ChildrenSplice<'a, 'b, 'c> { + fn push(&mut self, element: Pod, _cx: &mut Cx) { + self.parent + .append_child(element.0.as_node_ref()) + .unwrap_throw(); + self.child_idx += 1; + self.children.push(element); + } + + fn mutate(&mut self, _cx: &mut Cx) -> &mut Pod { + self.children.mutate() + } + + fn delete(&mut self, n: usize, _cx: &mut Cx) { + // Optimization in case all elements are deleted at once + if n == self.prev_element_count { + self.parent.set_text_content(None); + } else { + // lazy NodeList access, in case it's not necessary at all, which is slightly faster when there's no need for the NodeList + let node_list = if let Some(node_list) = &self.node_list { + node_list + } else { + self.node_list = Some(self.parent.child_nodes()); + self.node_list.as_ref().unwrap() + }; + for _ in 0..n { + let child = node_list.get(self.child_idx).unwrap_throw(); + self.parent.remove_child(&child).unwrap_throw(); + } + } + self.children.delete(n); + } + + fn len(&self) -> usize { + self.children.len() + } + + fn mark(&mut self, mut changeflags: ChangeFlags, _cx: &mut Cx) -> ChangeFlags { + if changeflags.contains(ChangeFlags::STRUCTURE) { + let node_list = if let Some(node_list) = &self.node_list { + node_list + } else { + self.node_list = Some(self.parent.child_nodes()); + self.node_list.as_ref().unwrap() + }; + let cur_child = self.children.peek_mut().unwrap_throw(); + let old_child = node_list.get(self.child_idx).unwrap_throw(); + self.parent + .replace_child(cur_child.0.as_node_ref(), &old_child) + .unwrap_throw(); + // TODO(#160) do something else with the structure information? + changeflags.remove(ChangeFlags::STRUCTURE); + } + self.child_idx += 1; + changeflags + } +} + impl ViewMarker for CustomElement {} impl Sealed for CustomElement {} @@ -66,12 +153,12 @@ where let (el, attributes) = cx.build_element(HTML_NS, &self.name); let mut child_elements = vec![]; - let (id, children_states) = - cx.with_new_id(|cx| self.children.build(cx, &mut child_elements)); + let mut scratch = vec![]; + let mut splice = ChildrenSplice::new(&mut child_elements, &mut scratch, &el); - for child in &child_elements { - el.append_child(child.0.as_node_ref()).unwrap_throw(); - } + let (id, children_states) = cx.with_new_id(|cx| self.children.build(cx, &mut splice)); + + debug_assert!(scratch.is_empty()); // Set the id used internally to the `data-debugid` attribute. // This allows the user to see if an element has been re-created or only altered. @@ -83,7 +170,7 @@ where let state = ElementState { children_states, child_elements, - scratch: vec![], + scratch, attributes, }; (id, state, el) @@ -109,10 +196,8 @@ where let (new_element, attributes) = cx.build_element(HTML_NS, self.node_name()); state.attributes = attributes; // TODO could this be combined with child updates? - while element.child_element_count() > 0 { - new_element - .append_child(&element.child_nodes().get(0).unwrap_throw()) - .unwrap_throw(); + while let Some(child) = element.child_nodes().get(0) { + new_element.append_child(&child).unwrap_throw(); } *element = new_element.dyn_into().unwrap_throw(); changed |= ChangeFlags::STRUCTURE; @@ -121,23 +206,14 @@ where changed |= cx.rebuild_element(element, &mut state.attributes); // update children - let mut splice = VecSplice::new(&mut state.child_elements, &mut state.scratch); + let mut splice = + ChildrenSplice::new(&mut state.child_elements, &mut state.scratch, element); changed |= cx.with_id(*id, |cx| { self.children .rebuild(cx, &prev.children, &mut state.children_states, &mut splice) }); - if changed.contains(ChangeFlags::STRUCTURE) { - // This is crude and will result in more DOM traffic than needed. - // The right thing to do is diff the new state of the children id - // vector against the old, and derive DOM mutations from that. - while let Some(child) = element.first_child() { - element.remove_child(&child).unwrap_throw(); - } - for child in &state.child_elements { - element.append_child(child.0.as_node_ref()).unwrap_throw(); - } - changed.remove(ChangeFlags::STRUCTURE); - } + debug_assert!(state.scratch.is_empty()); + changed.remove(ChangeFlags::STRUCTURE); changed } @@ -207,11 +283,11 @@ macro_rules! define_element { let (el, attributes) = cx.build_element($ns, $tag_name); let mut child_elements = vec![]; - let (id, children_states) = - cx.with_new_id(|cx| self.0.build(cx, &mut child_elements)); - for child in &child_elements { - el.append_child(child.0.as_node_ref()).unwrap_throw(); - } + let mut scratch = vec![]; + let mut splice = ChildrenSplice::new(&mut child_elements, &mut scratch, &el); + + let (id, children_states) = cx.with_new_id(|cx| self.0.build(cx, &mut splice)); + debug_assert!(scratch.is_empty()); // Set the id used internally to the `data-debugid` attribute. // This allows the user to see if an element has been re-created or only altered. @@ -223,7 +299,7 @@ macro_rules! define_element { let state = ElementState { children_states, child_elements, - scratch: vec![], + scratch, attributes, }; (id, state, el) @@ -239,26 +315,15 @@ macro_rules! define_element { ) -> ChangeFlags { let mut changed = ChangeFlags::empty(); - changed |= cx.apply_attribute_changes(element, &mut state.attributes); + changed |= cx.rebuild_element(element, &mut state.attributes); // update children - let mut splice = VecSplice::new(&mut state.child_elements, &mut state.scratch); + let mut splice = ChildrenSplice::new(&mut state.child_elements, &mut state.scratch, element); changed |= cx.with_id(*id, |cx| { - self.0 - .rebuild(cx, &prev.0, &mut state.children_states, &mut splice) + self.0.rebuild(cx, &prev.0, &mut state.children_states, &mut splice) }); - if changed.contains(ChangeFlags::STRUCTURE) { - // This is crude and will result in more DOM traffic than needed. - // The right thing to do is diff the new state of the children id - // vector against the old, and derive DOM mutations from that. - while let Some(child) = element.first_child() { - element.remove_child(&child).unwrap_throw(); - } - for child in &state.child_elements { - element.append_child(child.0.as_node_ref()).unwrap_throw(); - } - changed.remove(ChangeFlags::STRUCTURE); - } + debug_assert!(state.scratch.is_empty()); + changed.remove(ChangeFlags::STRUCTURE); // this is handled by the ChildrenSplice already changed } @@ -293,11 +358,11 @@ macro_rules! define_elements { ($ns:ident, $($element_def:tt,)*) => { use std::marker::PhantomData; use wasm_bindgen::{JsCast, UnwrapThrowExt}; - use xilem_core::{Id, MessageResult, VecSplice}; - use super::ElementState; + use xilem_core::{Id, MessageResult}; + use super::{ElementState, ChildrenSplice}; use crate::{ - interfaces::sealed::Sealed, view::DomNode, + interfaces::sealed::Sealed, ChangeFlags, Cx, View, ViewMarker, ViewSequence, }; diff --git a/crates/xilem_web/src/lib.rs b/crates/xilem_web/src/lib.rs index 9c77c2966..a7c6d1e3d 100644 --- a/crates/xilem_web/src/lib.rs +++ b/crates/xilem_web/src/lib.rs @@ -36,8 +36,8 @@ pub use one_of::{ pub use optional_action::{Action, OptionalAction}; pub use pointer::{Pointer, PointerDetails, PointerMsg}; pub use view::{ - memoize, static_view, Adapt, AdaptState, AdaptThunk, AnyView, BoxedView, Memoize, MemoizeState, - Pod, View, ViewMarker, ViewSequence, + memoize, static_view, Adapt, AdaptState, AdaptThunk, AnyView, BoxedView, ElementsSplice, + Memoize, MemoizeState, Pod, View, ViewMarker, ViewSequence, }; pub use view_ext::ViewExt; diff --git a/crates/xilem_web/src/one_of.rs b/crates/xilem_web/src/one_of.rs index 7696080dc..7d912b99f 100644 --- a/crates/xilem_web/src/one_of.rs +++ b/crates/xilem_web/src/one_of.rs @@ -1,7 +1,8 @@ use wasm_bindgen::throw_str; use crate::{ - interfaces::for_all_element_descendents, ChangeFlags, Cx, Pod, View, ViewMarker, ViewSequence, + interfaces::for_all_element_descendents, ChangeFlags, Cx, ElementsSplice, View, ViewMarker, + ViewSequence, }; macro_rules! impl_dom_traits { @@ -166,7 +167,7 @@ macro_rules! one_of_sequence { )+ { type State = $ident<$($vars::State),+>; - fn build(&self, cx: &mut Cx, elements: &mut Vec) -> Self::State { + fn build(&self, cx: &mut Cx, elements: &mut dyn ElementsSplice) -> Self::State { match self { $( $ident::$vars(view_sequence) => { @@ -181,7 +182,7 @@ macro_rules! one_of_sequence { cx: &mut Cx, prev: &Self, state: &mut Self::State, - element: &mut xilem_core::VecSplice, + elements: &mut dyn ElementsSplice, ) -> ChangeFlags { match (prev, self) { $( @@ -194,12 +195,11 @@ macro_rules! one_of_sequence { " (unreachable)", )); }; - view_sequence.rebuild(cx, prev_view, state, element) + view_sequence.rebuild(cx, prev_view, state, elements) } // Variant has changed (_, $ident::$vars(view_sequence)) => { - let new_state = - element.as_vec(|elements| view_sequence.build(cx, elements)); + let new_state = view_sequence.build(cx, elements); *state = $ident::$vars(new_state); ChangeFlags::STRUCTURE } diff --git a/crates/xilem_web/src/view.rs b/crates/xilem_web/src/view.rs index b9d79003f..6a53e613e 100644 --- a/crates/xilem_web/src/view.rs +++ b/crates/xilem_web/src/view.rs @@ -71,21 +71,21 @@ impl DomNode for Box { pub struct Pod(pub Box); impl Pod { - fn new(node: impl DomNode) -> Self { + pub(crate) fn new(node: impl DomNode) -> Self { node.into_pod() } - fn downcast_mut(&mut self) -> Option<&mut T> { + pub(crate) fn downcast_mut(&mut self) -> Option<&mut T> { self.0.as_any_mut().downcast_mut() } - fn mark(&mut self, flags: ChangeFlags) -> ChangeFlags { + pub(crate) fn mark(&mut self, flags: ChangeFlags) -> ChangeFlags { flags } } xilem_core::generate_view_trait! {View, DomNode, Cx, ChangeFlags;} -xilem_core::generate_viewsequence_trait! {ViewSequence, View, ViewMarker, DomNode, Cx, ChangeFlags, Pod;} +xilem_core::generate_viewsequence_trait! {ViewSequence, View, ViewMarker, ElementsSplice, DomNode, Cx, ChangeFlags, Pod;} xilem_core::generate_anyview_trait! {AnyView, View, ViewMarker, Cx, ChangeFlags, AnyNode, BoxedView;} xilem_core::generate_memoize_view! {Memoize, MemoizeState, View, ViewMarker, Cx, ChangeFlags, static_view, memoize;} xilem_core::generate_adapt_view! {View, Cx, ChangeFlags;} diff --git a/src/app.rs b/src/app.rs index 6f9e48b10..070c5dcc2 100644 --- a/src/app.rs +++ b/src/app.rs @@ -157,7 +157,7 @@ where id: None, root_pod: None, events: Vec::new(), - root_state: WidgetState::new(), + root_state: WidgetState::new(crate::id::Id::next()), size: Default::default(), new_size: Default::default(), cursor_pos: None, @@ -181,7 +181,8 @@ where // TODO: be more lazy re-rendering self.render(); let root_pod = self.root_pod.as_mut().unwrap(); - let mut cx_state = CxState::new(&mut self.font_cx, &mut self.events); + let mut cx_state = + CxState::new(&mut self.font_cx, &self.cx.tree_structure, &mut self.events); let mut lifecycle_cx = LifeCycleCx::new(&mut cx_state, &mut self.root_state); root_pod.lifecycle(&mut lifecycle_cx, &LifeCycle::TreeUpdate); @@ -225,7 +226,8 @@ where // Borrow again to avoid multiple borrows. // TODO: maybe make accessibility a method on CxState? let root_pod = self.root_pod.as_mut().unwrap(); - let mut cx_state = CxState::new(&mut self.font_cx, &mut self.events); + let mut cx_state = + CxState::new(&mut self.font_cx, &self.cx.tree_structure, &mut self.events); let mut paint_cx = PaintCx::new(&mut cx_state, &mut self.root_state); root_pod.paint_impl(&mut paint_cx); break; @@ -247,7 +249,8 @@ where self.ensure_root(); let root_pod = self.root_pod.as_mut().unwrap(); - let mut cx_state = CxState::new(&mut self.font_cx, &mut self.events); + let mut cx_state = + CxState::new(&mut self.font_cx, &self.cx.tree_structure, &mut self.events); let mut event_cx = EventCx::new(&mut cx_state, &mut self.root_state); root_pod.event(&mut event_cx, &event); self.send_events(); @@ -283,23 +286,30 @@ where if let Some(response) = self.response_chan.blocking_recv() { let state = if let Some(root_pod) = self.root_pod.as_mut() { let mut state = response.state.unwrap(); - let changes = response.view.rebuild( - &mut self.cx, - response.prev.as_ref().unwrap(), - self.id.as_mut().unwrap(), - &mut state, - //TODO: fail more gracefully but make it explicit that this is a bug - root_pod - .downcast_mut() - .expect("the root widget changed its type, this should never happen!"), - ); + let changes = self.cx.with_pod(root_pod, |root_el, cx| { + response.view.rebuild( + cx, + response.prev.as_ref().unwrap(), + self.id.as_mut().unwrap(), + &mut state, + root_el, + ) + }); let _ = root_pod.mark(changes); - assert!(self.cx.is_empty(), "id path imbalance on rebuild"); + assert!(self.cx.id_path_is_empty(), "id path imbalance on rebuild"); + assert!( + self.cx.element_id_path_is_empty(), + "element id path imbalance on rebuild" + ); state } else { - let (id, state, root_widget) = response.view.build(&mut self.cx); - assert!(self.cx.is_empty(), "id path imbalance on build"); - self.root_pod = Some(Pod::new(root_widget)); + let (id, state, root_pod) = self.cx.with_new_pod(|cx| response.view.build(cx)); + assert!(self.cx.id_path_is_empty(), "id path imbalance on build"); + assert!( + self.cx.element_id_path_is_empty(), + "element id path imbalance on rebuild" + ); + self.root_pod = Some(root_pod); self.id = Some(id); state }; diff --git a/src/bloom.rs b/src/bloom.rs deleted file mode 100644 index 205ed2f58..000000000 --- a/src/bloom.rs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2020 The Druid Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! A simple Bloom filter, used to track child widgets. - -use std::hash::{Hash, Hasher}; -use std::marker::PhantomData; - -use fnv::FnvHasher; - -const NUM_BITS: u64 = 64; - -// the 'offset_basis' for the fnv-1a hash algorithm. -// see http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param -// -// The first of these is the one described in the algorithm, the second is random. -const OFFSET_ONE: u64 = 0xcbf2_9ce4_8422_2325; -const OFFSET_TWO: u64 = 0xe10_3ad8_2dad_8028; - -/// A very simple Bloom filter optimized for small values. -#[derive(Clone, Copy)] -pub(crate) struct Bloom { - bits: u64, - data: PhantomData, - entry_count: usize, -} - -impl Bloom { - /// Returns the number of items that have been added to the filter. - /// - /// Does not count unique entries; this is just the number of times - /// `add()` was called since the filter was created or last `clear()`ed. - // it feels wrong to call this 'len'? - #[allow(dead_code)] - pub fn entry_count(&self) -> usize { - self.entry_count - } - - /// Return the raw bits of this filter. - #[allow(dead_code)] - pub fn to_raw(&self) -> u64 { - self.bits - } - - /// Remove all entries from the filter. - pub fn clear(&mut self) { - self.bits = 0; - self.entry_count = 0; - } - - /// Add an item to the filter. - pub fn add(&mut self, item: &T) { - let mask = self.make_bit_mask(item); - self.bits |= mask; - self.entry_count += 1; - } - - /// Returns `true` if the item may have been added to the filter. - /// - /// This can return false positives, but never false negatives. - /// Thus `true` means that the item may have been added - or not, - /// while `false` means that the item has definitely not been added. - #[allow(unused)] - pub fn may_contain(&self, item: &T) -> bool { - let mask = self.make_bit_mask(item); - self.bits & mask == mask - } - - /// Create a new `Bloom` with the items from both filters. - pub fn union(&self, other: Bloom) -> Bloom { - Bloom { - bits: self.bits | other.bits, - data: PhantomData, - entry_count: self.entry_count + other.entry_count, - } - } - - #[inline] - fn make_bit_mask(&self, item: &T) -> u64 { - //NOTE: we use two hash functions, which performs better than a single hash - // with smaller numbers of items, but poorer with more items. Threshold - // (given 64 bits) is ~30 items. - // The reasoning is that with large numbers of items we're already in bad shape; - // optimize for fewer false positives as we get closer to the leaves. - // This can be tweaked after profiling. - let hash1 = self.make_hash(item, OFFSET_ONE); - let hash2 = self.make_hash(item, OFFSET_TWO); - (1 << (hash1 % NUM_BITS)) | (1 << (hash2 % NUM_BITS)) - } - - #[inline] - fn make_hash(&self, item: &T, seed: u64) -> u64 { - let mut hasher = FnvHasher::with_key(seed); - item.hash(&mut hasher); - hasher.finish() - } -} - -impl std::fmt::Debug for Bloom { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "Bloom: {:064b}: ({})", self.bits, self.entry_count) - } -} - -impl Default for Bloom { - fn default() -> Self { - Bloom { - bits: 0, - data: PhantomData, - entry_count: 0, - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use test_log::test; - - #[test] - fn very_good_test() { - let mut bloom = Bloom::default(); - for i in 0..100 { - bloom.add(&i); - assert!(bloom.may_contain(&i)); - } - bloom.clear(); - for i in 0..100 { - assert!(!bloom.may_contain(&i)); - } - } - - #[test] - fn union() { - let mut bloom1 = Bloom::default(); - bloom1.add(&0); - bloom1.add(&1); - assert!(!bloom1.may_contain(&2)); - assert!(!bloom1.may_contain(&3)); - let mut bloom2 = Bloom::default(); - bloom2.add(&2); - bloom2.add(&3); - assert!(!bloom2.may_contain(&0)); - assert!(!bloom2.may_contain(&1)); - - let bloom3 = bloom1.union(bloom2); - assert!(bloom3.may_contain(&0)); - assert!(bloom3.may_contain(&1)); - assert!(bloom3.may_contain(&2)); - assert!(bloom3.may_contain(&3)); - } -} diff --git a/src/lib.rs b/src/lib.rs index f20da417e..68ffe75d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,6 @@ extern crate core; mod app; mod app_main; -mod bloom; mod geometry; mod id; pub mod text; @@ -15,7 +14,6 @@ pub use xilem_core::{IdPath, MessageResult}; pub use app::App; pub use app_main::AppLauncher; -pub(crate) use bloom::Bloom; pub use geometry::Axis; pub use parley; diff --git a/src/view/linear_layout.rs b/src/view/linear_layout.rs index 09f24dcec..30ee4764e 100644 --- a/src/view/linear_layout.rs +++ b/src/view/linear_layout.rs @@ -15,11 +15,11 @@ use std::{any::Any, marker::PhantomData}; use crate::geometry::Axis; -use crate::view::{Id, VecSplice, ViewMarker, ViewSequence}; +use crate::view::{Id, ViewMarker, ViewSequence}; use crate::widget::{self, ChangeFlags}; use crate::MessageResult; -use super::{Cx, View}; +use super::{Cx, TreeStructureSplice, View}; /// LinearLayout is a simple view which does layout for the specified ViewSequence. /// @@ -70,7 +70,9 @@ impl> View for LinearLayout { fn build(&self, cx: &mut Cx) -> (Id, Self::State, Self::Element) { let mut elements = vec![]; - let (id, state) = cx.with_new_id(|cx| self.children.build(cx, &mut elements)); + let mut scratch = vec![]; + let mut splice = TreeStructureSplice::new(&mut elements, &mut scratch); + let (id, state) = cx.with_new_id(|cx| self.children.build(cx, &mut splice)); let column = widget::LinearLayout::new(elements, self.spacing, self.axis); (id, state, column) } @@ -83,9 +85,8 @@ impl> View for LinearLayout { state: &mut Self::State, element: &mut Self::Element, ) -> ChangeFlags { - let mut scratch = vec![]; - let mut splice = VecSplice::new(&mut element.children, &mut scratch); - + let mut scratch = vec![]; // TODO(#160) could save some allocations by using View::State + let mut splice = TreeStructureSplice::new(&mut element.children, &mut scratch); let mut flags = cx.with_id(*id, |cx| { self.children .rebuild(cx, &prev.children, state, &mut splice) diff --git a/src/view/list.rs b/src/view/list.rs index 073887d6f..1fb1edb3f 100644 --- a/src/view/list.rs +++ b/src/view/list.rs @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::view::{Cx, VecSplice, ViewSequence}; -use crate::widget::{ChangeFlags, Pod}; +use crate::view::{Cx, ElementsSplice, ViewSequence}; +use crate::widget::ChangeFlags; use crate::MessageResult; use std::any::Any; use std::marker::PhantomData; @@ -49,7 +49,7 @@ impl, F: Fn(usize) -> VT + Send> ViewSequence { type State = ListState; - fn build(&self, cx: &mut Cx, elements: &mut Vec) -> Self::State { + fn build(&self, cx: &mut Cx, elements: &mut dyn ElementsSplice) -> Self::State { let leading = elements.len(); let views = @@ -72,29 +72,29 @@ impl, F: Fn(usize) -> VT + Send> ViewSequence cx: &mut Cx, prev: &Self, state: &mut Self::State, - element: &mut VecSplice, + elements: &mut dyn ElementsSplice, ) -> ChangeFlags { // Common length - let leading = element.len(); + let leading = elements.len(); let mut flags = (0..(self.items.min(prev.items))) .zip(&mut state.views) .fold(ChangeFlags::empty(), |flags, (index, (prev, state))| { let vt = (self.build)(index); - let vt_flags = vt.rebuild(cx, prev, state, element); + let vt_flags = vt.rebuild(cx, prev, state, elements); *prev = vt; flags | vt_flags }); if self.items < prev.items { for (prev, state) in state.views.splice(self.items.., []) { - element.delete(prev.count(&state)); + elements.delete(prev.count(&state), cx); } } while self.items > state.views.len() { let vt = (self.build)(state.views.len()); - let vt_state = element.as_vec(|vec| vt.build(cx, vec)); + let vt_state = vt.build(cx, elements); state.views.push((vt, vt_state)); } @@ -104,7 +104,7 @@ impl, F: Fn(usize) -> VT + Send> ViewSequence flags |= ChangeFlags::all(); } - state.element_count = element.len() - leading; + state.element_count = elements.len() - leading; flags } diff --git a/src/view/mod.rs b/src/view/mod.rs index 3b026bf2c..7a1d38e9e 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -22,6 +22,7 @@ mod text; mod linear_layout; mod list; mod switch; +mod tree_structure_tracking; #[allow(clippy::module_inception)] mod view; @@ -31,7 +32,8 @@ pub use button::button; pub use linear_layout::{h_stack, v_stack, LinearLayout}; pub use list::{list, List}; pub use switch::switch; -pub use view::{Adapt, AdaptState, Cx, Memoize, View, ViewMarker, ViewSequence}; +pub use tree_structure_tracking::TreeStructureSplice; +pub use view::{Adapt, AdaptState, Cx, ElementsSplice, Memoize, View, ViewMarker, ViewSequence}; #[cfg(feature = "taffy")] mod taffy_layout; diff --git a/src/view/taffy_layout.rs b/src/view/taffy_layout.rs index 38adb0ff1..1b8e67f4a 100644 --- a/src/view/taffy_layout.rs +++ b/src/view/taffy_layout.rs @@ -16,7 +16,7 @@ use std::{any::Any, marker::PhantomData}; use vello::peniko::Color; -use crate::view::{Id, VecSplice, ViewMarker, ViewSequence}; +use crate::view::{Id, TreeStructureSplice, ViewMarker, ViewSequence}; use crate::widget::{self, ChangeFlags}; use crate::MessageResult; @@ -103,7 +103,9 @@ impl> View for TaffyLayout { fn build(&self, cx: &mut Cx) -> (Id, Self::State, Self::Element) { let mut elements = vec![]; - let (id, state) = cx.with_new_id(|cx| self.children.build(cx, &mut elements)); + let mut scratch = vec![]; + let mut splice = TreeStructureSplice::new(&mut elements, &mut scratch); + let (id, state) = cx.with_new_id(|cx| self.children.build(cx, &mut splice)); let column = widget::TaffyLayout::new(elements, self.style.clone(), self.background_color); (id, state, column) } @@ -117,8 +119,7 @@ impl> View for TaffyLayout { element: &mut Self::Element, ) -> ChangeFlags { let mut scratch = vec![]; - let mut splice = VecSplice::new(&mut element.children, &mut scratch); - + let mut splice = TreeStructureSplice::new(&mut element.children, &mut scratch); let mut flags = cx.with_id(*id, |cx| { self.children .rebuild(cx, &prev.children, state, &mut splice) diff --git a/src/view/tree_structure_tracking.rs b/src/view/tree_structure_tracking.rs new file mode 100644 index 000000000..a05ada475 --- /dev/null +++ b/src/view/tree_structure_tracking.rs @@ -0,0 +1,61 @@ +use crate::{ + id::Id, + view::ElementsSplice, + widget::{ChangeFlags, Pod}, +}; +use xilem_core::VecSplice; + +use super::Cx; + +/// An ElementsSplice that tracks the widget tree structure +pub struct TreeStructureSplice<'a, 'b> { + current_child_id: Option, + splice: VecSplice<'a, 'b, Pod>, +} + +impl<'a, 'b> TreeStructureSplice<'a, 'b> { + pub fn new(elements: &'a mut Vec, scratch: &'b mut Vec) -> Self { + Self { + splice: VecSplice::new(elements, scratch), + current_child_id: None, + } + } +} + +impl<'a, 'b> ElementsSplice for TreeStructureSplice<'a, 'b> { + fn push(&mut self, element: Pod, cx: &mut Cx) { + cx.tree_structure + .append_child(cx.element_id(), element.id()); + self.splice.push(element); + } + + fn mutate(&mut self, _cx: &mut Cx) -> &mut Pod { + let pod = self.splice.mutate(); + self.current_child_id = Some(pod.id()); + pod + } + + fn mark(&mut self, changeflags: ChangeFlags, cx: &mut Cx) -> ChangeFlags { + if changeflags.contains(ChangeFlags::tree_structure()) { + let current_id = self.current_child_id.take().unwrap(); + let new_id = self.splice.peek().unwrap().id(); + if current_id != new_id { + cx.tree_structure + .change_child(cx.element_id(), self.splice.len() - 1, new_id); + } + } + + self.splice.mark(changeflags, cx) + } + + fn delete(&mut self, n: usize, cx: &mut Cx) { + let ix = self.splice.len(); + cx.tree_structure + .delete_children(cx.element_id(), ix..ix + n); + self.splice.delete(n); + } + + fn len(&self) -> usize { + self.splice.len() + } +} diff --git a/src/view/view.rs b/src/view/view.rs index 3a1bfacac..89cb81cb6 100644 --- a/src/view/view.rs +++ b/src/view/view.rs @@ -21,10 +21,10 @@ use futures_task::{ArcWake, Waker}; use xilem_core::{Id, IdPath}; -use crate::widget::{AnyWidget, ChangeFlags, Pod, Widget}; +use crate::widget::{tree_structure::TreeStructure, AnyWidget, ChangeFlags, Pod, Widget}; xilem_core::generate_view_trait! {View, Widget, Cx, ChangeFlags; : Send} -xilem_core::generate_viewsequence_trait! {ViewSequence, View, ViewMarker, Widget, Cx, ChangeFlags, Pod; : Send} +xilem_core::generate_viewsequence_trait! {ViewSequence, View, ViewMarker, ElementsSplice, Widget, Cx, ChangeFlags, Pod; : Send} xilem_core::generate_anyview_trait! {AnyView, View, ViewMarker, Cx, ChangeFlags, AnyWidget, BoxedView; + Send} xilem_core::generate_memoize_view! {Memoize, MemoizeState, View, ViewMarker, Cx, ChangeFlags, s, memoize; + Send} xilem_core::generate_adapt_view! {View, Cx, ChangeFlags; + Send} @@ -33,7 +33,9 @@ xilem_core::generate_adapt_state_view! {View, Cx, ChangeFlags; + Send} #[derive(Clone)] pub struct Cx { id_path: IdPath, + element_id_path: Vec, // Note that this is the widget id type. req_chan: SyncSender, + pub(crate) tree_structure: TreeStructure, pub(crate) pending_async: HashSet, } @@ -53,8 +55,10 @@ impl Cx { pub(crate) fn new(req_chan: &SyncSender) -> Self { Cx { id_path: Vec::new(), + element_id_path: Vec::new(), req_chan: req_chan.clone(), pending_async: HashSet::new(), + tree_structure: TreeStructure::default(), } } @@ -66,7 +70,7 @@ impl Cx { self.id_path.pop(); } - pub fn is_empty(&self) -> bool { + pub fn id_path_is_empty(&self) -> bool { self.id_path.is_empty() } @@ -74,6 +78,18 @@ impl Cx { &self.id_path } + pub fn element_id_path_is_empty(&self) -> bool { + self.element_id_path.is_empty() + } + + /// Return the element id of the current element/widget + pub fn element_id(&self) -> crate::id::Id { + *self + .element_id_path + .last() + .expect("element_id path imbalance, there should be an element id") + } + /// Run some logic with an id added to the id path. /// /// This is an ergonomic helper that ensures proper nesting of the id path. @@ -95,6 +111,42 @@ impl Cx { (id, result) } + /// Run some logic within a new Pod context and return the newly created Pod, + /// + /// This logic is usually `View::build` to wrap the returned element into a Pod. + pub fn with_new_pod(&mut self, f: F) -> (Id, S, Pod) + where + E: Widget + 'static, + F: FnOnce(&mut Cx) -> (Id, S, E), + { + let pod_id = crate::id::Id::next(); + self.element_id_path.push(pod_id); + let (id, state, element) = f(self); + self.element_id_path.pop(); + (id, state, Pod::new(element, pod_id)) + } + + /// Run some logic within the context of a given Pod, + /// + /// This logic is usually `View::rebuild` + /// + /// # Panics + /// + /// When the element type `E` is not the same type as the inner `Widget` of the `Pod`. + pub fn with_pod(&mut self, pod: &mut Pod, f: F) -> T + where + E: Widget + 'static, + F: FnOnce(&mut E, &mut Cx) -> T, + { + self.element_id_path.push(pod.id()); + let element = pod + .downcast_mut() + .expect("Element type has changed, this should never happen!"); + let result = f(element, self); + self.element_id_path.pop(); + result + } + pub fn waker(&self) -> Waker { futures_task::waker(Arc::new(MyWaker { id_path: self.id_path.clone(), diff --git a/src/widget/contexts.rs b/src/widget/contexts.rs index a9568cb7d..2edb87c62 100644 --- a/src/widget/contexts.rs +++ b/src/widget/contexts.rs @@ -20,7 +20,7 @@ use parley::FontContext; use vello::kurbo::{Point, Size}; -use super::{PodFlags, WidgetState}; +use super::{tree_structure::TreeStructure, PodFlags, WidgetState}; use crate::Message; // These contexts loosely follow Druid. @@ -28,6 +28,7 @@ use crate::Message; /// Static state that is shared between most contexts. pub struct CxState<'a> { #[allow(unused)] + tree_structure: &'a TreeStructure, font_cx: &'a mut FontContext, messages: &'a mut Vec, } @@ -103,8 +104,16 @@ macro_rules! impl_context_method { } impl<'a> CxState<'a> { - pub fn new(font_cx: &'a mut FontContext, messages: &'a mut Vec) -> Self { - CxState { font_cx, messages } + pub fn new( + font_cx: &'a mut FontContext, + tree_structure: &'a TreeStructure, + messages: &'a mut Vec, + ) -> Self { + CxState { + font_cx, + messages, + tree_structure, + } } pub(crate) fn has_messages(&self) -> bool { @@ -203,6 +212,11 @@ impl_context_method!( pub fn is_active(&self) -> bool { self.widget_state.flags.contains(PodFlags::IS_ACTIVE) } + + /// Returns the pure structure (parent/children relations via ids) of the widget tree + pub fn tree_structure(&self) -> &TreeStructure { + self.cx_state.tree_structure + } } ); diff --git a/src/widget/core.rs b/src/widget/core.rs index 68e308e11..210e5bf90 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -24,8 +24,8 @@ use vello::{ }; use super::widget::{AnyWidget, Widget}; +use crate::id::Id; use crate::Axis; -use crate::{id::Id, Bloom}; use super::{ contexts::LifeCycleCx, BoxConstraints, CxState, Event, EventCx, LayoutCx, LifeCycle, PaintCx, @@ -106,12 +106,6 @@ pub(crate) struct WidgetState { pub(crate) parent_window_origin: Point, /// The size of the widget. pub(crate) size: Size, - /// A bloom filter containing this widgets is and the ones of its children. - // TODO: decide the final solution for this. This is probably going to be a global structure - // tracking parent child relations in the tree: - // parents: HashMap, - // children: HashMap>, - pub(crate) sub_tree: Bloom, } impl PodFlags { @@ -140,21 +134,18 @@ impl ChangeFlags { } impl WidgetState { - pub(crate) fn new() -> Self { - let id = Id::next(); + pub(crate) fn new(id: Id) -> Self { WidgetState { id, flags: PodFlags::INIT_FLAGS, origin: Default::default(), parent_window_origin: Default::default(), size: Default::default(), - sub_tree: Default::default(), } } fn merge_up(&mut self, child_state: &mut WidgetState) { self.flags |= child_state.flags.upwards(); - self.sub_tree = self.sub_tree.union(child_state.sub_tree); } fn request(&mut self, flags: PodFlags) { @@ -167,17 +158,17 @@ impl Pod { /// /// In a widget hierarchy, each widget is wrapped in a `Pod` /// so it can participate in layout and event flow. - pub fn new(widget: impl Widget + 'static) -> Self { - Self::new_from_box(Box::new(widget)) + pub fn new(widget: impl Widget + 'static, id: Id) -> Self { + Self::new_from_box(Box::new(widget), id) } /// Create a new pod. /// /// In a widget hierarchy, each widget is wrapped in a `Pod` /// so it can participate in layout and event flow. - pub fn new_from_box(widget: Box) -> Self { + pub fn new_from_box(widget: Box, id: Id) -> Self { Pod { - state: WidgetState::new(), + state: WidgetState::new(id), fragment: Scene::default(), widget, } @@ -329,8 +320,6 @@ impl Pod { } LifeCycle::TreeUpdate => { if self.state.flags.contains(PodFlags::TREE_CHANGED) { - self.state.sub_tree.clear(); - self.state.sub_tree.add(&self.state.id); self.state.flags.remove(PodFlags::TREE_CHANGED); true } else { diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 7da04cc9f..4f1327b04 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -24,6 +24,7 @@ mod raw_event; mod switch; //mod scroll_view; mod text; +pub mod tree_structure; #[allow(clippy::module_inception)] mod widget; @@ -36,6 +37,7 @@ pub use linear_layout::LinearLayout; pub use raw_event::{Event, LifeCycle, MouseEvent, PointerCrusher, ViewContext}; pub use switch::Switch; pub use text::TextWidget; +pub use tree_structure::TreeStructure; pub use widget::{AnyWidget, Widget}; #[cfg(feature = "taffy")] diff --git a/src/widget/tree_structure.rs b/src/widget/tree_structure.rs new file mode 100644 index 000000000..3c07af3cf --- /dev/null +++ b/src/widget/tree_structure.rs @@ -0,0 +1,143 @@ +use crate::id::Id; +use std::collections::HashMap; + +/// The pure structure (parent/children relations via ids) of the widget tree. +#[derive(Debug, Default, Clone)] +pub struct TreeStructure { + parent: HashMap, + children: HashMap>, +} + +impl TreeStructure { + pub fn parent(&self, id: Id) -> Option { + self.parent.get(&id).copied() + } + + pub fn children(&self, id: Id) -> Option<&[Id]> { + self.children.get(&id).map(Vec::as_slice) + } + + pub fn is_descendant_of(&self, mut id: Id, ancestor: Id) -> bool { + while let Some(parent) = self.parent(id) { + if parent == ancestor { + return true; + } + id = parent; + } + false + } + + pub(crate) fn append_child(&mut self, parent_id: Id, id: Id) { + self.parent + .entry(id) + .and_modify(|parent| { + *parent = parent_id; + }) + .or_insert(parent_id); + self.children + .entry(parent_id) + .and_modify(|children| { + children.push(id); + }) + .or_insert_with(|| vec![id]); + } + + /// # Panics + /// + /// When the `parent_id` doesn't exist in the structure or `idx` is out of bounds this will panic + pub(crate) fn change_child(&mut self, parent_id: Id, idx: usize, new_id: Id) { + let children = self + .children + .get_mut(&parent_id) + .unwrap_or_else(|| panic!("{parent_id:?} doesn't have any child")); + let old_id = children[idx]; + children[idx] = new_id; + + self.parent.remove(&old_id); + self.parent + .entry(new_id) + .and_modify(|parent| { + *parent = parent_id; + }) + .or_insert(parent_id); + } + + /// # Panics + /// + /// When the `parent_id` doesn't exist in the structure or `range` is out of bounds this will panic + pub(crate) fn delete_children(&mut self, parent_id: Id, range: std::ops::Range) { + let children = &self.children[&parent_id][range.clone()]; + for child in children { + self.parent.remove(child); + } + self.children.get_mut(&parent_id).unwrap().drain(range); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn mutates_simple_tree_structure() { + let mut tree_structure = TreeStructure::default(); + + let parent = Id::next(); + let child1 = Id::next(); + let child2 = Id::next(); + let child3 = Id::next(); + + // append children + tree_structure.append_child(parent, child1); + tree_structure.append_child(parent, child2); + tree_structure.append_child(parent, child3); + let children = tree_structure.children(parent).unwrap(); + assert_eq!(children, [child1, child2, child3]); + assert_eq!(tree_structure.parent(child1), Some(parent)); + assert_eq!(tree_structure.parent(child2), Some(parent)); + assert_eq!(tree_structure.parent(child3), Some(parent)); + + // change children + let child2_new = Id::next(); + tree_structure.change_child(parent, 1, child2_new); + let children = tree_structure.children(parent).unwrap(); + assert_eq!(children, [child1, child2_new, child3]); + assert_eq!(tree_structure.parent(child1), Some(parent)); + assert_eq!(tree_structure.parent(child2), None); + assert_eq!(tree_structure.parent(child2_new), Some(parent)); + assert_eq!(tree_structure.parent(child3), Some(parent)); + + // delete children + tree_structure.delete_children(parent, 0..2); + let children = tree_structure.children(parent).unwrap(); + assert_eq!(children, [child3]); + assert_eq!(tree_structure.parent(child1), None); + assert_eq!(tree_structure.parent(child2), None); + assert_eq!(tree_structure.parent(child2_new), None); + assert_eq!(tree_structure.parent(child3), Some(parent)); + } + + #[test] + fn is_descendant_of() { + let mut tree_structure = TreeStructure::default(); + let parent = Id::next(); + let child1 = Id::next(); + let child2 = Id::next(); + let child3 = Id::next(); + tree_structure.append_child(parent, child1); + tree_structure.append_child(parent, child2); + tree_structure.append_child(parent, child3); + + let child3_child1 = Id::next(); + let child3_child2 = Id::next(); + tree_structure.append_child(child3, child3_child1); + tree_structure.append_child(child3, child3_child2); + let child3_child1_child1 = Id::next(); + tree_structure.append_child(child3_child1, child3_child1_child1); + assert!(tree_structure.is_descendant_of(child3_child1_child1, child3_child1)); + assert!(tree_structure.is_descendant_of(child3_child1_child1, child3)); + assert!(tree_structure.is_descendant_of(child3_child1, parent)); + assert!(!tree_structure.is_descendant_of(child3_child1, child2)); + assert!(!tree_structure.is_descendant_of(parent, child3_child1)); + } +} From 6500c5058b26478a05bb1cc336121e91dcbc858f Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Thu, 29 Feb 2024 13:45:26 -0500 Subject: [PATCH 11/17] Handle scroll events and use winit Modifiers and MouseButton (#178) --- Cargo.lock | 1530 ++------------------------------------- Cargo.toml | 9 +- src/app_main.rs | 108 ++- src/widget/mod.rs | 2 +- src/widget/raw_event.rs | 45 +- 5 files changed, 140 insertions(+), 1554 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68af6a7ab..1754bcc06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,12 +97,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anyhow" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" - [[package]] name = "arrayref" version = "0.3.7" @@ -130,247 +124,6 @@ dependencies = [ "libloading 0.7.4", ] -[[package]] -name = "ashpd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7370b58af1d7e96df3ca0f454b57e69acf9aa42ed2d7337bd206923bae0d5754" -dependencies = [ - "async-std", - "enumflags2", - "futures-channel", - "futures-util", - "once_cell", - "rand", - "serde", - "serde_repr", - "url", - "zbus", -] - -[[package]] -name = "async-broadcast" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" -dependencies = [ - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" -dependencies = [ - "concurrent-queue", - "event-listener 5.1.0", - "event-listener-strategy 0.5.0", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" -dependencies = [ - "async-lock 3.3.0", - "async-task", - "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", - "slab", -] - -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.2.0", - "async-executor", - "async-io 2.3.1", - "async-lock 3.3.0", - "blocking", - "futures-lite 2.2.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" -dependencies = [ - "async-lock 3.3.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.2.0", - "parking", - "polling 3.5.0", - "rustix 0.38.31", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.31", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-recursion" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.3.1", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.31", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - -[[package]] -name = "async-trait" -version = "0.1.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -398,29 +151,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "bindgen" -version = "0.66.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" -dependencies = [ - "bitflags 2.4.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.50", - "which", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -454,15 +184,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - [[package]] name = "block-sys" version = "0.2.1" @@ -482,22 +203,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel 2.2.0", - "async-lock 3.3.0", - "async-task", - "fastrand 2.0.1", - "futures-io", - "futures-lite 2.2.0", - "piper", - "tracing", -] - [[package]] name = "bumpalo" version = "3.15.3" @@ -524,32 +229,12 @@ dependencies = [ "syn 2.0.50", ] -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -[[package]] -name = "calloop" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" -dependencies = [ - "bitflags 1.3.2", - "log", - "nix 0.25.1", - "slotmap", - "thiserror", - "vec_map", -] - [[package]] name = "calloop" version = "0.12.4" @@ -558,8 +243,8 @@ checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ "bitflags 2.4.2", "log", - "polling 3.5.0", - "rustix 0.38.31", + "polling", + "rustix", "slab", "thiserror", ] @@ -570,10 +255,10 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ - "calloop 0.12.4", - "rustix 0.38.31", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", + "calloop", + "rustix", + "wayland-backend", + "wayland-client", ] [[package]] @@ -591,15 +276,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -612,47 +288,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading 0.8.1", -] - -[[package]] -name = "cocoa" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" -dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa-foundation" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-foundation", - "core-graphics-types", - "libc", - "objc", -] - [[package]] name = "codespan-reporting" version = "0.11.1" @@ -783,31 +418,12 @@ dependencies = [ "xilem_web", ] -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - [[package]] name = "crossbeam-utils" version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "cursor-icon" version = "1.1.0" @@ -824,27 +440,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - [[package]] name = "dispatch" version = "0.2.0" @@ -875,33 +470,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "enumflags2" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -940,80 +508,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" -dependencies = [ - "event-listener 5.1.0", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - [[package]] name = "fnv" version = "1.0.7" @@ -1048,167 +542,33 @@ dependencies = [ ] [[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", - "parking_lot", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" -dependencies = [ - "fastrand 2.0.1", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" +name = "foreign-types-shared" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] -name = "futures-util" +name = "futures-core" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] -name = "generic-array" -version = "0.14.7" +name = "futures-intrusive" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ - "typenum", - "version_check", + "futures-core", + "lock_api", + "parking_lot", ] [[package]] -name = "gethostname" -version = "0.3.0" +name = "futures-task" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" -dependencies = [ - "libc", - "winapi", -] +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "gethostname" @@ -1248,48 +608,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "glazier" -version = "0.1.0" -source = "git+https://github.com/linebender/glazier?rev=8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e#8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e" -dependencies = [ - "anyhow", - "ashpd", - "bindgen", - "bitflags 2.4.2", - "block", - "cfg-if", - "cocoa", - "core-graphics", - "futures", - "instant", - "js-sys", - "keyboard-types", - "kurbo 0.11.0", - "lazy_static", - "memchr", - "nix 0.25.1", - "objc", - "once_cell", - "pkg-config", - "raw-window-handle 0.5.2", - "scopeguard", - "smithay-client-toolkit 0.17.0", - "tracing", - "wasm-bindgen", - "wayland-backend 0.1.2", - "web-sys", - "winapi", - "wio", - "x11rb 0.12.0", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "gloo" version = "0.8.1" @@ -1310,18 +628,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "gloo-utils" version = "0.1.7" @@ -1455,27 +761,12 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "hexf-parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "humantime" version = "2.1.0" @@ -1493,16 +784,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "indexmap" version = "2.2.3" @@ -1525,17 +806,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "is-terminal" version = "0.4.12" @@ -1584,15 +854,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "keyboard-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" -dependencies = [ - "bitflags 2.4.2", -] - [[package]] name = "khronos-egl" version = "6.0.0" @@ -1630,27 +891,12 @@ dependencies = [ "smallvec", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.153" @@ -1688,12 +934,6 @@ dependencies = [ "redox_syscall 0.4.1", ] -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -1721,9 +961,6 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -dependencies = [ - "value-bag", -] [[package]] name = "malloc_buf" @@ -1750,15 +987,6 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - [[package]] name = "memmap2" version = "0.9.4" @@ -1768,33 +996,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "metal" version = "0.27.0" @@ -1810,12 +1011,6 @@ dependencies = [ "paste", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.2" @@ -1887,42 +1082,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", - "pin-utils", -] - -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-traits" version = "0.2.18" @@ -1957,7 +1116,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.50", @@ -2028,16 +1187,6 @@ dependencies = [ "libredox", ] -[[package]] -name = "ordered-stream" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "owned_ttf_parser" version = "0.20.0" @@ -2047,12 +1196,6 @@ dependencies = [ "ttf-parser", ] -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" version = "0.12.1" @@ -2091,12 +1234,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "peniko" version = "0.1.0" @@ -2128,45 +1265,12 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.1", - "futures-io", -] - [[package]] name = "pkg-config" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - [[package]] name = "polling" version = "3.5.0" @@ -2176,50 +1280,24 @@ dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.31", + "rustix", "tracing", "windows-sys 0.52.0", ] -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - [[package]] name = "presser" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "prettyplease" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" -dependencies = [ - "proc-macro2", - "syn 2.0.50", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", ] [[package]] @@ -2237,15 +1315,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" -[[package]] -name = "quick-xml" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" -dependencies = [ - "memchr", -] - [[package]] name = "quick-xml" version = "0.31.0" @@ -2264,36 +1333,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - [[package]] name = "range-alloc" version = "0.1.3" @@ -2382,23 +1421,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.37.27" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" @@ -2409,7 +1434,7 @@ dependencies = [ "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -2448,8 +1473,8 @@ checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" dependencies = [ "ab_glyph", "log", - "memmap2 0.9.4", - "smithay-client-toolkit 0.18.1", + "memmap2", + "smithay-client-toolkit", "tiny-skia", ] @@ -2484,28 +1509,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -2515,12 +1518,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -2563,28 +1560,6 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" -[[package]] -name = "smithay-client-toolkit" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1476c3d89bb67079264b88aaf4f14358353318397e083b7c4e8c14517f55de7" -dependencies = [ - "bitflags 1.3.2", - "calloop 0.10.6", - "dlib", - "lazy_static", - "log", - "memmap2 0.5.10", - "nix 0.26.4", - "thiserror", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-cursor 0.30.0", - "wayland-protocols 0.30.1", - "wayland-protocols-wlr 0.1.0", - "wayland-scanner 0.30.1", -] - [[package]] name = "smithay-client-toolkit" version = "0.18.1" @@ -2592,21 +1567,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ "bitflags 2.4.2", - "calloop 0.12.4", + "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", - "memmap2 0.9.4", - "rustix 0.38.31", + "memmap2", + "rustix", "thiserror", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", + "wayland-backend", + "wayland-client", "wayland-csd-frame", - "wayland-cursor 0.31.1", - "wayland-protocols 0.31.2", - "wayland-protocols-wlr 0.2.0", - "wayland-scanner 0.31.1", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", "xkeysym", ] @@ -2619,16 +1594,6 @@ dependencies = [ "serde", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -2722,18 +1687,6 @@ dependencies = [ "slotmap", ] -[[package]] -name = "tempfile" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" -dependencies = [ - "cfg-if", - "fastrand 2.0.1", - "rustix 0.38.31", - "windows-sys 0.52.0", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -2819,21 +1772,6 @@ dependencies = [ "strict-num", ] -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "todomvc" version = "0.1.0" @@ -2862,7 +1800,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -2884,17 +1822,6 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -2912,7 +1839,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2966,44 +1892,12 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uds_windows" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" -dependencies = [ - "memoffset 0.9.0", - "tempfile", - "winapi", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -3022,30 +1916,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "value-bag" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "vello" version = "0.0.1" @@ -3077,12 +1947,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" version = "2.4.0" @@ -3165,21 +2029,6 @@ version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" -[[package]] -name = "wayland-backend" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b48e27457e8da3b2260ac60d0a94512f5cba36448679f3747c0865b7893ed8" -dependencies = [ - "cc", - "downcast-rs", - "io-lifetimes", - "nix 0.26.4", - "scoped-tls", - "smallvec", - "wayland-sys 0.30.1", -] - [[package]] name = "wayland-backend" version = "0.3.3" @@ -3188,23 +2037,10 @@ checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" dependencies = [ "cc", "downcast-rs", - "rustix 0.38.31", + "rustix", "scoped-tls", "smallvec", - "wayland-sys 0.31.1", -] - -[[package]] -name = "wayland-client" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" -dependencies = [ - "bitflags 1.3.2", - "calloop 0.10.6", - "nix 0.26.4", - "wayland-backend 0.1.2", - "wayland-scanner 0.30.1", + "wayland-sys", ] [[package]] @@ -3214,9 +2050,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ "bitflags 2.4.2", - "rustix 0.38.31", - "wayland-backend 0.3.3", - "wayland-scanner 0.31.1", + "rustix", + "wayland-backend", + "wayland-scanner", ] [[package]] @@ -3227,18 +2063,7 @@ checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ "bitflags 2.4.2", "cursor-icon", - "wayland-backend 0.3.3", -] - -[[package]] -name = "wayland-cursor" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0c3a0d5b4b688b07b0442362d3ed6bf04724fcc16cd69ab6285b90dbc487aa" -dependencies = [ - "nix 0.26.4", - "wayland-client 0.30.2", - "xcursor", + "wayland-backend", ] [[package]] @@ -3247,23 +2072,11 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ - "rustix 0.38.31", - "wayland-client 0.31.2", + "rustix", + "wayland-client", "xcursor", ] -[[package]] -name = "wayland-protocols" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" -dependencies = [ - "bitflags 1.3.2", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-scanner 0.30.1", -] - [[package]] name = "wayland-protocols" version = "0.31.2" @@ -3271,9 +2084,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ "bitflags 2.4.2", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-scanner 0.31.1", + "wayland-backend", + "wayland-client", + "wayland-scanner", ] [[package]] @@ -3283,23 +2096,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ "bitflags 2.4.2", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-protocols 0.31.2", - "wayland-scanner 0.31.1", -] - -[[package]] -name = "wayland-protocols-wlr" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce991093320e4a6a525876e6b629ab24da25f9baef0c2e0080ad173ec89588a" -dependencies = [ - "bitflags 1.3.2", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-protocols 0.30.1", - "wayland-scanner 0.30.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] @@ -3309,21 +2109,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ "bitflags 2.4.2", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-protocols 0.31.2", - "wayland-scanner 0.31.1", -] - -[[package]] -name = "wayland-scanner" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" -dependencies = [ - "proc-macro2", - "quick-xml 0.28.2", - "quote", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] @@ -3333,21 +2122,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", - "quick-xml 0.31.0", + "quick-xml", "quote", ] -[[package]] -name = "wayland-sys" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" -dependencies = [ - "dlib", - "log", - "pkg-config", -] - [[package]] name = "wayland-sys" version = "0.31.1" @@ -3484,18 +2262,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.31", -] - [[package]] name = "widestring" version = "1.0.2" @@ -3527,15 +2293,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3770,7 +2527,7 @@ dependencies = [ "atomic-waker", "bitflags 2.4.2", "bytemuck", - "calloop 0.12.4", + "calloop", "cfg_aliases", "core-foundation", "core-graphics", @@ -3779,7 +2536,7 @@ dependencies = [ "js-sys", "libc", "log", - "memmap2 0.9.4", + "memmap2", "ndk", "ndk-sys", "objc2", @@ -3789,22 +2546,22 @@ dependencies = [ "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", "redox_syscall 0.3.5", - "rustix 0.38.31", + "rustix", "sctk-adwaita", - "smithay-client-toolkit 0.18.1", + "smithay-client-toolkit", "smol_str", "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-protocols 0.31.2", + "wayland-backend", + "wayland-client", + "wayland-protocols", "wayland-protocols-plasma", "web-sys", "web-time", "windows-sys 0.48.0", "x11-dl", - "x11rb 0.13.0", + "x11rb", "xkbcommon-dl", ] @@ -3817,15 +2574,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - [[package]] name = "x11-dl" version = "2.21.0" @@ -3837,21 +2585,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x11rb" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" -dependencies = [ - "as-raw-xcb-connection", - "gethostname 0.3.0", - "libc", - "nix 0.26.4", - "winapi", - "winapi-wsapoll", - "x11rb-protocol 0.12.0", -] - [[package]] name = "x11rb" version = "0.13.0" @@ -3859,21 +2592,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ "as-raw-xcb-connection", - "gethostname 0.4.3", + "gethostname", "libc", "libloading 0.8.1", "once_cell", - "rustix 0.38.31", - "x11rb-protocol 0.13.0", -] - -[[package]] -name = "x11rb-protocol" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" -dependencies = [ - "nix 0.26.4", + "rustix", + "x11rb-protocol", ] [[package]] @@ -3888,16 +2612,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" -[[package]] -name = "xdg-home" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "xilem" version = "0.1.0" @@ -3906,7 +2620,6 @@ dependencies = [ "env_logger", "fnv", "futures-task", - "glazier", "instant", "parley", "taffy", @@ -3969,72 +2682,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" -[[package]] -name = "zbus" -version = "3.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c45d06ae3b0f9ba1fb2671268b975557d8f5a84bb5ec6e43964f87e763d8bca8" -dependencies = [ - "async-broadcast", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "async-recursion", - "async-task", - "async-trait", - "blocking", - "byteorder", - "derivative", - "enumflags2", - "event-listener 2.5.3", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "nix 0.26.4", - "once_cell", - "ordered-stream", - "rand", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "tracing", - "uds_windows", - "winapi", - "xdg-home", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "3.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "regex", - "syn 1.0.109", - "zvariant_utils", -] - -[[package]] -name = "zbus_names" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] - [[package]] name = "zeno" version = "0.2.3" @@ -4060,42 +2707,3 @@ dependencies = [ "quote", "syn 2.0.50", ] - -[[package]] -name = "zvariant" -version = "3.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" -dependencies = [ - "byteorder", - "enumflags2", - "libc", - "serde", - "static_assertions", - "url", - "zvariant_derive", -] - -[[package]] -name = "zvariant_derive" -version = "3.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] diff --git a/Cargo.toml b/Cargo.toml index a52e422bc..fd42d30b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,8 +42,8 @@ cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] [features] default = ["x11", "taffy"] -x11 = ["glazier/x11"] -wayland = ["glazier/wayland"] +x11 = ["winit/x11"] +wayland = ["winit/wayland"] taffy = ["dep:taffy"] [dependencies] @@ -60,11 +60,6 @@ fnv = "1.0.7" instant = { version = "0.1.6", features = ["wasm-bindgen"] } winit = { version = "0.29", features = ["rwh_05"] } -[dependencies.glazier] -git = "https://github.com/linebender/glazier" -rev = "8d2a4b2cafd5e6be49bfb4ac8d0bd26fe02f036e" -default-features = false - [dev-dependencies] env_logger = "0.10.0" test-log = "0.2.11" diff --git a/src/app_main.rs b/src/app_main.rs index bab0e60af..840c49ebd 100644 --- a/src/app_main.rs +++ b/src/app_main.rs @@ -14,20 +14,24 @@ use std::{num::NonZeroUsize, sync::Arc}; -use glazier::{Modifiers, PointerButton}; use vello::{ - kurbo::{Affine, Point, Size}, + kurbo::{Affine, Point, Size, Vec2}, peniko::Color, util::{RenderContext, RenderSurface}, AaSupport, RenderParams, Renderer, RendererOptions, Scene, }; use winit::{ - event::WindowEvent, + dpi::PhysicalPosition, + event::{ElementState, Modifiers, MouseButton, MouseScrollDelta, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::{Window, WindowBuilder}, }; -use crate::{app::App, view::View, widget::Event, widget::PointerCrusher}; +use crate::{ + app::App, + view::View, + widget::{Event, PointerCrusher, ScrollDelta}, +}; // This is a bit of a hack just to get a window launched. The real version // would deal with multiple windows and have other ways to configure things. @@ -75,72 +79,31 @@ impl + 'static> AppLauncher { let mut main_state = MainState::new(self.app, window); event_loop - .run(move |event, elwt| match event { - winit::event::Event::WindowEvent { - event: WindowEvent::CloseRequested, - .. - } => elwt.exit(), - winit::event::Event::WindowEvent { - event: WindowEvent::RedrawRequested, - .. - } => main_state.paint(), - winit::event::Event::WindowEvent { - event: WindowEvent::Resized(winit::dpi::PhysicalSize { width, height }), - .. - } => main_state.size(Size { - width: width.into(), - height: height.into(), - }), - winit::event::Event::WindowEvent { - event: WindowEvent::ModifiersChanged(modifiers), - .. - } => { - let mut m = Modifiers::empty(); - let ms = modifiers.state(); - if ms.contains(winit::keyboard::ModifiersState::SHIFT) { - m |= Modifiers::SHIFT; - } - if ms.contains(winit::keyboard::ModifiersState::CONTROL) { - m |= Modifiers::CONTROL; - } - if ms.contains(winit::keyboard::ModifiersState::SUPER) { - m |= Modifiers::SUPER; - } - if ms.contains(winit::keyboard::ModifiersState::ALT) { - m |= Modifiers::ALT; - } - main_state.mods(m); - } - winit::event::Event::WindowEvent { - event: + .run(move |event, elwt| { + if let winit::event::Event::WindowEvent { event: e, .. } = event { + match e { + WindowEvent::CloseRequested => elwt.exit(), + WindowEvent::RedrawRequested => main_state.paint(), + WindowEvent::Resized(winit::dpi::PhysicalSize { width, height }) => { + main_state.size(Size { + width: width.into(), + height: height.into(), + }); + } + WindowEvent::ModifiersChanged(modifiers) => main_state.mods(modifiers), WindowEvent::CursorMoved { position: winit::dpi::PhysicalPosition { x, y }, .. + } => main_state.pointer_move(Point { x, y }), + WindowEvent::CursorLeft { .. } => main_state.pointer_leave(), + WindowEvent::MouseInput { state, button, .. } => match state { + ElementState::Pressed => main_state.pointer_down(button), + ElementState::Released => main_state.pointer_up(button), }, - .. - } => main_state.pointer_move(Point { x, y }), - winit::event::Event::WindowEvent { - event: WindowEvent::CursorLeft { .. }, - .. - } => main_state.pointer_leave(), - winit::event::Event::WindowEvent { - event: WindowEvent::MouseInput { state, button, .. }, - .. - } => { - let b = match button { - winit::event::MouseButton::Left => PointerButton::Primary, - winit::event::MouseButton::Right => PointerButton::Secondary, - winit::event::MouseButton::Middle => PointerButton::Auxiliary, - winit::event::MouseButton::Back => PointerButton::X1, - winit::event::MouseButton::Forward => PointerButton::X2, - winit::event::MouseButton::Other(_) => PointerButton::None, - }; - match state { - winit::event::ElementState::Pressed => main_state.pointer_down(b), - winit::event::ElementState::Released => main_state.pointer_up(b), + WindowEvent::MouseWheel { delta, .. } => main_state.pointer_wheel(delta), + _ => (), } } - _ => (), }) .unwrap(); } @@ -187,13 +150,13 @@ where self.window.request_redraw(); } - fn pointer_down(&mut self, button: PointerButton) { + fn pointer_down(&mut self, button: MouseButton) { self.app .window_event(Event::MouseDown(self.main_pointer.pressed(button))); self.window.request_redraw(); } - fn pointer_up(&mut self, button: PointerButton) { + fn pointer_up(&mut self, button: MouseButton) { self.app .window_event(Event::MouseUp(self.main_pointer.released(button))); self.window.request_redraw(); @@ -204,6 +167,19 @@ where self.window.request_redraw(); } + fn pointer_wheel(&mut self, delta: MouseScrollDelta) { + self.app + .window_event(Event::MouseWheel(self.main_pointer.wheel(match delta { + MouseScrollDelta::LineDelta(x, y) => { + ScrollDelta::Lines(x.trunc() as isize, y.trunc() as isize) + } + MouseScrollDelta::PixelDelta(PhysicalPosition { x, y }) => { + ScrollDelta::Precise(Vec2::new(x, y) * (1.0 / self.window.scale_factor())) + } + }))); + self.window.request_redraw(); + } + fn paint(&mut self) { self.app.paint(); self.render(); diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 4f1327b04..2118814aa 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -34,7 +34,7 @@ pub use box_constraints::BoxConstraints; pub use button::Button; pub use contexts::{CxState, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; pub use linear_layout::LinearLayout; -pub use raw_event::{Event, LifeCycle, MouseEvent, PointerCrusher, ViewContext}; +pub use raw_event::{Event, LifeCycle, MouseEvent, PointerCrusher, ScrollDelta, ViewContext}; pub use switch::Switch; pub use text::TextWidget; pub use tree_structure::TreeStructure; diff --git a/src/widget/raw_event.rs b/src/widget/raw_event.rs index ec8e3754a..1d3f36620 100644 --- a/src/widget/raw_event.rs +++ b/src/widget/raw_event.rs @@ -16,9 +16,10 @@ //! //! Note: arguably this module should be renamed, perhaps we should use //! "event" for this level and maybe "message" at the View level. +use std::collections::HashSet; -use glazier::{Modifiers, PointerButton, PointerButtons}; use vello::kurbo::{Point, Rect, Vec2}; +use winit::event::{Modifiers, MouseButton}; #[derive(Debug, Clone)] pub enum Event { @@ -35,12 +36,18 @@ pub struct MouseEvent { pub pos: Point, /// The position of the mouse in the window coordinate space. pub window_pos: Point, - pub buttons: PointerButtons, + pub buttons: HashSet, pub mods: Modifiers, pub count: u8, pub focus: bool, - pub button: PointerButton, - pub wheel_delta: Vec2, + pub button: Option, + pub wheel_delta: Option, +} + +#[derive(Debug, Clone)] +pub enum ScrollDelta { + Precise(Vec2), + Lines(isize, isize), } #[derive(Debug)] @@ -62,12 +69,12 @@ impl Default for MouseEvent { MouseEvent { pos: Point::ZERO, window_pos: Point::ZERO, - buttons: PointerButtons::new(), + buttons: HashSet::::new(), mods: Modifiers::default(), count: 0, focus: false, - button: PointerButton::None, - wheel_delta: Vec2::ZERO, + button: None, + wheel_delta: None, } } } @@ -100,32 +107,32 @@ impl PointerCrusher { self.e.mods = mods; } - pub fn pressed(&mut self, button: PointerButton) -> MouseEvent { - self.e.wheel_delta = Vec2::ZERO; + pub fn pressed(&mut self, button: MouseButton) -> MouseEvent { + self.e.wheel_delta = None; self.e.buttons.insert(button); self.e.count = self.counter.count_for_click(self.e.pos); - self.e.button = button; + self.e.button = Some(button); self.e.clone() } - pub fn released(&mut self, button: PointerButton) -> MouseEvent { - self.e.wheel_delta = Vec2::ZERO; - self.e.buttons.remove(button); - self.e.button = button; + pub fn released(&mut self, button: MouseButton) -> MouseEvent { + self.e.wheel_delta = None; + self.e.buttons.remove(&button); + self.e.button = Some(button); self.e.clone() } pub fn moved(&mut self, pos: Point) -> MouseEvent { - self.e.wheel_delta = Vec2::ZERO; - self.e.button = PointerButton::None; + self.e.wheel_delta = None; + self.e.button = None; self.e.pos = pos; self.e.window_pos = pos; self.e.clone() } - pub fn wheel(&mut self, wheel_delta: Vec2) -> MouseEvent { - self.e.wheel_delta = wheel_delta; - self.e.button = PointerButton::None; + pub fn wheel(&mut self, wheel_delta: ScrollDelta) -> MouseEvent { + self.e.wheel_delta = Some(wheel_delta); + self.e.button = None; self.e.clone() } } From a13a814e35ad0abc81f8146f26ed73cc662e9814 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Fri, 1 Mar 2024 08:28:07 +1300 Subject: [PATCH 12/17] Alternative scrollview implementation (doesn't use "origin" for scroll offset) (#155) * Enable scroll_view widget * Add scrollview to taffy example * Apply message/event suggestions * Apply suggestions from code review Co-authored-by: Kaur Kuut Co-authored-by: Philipp Mildenberger * Rename get_size method to size * Remove accessibility method from scroll_view * Pass Id when creating Pod * Update usage of Vello * Cargo fmt * Handle scroll deltas properly. --------- Co-authored-by: Kaur Kuut Co-authored-by: Philipp Mildenberger Co-authored-by: Aaron Muir Hamilton --- examples/taffy.rs | 129 +++++++++++++++++++------------------- src/view/mod.rs | 3 +- src/view/scroll_view.rs | 38 ++++++----- src/widget/core.rs | 5 ++ src/widget/mod.rs | 3 +- src/widget/scroll_view.rs | 126 +++++++++++++++++++++++++------------ 6 files changed, 182 insertions(+), 122 deletions(-) diff --git a/examples/taffy.rs b/examples/taffy.rs index e3f37249f..c58791158 100644 --- a/examples/taffy.rs +++ b/examples/taffy.rs @@ -21,7 +21,7 @@ fn app_logic(state: &mut AppState) -> impl View { use taffy::style::{AlignItems, FlexWrap, JustifyContent}; use taffy::style_helpers::length; use vello::peniko::Color; - use xilem::view::{button, div, flex_column, flex_row}; + use xilem::view::{button, div, flex_column, flex_row, scroll_view}; const COLORS: [Color; 4] = [ Color::LIGHT_GREEN, @@ -45,73 +45,76 @@ fn app_logic(state: &mut AppState) -> impl View { .with_background_color(Color::RED) .with_style(|s| s.padding = length(20.0)), - // Body - flex_column(( + scroll_view( - // Counter control buttons - flex_row(( - label, - button("increase", |state: &mut AppState| { - println!("clicked increase"); - state.count += 1; - }), - button("decrease", |state: &mut AppState| { - println!("clicked decrease"); - if state.count > 0 { - state.count -= 1; - } - }), - button("reset", |state: &mut AppState| { - println!("clicked reset"); - state.count = 1; - }), - )) - .with_background_color(Color::BLUE_VIOLET) - .with_style(|s| { - s.gap.width = length(20.0); - s.padding = length(20.0); - s.justify_content = Some(JustifyContent::Start); - s.align_items = Some(AlignItems::Center); - }), - - // Description text - div(String::from("The number of squares below is controlled by the counter above.\n\nTry clicking \"increase\" until the square count increases enough that the view becomes scrollable.")) - .with_background_color(Color::RED) - .with_style(|s| s.padding = length(20.0)), - - // Lorem Ipsum text - div(String::from("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")) - .with_background_color(Color::RED) - .with_style(|s| s.padding = length(20.0)), - - // Wrapping container (number of children controlled by counter) - flex_row( - (0..state.count).map(|i| { - div(()) - .with_background_color(COLORS[(i % 4) as usize]) - .with_style(|s| { - s.size.width = length(200.0); - s.size.height = length(200.0); - }) - }).collect::>() - ) - .with_background_color(Color::FOREST_GREEN) + // Body + flex_column(( + + // Counter control buttons + flex_row(( + label, + button("increase", |state: &mut AppState| { + println!("clicked increase"); + state.count += 1; + }), + button("decrease", |state: &mut AppState| { + println!("clicked decrease"); + if state.count > 0 { + state.count -= 1; + } + }), + button("reset", |state: &mut AppState| { + println!("clicked reset"); + state.count = 1; + }), + )) + .with_background_color(Color::BLUE_VIOLET) .with_style(|s| { - s.flex_grow = 1.0; - s.flex_wrap = FlexWrap::Wrap; - s.gap = length(20.0); + s.gap.width = length(20.0); s.padding = length(20.0); + s.justify_content = Some(JustifyContent::Start); + s.align_items = Some(AlignItems::Center); }), - )) - .with_style(|s| { - s.gap.height = length(20.0); - s.padding.left = length(20.0); - s.padding.right = length(20.0); - s.padding.top = length(20.0); - s.padding.bottom = length(20.0); - }) - .with_background_color(Color::WHITE) + // Description text + div(String::from("The number of squares below is controlled by the counter above.\n\nTry clicking \"increase\" until the square count increases enough that the view becomes scrollable.")) + .with_background_color(Color::RED) + .with_style(|s| s.padding = length(20.0)), + + // Lorem Ipsum text + div(String::from("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")) + .with_background_color(Color::RED) + .with_style(|s| s.padding = length(20.0)), + + // Wrapping container (number of children controlled by counter) + flex_row( + (0..state.count).map(|i| { + div(()) + .with_background_color(COLORS[(i % 4) as usize]) + .with_style(|s| { + s.size.width = length(200.0); + s.size.height = length(200.0); + }) + }).collect::>() + ) + .with_background_color(Color::FOREST_GREEN) + .with_style(|s| { + s.flex_grow = 1.0; + s.flex_wrap = FlexWrap::Wrap; + s.gap = length(20.0); + s.padding = length(20.0); + }), + + )) + .with_style(|s| { + s.gap.height = length(20.0); + s.padding.left = length(20.0); + s.padding.right = length(20.0); + s.padding.top = length(20.0); + s.padding.bottom = length(20.0); + }) + .with_background_color(Color::WHITE) + ) )).with_style(|s| { s.padding.left = length(20.0); s.padding.right = length(20.0); diff --git a/src/view/mod.rs b/src/view/mod.rs index 7a1d38e9e..f8a153ab5 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -16,7 +16,7 @@ mod button; // mod layout_observer; // mod list; -// mod scroll_view; +mod scroll_view; mod text; // mod use_state; mod linear_layout; @@ -31,6 +31,7 @@ pub use xilem_core::{Id, IdPath, VecSplice}; pub use button::button; pub use linear_layout::{h_stack, v_stack, LinearLayout}; pub use list::{list, List}; +pub use scroll_view::{scroll_view, ScrollView}; pub use switch::switch; pub use tree_structure_tracking::TreeStructureSplice; pub use view::{Adapt, AdaptState, Cx, ElementsSplice, Memoize, View, ViewMarker, ViewSequence}; diff --git a/src/view/scroll_view.rs b/src/view/scroll_view.rs index f9a64d9ea..4014791c8 100644 --- a/src/view/scroll_view.rs +++ b/src/view/scroll_view.rs @@ -14,9 +14,11 @@ use std::{any::Any, marker::PhantomData}; -use crate::{event::EventResult, id::Id, View}; +use crate::{view::View, widget::ChangeFlags, MessageResult}; -use super::Cx; +use xilem_core::Id; + +use super::{Cx, ViewMarker, ViewSequence}; pub struct ScrollView { child: C, @@ -36,18 +38,20 @@ impl ScrollView { } } +impl> ViewMarker for ScrollView {} + impl> View for ScrollView where C::Element: 'static, { type State = (Id, C::State); - type Element = crate::widget::scroll_view::ScrollView; + type Element = crate::widget::ScrollView; fn build(&self, cx: &mut Cx) -> (Id, Self::State, Self::Element) { let (id, (child_id, child_state, child_element)) = cx.with_new_id(|cx| self.child.build(cx)); - let element = crate::widget::scroll_view::ScrollView::new(child_element); + let element = crate::widget::ScrollView::new(child_element); (id, (child_id, child_state), element) } @@ -58,27 +62,27 @@ where id: &mut Id, state: &mut Self::State, element: &mut Self::Element, - ) -> bool { + ) -> ChangeFlags { cx.with_id(*id, |cx| { let child_element = element.child_mut().downcast_mut().unwrap(); - let changed = - self.child - .rebuild(cx, &prev.child, &mut state.0, &mut state.1, child_element); - if changed { - element.child_mut().request_update(); - } - changed + self.child + .rebuild(cx, &prev.child, &mut state.0, &mut state.1, child_element) }) } - fn event( + fn message( &self, id_path: &[Id], state: &mut Self::State, - event: Box, + message: Box, app_state: &mut T, - ) -> EventResult { - let tl = &id_path[1..]; - self.child.event(tl, &mut state.1, event, app_state) + ) -> MessageResult { + match id_path { + [child_id, rest_path @ ..] if *child_id == state.0 => { + self.child + .message(rest_path, &mut state.1, message, app_state) + } + _ => MessageResult::Stale(message), + } } } diff --git a/src/widget/core.rs b/src/widget/core.rs index 210e5bf90..c4e0fbc36 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -460,6 +460,11 @@ impl Pod { } } + /// Get the widget's size (as returned by the layout method) + pub fn size(&mut self) -> Size { + self.state.size + } + // Return true if hot state has changed fn set_hot_state( widget: &mut dyn AnyWidget, diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 2118814aa..76dbbfc5b 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -21,8 +21,8 @@ mod core; mod linear_layout; pub mod piet_scene_helpers; mod raw_event; +mod scroll_view; mod switch; -//mod scroll_view; mod text; pub mod tree_structure; #[allow(clippy::module_inception)] @@ -35,6 +35,7 @@ pub use button::Button; pub use contexts::{CxState, EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; pub use linear_layout::LinearLayout; pub use raw_event::{Event, LifeCycle, MouseEvent, PointerCrusher, ScrollDelta, ViewContext}; +pub use scroll_view::ScrollView; pub use switch::Switch; pub use text::TextWidget; pub use tree_structure::TreeStructure; diff --git a/src/widget/scroll_view.rs b/src/widget/scroll_view.rs index 2eeaebfd1..bf770f6f7 100644 --- a/src/widget/scroll_view.rs +++ b/src/widget/scroll_view.rs @@ -17,17 +17,22 @@ //! There's a lot more functionality in the Druid version, including //! control over scrolling axes, ability to scroll to content, etc. -use druid_shell::{ - kurbo::{Affine, Point, Rect, Size, Vec2}, - piet::RenderContext, -}; +use crate::id::Id; +use crate::Axis; +use vello::kurbo::{Affine, Size, Vec2}; +use vello::peniko::Mix; +use vello::Scene; -use crate::Widget; +use super::{BoxConstraints, ScrollDelta, Widget}; -use super::{ - contexts::LifeCycleCx, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, PreparePaintCx, RawEvent, - UpdateCx, -}; +use super::{contexts::LifeCycleCx, Event, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, UpdateCx}; + +// This number can be related to a platform detail, for example +// on Windows there is SPI_GETWHEELSCROLLLINES +// This number should also be configurable on a given scroll context. +// When scroll gesture handling is hoisted up outside of the widget layer, as it ultimately must be, +// this value will be abstracted away for most users. +const LINE_HEIGHT: f64 = 53.0; pub struct ScrollView { child: Pod, @@ -37,7 +42,7 @@ pub struct ScrollView { impl ScrollView { pub fn new(child: impl Widget + 'static) -> Self { ScrollView { - child: Pod::new(child), + child: Pod::new(child, Id::next()), offset: 0.0, } } @@ -47,41 +52,53 @@ impl ScrollView { } } +// TODO: scroll bars impl Widget for ScrollView { - fn event(&mut self, cx: &mut EventCx, event: &RawEvent) { + fn event(&mut self, cx: &mut EventCx, event: &Event) { + // Pass event through to child, adjusting the coordinates of mouse events + // by the scroll offset first. // TODO: scroll wheel + click-drag on scroll bars let offset = Vec2::new(0.0, self.offset); let child_event = match event { - RawEvent::MouseDown(mouse_event) => { + Event::MouseDown(mouse_event) => { let mut mouse_event = mouse_event.clone(); mouse_event.pos += offset; - RawEvent::MouseDown(mouse_event) + Event::MouseDown(mouse_event) } - RawEvent::MouseUp(mouse_event) => { + Event::MouseUp(mouse_event) => { let mut mouse_event = mouse_event.clone(); mouse_event.pos += offset; - RawEvent::MouseUp(mouse_event) + Event::MouseUp(mouse_event) } - RawEvent::MouseMove(mouse_event) => { + Event::MouseMove(mouse_event) => { let mut mouse_event = mouse_event.clone(); mouse_event.pos += offset; - RawEvent::MouseMove(mouse_event) + Event::MouseMove(mouse_event) } - RawEvent::MouseWheel(mouse_event) => { + Event::MouseWheel(mouse_event) => { let mut mouse_event = mouse_event.clone(); mouse_event.pos += offset; - RawEvent::MouseWheel(mouse_event) + Event::MouseWheel(mouse_event) } _ => event.clone(), }; + self.child.event(cx, &child_event); + + // Handle scroll wheel events if !cx.is_handled() { - if let RawEvent::MouseWheel(mouse) = event { - let new_offset = (self.offset + mouse.wheel_delta.y).max(0.0); + if let Event::MouseWheel(mouse_event) = event { + let max_offset = (self.child.size().height - cx.size().height).max(0.0); + let y_delta = match mouse_event.wheel_delta { + Some(ScrollDelta::Precise(Vec2 { y, .. })) => y, + Some(ScrollDelta::Lines(_, y)) => -y as f64 * LINE_HEIGHT, + None => 0.0, + }; + let new_offset = (self.offset + y_delta).max(0.0).min(max_offset); if new_offset != self.offset { self.offset = new_offset; cx.set_handled(true); - // TODO: request paint + cx.request_paint(); } } } @@ -95,28 +112,57 @@ impl Widget for ScrollView { self.child.update(cx); } - fn measure(&mut self, cx: &mut LayoutCx) -> (Size, Size) { - let _ = self.child.measure(cx); - (Size::ZERO, Size::new(1e9, 1e9)) + fn compute_max_intrinsic(&mut self, axis: Axis, cx: &mut LayoutCx, bc: &BoxConstraints) -> f64 { + match axis { + Axis::Horizontal => { + if bc.min().width.is_sign_negative() { + 0.0 + } else { + let length = + self.child + .compute_max_intrinsic(axis, cx, &bc.unbound_max_height()); + length.min(bc.max().width).max(bc.min().width) + } + } + Axis::Vertical => { + if bc.min().height.is_sign_negative() { + 0.0 + } else { + let length = + self.child + .compute_max_intrinsic(axis, cx, &bc.unbound_max_height()); + length.min(bc.max().height).max(bc.min().height) + } + } + } } - fn layout(&mut self, cx: &mut LayoutCx, proposed_size: Size) -> Size { - let child_proposed = Size::new(proposed_size.width, 1e9); - let child_size = self.child.layout(cx, child_proposed); - Size::new(child_size.width, proposed_size.height) - } + fn layout(&mut self, cx: &mut LayoutCx, bc: &BoxConstraints) -> Size { + cx.request_paint(); + + let cbc = BoxConstraints::new( + Size::new(0.0, 0.0), + Size::new(bc.max().width, f64::INFINITY), + ); + let child_size = self.child.layout(cx, &cbc); + let size = Size::new( + child_size.width.min(bc.max().width), + child_size.height.min(bc.max().height), + ); + + // Ensure that scroll offset is within bounds + let max_offset = (child_size.height - size.height).max(0.0); + if max_offset < self.offset { + self.offset = max_offset; + } - fn prepare_paint(&mut self, cx: &mut PreparePaintCx, visible: Rect) { - let child_visible = visible + Vec2::new(0.0, self.offset); - self.child.prepare_paint(cx, child_visible); + size } - fn paint(&mut self, cx: &mut PaintCx) { - cx.with_save(|cx| { - let size = cx.size(); - cx.clip(size.to_rect()); - cx.transform(Affine::translate((0.0, -self.offset))); - self.child.paint_raw(cx); - }); + fn paint(&mut self, cx: &mut PaintCx, scene: &mut Scene) { + scene.push_layer(Mix::Normal, 1.0, Affine::IDENTITY, &cx.size().to_rect()); + let fragment = self.child.paint_custom(cx); + scene.append(fragment, Some(Affine::translate((0.0, -self.offset)))); + scene.pop_layer(); } } From 21a84d69733da21a79128963925736c64e0c85ac Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Sat, 2 Mar 2024 17:09:27 -0500 Subject: [PATCH 13/17] Bump vello and remove wgpu override. (#179) --- .github/workflows/ci.yml | 2 +- Cargo.lock | 186 ++++++++++++++++++++++----------------- Cargo.toml | 6 +- 3 files changed, 108 insertions(+), 86 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96745fe6c..9b9df9593 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ env: # version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still # come automatically. If the version specified here is no longer the latest stable version, # then please feel free to submit a PR that adjusts it along with the potential clippy fixes. - RUST_STABLE_VER: "1.74" # In quotes because otherwise 1.70 would be interpreted as 1.7 + RUST_STABLE_VER: "1.75" # In quotes because otherwise 1.70 would be interpreted as 1.7 # Rationale # diff --git a/Cargo.lock b/Cargo.lock index 1754bcc06..8c5406794 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if", "getrandom", @@ -226,7 +226,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -263,9 +263,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ "libc", ] @@ -433,10 +433,10 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "bitflags 2.4.2", - "libloading 0.8.1", + "libloading 0.8.2", "winapi", ] @@ -452,7 +452,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.2", ] [[package]] @@ -470,6 +470,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", +] + [[package]] name = "env_logger" version = "0.10.2" @@ -483,6 +492,16 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +dependencies = [ + "env_filter", + "log", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -538,7 +557,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -749,7 +768,7 @@ dependencies = [ "bitflags 2.4.2", "com", "libc", - "libloading 0.8.1", + "libloading 0.8.2", "thiserror", "widestring", "winapi", @@ -757,9 +776,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hexf-parse" @@ -786,9 +805,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", @@ -861,7 +880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.1", + "libloading 0.8.2", "pkg-config", ] @@ -915,12 +934,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "2caa5afb8bf9f3a2652760ce7d4f62d21c4d5a423e68466fca30df82f2330164" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.4", ] [[package]] @@ -958,9 +977,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "malloc_buf" @@ -1022,9 +1041,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1034,7 +1053,7 @@ dependencies = [ [[package]] name = "naga" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "bit-set", @@ -1119,7 +1138,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1353,9 +1372,9 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "read-fonts" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" +checksum = "17ea23eedb4d938031b6d4343222444608727a6aa68ec355e13588d9947ffe92" dependencies = [ "font-types", ] @@ -1409,9 +1428,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "renderdoc-sys" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "rustc-demangle" @@ -1495,7 +1514,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1596,12 +1615,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1665,9 +1684,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -1698,23 +1717,23 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +checksum = "7b319995299c65d522680decf80f2c108d85b861d81dfe340a10d16cee29d9e6" dependencies = [ - "env_logger", + "env_logger 0.11.2", "test-log-macros", ] [[package]] name = "test-log-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1734,7 +1753,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1813,7 +1832,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1852,7 +1871,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1949,9 +1968,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -1984,7 +2003,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -2018,7 +2037,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2161,7 +2180,7 @@ dependencies = [ [[package]] name = "wgpu" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "cfg-if", @@ -2186,7 +2205,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "bit-vec", @@ -2212,7 +2231,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "android_system_properties", "arrayvec", @@ -2232,10 +2251,11 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.1", + "libloading 0.8.2", "log", "metal", "naga", + "ndk-sys", "objc", "once_cell", "parking_lot", @@ -2255,7 +2275,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "bitflags 2.4.2", "js-sys", @@ -2306,7 +2326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2315,7 +2335,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2342,7 +2362,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2377,17 +2397,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -2404,9 +2424,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -2422,9 +2442,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -2440,9 +2460,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -2458,9 +2478,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -2476,9 +2496,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -2494,9 +2514,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -2512,15 +2532,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winit" -version = "0.29.10" +version = "0.29.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" +checksum = "2b9d7047a2a569d5a81e3be098dcd8153759909b127477f4397e03cf1006d90a" dependencies = [ "ahash", "android-activity", @@ -2594,7 +2614,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.1", + "libloading 0.8.2", "once_cell", "rustix", "x11rb-protocol", @@ -2617,7 +2637,7 @@ name = "xilem" version = "0.1.0" dependencies = [ "bitflags 2.4.2", - "env_logger", + "env_logger 0.10.2", "fnv", "futures-task", "instant", @@ -2705,5 +2725,5 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] diff --git a/Cargo.toml b/Cargo.toml index fd42d30b5..4927fb97c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,9 @@ taffy = ["dep:taffy"] xilem_core.workspace = true taffy = { version = "0.4.0", optional = true } vello = { git = "https://github.com/linebender/vello", rev = "6fa114c020f8656947e283bdf4bed96fe7a54c70" } -wgpu = "0.19.0" +# vello currently depends on wgpu 0.19.3, but a fix for a hang on NVIDIA Vk drivers will be postponed +# until 0.20 because it depends on a breaking change to wgpu-hal. For now this is a working revision. +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"} parley = { git = "https://github.com/dfrg/parley", rev = "1940d1ae9f2a9b44b7c18967147ffa7d345fdafd" } tokio = { version = "1.35", features = ["full"] } futures-task = "0.3" @@ -65,4 +67,4 @@ env_logger = "0.10.0" test-log = "0.2.11" [patch.crates-io] -wgpu = { git = 'https://github.com/gfx-rs/wgpu.git' } +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"} From 8f7f5db8e025f76d6da9fd0b4fe79277e05d80d7 Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Mon, 4 Mar 2024 11:18:19 -0500 Subject: [PATCH 14/17] Reset retained click count after mouse released. (#181) --- src/widget/raw_event.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget/raw_event.rs b/src/widget/raw_event.rs index 1d3f36620..212d94f9f 100644 --- a/src/widget/raw_event.rs +++ b/src/widget/raw_event.rs @@ -119,7 +119,9 @@ impl PointerCrusher { self.e.wheel_delta = None; self.e.buttons.remove(&button); self.e.button = Some(button); - self.e.clone() + let r = self.e.clone(); + self.e.count = 0; + r } pub fn moved(&mut self, pos: Point) -> MouseEvent { From a0db0a4a616a1d7ffcf23db1129124d9dea5cc38 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 9 Mar 2024 22:33:30 +0700 Subject: [PATCH 15/17] clippy: Fix semicolon_if_nothing_returned lints. (#184) --- crates/xilem_web/src/app.rs | 2 +- crates/xilem_web/src/context.rs | 6 +++--- crates/xilem_web/src/vecmap.rs | 2 +- crates/xilem_web/web_examples/todomvc/src/state.rs | 4 ++-- examples/hello.rs | 4 ++-- examples/taffy.rs | 2 +- src/geometry.rs | 2 +- src/view/taffy_layout.rs | 4 ++-- src/widget/button.rs | 2 +- src/widget/core.rs | 2 +- src/widget/piet_scene_helpers.rs | 4 ++-- src/widget/switch.rs | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/xilem_web/src/app.rs b/crates/xilem_web/src/app.rs index 56927615d..f1fda0285 100644 --- a/crates/xilem_web/src/app.rs +++ b/crates/xilem_web/src/app.rs @@ -51,7 +51,7 @@ impl + 'static, F: FnMut(&mut T) -> V + 'static> App VecMap { } pub fn clear(&mut self) { - self.0.clear() + self.0.clear(); } /// Returns `true` if the map contains no elements. diff --git a/crates/xilem_web/web_examples/todomvc/src/state.rs b/crates/xilem_web/web_examples/todomvc/src/state.rs index 98de0952c..13d5b860f 100644 --- a/crates/xilem_web/web_examples/todomvc/src/state.rs +++ b/crates/xilem_web/web_examples/todomvc/src/state.rs @@ -75,7 +75,7 @@ impl AppState { if let Some(ref mut todo) = self.todos.iter_mut().find(|todo| todo.id == id) { todo.title_editing.clear(); todo.title_editing.push_str(&todo.title); - self.editing_id = Some(id) + self.editing_id = Some(id); } } @@ -96,7 +96,7 @@ impl AppState { /// Save the current state to local_storage pub fn save(&self) { let raw = serde_json::to_string(self).unwrap_throw(); - storage().set_item(KEY, &raw).unwrap_throw() + storage().set_item(KEY, &raw).unwrap_throw(); } } diff --git a/examples/hello.rs b/examples/hello.rs index 1de432ab6..c1c86c060 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -26,7 +26,7 @@ fn app_logic(data: &mut AppData) -> impl View { data.count = 0; }), switch(data.is_on, |data: &mut AppData, value: bool| { - data.is_on = value + data.is_on = value; }), )), )) @@ -55,5 +55,5 @@ fn main() { }; let app = App::new(data, app_logic); - AppLauncher::new(app).run() + AppLauncher::new(app).run(); } diff --git a/examples/taffy.rs b/examples/taffy.rs index c58791158..de9e672b2 100644 --- a/examples/taffy.rs +++ b/examples/taffy.rs @@ -126,5 +126,5 @@ fn app_logic(state: &mut AppState) -> impl View { fn main() { let app = App::new(AppState::new(), app_logic); - AppLauncher::new(app).run() + AppLauncher::new(app).run(); } diff --git a/src/geometry.rs b/src/geometry.rs index 5d49b4525..7fa12da81 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -62,7 +62,7 @@ impl Axis { /// Updates the scalar of value on the orthogonal axis. pub fn set_minor(self, value: &mut T, major: T::Scalar) { - self.cross().set_major(value, major) + self.cross().set_major(value, major); } /// Maps the scalar of the value on this axis. diff --git a/src/view/taffy_layout.rs b/src/view/taffy_layout.rs index 1b8e67f4a..b7f6d472b 100644 --- a/src/view/taffy_layout.rs +++ b/src/view/taffy_layout.rs @@ -127,7 +127,7 @@ impl> View for TaffyLayout { if self.background_color != prev.background_color { element.background_color = self.background_color; - flags |= ChangeFlags::PAINT + flags |= ChangeFlags::PAINT; } if self.style != prev.style { @@ -137,7 +137,7 @@ impl> View for TaffyLayout { // Clear layout cache if the layout ChangeFlag is set if flags.contains(ChangeFlags::LAYOUT) || flags.contains(ChangeFlags::TREE) { - element.cache.clear() + element.cache.clear(); } flags diff --git a/src/widget/button.rs b/src/widget/button.rs index b19c8bd9e..c05081147 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -72,7 +72,7 @@ impl Widget for Button { fn lifecycle(&mut self, cx: &mut LifeCycleCx, event: &LifeCycle) { if let LifeCycle::HotChanged(_) = event { - cx.request_paint() + cx.request_paint(); } } diff --git a/src/widget/core.rs b/src/widget/core.rs index c4e0fbc36..19f348030 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -149,7 +149,7 @@ impl WidgetState { } fn request(&mut self, flags: PodFlags) { - self.flags |= flags + self.flags |= flags; } } diff --git a/src/widget/piet_scene_helpers.rs b/src/widget/piet_scene_helpers.rs index bdda53a5a..aecacf4ba 100644 --- a/src/widget/piet_scene_helpers.rs +++ b/src/widget/piet_scene_helpers.rs @@ -22,7 +22,7 @@ pub fn stroke<'b>( brush, None, path, - ) + ); } // Note: copied from piet @@ -77,5 +77,5 @@ pub fn fill_lin_gradient( } pub fn fill_color(scene: &mut Scene, path: &impl Shape, color: Color) { - scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path) + scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path); } diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 21a080706..33edd8762 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -74,7 +74,7 @@ impl Widget for Switch { Event::MouseUp(_) => { if self.is_dragging { if self.is_on != (self.knob_position.x > SWITCH_WIDTH / 2.0) { - cx.add_message(Message::new(self.id_path.clone(), ())) + cx.add_message(Message::new(self.id_path.clone(), ())); } } else if cx.is_active() { cx.add_message(Message::new(self.id_path.clone(), ())); From fbe553f9de161c8129b8667761a6f4e03050ab4d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 9 Mar 2024 23:26:02 +0700 Subject: [PATCH 16/17] clippy: Configure via `lints` table in `Cargo.toml` (#185) As of Rust 1.74, lints can be configured within the `Cargo.toml` which allows us to not have to configure them in the source code as well as simplifying having a single configuration across an entire workspace. This is documented at: https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-lints-section --- Cargo.toml | 6 ++++++ crates/xilem_core/Cargo.toml | 3 +++ crates/xilem_web/Cargo.toml | 3 +++ crates/xilem_web/web_examples/counter/Cargo.toml | 3 +++ .../web_examples/counter_custom_element/Cargo.toml | 3 +++ crates/xilem_web/web_examples/mathml_svg/Cargo.toml | 3 +++ crates/xilem_web/web_examples/svgtoy/Cargo.toml | 3 +++ crates/xilem_web/web_examples/todomvc/Cargo.toml | 3 +++ 8 files changed, 27 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4927fb97c..2039d2571 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,9 @@ license = "Apache-2.0" xilem_core = { version = "0.1.0", path = "crates/xilem_core" } kurbo = "0.11.0" +[workspace.lints] +clippy.semicolon_if_nothing_returned = "warn" + [package] name = "xilem" version = "0.1.0" @@ -39,6 +42,9 @@ default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[lints] +workspace = true + [features] default = ["x11", "taffy"] diff --git a/crates/xilem_core/Cargo.toml b/crates/xilem_core/Cargo.toml index a44643da5..b2d9c7256 100644 --- a/crates/xilem_core/Cargo.toml +++ b/crates/xilem_core/Cargo.toml @@ -17,4 +17,7 @@ default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[lints] +workspace = true + [dependencies] diff --git a/crates/xilem_web/Cargo.toml b/crates/xilem_web/Cargo.toml index 18fb95ee1..43d04e426 100644 --- a/crates/xilem_web/Cargo.toml +++ b/crates/xilem_web/Cargo.toml @@ -17,6 +17,9 @@ default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[lints] +workspace = true + [dependencies] xilem_core.workspace = true kurbo.workspace = true diff --git a/crates/xilem_web/web_examples/counter/Cargo.toml b/crates/xilem_web/web_examples/counter/Cargo.toml index ccd520cf9..0db723c23 100644 --- a/crates/xilem_web/web_examples/counter/Cargo.toml +++ b/crates/xilem_web/web_examples/counter/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml b/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml index 4a1179f00..c718f594f 100644 --- a/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml +++ b/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/mathml_svg/Cargo.toml b/crates/xilem_web/web_examples/mathml_svg/Cargo.toml index 195a9ca79..529b27905 100644 --- a/crates/xilem_web/web_examples/mathml_svg/Cargo.toml +++ b/crates/xilem_web/web_examples/mathml_svg/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/svgtoy/Cargo.toml b/crates/xilem_web/web_examples/svgtoy/Cargo.toml index 0f0dc259e..8f9f41cc5 100644 --- a/crates/xilem_web/web_examples/svgtoy/Cargo.toml +++ b/crates/xilem_web/web_examples/svgtoy/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/todomvc/Cargo.toml b/crates/xilem_web/web_examples/todomvc/Cargo.toml index 7aa04c4b0..7e33d8dc5 100644 --- a/crates/xilem_web/web_examples/todomvc/Cargo.toml +++ b/crates/xilem_web/web_examples/todomvc/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1.7" serde = { version = "1.0.170", features = ["derive"] } From 50d51fad014b421bb16dbbc2b9bf29cd78990ec6 Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Mon, 11 Mar 2024 11:24:48 +0100 Subject: [PATCH 17/17] Fix peek in `VecSplice` (#187) * Fix peek in `VecSplice` * Rename `peek(_mut)` to `last_mutated(_mut)` in `VecSplice` and fixed index access --- crates/xilem_core/src/sequence.rs | 2 +- crates/xilem_core/src/vec_splice.rs | 16 ++++++++++++---- crates/xilem_web/src/elements.rs | 2 +- src/view/tree_structure_tracking.rs | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/xilem_core/src/sequence.rs b/crates/xilem_core/src/sequence.rs index 622cb3dce..b2e2560ec 100644 --- a/crates/xilem_core/src/sequence.rs +++ b/crates/xilem_core/src/sequence.rs @@ -91,7 +91,7 @@ macro_rules! generate_viewsequence_trait { fn mark(&mut self, changeflags: $changeflags, _cx: &mut $cx) -> $changeflags { - self.peek_mut().map(|pod| pod.mark(changeflags)).unwrap_or_default() + self.last_mutated_mut().map(|pod| pod.mark(changeflags)).unwrap_or_default() } fn delete(&mut self, n: usize, _cx: &mut $cx) { diff --git a/crates/xilem_core/src/vec_splice.rs b/crates/xilem_core/src/vec_splice.rs index b460744fe..e438d7615 100644 --- a/crates/xilem_core/src/vec_splice.rs +++ b/crates/xilem_core/src/vec_splice.rs @@ -50,12 +50,20 @@ impl<'a, 'b, T> VecSplice<'a, 'b, T> { &mut self.v[ix] } - pub fn peek(&self) -> Option<&T> { - self.v.last() + pub fn last_mutated(&self) -> Option<&T> { + if self.ix == 0 { + None + } else { + self.v.get(self.ix - 1) + } } - pub fn peek_mut(&mut self) -> Option<&mut T> { - self.v.last_mut() + pub fn last_mutated_mut(&mut self) -> Option<&mut T> { + if self.ix == 0 { + None + } else { + self.v.get_mut(self.ix - 1) + } } pub fn len(&self) -> usize { diff --git a/crates/xilem_web/src/elements.rs b/crates/xilem_web/src/elements.rs index 10111bb97..1a48bf596 100644 --- a/crates/xilem_web/src/elements.rs +++ b/crates/xilem_web/src/elements.rs @@ -123,7 +123,7 @@ impl<'a, 'b, 'c> ElementsSplice for ChildrenSplice<'a, 'b, 'c> { self.node_list = Some(self.parent.child_nodes()); self.node_list.as_ref().unwrap() }; - let cur_child = self.children.peek_mut().unwrap_throw(); + let cur_child = self.children.last_mutated_mut().unwrap_throw(); let old_child = node_list.get(self.child_idx).unwrap_throw(); self.parent .replace_child(cur_child.0.as_node_ref(), &old_child) diff --git a/src/view/tree_structure_tracking.rs b/src/view/tree_structure_tracking.rs index a05ada475..aa5c797cd 100644 --- a/src/view/tree_structure_tracking.rs +++ b/src/view/tree_structure_tracking.rs @@ -38,7 +38,7 @@ impl<'a, 'b> ElementsSplice for TreeStructureSplice<'a, 'b> { fn mark(&mut self, changeflags: ChangeFlags, cx: &mut Cx) -> ChangeFlags { if changeflags.contains(ChangeFlags::tree_structure()) { let current_id = self.current_child_id.take().unwrap(); - let new_id = self.splice.peek().unwrap().id(); + let new_id = self.splice.last_mutated().unwrap().id(); if current_id != new_id { cx.tree_structure .change_child(cx.element_id(), self.splice.len() - 1, new_id);