From ce0f2984c6808295cd58f8a1b6974a7dbb4c8949 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 2 Oct 2023 16:00:34 -0600 Subject: [PATCH] Improve design --- Cargo.lock | 1026 +++++++++++++++++++++++++++++++++++---------------- Cargo.toml | 4 +- src/main.rs | 178 +++++---- 3 files changed, 821 insertions(+), 387 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7613057..c672ce2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,6 +15,17 @@ dependencies = [ "accesskit", ] +[[package]] +name = "accesskit_macos" +version = "0.7.0" +source = "git+https://github.com/wash2/accesskit.git?tag=v0.11.0#2dee3df0a525d727df9f54ae71cfe8b47d7c2751" +dependencies = [ + "accesskit", + "accesskit_consumer", + "objc2", + "once_cell", +] + [[package]] name = "accesskit_unix" version = "0.4.0" @@ -30,6 +41,31 @@ dependencies = [ "zbus", ] +[[package]] +name = "accesskit_windows" +version = "0.14.0" +source = "git+https://github.com/wash2/accesskit.git?tag=v0.11.0#2dee3df0a525d727df9f54ae71cfe8b47d7c2751" +dependencies = [ + "accesskit", + "accesskit_consumer", + "arrayvec 0.7.4", + "once_cell", + "paste", + "windows", +] + +[[package]] +name = "accesskit_winit" +version = "0.13.0" +source = "git+https://github.com/wash2/accesskit.git?tag=v0.11.0#2dee3df0a525d727df9f54ae71cfe8b47d7c2751" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "winit", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -124,6 +160,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.4" @@ -154,9 +196,6 @@ dependencies = [ "serde_repr", "tokio", "url", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-protocols 0.30.1", "zbus", ] @@ -220,7 +259,7 @@ dependencies = [ "futures-lite", "log", "parking", - "polling 2.8.0", + "polling", "rustix 0.37.23", "slab", "socket2 0.4.9", @@ -422,6 +461,25 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-sys" +version = "0.1.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "block2" +version = "0.2.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +dependencies = [ + "block-sys", + "objc2-encode", +] + [[package]] name = "blocking" version = "1.4.0" @@ -478,28 +536,16 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" -version = "0.12.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadd183e815348c0649051b1c43418643208f8ed13c8a84da7215b4e1cf42714" +checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" dependencies = [ - "bitflags 2.4.0", + "bitflags 1.3.2", "log", - "polling 3.2.0", - "rustix 0.38.14", - "slab", + "nix 0.25.1", + "slotmap", "thiserror", -] - -[[package]] -name = "calloop-wayland-source" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" -dependencies = [ - "calloop", - "rustix 0.38.14", - "wayland-backend 0.3.2", - "wayland-client 0.31.1", + "vec_map", ] [[package]] @@ -523,6 +569,56 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "clipboard-win" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +dependencies = [ + "error-code", + "str-buf", + "winapi", +] + +[[package]] +name = "clipboard_macos" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145a7f9e9b89453bc0a5e32d166456405d389cea5b578f57f1274b1397588a95" +dependencies = [ + "objc", + "objc-foundation", + "objc_id", +] + +[[package]] +name = "clipboard_wayland" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f6364a9f7a66f2ac1a1a098aa1c7f6b686f2496c6ac5e5c0d773445df912747" +dependencies = [ + "smithay-clipboard", +] + +[[package]] +name = "clipboard_x11" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "983a7010836ecd04dde2c6d27a0cb56ec5d21572177e782bdcb24a600124e921" +dependencies = [ + "thiserror", + "x11rb 0.9.0", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "cocoa" version = "0.24.1" @@ -534,7 +630,7 @@ dependencies = [ "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] @@ -609,7 +705,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -624,6 +720,18 @@ dependencies = [ "libc", ] +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", + "libc", +] + [[package]] name = "cosmic-config" version = "0.1.0" @@ -655,8 +763,8 @@ dependencies = [ "greetd_ipc", "libcosmic", "log", + "pwd", "tokio", - "uzers", ] [[package]] @@ -754,6 +862,29 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossfont" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21fd3add36ea31aba1520aa5288714dd63be506106753226d0eb387a93bc9c45" +dependencies = [ + "cocoa", + "core-foundation", + "core-foundation-sys", + "core-graphics", + "core-text", + "dwrote", + "foreign-types 0.5.0", + "freetype-rs", + "libc", + "log", + "objc", + "once_cell", + "pkg-config", + "servo-fontconfig", + "winapi", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -781,10 +912,10 @@ dependencies = [ ] [[package]] -name = "cursor-icon" -version = "1.0.0" +name = "cty" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740bb192a8e2d1350119916954f4409ee7f62f149b536911eeb78ba5a20526bf" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "d3d12" @@ -797,14 +928,38 @@ dependencies = [ "winapi", ] +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] @@ -821,13 +976,24 @@ dependencies = [ "syn 2.0.37", ] +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core", + "darling_core 0.20.3", "quote", "syn 2.0.37", ] @@ -855,7 +1021,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro2", "quote", "syn 2.0.37", @@ -912,6 +1078,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + [[package]] name = "dlib" version = "0.5.2" @@ -933,23 +1105,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dwrote" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "serde", + "serde_derive", + "winapi", + "wio", +] + [[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "enum-repr" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad30c9c0fa1aaf1ae5010dab11f1117b15d35faf62cda4bbbc53b9987950f18" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enumflags2" version = "0.7.8" @@ -1011,6 +1186,16 @@ dependencies = [ "libc", ] +[[package]] +name = "error-code" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" +dependencies = [ + "libc", + "str-buf", +] + [[package]] name = "etagere" version = "0.2.8" @@ -1047,6 +1232,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "expat-sys" +version = "2.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" +dependencies = [ + "cmake", + "pkg-config", +] + [[package]] name = "exr" version = "1.6.4" @@ -1120,9 +1315,6 @@ name = "float-cmp" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] [[package]] name = "flume" @@ -1172,7 +1364,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "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 2.0.37", ] [[package]] @@ -1181,6 +1394,12 @@ 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" @@ -1213,6 +1432,28 @@ dependencies = [ "xdg", ] +[[package]] +name = "freetype-rs" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" +dependencies = [ + "bitflags 1.3.2", + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -1562,8 +1803,8 @@ dependencies = [ "iced_core", "iced_futures", "iced_renderer", - "iced_sctk", "iced_widget", + "iced_winit", "image", "thiserror", ] @@ -1574,7 +1815,7 @@ version = "0.1.0" source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" dependencies = [ "accesskit", - "accesskit_unix", + "accesskit_winit", ] [[package]] @@ -1583,11 +1824,9 @@ version = "0.10.0" source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" dependencies = [ "bitflags 1.3.2", - "iced_accessibility", "instant", "log", "palette", - "smithay-client-toolkit 0.17.0", "thiserror", "twox-hash", ] @@ -1618,7 +1857,7 @@ dependencies = [ "image", "kamadak-exif", "log", - "raw-window-handle", + "raw-window-handle 0.5.2", "thiserror", ] @@ -1631,7 +1870,7 @@ dependencies = [ "iced_tiny_skia", "iced_wgpu", "log", - "raw-window-handle", + "raw-window-handle 0.5.2", "thiserror", ] @@ -1640,37 +1879,11 @@ name = "iced_runtime" version = "0.1.1" source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" dependencies = [ - "iced_accessibility", "iced_core", "iced_futures", - "smithay-client-toolkit 0.17.0", "thiserror", ] -[[package]] -name = "iced_sctk" -version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" -dependencies = [ - "enum-repr", - "float-cmp", - "futures", - "iced_futures", - "iced_graphics", - "iced_runtime", - "iced_style", - "itertools", - "lazy_static", - "raw-window-handle", - "smithay-client-toolkit 0.17.0", - "smithay-clipboard", - "thiserror", - "tracing", - "wayland-backend 0.3.2", - "wayland-protocols 0.31.0", - "xkeysym", -] - [[package]] name = "iced_style" version = "0.9.0" @@ -1691,11 +1904,11 @@ dependencies = [ "iced_graphics", "kurbo", "log", - "raw-window-handle", + "raw-window-handle 0.5.2", "resvg", "rustc-hash", "softbuffer", - "tiny-skia", + "tiny-skia 0.10.0", "twox-hash", ] @@ -1713,7 +1926,7 @@ dependencies = [ "iced_graphics", "log", "once_cell", - "raw-window-handle", + "raw-window-handle 0.5.2", "resvg", "rustc-hash", "twox-hash", @@ -1730,11 +1943,27 @@ dependencies = [ "iced_style", "num-traits", "ouroboros", - "smithay-client-toolkit 0.17.0", "thiserror", "unicode-segmentation", ] +[[package]] +name = "iced_winit" +version = "0.10.0" +source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" +dependencies = [ + "iced_graphics", + "iced_runtime", + "iced_style", + "log", + "raw-window-handle 0.5.2", + "thiserror", + "web-sys", + "winapi", + "window_clipboard", + "winit", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1823,6 +2052,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -1847,21 +2079,18 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -1926,7 +2155,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", ] [[package]] @@ -1964,14 +2193,13 @@ dependencies = [ "iced_futures", "iced_renderer", "iced_runtime", - "iced_sctk", "iced_style", "iced_tiny_skia", "iced_widget", + "iced_winit", "lazy_static", "palette", "slotmap", - "smithay-client-toolkit 0.17.0", "thiserror", "tokio", "tracing", @@ -2075,15 +2303,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memmap2" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" -dependencies = [ - "libc", -] - [[package]] name = "memoffset" version = "0.6.5" @@ -2120,7 +2339,7 @@ dependencies = [ "bitflags 1.3.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -2188,6 +2407,77 @@ dependencies = [ "getrandom", ] +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags 1.3.2", + "jni-sys", + "ndk-sys", + "num_enum", + "raw-window-handle 0.5.2", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" +dependencies = [ + "libc", + "log", + "ndk", + "ndk-context", + "ndk-macro", + "ndk-sys", + "once_cell", + "parking_lot 0.12.1", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling 0.13.4", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ndk-sys" +version = "0.4.1+23.1.7779620" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + [[package]] name = "nix" version = "0.24.3" @@ -2341,6 +2631,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "objc" version = "0.2.7" @@ -2351,6 +2662,43 @@ dependencies = [ "objc_exception", ] +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc-sys" +version = "0.2.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" + +[[package]] +name = "objc2" +version = "0.3.0-beta.3.patch-leaks.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +dependencies = [ + "block2", + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "2.0.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +dependencies = [ + "objc-sys", +] + [[package]] name = "objc_exception" version = "0.1.2" @@ -2360,6 +2708,15 @@ dependencies = [ "cc", ] +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + [[package]] name = "object" version = "0.32.1" @@ -2503,6 +2860,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -2635,20 +2998,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "polling" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62a79e457c9898100b4298d57d69ec53d06f9a6ed352431ce5f377e082d2e846" -dependencies = [ - "cfg-if", - "concurrent-queue", - "pin-project-lite", - "rustix 0.38.14", - "tracing", - "windows-sys 0.48.0", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2704,6 +3053,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b" +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror", +] + [[package]] name = "qoi" version = "0.4.1" @@ -2722,15 +3081,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "quick-xml" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" -dependencies = [ - "memchr", -] - [[package]] name = "quote" version = "1.0.33" @@ -2782,6 +3132,15 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "977b1e897f9d764566891689e642653e5ed90c6895106acd005eb4c1d0203991" +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + [[package]] name = "raw-window-handle" version = "0.5.2" @@ -2891,7 +3250,7 @@ dependencies = [ "png", "rgb", "svgtypes", - "tiny-skia", + "tiny-skia 0.10.0", "usvg", ] @@ -3013,6 +3372,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "safe_arch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -3034,6 +3402,18 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sctk-adwaita" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61270629cc6b4d77ec1907db1033d5c2e1a404c412743621981a871dc9c12339" +dependencies = [ + "crossfont", + "log", + "smithay-client-toolkit", + "tiny-skia 0.7.0", +] + [[package]] name = "serde" version = "1.0.188" @@ -3076,6 +3456,27 @@ dependencies = [ "syn 2.0.37", ] +[[package]] +name = "servo-fontconfig" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" +dependencies = [ + "libc", + "servo-fontconfig-sys", +] + +[[package]] +name = "servo-fontconfig-sys" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" +dependencies = [ + "expat-sys", + "freetype-sys", + "pkg-config", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3148,6 +3549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" dependencies = [ "bitflags 1.3.2", + "calloop", "dlib", "lazy_static", "log", @@ -3155,35 +3557,8 @@ dependencies = [ "nix 0.24.3", "pkg-config", "wayland-client 0.29.5", - "wayland-cursor 0.29.5", - "wayland-protocols 0.29.5", -] - -[[package]] -name = "smithay-client-toolkit" -version = "0.17.0" -source = "git+https://github.com/smithay/client-toolkit?rev=dc8c4a0#dc8c4a035128208af65141fe12142a1dbc4a32bb" -dependencies = [ - "bitflags 2.4.0", - "bytemuck", - "calloop", - "calloop-wayland-source", - "cursor-icon", - "dlib", - "log", - "memmap2 0.7.1", - "nix 0.26.4", - "pkg-config", - "thiserror", - "wayland-backend 0.3.2", - "wayland-client 0.31.1", - "wayland-csd-frame", - "wayland-cursor 0.31.0", - "wayland-protocols 0.31.0", - "wayland-protocols-wlr", - "wayland-scanner 0.31.0", - "xkbcommon", - "xkeysym", + "wayland-cursor", + "wayland-protocols", ] [[package]] @@ -3192,7 +3567,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" dependencies = [ - "smithay-client-toolkit 0.16.1", + "smithay-client-toolkit", "wayland-client 0.29.5", ] @@ -3226,21 +3601,21 @@ dependencies = [ "cocoa", "core-graphics", "fastrand 1.9.0", - "foreign-types", + "foreign-types 0.3.2", "log", "nix 0.26.4", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "redox_syscall 0.3.5", "thiserror", "wasm-bindgen", - "wayland-backend 0.1.2", + "wayland-backend", "wayland-client 0.30.2", "wayland-sys 0.30.1", "web-sys", "windows-sys 0.42.0", "x11-dl", - "x11rb", + "x11rb 0.11.1", ] [[package]] @@ -3268,6 +3643,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "str-buf" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" + [[package]] name = "strict-num" version = "0.1.1" @@ -3393,6 +3774,21 @@ dependencies = [ "weezl", ] +[[package]] +name = "tiny-skia" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "bytemuck", + "cfg-if", + "png", + "safe_arch", + "tiny-skia-path 0.7.0", +] + [[package]] name = "tiny-skia" version = "0.10.0" @@ -3400,12 +3796,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.7.4", "bytemuck", "cfg-if", "log", "png", - "tiny-skia-path", + "tiny-skia-path 0.10.0", +] + +[[package]] +name = "tiny-skia-path" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" +dependencies = [ + "arrayref", + "bytemuck", ] [[package]] @@ -3698,18 +4104,14 @@ dependencies = [ "rctree", "strict-num", "svgtypes", - "tiny-skia-path", + "tiny-skia-path 0.10.0", ] [[package]] -name = "uzers" -version = "0.11.3" +name = "vec_map" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d283dc7e8c901e79e32d077866eaf599156cbf427fffa8289aecc52c5c3f63" -dependencies = [ - "libc", - "log", -] +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" @@ -3835,20 +4237,6 @@ dependencies = [ "wayland-sys 0.30.1", ] -[[package]] -name = "wayland-backend" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" -dependencies = [ - "cc", - "downcast-rs", - "nix 0.26.4", - "scoped-tls", - "smallvec", - "wayland-sys 0.31.1", -] - [[package]] name = "wayland-client" version = "0.29.5" @@ -3873,22 +4261,10 @@ checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" dependencies = [ "bitflags 1.3.2", "nix 0.26.4", - "wayland-backend 0.1.2", + "wayland-backend", "wayland-scanner 0.30.1", ] -[[package]] -name = "wayland-client" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" -dependencies = [ - "bitflags 2.4.0", - "nix 0.26.4", - "wayland-backend 0.3.2", - "wayland-scanner 0.31.0", -] - [[package]] name = "wayland-commons" version = "0.29.5" @@ -3901,17 +4277,6 @@ dependencies = [ "wayland-sys 0.29.5", ] -[[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.0", - "cursor-icon", - "wayland-backend 0.3.2", -] - [[package]] name = "wayland-cursor" version = "0.29.5" @@ -3923,17 +4288,6 @@ dependencies = [ "xcursor", ] -[[package]] -name = "wayland-cursor" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" -dependencies = [ - "nix 0.26.4", - "wayland-client 0.31.1", - "xcursor", -] - [[package]] name = "wayland-protocols" version = "0.29.5" @@ -3946,43 +4300,6 @@ dependencies = [ "wayland-scanner 0.29.5", ] -[[package]] -name = "wayland-protocols" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" -dependencies = [ - "bitflags 1.3.2", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-scanner 0.30.1", -] - -[[package]] -name = "wayland-protocols" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" -dependencies = [ - "bitflags 2.4.0", - "wayland-backend 0.3.2", - "wayland-client 0.31.1", - "wayland-scanner 0.31.0", -] - -[[package]] -name = "wayland-protocols-wlr" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" -dependencies = [ - "bitflags 2.4.0", - "wayland-backend 0.3.2", - "wayland-client 0.31.1", - "wayland-protocols 0.31.0", - "wayland-scanner 0.31.0", -] - [[package]] name = "wayland-scanner" version = "0.29.5" @@ -4001,18 +4318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" dependencies = [ "proc-macro2", - "quick-xml 0.28.2", - "quote", -] - -[[package]] -name = "wayland-scanner" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" -dependencies = [ - "proc-macro2", - "quick-xml 0.30.0", + "quick-xml", "quote", ] @@ -4039,17 +4345,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "wayland-sys" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" -dependencies = [ - "dlib", - "log", - "pkg-config", -] - [[package]] name = "web-sys" version = "0.3.64" @@ -4072,14 +4367,14 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "cfg-if", "js-sys", "log", "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle", + "raw-window-handle 0.5.2", "smallvec", "static_assertions", "wasm-bindgen", @@ -4096,7 +4391,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "bit-vec", "bitflags 2.4.0", "codespan-reporting", @@ -4104,7 +4399,7 @@ dependencies = [ "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle", + "raw-window-handle 0.5.2", "rustc-hash", "smallvec", "thiserror", @@ -4120,14 +4415,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" dependencies = [ "android_system_properties", - "arrayvec", + "arrayvec 0.7.4", "ash", "bit-set", "bitflags 2.4.0", "block", "core-graphics-types", "d3d12", - "foreign-types", + "foreign-types 0.3.2", "glow", "gpu-alloc", "gpu-allocator", @@ -4144,7 +4439,7 @@ dependencies = [ "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.5.2", "renderdoc-sys", "rustc-hash", "smallvec", @@ -4212,15 +4507,66 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "window_clipboard" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63287c9c4396ccf5346d035a9b0fcaead9e18377637f5eaa78b7ac65c873ff7d" +dependencies = [ + "clipboard-win", + "clipboard_macos", + "clipboard_wayland", + "clipboard_x11", + "raw-window-handle 0.5.2", + "thiserror", +] + [[package]] name = "windows" version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" dependencies = [ + "windows-implement", + "windows-interface", "windows-targets 0.42.2", ] +[[package]] +name = "windows-implement" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "windows-interface" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4287,6 +4633,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -4299,6 +4651,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4311,6 +4669,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -4323,6 +4687,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -4347,6 +4717,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -4359,6 +4735,38 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "winit" +version = "0.27.2" +source = "git+https://github.com/pop-os/winit.git?branch=iced#d35712bba65eb1dad8f6f546af49b96fdad9467e" +dependencies = [ + "bitflags 1.3.2", + "cocoa", + "core-foundation", + "core-graphics", + "dispatch", + "instant", + "libc", + "log", + "mio", + "ndk", + "ndk-glue", + "objc", + "once_cell", + "parking_lot 0.12.1", + "percent-encoding", + "raw-window-handle 0.4.3", + "raw-window-handle 0.5.2", + "sctk-adwaita", + "smithay-client-toolkit", + "wasm-bindgen", + "wayland-client 0.29.5", + "wayland-protocols", + "web-sys", + "windows-sys 0.36.1", + "x11-dl", +] + [[package]] name = "winnow" version = "0.5.15" @@ -4368,6 +4776,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + [[package]] name = "x11-dl" version = "2.21.0" @@ -4379,6 +4796,18 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" +dependencies = [ + "gethostname", + "nix 0.22.3", + "winapi", + "winapi-wsapoll", +] + [[package]] name = "x11rb" version = "0.11.1" @@ -4429,25 +4858,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "xkbcommon" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52db25b599e92bf6e3904134618728eeb7b49a5a4f38f107f92399bb9c496b88" -dependencies = [ - "libc", - "memmap2 0.7.1", -] - -[[package]] -name = "xkeysym" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" -dependencies = [ - "bytemuck", -] - [[package]] name = "xml-rs" version = "0.8.19" diff --git a/Cargo.toml b/Cargo.toml index 26cc32a..c74da1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] env_logger = "0.10" log = "0.4" -uzers = "0.11" +pwd = "1" [dependencies.greetd_ipc] version = "0.9" @@ -15,7 +15,7 @@ features = ["sync-codec"] [dependencies.libcosmic] git = "https://github.com/pop-os/libcosmic" default-features = false -features = ["tokio", "wayland"] +features = ["tokio", "winit"] [dependencies.tokio] version = "1" diff --git a/src/main.rs b/src/main.rs index 8e14dcd..dc83c15 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,23 +6,22 @@ use cosmic::app::{message, Command, Core, Settings}; use cosmic::{executor, iced, widget, Element}; use greetd_ipc::{codec::SyncCodec, AuthMessageType, Request, Response}; -use std::{env, io, sync::Arc}; +use std::{env, fs, io, path::Path, sync::Arc}; use tokio::net::UnixStream; -use uzers::os::unix::UserExt; fn main() -> Result<(), Box> { env_logger::init(); - // This method is unsafe due to using global state (libc pwent functions). - let users: Vec = unsafe { - uzers::all_users() + // The pwd::Passwd method is unsafe (but not labelled as such) due to using global state (libc pwent functions). + let users: Vec<_> = /* unsafe */ { + pwd::Passwd::iter() .filter(|user| { - if user.uid() < 1000 { + if user.uid < 1000 { // Skip system accounts return false; } - match user.shell().file_name().and_then(|x| x.to_str()) { + match Path::new(&user.shell).file_name().and_then(|x| x.to_str()) { // Skip shell ending in false Some("false") => false, // Skip shell ending in nologin @@ -30,6 +29,21 @@ fn main() -> Result<(), Box> { _ => true, } }) + .map(|user| { + let icon_path = Path::new("/var/lib/AccountsService/icons").join(&user.name); + let icon_opt = if icon_path.is_file() { + match fs::read(&icon_path) { + Ok(icon_data) => Some(widget::image::Handle::from_memory(icon_data)), + Err(err) => { + log::error!("failed to read {:?}: {:?}", icon_path, err); + None + } + } + } else { + None + }; + (user, icon_opt) + }) .collect() }; @@ -62,7 +76,7 @@ pub enum SocketState { #[derive(Clone, Debug)] pub enum InputState { None, - Username(String), + Username, Auth(bool, String, String), } @@ -72,7 +86,8 @@ pub enum Message { None, Socket(SocketState), Input(InputState), - Submit, + Username(String), + Auth(String), Login, } @@ -144,7 +159,7 @@ async fn request(socket: Arc, request: Request) -> Message { /// The [`App`] stores application-specific state. pub struct App { core: Core, - users: Vec, + users: Vec<(pwd::Passwd, Option)>, socket_state: SocketState, input_state: InputState, } @@ -155,7 +170,7 @@ impl cosmic::Application for App { type Executor = executor::Default; /// Argument received [`cosmic::Application::new`]. - type Flags = Vec; + type Flags = Vec<(pwd::Passwd, Option)>; /// Message type specific to our [`App`]. type Message = Message; @@ -186,7 +201,7 @@ impl cosmic::Application for App { users, socket_state: SocketState::Pending, //TODO: set to pending until socket is open? - input_state: InputState::Username(String::new()), + input_state: InputState::Username, }, Command::perform( async { @@ -213,41 +228,39 @@ impl cosmic::Application for App { Message::Input(input_state) => { self.input_state = input_state; } - Message::Submit => match &self.socket_state { - SocketState::Open(socket) => match &self.input_state { - InputState::None => {} - InputState::Username(username) => { - let socket = socket.clone(); - let username = username.clone(); - return Command::perform( - async move { - message::app( - request(socket, Request::CreateSession { username }).await, + Message::Username(username) => match &self.socket_state { + SocketState::Open(socket) => { + let socket = socket.clone(); + let username = username.clone(); + return Command::perform( + async move { + message::app(request(socket, Request::CreateSession { username }).await) + }, + |x| x, + ); + } + _ => todo!("socket not open but username provided"), + }, + Message::Auth(value) => match &self.socket_state { + SocketState::Open(socket) => { + let socket = socket.clone(); + let value = value.clone(); + return Command::perform( + async move { + message::app( + request( + socket, + Request::PostAuthMessageResponse { + response: Some(value), + }, ) - }, - |x| x, - ); - } - InputState::Auth(_secret, _prompt, value) => { - let socket = socket.clone(); - let value = value.clone(); - return Command::perform( - async move { - message::app( - request( - socket, - Request::PostAuthMessageResponse { - response: Some(value), - }, - ) - .await, - ) - }, - |x| x, - ); - } - }, - _ => todo!("socket not open but input provided"), + .await, + ) + }, + |x| x, + ); + } + _ => todo!("socket not open but authentication provided"), }, Message::Login => match &self.socket_state { SocketState::Open(socket) => { @@ -277,59 +290,70 @@ impl cosmic::Application for App { /// Creates a view after each update. fn view(&self) -> Element { - let mut column = widget::column::with_capacity(2); - - match &self.socket_state { - SocketState::Pending => { - column = column.push(widget::text("Opening GREETD_SOCK")); - } + let content: Element<_> = match &self.socket_state { + SocketState::Pending => widget::text("Opening GREETD_SOCK").into(), SocketState::Open(_) => match &self.input_state { - InputState::None => {} - InputState::Username(username) => { - column = column.push(widget::text("Username:")); - column = column.push( - widget::text_input("Username", &username) - .on_input(|username| Message::Input(InputState::Username(username))) - .on_submit(Message::Submit), - ); - - for user in &self.users { - match user.name().to_str() { - Some(user_name) => { - column = column.push(widget::button(user_name).on_press( - Message::Input(InputState::Username(user_name.to_string())), - )); + InputState::None => { + //TODO + widget::text("").into() + } + InputState::Username => { + let mut row = widget::row::with_capacity(self.users.len()).spacing(12.0); + for (user, icon_opt) in &self.users { + let mut column = widget::column::with_capacity(2).spacing(12.0); + match icon_opt { + Some(icon) => { + column = column.push( + widget::Image::new(icon.clone()) + .width(iced::Length::Fixed(256.0)) + .height(iced::Length::Fixed(256.0)), + ) } None => {} } + match &user.gecos { + Some(gecos) => { + column = column.push(widget::text(gecos)); + } + None => {} + } + row = row.push( + widget::MouseArea::new( + widget::cosmic_container::container(column) + .layer(cosmic::cosmic_theme::Layer::Primary) + .padding(16) + .style(cosmic::theme::Container::Primary), + ) + .on_press(Message::Username(user.name.clone())), + ); } + row.into() } InputState::Auth(secret, prompt, value) => { + let mut column = widget::column::with_capacity(2) + .spacing(12.0) + .width(iced::Length::Fixed(400.0)); column = column.push(widget::text(prompt)); let text_input = widget::text_input("", &value) .on_input(|value| { Message::Input(InputState::Auth(*secret, prompt.clone(), value)) }) - .on_submit(Message::Submit); + .on_submit(Message::Auth(value.clone())); if *secret { column = column.push(text_input.password()); } else { column = column.push(text_input); } + column.into() } }, - SocketState::NotSet => { - column = column.push(widget::text("GREETD_SOCK variable not set")); - } + SocketState::NotSet => widget::text("GREETD_SOCK variable not set").into(), SocketState::Error(err) => { - column = column.push(widget::text(format!( - "Failed to open GREETD_SOCK: {:?}", - err - ))) + widget::text(format!("Failed to open GREETD_SOCK: {:?}", err)).into() } - } + }; - let centered = widget::container(column.spacing(12.0).width(iced::Length::Fixed(400.0))) + let centered = widget::container(content) .width(iced::Length::Fill) .height(iced::Length::Fill) .align_x(iced::alignment::Horizontal::Center)