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 3c9690a1a..8c5406794 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,51 +3,26 @@ version = 3 [[package]] -name = "accesskit" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" - -[[package]] -name = "accesskit_consumer" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04bb4d9e4772fe0d47df57d0d5dbe5d85dd05e2f37ae1ddb6b105e76be58fb00" -dependencies = [ - "accesskit", -] - -[[package]] -name = "accesskit_macos" -version = "0.9.0" +name = "ab_glyph" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134d0acf6acb667c89d3332999b1a5df4edbc8d6113910f392ebb73f2b03bb56" +checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" dependencies = [ - "accesskit", - "accesskit_consumer", - "objc2", - "once_cell", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] -name = "accesskit_windows" -version = "0.14.3" +name = "ab_glyph_rasterizer" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eac0a7f2d7cd7a93b938af401d3d8e8b7094217989a7c25c55a953023436e31" -dependencies = [ - "accesskit", - "accesskit_consumer", - "arrayvec", - "once_cell", - "paste", - "windows 0.48.0", -] +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[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,216 +35,100 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ + "cfg-if", "getrandom", "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 = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" - -[[package]] -name = "arrayvec" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" - -[[package]] -name = "as-raw-xcb-connection" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5f312b0a56c5cdf967c0aeb67f6289603354951683bc97ddc595ab974ba9aa" - -[[package]] -name = "ash" -version = "0.37.3+1.3.251" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" -dependencies = [ - "libloading 0.7.4", -] - -[[package]] -name = "ashpd" -version = "0.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", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.5.1" +name = "allocator-api2" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" -dependencies = [ - "async-lock", - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", -] +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] -name = "async-global-executor" -version = "2.3.1" +name = "android-activity" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", + "android-properties", + "bitflags 2.4.2", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "num_enum", + "thiserror", ] [[package]] -name = "async-io" -version = "1.13.0" +name = "android-properties" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite", - "log", - "parking", - "polling", - "rustix", - "slab", - "socket2", - "waker-fn", -] +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" [[package]] -name = "async-lock" -version = "2.7.0" +name = "android_system_properties" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ - "event-listener", + "libc", ] [[package]] -name = "async-recursion" -version = "1.0.4" +name = "arrayref" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] -name = "async-std" -version = "1.12.0" +name = "arrayvec" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] -name = "async-task" -version = "4.4.0" +name = "as-raw-xcb-connection" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] -name = "async-trait" -version = "0.1.68" +name = "ash" +version = "0.37.3+1.3.251" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", + "libloading 0.7.4", ] [[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 +138,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", @@ -292,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.3.3", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.25", - "which", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -338,9 +174,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" @@ -348,116 +184,98 @@ 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.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", -] - -[[package]] -name = "blocking" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" -dependencies = [ - "async-channel", - "async-lock", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "log", + "objc2", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" 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.52", ] -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[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" -version = "0.10.6" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "log", - "nix 0.25.1", - "slotmap", + "polling", + "rustix", + "slab", "thiserror", - "vec_map", ] [[package]] -name = "cc" -version = "1.0.79" +name = "calloop-wayland-source" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop", + "rustix", + "wayland-backend", + "wayland-client", +] [[package]] -name = "cexpr" -version = "0.6.0" +name = "cc" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ - "nom", + "libc", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" @@ -465,68 +283,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "clang-sys" -version = "1.6.1" +name = "cfg_aliases" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "glob", - "libc", - "libloading 0.7.4", + "termcolor", + "unicode-width", ] [[package]] -name = "cocoa" -version = "0.25.0" +name = "com" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types 0.5.0", - "libc", - "objc", + "com_macros", ] [[package]] -name = "cocoa-foundation" -version = "0.1.1" +name = "com_macros" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" dependencies = [ - "bitflags 1.3.2", - "block", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", - "objc", + "com_macros_support", + "proc-macro2", + "syn 1.0.109", ] [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "com_macros_support" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" dependencies = [ - "termcolor", - "unicode-width", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "com-rs" -version = "0.2.1" +name = "combine" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] [[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 +360,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 +370,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 +383,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", ] @@ -602,93 +418,50 @@ dependencies = [ "xilem_web", ] -[[package]] -name = "cpufeatures" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" -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" -version = "0.1.6" +name = "cursor-icon" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] +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?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ - "bitflags 2.3.3", - "libloading 0.8.0", + "bitflags 2.4.2", + "libloading 0.8.2", "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 = "dirs" -version = "4.0.0" +name = "dispatch" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] -name = "dirs-sys" -version = "0.3.7" +name = "dlib" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libc", - "redox_users", - "winapi", + "libloading 0.8.2", ] [[package]] -name = "dlib" -version = "0.5.2" +name = "document-features" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" dependencies = [ - "libloading 0.8.0", + "litrs", ] [[package]] @@ -698,37 +471,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "enumflags2" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.7" +name = "env_filter" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", + "log", ] [[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", @@ -738,24 +493,29 @@ dependencies = [ ] [[package]] -name = "errno" -version = "0.3.1" +name = "env_logger" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", + "env_filter", + "log", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +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]] @@ -767,29 +527,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 = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fello" -version = "0.1.0" -source = "git+https://github.com/dfrg/fount?rev=dadbcf75695f035ca46766bfd60555d05bd421b1#dadbcf75695f035ca46766bfd60555d05bd421b1" -dependencies = [ - "read-fonts", -] - [[package]] name = "fnv" version = "1.0.7" @@ -798,18 +535,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" - -[[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", -] +checksum = "0bd7f3ea17572640b606b35df42cfb6ecdf003704b062580e59918692190b73d" [[package]] name = "foreign-types" @@ -818,7 +546,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]] @@ -829,79 +557,20 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.52", ] -[[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" -[[package]] -name = "form_urlencoded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-intrusive" @@ -914,93 +583,27 @@ dependencies = [ "parking_lot", ] -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "gethostname" -version = "0.3.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "winapi", + "windows-targets 0.48.5", ] [[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", "libc", @@ -1009,54 +612,20 @@ 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 = "glazier" -version = "0.1.0" -source = "git+https://github.com/linebender/glazier?rev=19a01ba8a97f15bf499ac64e6ea9690d7390deb5#19a01ba8a97f15bf499ac64e6ea9690d7390deb5" -dependencies = [ - "accesskit", - "accesskit_macos", - "accesskit_windows", - "anyhow", - "ashpd", - "bindgen", - "bitflags 2.3.3", - "block", - "cfg-if", - "cocoa", - "core-graphics", - "futures", - "instant", - "js-sys", - "keyboard-types", - "kurbo 0.9.5", - "lazy_static", - "memchr", - "nix 0.25.1", - "objc", - "once_cell", - "pkg-config", - "raw-window-handle", - "scopeguard", - "smithay-client-toolkit", - "tracing", - "wasm-bindgen", - "wayland-backend", - "web-sys", - "winapi", - "wio", - "x11rb", -] - -[[package]] -name = "glob" -version = "0.3.1" +name = "gl_generator" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] [[package]] name = "gloo" @@ -1078,18 +647,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" @@ -1105,9 +662,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,13 +672,22 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "gpu-alloc-types", ] @@ -1131,47 +697,47 @@ 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]] name = "gpu-allocator" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows", ] [[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", ] [[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]] 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" @@ -1185,23 +751,24 @@ 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 = "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.2", "thiserror", "widestring", "winapi", @@ -1209,24 +776,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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "hex" -version = "0.4.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hexf-parse" @@ -1241,22 +793,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] -name = "idna" -version = "0.4.0" +name = "icrate" +version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "block2", + "dispatch", + "objc2", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] @@ -1273,71 +826,69 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "is-terminal" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] -name = "is-terminal" -version = "0.4.7" +name = "itoa" +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 = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys", + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", ] [[package]] -name = "itoa" -version = "1.0.6" +name = "jni-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[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", ] -[[package]] -name = "keyboard-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" -dependencies = [ - "bitflags 2.3.3", -] - [[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.2", "pkg-config", ] [[package]] -name = "kurbo" -version = "0.9.5" +name = "khronos_api" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" -dependencies = [ - "arrayvec", -] +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "kurbo" @@ -1350,12 +901,13 @@ dependencies = [ ] [[package]] -name = "kv-log-macro" -version = "1.0.7" +name = "kurbo" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +checksum = "6e5aa9f0f96a938266bdb12928a67169e8d22c6a786fda8ed984b85e6ba93c3c" dependencies = [ - "log", + "arrayvec", + "smallvec", ] [[package]] @@ -1365,48 +917,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "lazycell" -version = "1.3.0" +name = "libc" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] -name = "libc" -version = "0.2.146" +name = "libloading" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "2caa5afb8bf9f3a2652760ce7d4f62d21c4d5a423e68466fca30df82f2330164" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.52.4", ] [[package]] -name = "libloading" -version = "0.8.0" +name = "libredox" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "cfg-if", - "windows-sys", + "bitflags 2.4.2", + "libc", + "redox_syscall 0.4.1", ] [[package]] name = "linux-raw-sys" -version = "0.3.8" +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 = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[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", @@ -1414,12 +977,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" -dependencies = [ - "value-bag", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "malloc_buf" @@ -1442,86 +1002,62 @@ 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" -version = "0.5.10" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" 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 = "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", + "bitflags 2.4.2", "block", "core-graphics-types", - "foreign-types 0.5.0", + "foreign-types", "log", "objc", "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.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "naga" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ + "arrayvec", "bit-set", - "bitflags 2.3.3", + "bitflags 2.4.2", "codespan-reporting", "hexf-parse", "indexmap", @@ -1535,61 +1071,76 @@ dependencies = [ ] [[package]] -name = "nix" -version = "0.25.1" +name = "ndk" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", - "pin-utils", + "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 = "nix" -version = "0.26.2" +name = "ndk-context" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "static_assertions", -] +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] -name = "nom" -version = "7.1.3" +name = "ndk-sys" +version = "0.5.0+25.2.9519653" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ - "memchr", - "minimal-lexical", + "jni-sys", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 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", ] +[[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.52", +] + [[package]] name = "objc" version = "0.2.7" @@ -1602,29 +1153,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" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe31e5425d3d0b89a15982c024392815da40689aceb34bad364d58732bcfd649" +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" @@ -1637,34 +1184,36 @@ 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" -version = "0.2.0" +name = "orbclient" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "futures-core", - "pin-project-lite", + "libredox", ] [[package]] -name = "parking" -version = "2.1.0" +name = "owned_ttf_parser" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +dependencies = [ + "ttf-parser", +] [[package]] name = "parking_lot" @@ -1678,185 +1227,131 @@ 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 0.4.1", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[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=1940d1ae9f2a9b44b7c18967147ffa7d345fdafd#1940d1ae9f2a9b44b7c18967147ffa7d345fdafd" dependencies = [ - "fount", + "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "swash", ] [[package]] name = "paste" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[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=cafdac9a211a0fb2fec5656bd663d1ac770bcc81#cafdac9a211a0fb2fec5656bd663d1ac770bcc81" +source = "git+https://github.com/linebender/peniko?rev=629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa#629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa" dependencies = [ - "kurbo 0.9.5", + "kurbo 0.10.4", "smallvec", ] [[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" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" -version = "2.8.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" dependencies = [ - "autocfg", - "bitflags 1.3.2", "cfg-if", "concurrent-queue", - "libc", - "log", "pin-project-lite", - "windows-sys", + "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 = "prettyplease" -version = "0.2.12" +name = "presser" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" -dependencies = [ - "proc-macro2", - "syn 2.0.25", -] +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "once_cell", "toml_edit", ] [[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.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] [[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", ] -[[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" @@ -1869,49 +1364,56 @@ 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.10.0" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d08214643b2df95b0b3955cd9f264bcfab22b73470b83df4992df523b4d6eb" +checksum = "17ea23eedb4d938031b6d4343222444608727a6aa68ec355e13588d9947ffe92" dependencies = [ "font-types", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 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", @@ -1920,15 +1422,15 @@ 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" -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" @@ -1944,23 +1446,31 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.37.20" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "scoped-tls" @@ -1970,78 +1480,63 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +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 = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] [[package]] name = "serde" -version = "1.0.170" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56657f512baabca8f840542f9ca8152aecf182c473c26e46e58d6aab4f6e439" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.170" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d477848e6b23adba0db397777d5aad864555bc17fd9c89abb3b8009788b7b8" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.52", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -2051,70 +1546,90 @@ dependencies = [ "libc", ] +[[package]] +name = "skrifa" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +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" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1476c3d89bb67079264b88aaf4f14358353318397e083b7c4e8c14517f55de7" +checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "calloop", - "dlib", - "lazy_static", + "calloop-wayland-source", + "cursor-icon", + "libc", "log", "memmap2", - "nix 0.26.2", + "rustix", "thiserror", "wayland-backend", "wayland-client", + "wayland-csd-frame", "wayland-cursor", "wayland-protocols", "wayland-protocols-wlr", "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smol_str" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +dependencies = [ + "serde", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[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]] @@ -2123,6 +1638,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" @@ -2141,9 +1662,11 @@ dependencies = [ [[package]] name = "swash" -version = "0.1.8" -source = "git+https://github.com/dfrg/swash#56ea551ac49e51580c466f03d6c75252a8c8e700" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d06ff4664af8923625604261c645f5c4cc610cc83c84bec74b50d76237089de7" dependencies = [ + "read-fonts", "yazi", "zeno", ] @@ -2161,9 +1684,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -2172,94 +1695,102 @@ 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", ] [[package]] -name = "tempfile" -version = "3.6.0" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ - "autocfg", - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys", + "winapi-util", ] [[package]] -name = "termcolor" -version = "1.2.0" +name = "test-log" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "7b319995299c65d522680decf80f2c108d85b861d81dfe340a10d16cee29d9e6" dependencies = [ - "winapi-util", + "env_logger 0.11.2", + "test-log-macros", ] [[package]] -name = "test-log" -version = "0.2.12" +name = "test-log-macros" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9601d162c1d77e62c1ea0bc8116cd1caf143ce3af947536c3c9052a1677fe0c" +checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.52", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.52", ] [[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", ] [[package]] -name = "tinyvec" -version = "1.6.0" +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 = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" dependencies = [ - "tinyvec_macros", + "arrayref", + "bytemuck", + "strict-num", ] -[[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" @@ -2276,11 +1807,11 @@ dependencies = [ [[package]] name = "tokio" -version = "1.28.2" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -2290,31 +1821,31 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[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", - "syn 2.0.25", + "syn 2.0.52", ] [[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.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -2323,12 +1854,10 @@ dependencies = [ [[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", "tracing-core", @@ -2336,29 +1865,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.52", ] [[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", @@ -2377,47 +1906,28 @@ dependencies = [ ] [[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "uds_windows" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" -dependencies = [ - "tempfile", - "winapi", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.13" +name = "ttf-parser" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[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" -version = "0.1.22" +name = "unicode-segmentation" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[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" @@ -2425,40 +1935,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "url" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "value-bag" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" - -[[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" -source = "git+https://github.com/linebender/vello?rev=9d7c4f00d8db420337706771a37937e9025e089c#9d7c4f00d8db420337706771a37937e9025e089c" +source = "git+https://github.com/linebender/vello?rev=6fa114c020f8656947e283bdf4bed96fe7a54c70#6fa114c020f8656947e283bdf4bed96fe7a54c70" dependencies = [ "bytemuck", - "fello", "futures-intrusive", - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=cafdac9a211a0fb2fec5656bd663d1ac770bcc81)", - "raw-window-handle", + "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.6.0", + "skrifa", "vello_encoding", "wgpu", ] @@ -2466,12 +1952,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=6fa114c020f8656947e283bdf4bed96fe7a54c70#6fa114c020f8656947e283bdf4bed96fe7a54c70" dependencies = [ "bytemuck", - "fello", "guillotiere", - "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=cafdac9a211a0fb2fec5656bd663d1ac770bcc81)", + "peniko 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "skrifa", ] [[package]] @@ -2481,10 +1967,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "waker-fn" -version = "1.1.0" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasi" @@ -2494,9 +1984,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", @@ -2504,24 +1994,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.52", "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", @@ -2531,9 +2021,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", @@ -2541,33 +2031,32 @@ 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.52", "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" -version = "0.1.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b48e27457e8da3b2260ac60d0a94512f5cba36448679f3747c0865b7893ed8" +checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" dependencies = [ "cc", "downcast-rs", - "io-lifetimes", - "nix 0.26.2", + "rustix", "scoped-tls", "smallvec", "wayland-sys", @@ -2575,47 +2064,70 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.30.2" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" +checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ - "bitflags 1.3.2", - "calloop", - "nix 0.26.2", + "bitflags 2.4.2", + "rustix", "wayland-backend", "wayland-scanner", ] +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.4.2", + "cursor-icon", + "wayland-backend", +] + [[package]] name = "wayland-cursor" -version = "0.30.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0c3a0d5b4b688b07b0442362d3ed6bf04724fcc16cd69ab6285b90dbc487aa" +checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ - "nix 0.26.2", + "rustix", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.30.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.4.2", "wayland-backend", "wayland-client", + "wayland-protocols", "wayland-scanner", ] [[package]] name = "wayland-protocols-wlr" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce991093320e4a6a525876e6b629ab24da25f9baef0c2e0080ad173ec89588a" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2624,9 +2136,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" +checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", "quick-xml", @@ -2635,39 +2147,51 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", "log", + "once_cell", "pkg-config", ] [[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", ] [[package]] -name = "wgpu" -version = "0.17.0" +name = "web-time" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wgpu" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "cfg-if", + "cfg_aliases", + "document-features", "js-sys", "log", "naga", "parking_lot", "profiling", - "raw-window-handle", + "raw-window-handle 0.6.0", "smallvec", "static_assertions", "wasm-bindgen", @@ -2680,19 +2204,22 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.3.3", + "bitflags 2.4.2", + "cfg_aliases", "codespan-reporting", + "document-features", + "indexmap", "log", "naga", + "once_cell", "parking_lot", "profiling", - "raw-window-handle", + "raw-window-handle 0.6.0", "rustc-hash", "smallvec", "thiserror", @@ -2703,19 +2230,20 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 2.3.3", + "bitflags 2.4.2", "block", + "cfg_aliases", "core-graphics-types", "d3d12", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -2723,15 +2251,17 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.0", + "libloading 0.8.2", "log", "metal", "naga", + "ndk-sys", "objc", + "once_cell", "parking_lot", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.6.0", "renderdoc-sys", "rustc-hash", "smallvec", @@ -2744,26 +2274,14 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +version = "0.19.0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.2", "js-sys", "web-sys", ] -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "widestring" version = "1.0.2" @@ -2788,18 +2306,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2812,53 +2321,48 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core", + "windows-targets 0.52.4", ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-implement", - "windows-interface", - "windows-targets 0.48.0", + "windows-targets 0.52.4", ] [[package]] -name = "windows-implement" -version = "0.48.0" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "windows-targets 0.42.2", ] [[package]] -name = "windows-interface" +name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.52.4", ] [[package]] @@ -2878,17 +2382,32 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 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", + "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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "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]] @@ -2899,9 +2418,15 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -2911,9 +2436,15 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -2923,9 +2454,15 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -2935,9 +2472,15 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -2947,9 +2490,15 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +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.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -2959,9 +2508,15 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -2971,71 +2526,121 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[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 = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winit" +version = "0.29.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "2b9d7047a2a569d5a81e3be098dcd8153759909b127477f4397e03cf1006d90a" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.4.2", + "bytemuck", + "calloop", + "cfg_aliases", + "core-foundation", + "core-graphics", + "cursor-icon", + "icrate", + "js-sys", + "libc", + "log", + "memmap2", + "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", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.48.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] -name = "wio" -version = "0.2.2" +name = "x11-dl" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" dependencies = [ - "winapi", + "libc", + "once_cell", + "pkg-config", ] [[package]] name = "x11rb" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "nix 0.26.2", - "winapi", - "winapi-wsapoll", + "libloading 0.8.2", + "once_cell", + "rustix", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" -dependencies = [ - "nix 0.26.2", -] +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" [[package]] name = "xcursor" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" -dependencies = [ - "nom", -] +checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" [[package]] name = "xilem" version = "0.1.0" dependencies = [ - "accesskit", - "bitflags 2.3.3", - "env_logger", + "bitflags 2.4.2", + "env_logger 0.10.2", "fnv", "futures-task", - "glazier", + "instant", "parley", "taffy", "test-log", @@ -3043,6 +2648,7 @@ dependencies = [ "tracing", "vello", "wgpu", + "winit", "xilem_core", ] @@ -3054,9 +2660,9 @@ 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", + "kurbo 0.11.0", "log", "paste", "peniko 0.1.0 (git+https://github.com/linebender/peniko?rev=629fc3325b016a8c98b1cd6204cb4ddf1c6b3daa)", @@ -3066,114 +2672,58 @@ dependencies = [ ] [[package]] -name = "yazi" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" - -[[package]] -name = "zbus" -version = "3.10.0" +name = "xkbcommon-dl" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f770930448dd412a4a7131dd968a8e6df0064db4d7916fbbd2d6c3f26b566938" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "async-broadcast", - "async-executor", - "async-io", - "async-lock", - "async-recursion", - "async-task", - "async-trait", - "byteorder", - "derivative", - "dirs", - "enumflags2", - "event-listener", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "nix 0.25.1", + "bitflags 2.4.2", + "dlib", + "log", "once_cell", - "ordered-stream", - "rand", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "tracing", - "uds_windows", - "winapi", - "zbus_macros", - "zbus_names", - "zvariant", + "xkeysym", ] [[package]] -name = "zbus_macros" -version = "3.10.0" +name = "xkeysym" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4832059b438689017db7340580ebabba07f114eab91bf990c6e55052408b40d8" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "regex", - "syn 1.0.109", -] +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" [[package]] -name = "zbus_names" -version = "2.5.1" +name = "xml-rs" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82441e6033be0a741157a72951a3e4957d519698f3a824439cc131c5ba77ac2a" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] -name = "zeno" -version = "0.2.2" +name = "yazi" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701" +checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" [[package]] -name = "zvariant" -version = "3.14.0" +name = "zeno" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622cc473f10cef1b0d73b7b34a266be30ebdcfaea40ec297dd8cbda088f9f93c" -dependencies = [ - "byteorder", - "enumflags2", - "libc", - "serde", - "static_assertions", - "url", - "zvariant_derive", -] +checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697" [[package]] -name = "zvariant_derive" -version = "3.14.0" +name = "zerocopy" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d9c1b57352c25b778257c661f3c4744b7cefb7fc09dd46909a153cce7773da2" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", - "zvariant_utils", + "zerocopy-derive", ] [[package]] -name = "zvariant_utils" -version = "1.0.1" +name = "zerocopy-derive" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.52", ] diff --git a/Cargo.toml b/Cargo.toml index 1ffa1057d..2039d2571 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,10 @@ license = "Apache-2.0" [workspace.dependencies] xilem_core = { version = "0.1.0", path = "crates/xilem_core" } -kurbo = "0.9.1" +kurbo = "0.11.0" + +[workspace.lints] +clippy.semicolon_if_nothing_returned = "warn" [package] name = "xilem" @@ -39,32 +42,35 @@ 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"] -x11 = ["glazier/x11"] -wayland = ["glazier/wayland"] +x11 = ["winit/x11"] +wayland = ["winit/wayland"] 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"] } +taffy = { version = "0.4.0", optional = true } +vello = { git = "https://github.com/linebender/vello", rev = "6fa114c020f8656947e283bdf4bed96fe7a54c70" } +# 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" bitflags = "2" tracing = "0.1.37" -accesskit = "0.11" fnv = "1.0.7" - -[dependencies.glazier] -git = "https://github.com/linebender/glazier" -rev = "19a01ba8a97f15bf499ac64e6ea9690d7390deb5" -default-features = false -features = ["accesskit"] +instant = { version = "0.1.6", features = ["wasm-bindgen"] } +winit = { version = "0.29", features = ["rwh_05"] } [dev-dependencies] env_logger = "0.10.0" test-log = "0.2.11" + +[patch.crates-io] +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"} 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_core/src/sequence.rs b/crates/xilem_core/src/sequence.rs index 54b19f99d..26767e63b 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,13 +53,13 @@ macro_rules! impl_view_tuple { } } } - #[macro_export] macro_rules! generate_viewsequence_trait { ( $viewseq:ident, $view:ident, $viewmarker: ident, + $elements_splice: ident, $bound:ident, $cx:ty, $changeflags:ty, @@ -67,6 +67,53 @@ macro_rules! generate_viewsequence_trait { $(($($super_bounds:tt)*))? $(,($($state_bounds: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.last_mutated_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. @@ -75,7 +122,10 @@ macro_rules! generate_viewsequence_trait { type State: $($( $state_bounds )*)?; /// 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. /// @@ -85,7 +135,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. @@ -110,9 +160,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) } @@ -121,20 +171,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( @@ -166,7 +216,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) => { @@ -181,20 +231,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() } @@ -229,7 +278,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() } @@ -238,7 +287,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()) { @@ -252,16 +301,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(); } @@ -305,26 +349,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..e438d7615 100644 --- a/crates/xilem_core/src/vec_splice.rs +++ b/crates/xilem_core/src/vec_splice.rs @@ -50,6 +50,22 @@ impl<'a, 'b, T> VecSplice<'a, 'b, T> { &mut self.v[ix] } + pub fn last_mutated(&self) -> Option<&T> { + if self.ix == 0 { + None + } else { + self.v.get(self.ix - 1) + } + } + + 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 { self.ix } 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/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; @@ -20,10 +21,10 @@ fn set_attribute(element: &web_sys::Element, name: &str, value: &str) { // doesn't work after the value has been changed. if name == "value" { let element: &web_sys::HtmlInputElement = element.dyn_ref().unwrap_throw(); - element.set_value(value) + element.set_value(value); } else if name == "checked" { let element: &web_sys::HtmlInputElement = element.dyn_ref().unwrap_throw(); - element.set_checked(true) + element.set_checked(true); } else { element.set_attribute(name, value).unwrap_throw(); } @@ -34,7 +35,7 @@ fn remove_attribute(element: &web_sys::Element, name: &str) { // doesn't work after the value has been changed. if name == "checked" { let element: &web_sys::HtmlInputElement = element.dyn_ref().unwrap_throw(); - element.set_checked(false) + element.set_checked(false); } else { element.remove_attribute(name).unwrap_throw(); } @@ -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..1a48bf596 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.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) + .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 a4178cde7..e0f2e352a 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, Memoize, MemoizeState, Pod, View, - ViewMarker, ViewSequence, + memoize, static_view, Adapt, AdaptState, AdaptThunk, AnyView, 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/vecmap.rs b/crates/xilem_web/src/vecmap.rs index 9f224da8c..3a76cb777 100644 --- a/crates/xilem_web/src/vecmap.rs +++ b/crates/xilem_web/src/vecmap.rs @@ -204,7 +204,7 @@ impl 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/src/view.rs b/crates/xilem_web/src/view.rs index ee9ca428a..3a075f699 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;} 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/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"] } 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 e3f37249f..de9e672b2 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); @@ -123,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/app.rs b/src/app.rs index 1e9d55751..070c5dcc2 100644 --- a/src/app.rs +++ b/src/app.rs @@ -13,20 +13,19 @@ // 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::kurbo::{Point, Rect, Size}; -use vello::SceneFragment; +use vello::{ + kurbo::{Point, Rect, Size}, + Scene, +}; 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}, @@ -44,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, @@ -53,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. @@ -77,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 @@ -113,9 +104,6 @@ enum UiState { WokeUI, } -#[derive(Clone, Default)] -pub struct WakeQueue(Arc>>); - impl + 'static> App where V::State: 'static, @@ -157,7 +145,6 @@ where app_logic, view: None, state: None, - idle_handle: None, pending_async: HashSet::new(), ui_state: UiState::Start, }; @@ -170,26 +157,13 @@ where id: None, root_pod: None, events: Vec::new(), - window_handle: Default::default(), - root_state: WidgetState::new(), + root_state: WidgetState::new(crate::id::Id::next()), size: Default::default(), new_size: Default::default(), cursor_pos: None, 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)); } } @@ -197,33 +171,6 @@ where self.new_size = size; } - pub fn accessibility(&mut self) -> TreeUpdate { - let mut update = TreeUpdate::default(); - 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 @@ -235,7 +182,7 @@ where 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); + 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); @@ -276,16 +223,11 @@ 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); + 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; @@ -303,12 +245,12 @@ 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, &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(); @@ -344,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 }; @@ -377,7 +326,7 @@ where } impl> App { - pub fn fragment(&self) -> &SceneFragment { + pub fn fragment(&self) -> &Scene { &self.root_pod.as_ref().unwrap().fragment } } @@ -393,7 +342,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..]; @@ -420,9 +368,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 ebcbae4ff..840c49ebd 100644 --- a/src/app_main.rs +++ b/src/app_main.rs @@ -12,22 +12,26 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::any::Any; +use std::{num::NonZeroUsize, sync::Arc}; -use accesskit::TreeUpdate; -use glazier::{ - Application, Cursor, HotKey, IdleToken, Menu, PointerEvent, Region, Scalable, SysMods, - WinHandler, WindowBuilder, WindowHandle, -}; use vello::{ - kurbo::{Affine, Size}, + kurbo::{Affine, Point, Size, Vec2}, peniko::Color, util::{RenderContext, RenderSurface}, - RenderParams, Renderer, RendererOptions, + AaSupport, RenderParams, Renderer, RendererOptions, Scene, +}; +use winit::{ + dpi::PhysicalPosition, + event::{ElementState, Modifiers, MouseButton, MouseScrollDelta, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::{Window, WindowBuilder}, }; -use vello::{Scene, SceneBuilder}; -use crate::{app::App, view::View, widget::Event}; +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. @@ -37,18 +41,17 @@ pub struct AppLauncher> { } // The logic of this struct is mostly parallel to DruidHandler in win_handler.rs. -struct MainState> { - handle: WindowHandle, +struct MainState<'a, T, V: View> { + window: Arc, app: App, render_cx: RenderContext, - surface: Option, + surface: RenderSurface<'a>, 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 { @@ -63,186 +66,174 @@ 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(); + let mut main_state = MainState::new(self.app, window); + + event_loop + .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), + }, + WindowEvent::MouseWheel { delta, .. } => main_state.pointer_wheel(delta), + _ => (), + } + } + }) .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()); - } - - fn prepare_paint(&mut self) {} - - fn paint(&mut self, _: &Region) { - self.app.paint(); - self.render(); - self.schedule_render(); - } - - 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<'a, T, V: View + 'static> MainState<'a, T, V> +where + T: Send + 'static, +{ + fn new(app: App, window: Window) -> Self { + 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, + 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: MouseButton) { + 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: MouseButton) { + 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(); - } - - fn destroy(&mut self) { - Application::global().quit() + self.window.request_redraw(); } - 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 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(); } 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; - 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)) - .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 (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)) - } else { - None - }; - let mut builder = SceneBuilder::for_scene(&mut self.scene); - builder.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), - timestamp_period: queue.get_timestamp_period(), - }; - let render_params = RenderParams { - base_color: Color::BLACK, - width, - height, - }; - 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); + let scale = self.window.scale_factor(); + let size = self.window.inner_size(); + let width = size.width; + let height = size.height; + + 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); } } diff --git a/src/bloom.rs b/src/bloom.rs deleted file mode 100644 index 1571ef330..000000000 --- a/src/bloom.rs +++ /dev/null @@ -1,162 +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. - 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/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/id.rs b/src/id.rs index 8f8d2bac0..82b61fd97 100644 --- a/src/id.rs +++ b/src/id.rs @@ -21,12 +21,14 @@ 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)] pub fn to_raw(self) -> u64 { self.0.into() } @@ -34,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 { - id.to_nonzero_raw().into() - } } diff --git a/src/lib.rs b/src/lib.rs index d5c29c1b2..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,9 +14,7 @@ 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 accesskit; pub use parley; pub use vello; diff --git a/src/text.rs b/src/text.rs index 5b1a3cc36..c8947f145 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}, + Scene, }; -#[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(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(); @@ -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::>(); + scene + .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/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 8353820d2..f6edda96b 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 + Sync> ViewSequenc { 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,39 +72,39 @@ impl, F: Fn(usize) -> VT + Send + Sync> ViewSequenc 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)); } - // 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(); } - 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 ffb5bdfad..bd3879482 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -16,12 +16,13 @@ mod button; // mod layout_observer; // mod list; -// mod scroll_view; +mod scroll_view; mod text; // mod use_state; mod linear_layout; mod list; mod switch; +mod tree_structure_tracking; #[allow(clippy::module_inception)] mod view; @@ -30,10 +31,12 @@ 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::{ - memoize, static_view, Adapt, AdaptState, AnyView, Cx, Memoize, MemoizeState, View, ViewMarker, - ViewSequence, + memoize, static_view, Adapt, AdaptState, AnyView, Cx, ElementsSplice, Memoize, MemoizeState, + View, ViewMarker, ViewSequence, }; #[cfg(feature = "taffy")] 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/view/taffy_layout.rs b/src/view/taffy_layout.rs index 38adb0ff1..b7f6d472b 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) @@ -126,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 { @@ -136,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/view/tree_structure_tracking.rs b/src/view/tree_structure_tracking.rs new file mode 100644 index 000000000..aa5c797cd --- /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.last_mutated().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 3ac7b4dc9..1383854de 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 + Sync), (Send)} -xilem_core::generate_viewsequence_trait! {ViewSequence, View, ViewMarker, Widget, Cx, ChangeFlags, Pod; (Send + Sync), (Send)} +xilem_core::generate_viewsequence_trait! {ViewSequence, View, ViewMarker, ElementsSplice, Widget, Cx, ChangeFlags, Pod; (Send + Sync), (Send)} xilem_core::generate_anyview_trait! {AnyView, View, ViewMarker, Cx, ChangeFlags, AnyWidget; (Send + Sync), (Send)} xilem_core::generate_memoize_view! {Memoize, MemoizeState, View, ViewMarker, Cx, ChangeFlags, static_view, memoize; + Send + Sync} xilem_core::generate_adapt_view! {View, Cx, ChangeFlags; + Send + Sync} @@ -34,7 +34,9 @@ xilem_core::generate_rc_view! {std::sync::Arc, View, ViewMarker, Cx, ChangeFlags #[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, } @@ -54,8 +56,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(), } } @@ -67,7 +71,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() } @@ -75,6 +79,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. @@ -96,6 +112,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/button.rs b/src/widget/button.rs index 2c8708d9c..c05081147 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -12,28 +12,25 @@ // 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}, peniko::{Brush, Color}, - SceneBuilder, + Scene, }; -use crate::{text::ParleyBrush, IdPath, Message}; +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 { id_path: IdPath, label: String, - layout: Option>, + layout: Option>, } impl Button { @@ -69,20 +66,13 @@ 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(), ())); - } - } _ => (), }; } fn lifecycle(&mut self, cx: &mut LifeCycleCx, event: &LifeCycle) { if let LifeCycle::HotChanged(_) = event { - cx.request_paint() + cx.request_paint(); } } @@ -96,8 +86,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? @@ -112,14 +102,7 @@ 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, 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 +121,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 +133,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/contexts.rs b/src/widget/contexts.rs index eb5277a79..2edb87c62 100644 --- a/src/widget/contexts.rs +++ b/src/widget/contexts.rs @@ -17,12 +17,10 @@ //! 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 super::{tree_structure::TreeStructure, PodFlags, WidgetState}; use crate::Message; // These contexts loosely follow Druid. @@ -30,7 +28,7 @@ use crate::Message; /// Static state that is shared between most contexts. pub struct CxState<'a> { #[allow(unused)] - window: &'a WindowHandle, + tree_structure: &'a TreeStructure, font_cx: &'a mut FontContext, messages: &'a mut Vec, } @@ -83,16 +81,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 @@ -117,14 +105,14 @@ macro_rules! impl_context_method { impl<'a> CxState<'a> { pub fn new( - window: &'a WindowHandle, font_cx: &'a mut FontContext, + tree_structure: &'a TreeStructure, messages: &'a mut Vec, ) -> Self { CxState { - window, font_cx, messages, + tree_structure, } } @@ -159,11 +147,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 +176,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 +193,6 @@ impl_context_method!( UpdateCx<'_, '_>, LifeCycleCx<'_, '_>, LayoutCx<'_, '_>, - AccessCx<'_, '_>, PaintCx<'_, '_>, { /// Returns whether this widget is hot. @@ -272,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 + } } ); @@ -339,7 +284,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 16db18e72..19f348030 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -18,16 +18,18 @@ //! 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::id::Id; 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! { @@ -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)] @@ -104,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 { @@ -138,29 +134,22 @@ 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) { - self.flags |= flags - } - - pub(crate) fn window_origin(&self) -> Point { - self.parent_window_origin + self.origin.to_vec2() + self.flags |= flags; } } @@ -169,18 +158,18 @@ 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(), - fragment: SceneFragment::default(), + state: WidgetState::new(id), + fragment: Scene::default(), widget, } } @@ -283,12 +272,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 @@ -337,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 { @@ -410,30 +391,12 @@ 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, 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 +409,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 neccessary 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 } @@ -498,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/linear_layout.rs b/src/widget/linear_layout.rs index 7057ecf9b..e3a890ba1 100644 --- a/src/widget/linear_layout.rs +++ b/src/widget/linear_layout.rs @@ -13,10 +13,9 @@ // 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::SceneBuilder; +use vello::Scene; use super::{contexts::LifeCycleCx, EventCx, LayoutCx, LifeCycle, PaintCx, Pod, UpdateCx, Widget}; @@ -83,27 +82,10 @@ 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, 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/mod.rs b/src/widget/mod.rs index a2b73c6c5..76dbbfc5b 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -21,9 +21,10 @@ 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)] mod widget; @@ -31,11 +32,13 @@ 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, ScrollDelta, ViewContext}; +pub use scroll_view::ScrollView; 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/piet_scene_helpers.rs b/src/widget/piet_scene_helpers.rs index 9e80a7aac..aecacf4ba 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}; -use vello::peniko::{BrushRef, Color, ColorStopsSource, Fill, Gradient, Stroke}; -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,18 +11,18 @@ pub struct UnitPoint { } pub fn stroke<'b>( - builder: &mut SceneBuilder, + scene: &mut Scene, path: &impl Shape, brush: impl Into>, stroke_width: f64, ) { - builder.stroke( - &Stroke::new(stroke_width as f32), + scene.stroke( + &Stroke::new(stroke_width), Affine::IDENTITY, brush, None, path, - ) + ); } // Note: copied from piet @@ -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/raw_event.rs b/src/widget/raw_event.rs index 66d4dec57..212d94f9f 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, PointerType}; use vello::kurbo::{Point, Rect, Vec2}; +use winit::event::{Modifiers, MouseButton}; #[derive(Debug, Clone)] pub enum Event { @@ -27,21 +28,26 @@ pub enum Event { MouseMove(MouseEvent), MouseWheel(MouseEvent), MouseLeft(), - TargetedAccessibilityAction(accesskit::ActionRequest), } #[derive(Debug, Clone)] 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 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)] @@ -58,21 +64,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: HashSet::::new(), + mods: Modifiers::default(), + count: 0, + focus: false, + button: None, + wheel_delta: None, } } } @@ -87,3 +89,117 @@ 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: 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 = Some(button); + self.e.clone() + } + + pub fn released(&mut self, button: MouseButton) -> MouseEvent { + self.e.wheel_delta = None; + self.e.buttons.remove(&button); + self.e.button = Some(button); + let r = self.e.clone(); + self.e.count = 0; + r + } + + pub fn moved(&mut self, pos: Point) -> MouseEvent { + 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: ScrollDelta) -> MouseEvent { + self.e.wheel_delta = Some(wheel_delta); + self.e.button = 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/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(); } } diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 29af1f4aa..33edd8762 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -12,11 +12,10 @@ // 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, + Scene, }; use crate::{IdPath, Message}; @@ -24,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 { @@ -76,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(), ())); @@ -101,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(), ())); - } - } _ => (), }; } @@ -126,20 +117,14 @@ 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, 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 { 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); @@ -149,8 +134,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; @@ -178,7 +163,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 787d9100d..f4d54056c 100644 --- a/src/widget/taffy_layout.rs +++ b/src/widget/taffy_layout.rs @@ -12,21 +12,18 @@ // 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 glazier::kurbo::Affine; -use vello::kurbo::{Point, Size}; -use vello::peniko::{Brush, Color, Fill}; -use vello::SceneBuilder; +use crate::{ + geometry::Axis, + widget::{BoxConstraints, Event}, +}; +use vello::{ + kurbo::{Affine, Point, Size}, + peniko::{Brush, Color, Fill}, + Scene, +}; 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}; @@ -162,7 +159,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; @@ -173,8 +170,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, @@ -189,7 +186,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<'_> { @@ -203,7 +200,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 { @@ -341,10 +340,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 @@ -399,10 +395,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 @@ -416,26 +409,9 @@ 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, 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), @@ -444,7 +420,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 e0ebe0f04..9548da74d 100644 --- a/src/widget/text.rs +++ b/src/widget/text.rs @@ -17,11 +17,9 @@ use std::borrow::Cow; use vello::{ kurbo::{Affine, Size}, peniko::{Brush, Color}, - SceneBuilder, + Scene, }; -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()); } @@ -116,15 +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); } } - - 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/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)); + } +} diff --git a/src/widget/widget.rs b/src/widget/widget.rs index f82300f30..dab5032e9 100644 --- a/src/widget/widget.rs +++ b/src/widget/widget.rs @@ -16,11 +16,10 @@ 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}; +use super::contexts::{EventCx, LayoutCx, LifeCycleCx, PaintCx, UpdateCx}; use super::raw_event::{Event, LifeCycle}; /// A basic widget trait. @@ -92,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`] @@ -108,7 +104,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)] @@ -231,11 +227,7 @@ 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, 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); } }