diff --git a/Cargo.lock b/Cargo.lock index ae17e10089..11b417eded 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,19 +24,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "getrandom 0.3.4", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.4" @@ -161,11 +148,11 @@ dependencies = [ "clipboard-win", "image", "log", - "objc2 0.6.4", - "objc2-app-kit 0.3.2", + "objc2", + "objc2-app-kit", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.2", + "objc2-foundation", "parking_lot", "percent-encoding", "windows-sys 0.60.2", @@ -311,7 +298,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 1.1.4", + "rustix", "slab", "windows-sys 0.61.2", ] @@ -353,7 +340,7 @@ dependencies = [ "cfg-if", "event-listener", "futures-lite", - "rustix 1.1.4", + "rustix", ] [[package]] @@ -379,7 +366,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 1.1.4", + "rustix", "signal-hook-registry", "slab", "windows-sys 0.61.2", @@ -585,22 +572,13 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" -dependencies = [ - "objc2 0.5.2", -] - [[package]] name = "block2" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" dependencies = [ - "objc2 0.6.4", + "objc2", ] [[package]] @@ -622,6 +600,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e79769241dcd44edf79a732545e8b5cec84c247ac060f5252cd51885d093a8fc" +[[package]] +name = "borsh" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88b7ea17d208c4193f2c1e6de3c35fe71f98c96982d5ced308bdcc749ff6e1f" +dependencies = [ + "bytes", + "cfg_aliases", +] + [[package]] name = "built" version = "0.8.1" @@ -680,26 +668,25 @@ checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" [[package]] name = "calloop" -version = "0.13.0" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7" dependencies = [ "bitflags 2.13.0", - "log", "polling", - "rustix 0.38.44", + "rustix", "slab", - "thiserror 1.0.69", + "tracing", ] [[package]] name = "calloop-wayland-source" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" dependencies = [ "calloop", - "rustix 0.38.44", + "rustix", "wayland-backend", "wayland-client", ] @@ -742,9 +729,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" @@ -959,30 +946,6 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" -[[package]] -name = "core-graphics" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "core-graphics-types", - "foreign-types 0.5.0", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "libc", -] - [[package]] name = "core_maths" version = "0.1.1" @@ -1280,9 +1243,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" dependencies = [ "bitflags 2.13.0", - "block2 0.6.2", + "block2", "libc", - "objc2 0.6.4", + "objc2", ] [[package]] @@ -1330,8 +1293,8 @@ dependencies = [ [[package]] name = "dpi" -version = "0.1.1" -source = "git+https://github.com/iced-rs/winit.git?rev=05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed#05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" +version = "0.1.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" [[package]] name = "dtor" @@ -1636,28 +1599,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared 0.1.1", -] - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared 0.3.1", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "foreign-types-shared", ] [[package]] @@ -1666,12 +1608,6 @@ 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.2" @@ -1830,7 +1766,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" dependencies = [ - "rustix 1.1.4", + "rustix", "windows-link", ] @@ -2450,7 +2386,7 @@ dependencies = [ "resvg", "rustc-hash 2.1.3", "softbuffer", - "tiny-skia", + "tiny-skia 0.11.4", ] [[package]] @@ -2499,7 +2435,6 @@ dependencies = [ "iced_runtime", "log", "mundy", - "objc2 0.5.2", "rustc-hash 2.1.3", "sysinfo", "thiserror 2.0.18", @@ -2892,6 +2827,16 @@ dependencies = [ "mutate_once", ] +[[package]] +name = "keyboard-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" +dependencies = [ + "bitflags 2.13.0", + "serde", +] + [[package]] name = "khronos-egl" version = "6.0.0" @@ -3021,12 +2966,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -3185,7 +3124,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" dependencies = [ - "rustix 1.1.4", + "rustix", ] [[package]] @@ -3290,9 +3229,9 @@ dependencies = [ "futures-lite", "jni", "ndk-context", - "objc2 0.6.4", - "objc2-app-kit 0.3.2", - "objc2-foundation 0.3.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", "pin-project-lite", "wasm-bindgen", "wasm-bindgen-futures", @@ -3507,22 +3446,6 @@ dependencies = [ "syn", ] -[[package]] -name = "objc-sys" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" - -[[package]] -name = "objc2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" -dependencies = [ - "objc-sys", - "objc2-encode", -] - [[package]] name = "objc2" version = "0.6.4" @@ -3532,22 +3455,6 @@ dependencies = [ "objc2-encode", ] -[[package]] -name = "objc2-app-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "libc", - "objc2 0.5.2", - "objc2-core-data 0.2.2", - "objc2-core-image 0.2.2", - "objc2-foundation 0.2.2", - "objc2-quartz-core 0.2.2", -] - [[package]] name = "objc2-app-kit" version = "0.3.2" @@ -3555,31 +3462,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ "bitflags 2.13.0", - "block2 0.6.2", + "block2", "libc", - "objc2 0.6.4", - "objc2-cloud-kit 0.3.2", - "objc2-core-data 0.3.2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", "objc2-core-foundation", "objc2-core-graphics", - "objc2-core-image 0.3.2", + "objc2-core-image", "objc2-core-text", "objc2-core-video", - "objc2-foundation 0.3.2", - "objc2-quartz-core 0.3.2", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-core-location", - "objc2-foundation 0.2.2", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] @@ -3589,31 +3483,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" dependencies = [ "bitflags 2.13.0", - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-contacts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-core-data" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3623,8 +3494,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" dependencies = [ "bitflags 2.13.0", - "objc2 0.6.4", - "objc2-foundation 0.3.2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3634,8 +3505,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.13.0", + "block2", "dispatch2", - "objc2 0.6.4", + "objc2", ] [[package]] @@ -3646,43 +3518,20 @@ checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ "bitflags 2.13.0", "dispatch2", - "objc2 0.6.4", + "libc", + "objc2", "objc2-core-foundation", "objc2-io-surface", ] -[[package]] -name = "objc2-core-image" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", - "objc2-metal 0.2.2", -] - [[package]] name = "objc2-core-image" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" dependencies = [ - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-core-location" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-contacts", - "objc2-foundation 0.2.2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3692,7 +3541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" dependencies = [ "bitflags 2.13.0", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", "objc2-core-graphics", ] @@ -3704,7 +3553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" dependencies = [ "bitflags 2.13.0", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", "objc2-core-graphics", "objc2-io-surface", @@ -3716,19 +3565,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" -[[package]] -name = "objc2-foundation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "dispatch", - "libc", - "objc2 0.5.2", -] - [[package]] name = "objc2-foundation" version = "0.3.2" @@ -3736,9 +3572,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.13.0", - "block2 0.6.2", + "block2", "libc", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", ] @@ -3749,34 +3585,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" dependencies = [ "bitflags 2.13.0", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", ] -[[package]] -name = "objc2-link-presentation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-metal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - [[package]] name = "objc2-metal" version = "0.3.2" @@ -3784,22 +3596,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794" dependencies = [ "bitflags 2.13.0", - "block2 0.6.2", - "objc2 0.6.4", - "objc2-foundation 0.3.2", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", - "objc2-metal 0.2.2", + "block2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3809,65 +3608,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" dependencies = [ "bitflags 2.13.0", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", - "objc2-foundation 0.3.2", - "objc2-metal 0.3.2", -] - -[[package]] -name = "objc2-symbols" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" -dependencies = [ - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "objc2-foundation", + "objc2-metal", ] [[package]] name = "objc2-ui-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" -dependencies = [ - "bitflags 2.13.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-cloud-kit 0.2.2", - "objc2-core-data 0.2.2", - "objc2-core-image 0.2.2", - "objc2-core-location", - "objc2-foundation 0.2.2", - "objc2-link-presentation", - "objc2-quartz-core 0.2.2", - "objc2-symbols", - "objc2-uniform-type-identifiers", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-uniform-type-identifiers" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ "bitflags 2.13.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-core-location", - "objc2-foundation 0.2.2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", ] [[package]] @@ -3900,7 +3656,7 @@ checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" dependencies = [ "bitflags 2.13.0", "cfg-if", - "foreign-types 0.3.2", + "foreign-types", "libc", "openssl-macros", "openssl-sys", @@ -3943,11 +3699,10 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orbclient" -version = "0.3.55" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747" +checksum = "bb08138df30517916447489a70848de31244c40c7b520bcf5ebdc9db6299da59" dependencies = [ - "libc", "libredox", ] @@ -4301,7 +4056,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.4", + "rustix", "windows-sys 0.61.2", ] @@ -4646,10 +4401,10 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" dependencies = [ - "objc2 0.6.4", + "objc2", "objc2-core-foundation", - "objc2-foundation 0.3.2", - "objc2-quartz-core 0.3.2", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] @@ -4694,12 +4449,13 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "redox_event" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "c5018d583d6d2f5499352aea8d177e9067d1eb03ab17c78169d5ba7a30001b15" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.0", + "libredox", ] [[package]] @@ -4821,7 +4577,7 @@ dependencies = [ "pico-args", "rgb", "svgtypes", - "tiny-skia", + "tiny-skia 0.11.4", "usvg", "zune-jpeg 0.4.21", ] @@ -4833,14 +4589,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672" dependencies = [ "ashpd", - "block2 0.6.2", + "block2", "dispatch2", "js-sys", "log", - "objc2 0.6.4", - "objc2-app-kit 0.3.2", + "objc2", + "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.2", + "objc2-foundation", "pollster", "raw-window-handle", "urlencoding", @@ -4900,19 +4656,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.13.0", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.4" @@ -4922,7 +4665,7 @@ dependencies = [ "bitflags 2.13.0", "errno", "libc", - "linux-raw-sys 0.12.1", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -5045,15 +4788,15 @@ dependencies = [ [[package]] name = "sctk-adwaita" -version = "0.10.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +checksum = "1f8ea028b7cb32e2f577b0a55a7b54cb206376bdb1221bd5c81dcf20b68db1fb" dependencies = [ "ab_glyph", "log", "memmap2", "smithay-client-toolkit", - "tiny-skia", + "tiny-skia 0.12.0", ] [[package]] @@ -5322,24 +5065,24 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "smithay-client-toolkit" -version = "0.19.2" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +checksum = "74dc9ee14b0fdcb535f9556141bacac070c994a977d2240ee455d7438a617f00" dependencies = [ "bitflags 2.13.0", "calloop", "calloop-wayland-source", "cursor-icon", - "libc", "log", "memmap2", - "rustix 0.38.44", - "thiserror 1.0.69", - "wayland-backend", + "rustix", + "thiserror 2.0.18", "wayland-client", "wayland-csd-frame", "wayland-cursor", "wayland-protocols", + "wayland-protocols-experimental", + "wayland-protocols-misc", "wayland-protocols-wlr", "wayland-scanner", "xkeysym", @@ -5376,6 +5119,10 @@ name = "smol_str" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4aaa7368fcf4852a4c2dd92df0cace6a71f2091ca0a23391ce7f3a31833f1523" +dependencies = [ + "borsh", + "serde_core", +] [[package]] name = "socket2" @@ -5399,14 +5146,14 @@ dependencies = [ "js-sys", "memmap2", "ndk", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.2", - "objc2-quartz-core 0.3.2", + "objc2-foundation", + "objc2-quartz-core", "raw-window-handle", "redox_syscall 0.5.18", - "rustix 1.1.4", + "rustix", "tiny-xlib", "tracing", "wasm-bindgen", @@ -5661,7 +5408,7 @@ dependencies = [ "fastrand", "getrandom 0.4.3", "once_cell", - "rustix 1.1.4", + "rustix", "windows-sys 0.61.2", ] @@ -5795,7 +5542,21 @@ dependencies = [ "cfg-if", "log", "png 0.17.16", - "tiny-skia-path", + "tiny-skia-path 0.11.4", +] + +[[package]] +name = "tiny-skia" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ffee5eaaf5527f630fb0e356b90ebdec84d5d18d937c5e440350f88c5a91ea" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path 0.12.0", ] [[package]] @@ -5809,6 +5570,17 @@ dependencies = [ "strict-num", ] +[[package]] +name = "tiny-skia-path" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca365c3faccca67d06593c5980fa6c57687de727a03131735bb85f01fdeeb9" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + [[package]] name = "tiny-xlib" version = "0.2.5" @@ -6299,7 +6071,7 @@ dependencies = [ "siphasher", "strict-num", "svgtypes", - "tiny-skia-path", + "tiny-skia-path 0.11.4", "unicode-bidi", "unicode-script", "unicode-vo", @@ -6534,7 +6306,7 @@ checksum = "2857dd20b54e916ec7253b3d6b4d5c4d7d4ca2c33c2e11c6c76a99bd8744755d" dependencies = [ "cc", "downcast-rs", - "rustix 1.1.4", + "rustix", "scoped-tls", "smallvec", "wayland-sys", @@ -6547,7 +6319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144" dependencies = [ "bitflags 2.13.0", - "rustix 1.1.4", + "rustix", "wayland-backend", "wayland-scanner", ] @@ -6569,7 +6341,7 @@ version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" dependencies = [ - "rustix 1.1.4", + "rustix", "wayland-client", "xcursor", ] @@ -6586,6 +6358,32 @@ dependencies = [ "wayland-scanner", ] +[[package]] +name = "wayland-protocols-experimental" +version = "20251230.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c6c3e7178e553d093d46999032bc79aafea9dedd71dd702c8ace7bbc25cf13" +dependencies = [ + "bitflags 2.13.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-misc" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8" +dependencies = [ + "bitflags 2.13.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + [[package]] name = "wayland-protocols-plasma" version = "0.3.12" @@ -6665,8 +6463,8 @@ dependencies = [ "jni", "log", "ndk-context", - "objc2 0.6.4", - "objc2-foundation 0.3.2", + "objc2", + "objc2-foundation", "url", "web-sys", ] @@ -6807,7 +6605,7 @@ dependencies = [ "ash", "bit-set 0.9.1", "bitflags 2.13.0", - "block2 0.6.2", + "block2", "bytemuck", "cfg-if", "cfg_aliases", @@ -6823,11 +6621,11 @@ dependencies = [ "log", "naga", "ndk-sys", - "objc2 0.6.4", + "objc2", "objc2-core-foundation", - "objc2-foundation 0.3.2", - "objc2-metal 0.3.2", - "objc2-quartz-core 0.3.2", + "objc2-foundation", + "objc2-metal", + "objc2-quartz-core", "once_cell", "ordered-float", "parking_lot", @@ -7079,15 +6877,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.60.2" @@ -7246,50 +7035,219 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winit" -version = "0.30.8" -source = "git+https://github.com/iced-rs/winit.git?rev=05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed#05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" dependencies = [ - "ahash", - "android-activity", - "atomic-waker", "bitflags 2.13.0", - "block2 0.5.1", - "bytemuck", - "calloop", "cfg_aliases", - "concurrent-queue", - "core-foundation 0.9.4", - "core-graphics", "cursor-icon", "dpi", - "js-sys", "libc", - "memmap2", + "raw-window-handle", + "rustix", + "smol_str 0.3.6", + "tracing", + "winit-android", + "winit-appkit", + "winit-common", + "winit-core", + "winit-orbital", + "winit-uikit", + "winit-wayland", + "winit-web", + "winit-win32", + "winit-x11", +] + +[[package]] +name = "winit-android" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "android-activity", + "bitflags 2.13.0", + "dpi", "ndk", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", - "objc2-ui-kit", + "raw-window-handle", + "smol_str 0.3.6", + "tracing", + "winit-core", +] + +[[package]] +name = "winit-appkit" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "block2", + "dispatch2", + "dpi", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-video", + "objc2-foundation", + "raw-window-handle", + "smol_str 0.3.6", + "tracing", + "winit-common", + "winit-core", +] + +[[package]] +name = "winit-common" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "block2", + "memmap2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "smol_str 0.3.6", + "tracing", + "winit-core", + "x11-dl", + "xkbcommon-dl", +] + +[[package]] +name = "winit-core" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "cursor-icon", + "dpi", + "keyboard-types", + "raw-window-handle", + "smol_str 0.3.6", + "url", + "web-time", +] + +[[package]] +name = "winit-orbital" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "dpi", + "libredox", "orbclient", + "raw-window-handle", + "redox_event", + "smol_str 0.3.6", + "tracing", + "winit-core", +] + +[[package]] +name = "winit-uikit" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "block2", + "dispatch2", + "dpi", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "raw-window-handle", + "smol_str 0.3.6", + "tracing", + "winit-common", + "winit-core", +] + +[[package]] +name = "winit-wayland" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "calloop", + "cursor-icon", + "dpi", + "foldhash 0.2.0", + "libc", + "memmap2", "percent-encoding", - "pin-project", "raw-window-handle", - "redox_syscall 0.4.1", - "rustix 0.38.44", + "rustix", "sctk-adwaita", "smithay-client-toolkit", - "smol_str 0.2.2", + "smol_str 0.3.6", "tracing", - "unicode-segmentation", - "wasm-bindgen", - "wasm-bindgen-futures", "wayland-backend", "wayland-client", "wayland-protocols", "wayland-protocols-plasma", + "winit-common", + "winit-core", +] + +[[package]] +name = "winit-web" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "atomic-waker", + "bitflags 2.13.0", + "concurrent-queue", + "cursor-icon", + "dpi", + "js-sys", + "pin-project", + "raw-window-handle", + "smol_str 0.3.6", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", "web-sys", "web-time", - "windows-sys 0.52.0", + "winit-core", +] + +[[package]] +name = "winit-win32" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "cursor-icon", + "dpi", + "raw-window-handle", + "smol_str 0.3.6", + "tracing", + "unicode-segmentation", + "url", + "windows-sys 0.61.2", + "winit-core", +] + +[[package]] +name = "winit-x11" +version = "0.31.0-beta.2" +source = "git+https://github.com/rust-windowing/winit.git?rev=f5e20bd7da25934f39abe8dc44a0597110ef6357#f5e20bd7da25934f39abe8dc44a0597110ef6357" +dependencies = [ + "bitflags 2.13.0", + "bytemuck", + "calloop", + "cursor-icon", + "dpi", + "libc", + "percent-encoding", + "raw-window-handle", + "rustix", + "smol_str 0.3.6", + "tracing", + "winit-common", + "winit-core", "x11-dl", "x11rb", "xkbcommon-dl", @@ -7319,7 +7277,7 @@ dependencies = [ "libc", "log", "os_pipe", - "rustix 1.1.4", + "rustix", "thiserror 2.0.18", "tree_magic_mini", "wayland-backend", @@ -7356,8 +7314,9 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 1.1.4", + "rustix", "x11rb-protocol", + "xcursor", ] [[package]] @@ -7475,7 +7434,7 @@ dependencies = [ "hex", "libc", "ordered-stream", - "rustix 1.1.4", + "rustix", "serde", "serde_repr", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 23d4d09013..74a7077caf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -244,7 +244,7 @@ wasmtimer = "0.4.2" web-sys = "=0.3.85" web-time = "1.1" wgpu = { version = "29", default-features = false, features = ["std", "wgsl"] } -winit = { git = "https://github.com/iced-rs/winit.git", rev = "05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed", default-features = false, features = ["rwh_06"] } +winit = { git = "https://github.com/rust-windowing/winit.git", rev = "f5e20bd7da25934f39abe8dc44a0597110ef6357", default-features = false } [workspace.lints.rust] rust_2018_idioms = { level = "deny", priority = -1 } diff --git a/benches/cpu.rs b/benches/cpu.rs index 46a9fd8d2c..235ff1d639 100644 --- a/benches/cpu.rs +++ b/benches/cpu.rs @@ -2,7 +2,7 @@ use criterion::{Bencher, Criterion, criterion_group, criterion_main}; use iced::border; -use iced::mouse; +use iced::pointer::mouse; use iced::widget::{canvas, center_y, column, container, row, scrollable, space, text}; use iced::{Center, Color, Element, Fill, Length, Never, Point, Rectangle, Size, Theme}; use iced_renderer::Renderer; diff --git a/benches/wgpu.rs b/benches/wgpu.rs index 2ff4e209b5..268726648e 100644 --- a/benches/wgpu.rs +++ b/benches/wgpu.rs @@ -2,7 +2,7 @@ use criterion::{Bencher, Criterion, criterion_group, criterion_main}; use iced::alignment; -use iced::mouse; +use iced::pointer::mouse; use iced::widget::{canvas, scrollable, stack, text}; use iced::{Color, Element, Font, Length, Pixels, Point, Rectangle, Size, Theme}; use iced_wgpu::Renderer; diff --git a/core/src/element.rs b/core/src/element.rs index a8c0d6adec..bcf0f06d79 100644 --- a/core/src/element.rs +++ b/core/src/element.rs @@ -1,6 +1,6 @@ use crate::layout; -use crate::mouse; use crate::overlay; +use crate::pointer::mouse; use crate::renderer; use crate::shell; use crate::widget; diff --git a/core/src/event.rs b/core/src/event.rs index f5325a57de..07b9d8636a 100644 --- a/core/src/event.rs +++ b/core/src/event.rs @@ -2,8 +2,7 @@ use crate::clipboard; use crate::input_method; use crate::keyboard; -use crate::mouse; -use crate::touch; +use crate::pointer; use crate::window; /// A user interface event. @@ -17,15 +16,12 @@ pub enum Event { /// A keyboard event Keyboard(keyboard::Event), - /// A mouse event - Mouse(mouse::Event), + /// A pointer event + Pointer(pointer::Event), /// A window event Window(window::Event), - /// A touch event - Touch(touch::Event), - /// An input method event InputMethod(input_method::Event), diff --git a/core/src/lib.rs b/core/src/lib.rs index a6b67b8de2..3c621993d9 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -23,16 +23,15 @@ pub mod input_method; pub mod keyboard; pub mod layout; pub mod length; -pub mod mouse; pub mod overlay; pub mod padding; +pub mod pointer; pub mod renderer; pub mod shell; pub mod svg; pub mod text; pub mod theme; pub mod time; -pub mod touch; pub mod widget; pub mod window; diff --git a/core/src/mouse.rs b/core/src/mouse.rs deleted file mode 100644 index d13a60fbc1..0000000000 --- a/core/src/mouse.rs +++ /dev/null @@ -1,13 +0,0 @@ -//! Handle mouse events. -pub mod click; - -mod button; -mod cursor; -mod event; -mod interaction; - -pub use button::Button; -pub use click::Click; -pub use cursor::Cursor; -pub use event::{Event, ScrollDelta}; -pub use interaction::Interaction; diff --git a/core/src/mouse/event.rs b/core/src/mouse/event.rs deleted file mode 100644 index 7f5585ada0..0000000000 --- a/core/src/mouse/event.rs +++ /dev/null @@ -1,56 +0,0 @@ -use crate::Point; - -use super::Button; - -/// A mouse event. -/// -/// _**Note:** This type is largely incomplete! If you need to track -/// additional events, feel free to [open an issue] and share your use case!_ -/// -/// [open an issue]: https://github.com/iced-rs/iced/issues -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum Event { - /// The mouse cursor entered the window. - CursorEntered, - - /// The mouse cursor left the window. - CursorLeft, - - /// The mouse cursor was moved - CursorMoved { - /// The new position of the mouse cursor - position: Point, - }, - - /// A mouse button was pressed. - ButtonPressed(Button), - - /// A mouse button was released. - ButtonReleased(Button), - - /// The mouse wheel was scrolled. - WheelScrolled { - /// The scroll movement. - delta: ScrollDelta, - }, -} - -/// A scroll movement. -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum ScrollDelta { - /// A line-based scroll movement - Lines { - /// The number of horizontal lines scrolled - x: f32, - - /// The number of vertical lines scrolled - y: f32, - }, - /// A pixel-based scroll movement - Pixels { - /// The number of horizontal pixels scrolled - x: f32, - /// The number of vertical pixels scrolled - y: f32, - }, -} diff --git a/core/src/overlay.rs b/core/src/overlay.rs index 5882e3dadc..7fa061f316 100644 --- a/core/src/overlay.rs +++ b/core/src/overlay.rs @@ -8,7 +8,7 @@ pub use group::Group; pub use nested::Nested; use crate::layout; -use crate::mouse; +use crate::pointer::mouse; use crate::renderer; use crate::widget; use crate::widget::Tree; diff --git a/core/src/overlay/element.rs b/core/src/overlay/element.rs index d6db752679..ba975d3b42 100644 --- a/core/src/overlay/element.rs +++ b/core/src/overlay/element.rs @@ -1,7 +1,7 @@ pub use crate::Overlay; use crate::layout; -use crate::mouse; +use crate::pointer::mouse; use crate::renderer; use crate::shell; use crate::widget; diff --git a/core/src/overlay/group.rs b/core/src/overlay/group.rs index 788ebcb5c3..c63c3aca64 100644 --- a/core/src/overlay/group.rs +++ b/core/src/overlay/group.rs @@ -1,6 +1,6 @@ use crate::layout; -use crate::mouse; use crate::overlay; +use crate::pointer::mouse; use crate::renderer; use crate::widget; use crate::{Event, Layout, Overlay, Shell, Size}; diff --git a/core/src/overlay/nested.rs b/core/src/overlay/nested.rs index 0846031c35..5ba3a16bdb 100644 --- a/core/src/overlay/nested.rs +++ b/core/src/overlay/nested.rs @@ -1,7 +1,7 @@ use crate::event; use crate::layout; -use crate::mouse; use crate::overlay; +use crate::pointer::mouse; use crate::renderer; use crate::widget; use crate::{Event, Layout, Shell, Size}; diff --git a/core/src/pointer.rs b/core/src/pointer.rs new file mode 100644 index 0000000000..1bf0aada9b --- /dev/null +++ b/core/src/pointer.rs @@ -0,0 +1,65 @@ +//! Handle pointer events. + +pub mod button; +pub mod mouse; +pub mod tablet; +pub mod touch; + +mod event; + +pub use event::Event; + +/// The kind of device that produced a pointer event. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum Kind { + /// A mouse. + Mouse, + + /// A finger touching a screen. + Touch(touch::Finger), + + /// A tablet tool. + TabletTool(tablet::Kind), + + /// An unknown pointer device. + Unknown, +} + +/// The device and associated data that produced a pointer event. +#[derive(Debug, Clone, PartialEq)] +pub enum Source { + /// A mouse. + Mouse, + + /// A finger touching a screen. + Touch { + /// The identifier of the finger. + finger_id: touch::Finger, + + /// The force of the touch, if reported by the device. + force: Option, + }, + + /// A tablet tool. + TabletTool { + /// The kind of tablet tool. + kind: tablet::Kind, + + /// Data describing how the tool is held and used. + data: tablet::Data, + }, + + /// An unknown pointer device. + Unknown, +} + +impl From for crate::pointer::Kind { + fn from(source: Source) -> Self { + match source { + Source::Mouse => Self::Mouse, + Source::Touch { finger_id, .. } => Self::Touch(finger_id), + Source::TabletTool { kind, .. } => Self::TabletTool(kind), + Source::Unknown => Self::Unknown, + } + } +} diff --git a/core/src/pointer/button.rs b/core/src/pointer/button.rs new file mode 100644 index 0000000000..0c2bf657a0 --- /dev/null +++ b/core/src/pointer/button.rs @@ -0,0 +1,34 @@ +//! Handle pointer buttons. + +use crate::pointer::{mouse, tablet, touch}; + +/// The source and button of a pointer button event. +#[derive(Debug, Clone, PartialEq)] +pub enum Source { + /// A mouse button. + Mouse(mouse::Button), + + /// A touch contact. + Touch { + /// The identifier of the finger. + finger_id: touch::Finger, + + /// The force of the touch, if reported by the device. + force: Option, + }, + + /// A tablet tool button. + TabletTool { + /// The kind of tablet tool. + kind: tablet::Kind, + + /// The button that changed state. + button: tablet::Button, + + /// Data describing how the tool is held and used. + data: tablet::Data, + }, + + /// A button from an unknown pointer source. + Unknown(u16), +} diff --git a/core/src/pointer/event.rs b/core/src/pointer/event.rs new file mode 100644 index 0000000000..3126f312f5 --- /dev/null +++ b/core/src/pointer/event.rs @@ -0,0 +1,119 @@ +use crate::Point; +use crate::pointer; +use crate::pointer::{button, mouse, tablet}; + +/// A pointer event. +#[derive(Debug, Clone, PartialEq)] +pub enum Event { + /// A pointer entered the window. + PointerEntered { + /// The position of the pointer when it entered the window. + position: Point, + + /// The kind of pointer that entered the window. + kind: pointer::Kind, + }, + + /// A pointer left the window. + PointerLeft { + /// The kind of pointer that left the window. + kind: pointer::Kind, + }, + + /// A pointer moved within the window. + PointerMoved { + /// The new position of the pointer. + position: Point, + + /// The source of the pointer movement. + source: pointer::Source, + }, + + /// A pointer button was pressed. + PointerPressed { + /// The position of the pointer when the button was pressed. + position: Point, + + /// The source and button that were pressed. + button: button::Source, + }, + + /// A pointer button was released. + PointerReleased { + /// The position of the pointer when the button was released. + position: Point, + + /// The source and button that were released. + button: button::Source, + }, + + /// A mouse wheel or touchpad was scrolled. + WheelScrolled { + /// The scroll movement. + delta: mouse::ScrollDelta, + }, +} + +impl Event { + /// Returns whether the event is a mouse left click, finger press, or tablet contact. + pub fn is_primary_click(&self) -> bool { + matches!( + self, + Self::PointerPressed { + button: button::Source::Mouse(mouse::Button::Left) + | button::Source::Touch { .. } + | button::Source::TabletTool { + button: tablet::Button::Contact, + .. + }, + .. + } + ) + } + + /// Returns whether the event is a mouse left release, finger lift, or tablet contact release. + pub fn is_primary_release(&self) -> bool { + matches!( + self, + Self::PointerReleased { + button: button::Source::Mouse(mouse::Button::Left) + | button::Source::Touch { .. } + | button::Source::TabletTool { + button: tablet::Button::Contact, + .. + }, + .. + } + ) + } + + /// Returns whether the event is a mouse right click or tablet barrel press. + pub fn is_secondary_click(&self) -> bool { + matches!( + self, + Self::PointerPressed { + button: button::Source::Mouse(mouse::Button::Right) + | button::Source::TabletTool { + button: tablet::Button::Barrel, + .. + }, + .. + } + ) + } + + /// Returns whether the event is a mouse right release or tablet barrel lift. + pub fn is_secondary_release(&self) -> bool { + matches!( + self, + Self::PointerReleased { + button: button::Source::Mouse(mouse::Button::Right) + | button::Source::TabletTool { + button: tablet::Button::Barrel, + .. + }, + .. + } + ) + } +} diff --git a/core/src/pointer/mouse.rs b/core/src/pointer/mouse.rs new file mode 100644 index 0000000000..1e059db15f --- /dev/null +++ b/core/src/pointer/mouse.rs @@ -0,0 +1,34 @@ +//! Handle mouse input. + +pub mod click; + +mod button; +mod cursor; +mod interaction; + +pub use button::Button; +pub use click::Click; +pub use cursor::Cursor; +pub use interaction::Interaction; + +/// A scroll movement. +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum ScrollDelta { + /// A line-based scroll movement. + Lines { + /// The number of horizontal lines scrolled. + x: f32, + + /// The number of vertical lines scrolled. + y: f32, + }, + + /// A pixel-based scroll movement. + Pixels { + /// The number of horizontal pixels scrolled. + x: f32, + + /// The number of vertical pixels scrolled. + y: f32, + }, +} diff --git a/core/src/mouse/button.rs b/core/src/pointer/mouse/button.rs similarity index 100% rename from core/src/mouse/button.rs rename to core/src/pointer/mouse/button.rs diff --git a/core/src/mouse/click.rs b/core/src/pointer/mouse/click.rs similarity index 98% rename from core/src/mouse/click.rs rename to core/src/pointer/mouse/click.rs index 8a1c461c41..ed0437ad0e 100644 --- a/core/src/mouse/click.rs +++ b/core/src/pointer/mouse/click.rs @@ -1,10 +1,11 @@ //! Track mouse clicks. -use crate::mouse::Button; use crate::time::Instant; use crate::{Point, Transformation}; use std::ops::Mul; +use super::Button; + /// A mouse click. #[derive(Debug, Clone, Copy)] pub struct Click { diff --git a/core/src/mouse/cursor.rs b/core/src/pointer/mouse/cursor.rs similarity index 100% rename from core/src/mouse/cursor.rs rename to core/src/pointer/mouse/cursor.rs diff --git a/core/src/mouse/interaction.rs b/core/src/pointer/mouse/interaction.rs similarity index 100% rename from core/src/mouse/interaction.rs rename to core/src/pointer/mouse/interaction.rs diff --git a/core/src/pointer/tablet.rs b/core/src/pointer/tablet.rs new file mode 100644 index 0000000000..2b1e81c25c --- /dev/null +++ b/core/src/pointer/tablet.rs @@ -0,0 +1,107 @@ +//! Handle tablet tool input. + +use crate::pointer::mouse; +use crate::pointer::touch::Force; + +/// The kind of tool used with a tablet. +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] +pub enum Kind { + /// A pen. + #[default] + Pen, + + /// An eraser. + Eraser, + + /// A brush. + Brush, + + /// A pencil. + Pencil, + + /// An airbrush. + Airbrush, + + /// A finger-like tool. + Finger, + + /// A mouse-like tool. + Mouse, + + /// A lens cursor. + Lens, +} + +/// Data describing how a tablet tool is held and used. +#[derive(Debug, Default, Clone, PartialEq)] +pub struct Data { + /// The force applied to the tool against the surface. + pub force: Option, + + /// The normalized tangential, or barrel, pressure in the range `-1.0..=1.0`. + pub tangential_force: Option, + + /// The clockwise rotation of the tool in degrees, in the range `0..=359`. + pub twist: Option, + + /// The plane angle of the tool in degrees. + pub tilt: Option, + + /// The angular position of the tool in radians. + pub angle: Option, +} + +/// The plane angle of a tablet tool in degrees. +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct Tilt { + /// The angle between the surface Y-Z plane and the tool's surface Y plane. + pub x: i8, + + /// The angle between the surface X-Z plane and the tool's surface X plane. + pub y: i8, +} + +/// The angular position of a tablet tool in radians. +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Angle { + /// The angle between the tool and the surface X-Y plane. + pub altitude: f64, + + /// The clockwise rotation between the tool's major axis and the surface X-Y plane. + pub azimuth: f64, +} + +impl Default for Angle { + fn default() -> Self { + Self { + altitude: std::f64::consts::FRAC_2_PI, + azimuth: 0.0, + } + } +} + +/// A button of a tablet tool. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum Button { + /// Contact between the tool and tablet surface. + Contact, + + /// The tool's barrel button. + Barrel, + + /// Another tablet tool button. + Other(u16), +} + +impl From