diff --git a/Cargo.lock b/Cargo.lock index a418ebb..5a18e9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,70 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +[[package]] +name = "accesskit" +version = "0.11.0" +source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0" + +[[package]] +name = "accesskit_consumer" +version = "0.15.0" +source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0" +dependencies = [ + "accesskit", +] + +[[package]] +name = "accesskit_macos" +version = "0.7.0" +source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0" +dependencies = [ + "accesskit", + "accesskit_consumer", + "objc2", + "once_cell", +] + +[[package]] +name = "accesskit_unix" +version = "0.4.0" +source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0" +dependencies = [ + "accesskit", + "accesskit_consumer", + "async-channel 1.9.0", + "atspi", + "futures-lite 1.13.0", + "log", + "serde", + "zbus", +] + +[[package]] +name = "accesskit_windows" +version = "0.14.0" +source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0" +dependencies = [ + "accesskit", + "accesskit_consumer", + "arrayvec", + "once_cell", + "paste", + "windows 0.44.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.13.0" +source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "winit 0.28.6", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -33,6 +97,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "ahash" version = "0.8.6" @@ -85,9 +160,9 @@ checksum = "35001a8c1caf0abe4a597de2f15464805b0b2094424bc22a8ba34ed891bffea5" dependencies = [ "alacritty_config", "alacritty_config_derive", - "base64", + "base64 0.13.1", "bitflags 1.3.2", - "dirs", + "dirs 4.0.0", "libc", "log", "mio 0.6.23", @@ -106,12 +181,24 @@ dependencies = [ "windows-sys 0.36.1", ] +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + [[package]] name = "allocator-api2" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +[[package]] +name = "almost" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14" + [[package]] name = "android-activity" version = "0.4.3" @@ -145,6 +232,21 @@ dependencies = [ "libc", ] +[[package]] +name = "apply" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47b57fc4521e3cae26a4d45b5227f8fadee4c345be0fefd8d5d1711afb8aeb9" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "arrayref" version = "0.3.7" @@ -157,6 +259,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ash" version = "0.37.3+1.3.251" @@ -166,6 +274,249 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "ashpd" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c018490e423efb6f032ef575f873ea57b61d44bec763cfe027b8e8852a027cf" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "once_cell", + "rand", + "serde", + "serde_repr", + "tokio", + "url", + "zbus", +] + +[[package]] +name = "async-broadcast" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +dependencies = [ + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.1", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.2.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.1.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +dependencies = [ + "async-lock 3.2.0", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-io", + "futures-lite 2.1.0", + "parking", + "polling 3.3.1", + "rustix 0.38.28", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +dependencies = [ + "event-listener 4.0.1", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if 1.0.0", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.28", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.2.2", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if 1.0.0", + "futures-core", + "futures-io", + "rustix 0.38.28", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-task" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" + +[[package]] +name = "async-trait" +version = "0.1.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atomicwrites" +version = "0.4.2" +source = "git+https://github.com/jackpot51/rust-atomicwrites#043ab4859d53ffd3d55334685303d8df39c9f768" +dependencies = [ + "rustix 0.38.28", + "tempfile", + "windows-sys 0.48.0", +] + +[[package]] +name = "atspi" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "674e7a3376837b2e7d12d34d58ac47073c491dc3bf6f71a7adaf687d4d817faa" +dependencies = [ + "async-recursion", + "async-trait", + "atspi-macros", + "enumflags2", + "futures-lite 1.13.0", + "serde", + "tracing", + "zbus", + "zbus_names", +] + +[[package]] +name = "atspi-macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb4870a32c0eaa17e35bca0e6b16020635157121fb7d45593d242c295bc768" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -193,6 +544,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + [[package]] name = "bit-set" version = "0.5.3" @@ -208,6 +565,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + [[package]] name = "bitflags" version = "1.3.2" @@ -219,6 +582,9 @@ name = "bitflags" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] [[package]] name = "block" @@ -226,6 +592,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-sys" version = "0.1.0-beta.1" @@ -245,6 +620,22 @@ dependencies = [ "objc2-encode", ] +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.1.1", + "async-lock 3.2.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.1.0", + "piper", + "tracing", +] + [[package]] name = "bumpalo" version = "3.14.0" @@ -256,6 +647,32 @@ name = "bytemuck" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" @@ -300,17 +717,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] -name = "cocoa" -version = "0.24.1" +name = "clipboard-win" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +dependencies = [ + "error-code", + "str-buf", + "winapi 0.3.9", +] + +[[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 = "cocoa" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", - "core-graphics", - "foreign-types 0.3.2", + "core-graphics 0.23.1", + "foreign-types 0.5.0", "libc", "objc", ] @@ -339,12 +797,27 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "com-rs" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -374,6 +847,19 @@ dependencies = [ "libc", ] +[[package]] +name = "core-graphics" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types 0.5.0", + "libc", +] + [[package]] name = "core-graphics-types" version = "0.1.3" @@ -385,21 +871,39 @@ dependencies = [ "libc", ] +[[package]] +name = "cosmic-config" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "atomicwrites", + "cosmic-config-derive", + "dirs 5.0.1", + "iced_futures", + "notify", + "ron", + "serde", +] + +[[package]] +name = "cosmic-config-derive" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "cosmic-term" version = "0.1.0" dependencies = [ "alacritty_terminal", - "bytemuck", "cosmic-text", "env_logger", - "glyphon", + "libcosmic", "log", - "pollster", - "softbuffer", - "tiny-skia 0.11.3", - "wgpu", - "winit 0.28.6", + "tokio", ] [[package]] @@ -422,6 +926,29 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cosmic-theme" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "almost", + "cosmic-config", + "csscolorparser", + "lazy_static", + "palette", + "ron", + "serde", +] + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -431,6 +958,90 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset 0.9.0", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "css-color" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d101c65424c856131a3cb818da2ddde03500dc3656972269cdf79f018ef77eb4" + +[[package]] +name = "csscolorparser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" +dependencies = [ + "phf", + "serde", +] + +[[package]] +name = "ctor" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +dependencies = [ + "quote", + "syn 2.0.41", +] + [[package]] name = "d3d12" version = "0.7.0" @@ -442,13 +1053,96 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.41", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "data-url" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_setters" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "dirs" version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -462,6 +1156,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -477,12 +1183,80 @@ dependencies = [ "libloading 0.8.1", ] +[[package]] +name = "dlv-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" + [[package]] name = "downcast-rs" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "drm" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb1b703ffbc7ebd216eba7900008049a56ace55580ecb2ee7fa801e8d8be87" +dependencies = [ + "bitflags 2.4.1", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "nix 0.27.1", +] + +[[package]] +name = "drm-ffi" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba7d1c19c4b6270e89d59fb27dc6d02a317c658a8a54e54781e1db9b5947595d" +dependencies = [ + "drm-sys", + "nix 0.27.1", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f1c0468062a56cd5705f1e3b5409eb286d5596a2028ec8e947595d7e715ae" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "enumflags2" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + [[package]] name = "env_logger" version = "0.10.1" @@ -512,6 +1286,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[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.10" @@ -531,6 +1315,66 @@ dependencies = [ "num-traits", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.1", + "pin-project-lite", +] + +[[package]] +name = "exr" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279d3efcc55e19917fff7ab3ddd6c14afb6a90881a0078465196fe2f99d08c56" +dependencies = [ + "bit_field", + "flume 0.10.14", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + [[package]] name = "fastrand" version = "1.9.0" @@ -540,6 +1384,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "fdeflate" version = "0.3.1" @@ -549,6 +1399,18 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", +] + [[package]] name = "flate2" version = "1.0.28" @@ -559,6 +1421,31 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + +[[package]] +name = "float_next_after" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" + +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin", +] + [[package]] name = "flume" version = "0.11.0" @@ -571,13 +1458,19 @@ dependencies = [ "spin", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "fontconfig-parser" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "674e258f4b5d2dcd63888c01c68413c51f565e8af99d2f7701c7b81d79ef41c4" dependencies = [ - "roxmltree", + "roxmltree 0.18.1", ] [[package]] @@ -636,6 +1529,47 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fraction" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a78dd758a47a7305478e0e054f9fde4e983b9f9eccda162bf7ca03b79e9d40" +dependencies = [ + "lazy_static", + "num", +] + +[[package]] +name = "freedesktop-icons" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9d46a9ae065c46efb83854bb10315de6d333bb6f4526ebe320c004dab7857e" +dependencies = [ + "dirs 4.0.0", + "once_cell", + "rust-ini", + "thiserror", + "xdg", +] + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -652,18 +1586,134 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "futures" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", + "futures-sink", +] + [[package]] name = "futures-core" version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + [[package]] name = "futures-sink" version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "gethostname" version = "0.2.3" @@ -674,6 +1724,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "gethostname" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "getrandom" version = "0.2.11" @@ -687,6 +1747,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.28.1" @@ -704,6 +1774,12 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "glam" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" + [[package]] name = "glow" version = "0.13.0" @@ -766,7 +1842,7 @@ dependencies = [ "presser", "thiserror", "winapi 0.3.9", - "windows", + "windows 0.51.1", ] [[package]] @@ -789,11 +1865,40 @@ dependencies = [ "bitflags 2.4.1", ] +[[package]] +name = "grid" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df00eed8d1f0db937f6be10e46e8072b0671accb504cf0f959c5c52c679f5b9" + +[[package]] +name = "guillotiere" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" +dependencies = [ + "euclid", + "svg_fmt", +] + +[[package]] +name = "half" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if 1.0.0", + "crunchy", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.7", +] [[package]] name = "hashbrown" @@ -801,7 +1906,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash", + "ahash 0.8.6", "allocator-api2", ] @@ -820,12 +1925,24 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hexf-parse" version = "0.2.1" @@ -838,6 +1955,225 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "iced" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "iced_accessibility", + "iced_core", + "iced_futures", + "iced_renderer", + "iced_widget", + "iced_winit", + "image", + "thiserror", +] + +[[package]] +name = "iced_accessibility" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "accesskit", + "accesskit_winit", +] + +[[package]] +name = "iced_core" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "bitflags 1.3.2", + "instant", + "log", + "num-traits", + "palette", + "raw-window-handle", + "serde", + "thiserror", + "xxhash-rust", +] + +[[package]] +name = "iced_futures" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "futures", + "iced_core", + "log", + "tokio", + "wasm-bindgen-futures", + "wasm-timer", +] + +[[package]] +name = "iced_graphics" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cosmic-text", + "glam", + "half", + "iced_core", + "image", + "kamadak-exif", + "log", + "lyon_path", + "once_cell", + "raw-window-handle", + "rustc-hash", + "thiserror", + "unicode-segmentation", + "xxhash-rust", +] + +[[package]] +name = "iced_renderer" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "iced_graphics", + "iced_tiny_skia", + "iced_wgpu", + "log", + "raw-window-handle", + "thiserror", +] + +[[package]] +name = "iced_runtime" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "iced_core", + "iced_futures", + "thiserror", +] + +[[package]] +name = "iced_style" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "iced_core", + "once_cell", + "palette", +] + +[[package]] +name = "iced_tiny_skia" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "bytemuck", + "cosmic-text", + "iced_graphics", + "kurbo", + "log", + "raw-window-handle", + "resvg", + "rustc-hash", + "softbuffer", + "tiny-skia 0.11.3", + "xxhash-rust", +] + +[[package]] +name = "iced_wgpu" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "futures", + "glam", + "glyphon", + "guillotiere", + "iced_graphics", + "log", + "lyon", + "once_cell", + "raw-window-handle", + "resvg", + "wgpu", +] + +[[package]] +name = "iced_widget" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "iced_renderer", + "iced_runtime", + "iced_style", + "num-traits", + "ouroboros", + "thiserror", + "unicode-segmentation", +] + +[[package]] +name = "iced_winit" +version = "0.12.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "iced_graphics", + "iced_runtime", + "iced_style", + "log", + "thiserror", + "tracing", + "web-sys", + "winapi 0.3.9", + "window_clipboard", + "winit 0.28.6", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-rational", + "num-traits", + "png", + "qoi", + "tiff", +] + +[[package]] +name = "imagesize" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" + [[package]] name = "indexmap" version = "1.9.3" @@ -858,6 +2194,26 @@ dependencies = [ "hashbrown 0.14.3", ] +[[package]] +name = "inotify" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +dependencies = [ + "bitflags 1.3.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + [[package]] name = "instant" version = "0.1.12" @@ -897,7 +2253,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix", + "rustix 0.38.28", "windows-sys 0.48.0", ] @@ -916,6 +2272,15 @@ dependencies = [ "libc", ] +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +dependencies = [ + "rayon", +] + [[package]] name = "js-sys" version = "0.3.66" @@ -925,6 +2290,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kamadak-exif" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" +dependencies = [ + "mutate_once", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -952,6 +2326,35 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +[[package]] +name = "kqueue" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + +[[package]] +name = "kurbo" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +dependencies = [ + "arrayvec", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -964,12 +2367,53 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + [[package]] name = "libc" version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +[[package]] +name = "libcosmic" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic.git#18a5c670656f53aed4b9318b633f925403ba2e02" +dependencies = [ + "apply", + "ashpd", + "cosmic-config", + "cosmic-theme", + "css-color", + "derive_setters", + "fraction", + "freedesktop-icons", + "iced", + "iced_core", + "iced_futures", + "iced_renderer", + "iced_runtime", + "iced_style", + "iced_tiny_skia", + "iced_wgpu", + "iced_widget", + "iced_winit", + "lazy_static", + "palette", + "slotmap", + "taffy", + "thiserror", + "tokio", + "tracing", + "unicode-segmentation", + "url", + "zbus", +] + [[package]] name = "libloading" version = "0.7.4" @@ -1024,6 +2468,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -1058,6 +2508,58 @@ dependencies = [ "hashbrown 0.14.3", ] +[[package]] +name = "lyon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e7f9cda98b5430809e63ca5197b06c7d191bf7e26dfc467d5a3f0290e2a74f" +dependencies = [ + "lyon_algorithms", + "lyon_tessellation", +] + +[[package]] +name = "lyon_algorithms" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3bca95f9a4955b3e4a821fbbcd5edfbd9be2a9a50bb5758173e5358bfb4c623" +dependencies = [ + "lyon_path", + "num-traits", +] + +[[package]] +name = "lyon_geom" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74df1ff0a0147282eb10699537a03baa7d31972b58984a1d44ce0624043fe8ad" +dependencies = [ + "arrayvec", + "euclid", + "num-traits", +] + +[[package]] +name = "lyon_path" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca507745ba7ccbc76e5c44e7b63b1a29d2b0d6126f375806a5bbaf657c7d6c45" +dependencies = [ + "lyon_geom", + "num-traits", +] + +[[package]] +name = "lyon_tessellation" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c67b5bc8123b352b2e7e742b47d1f236a13fe77619433be9568fbd888e9c0" +dependencies = [ + "float_next_after", + "lyon_path", + "num-traits", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -1109,6 +2611,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" version = "0.27.0" @@ -1222,6 +2733,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "mutate_once" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" + [[package]] name = "naga" version = "0.14.2" @@ -1291,6 +2808,19 @@ dependencies = [ "winapi 0.3.9", ] +[[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 1.0.0", + "libc", + "memoffset 0.6.5", +] + [[package]] name = "nix" version = "0.24.3" @@ -1326,7 +2856,103 @@ dependencies = [ "cfg-if 1.0.0", "libc", "memoffset 0.7.1", - "pin-utils", +] + +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.1", + "cfg-if 1.0.0", + "libc", +] + +[[package]] +name = "notify" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +dependencies = [ + "bitflags 2.4.1", + "crossbeam-channel", + "filetime", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio 0.8.10", + "walkdir", + "windows-sys 0.48.0", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", ] [[package]] @@ -1336,6 +2962,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", ] [[package]] @@ -1390,6 +3027,17 @@ 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" @@ -1425,6 +3073,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" @@ -1440,6 +3097,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "orbclient" version = "0.3.47" @@ -1449,6 +3112,50 @@ dependencies = [ "libredox 0.0.2", ] +[[package]] +name = "ordered-multimap" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +dependencies = [ + "dlv-list", + "hashbrown 0.12.3", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "ouroboros" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" +dependencies = [ + "aliasable", + "ouroboros_macro", + "static_assertions", +] + +[[package]] +name = "ouroboros_macro" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.41", +] + [[package]] name = "owned_ttf_parser" version = "0.20.0" @@ -1458,6 +3165,36 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "palette" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e2f34147767aa758aa649415b50a69eeb46a67f9dc7db8011eeb3d84b351dc" +dependencies = [ + "approx", + "fast-srgb8", + "palette_derive", + "phf", + "serde", +] + +[[package]] +name = "palette_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7db010ec5ff3d4385e4f133916faacd9dad0f6a09394c92d825b3aed310fa0a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.11.2" @@ -1518,12 +3255,97 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.27" @@ -1544,10 +3366,40 @@ dependencies = [ ] [[package]] -name = "pollster" -version = "0.3.0" +name = "polling" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +dependencies = [ + "cfg-if 1.0.0", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.28", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "presser" @@ -1565,6 +3417,30 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.70" @@ -1581,10 +3457,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de09527cd2ea2c2d59fb6c2f8c1ab8c71709ed9d1b6d60b0e1c9fbb6fdcb33c" [[package]] -name = "quick-xml" -version = "0.28.2" +name = "qoi" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" dependencies = [ "memchr", ] @@ -1598,6 +3483,36 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + [[package]] name = "range-alloc" version = "0.1.3" @@ -1616,6 +3531,32 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rctree" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" + [[package]] name = "redox_syscall" version = "0.2.16" @@ -1704,6 +3645,44 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +[[package]] +name = "resvg" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadccb3d99a9efb8e5e00c16fbb732cbe400db2ec7fc004697ee7d97d86cf1f4" +dependencies = [ + "gif", + "jpeg-decoder", + "log", + "pico-args", + "png", + "rgb", + "svgtypes", + "tiny-skia 0.11.3", + "usvg", +] + +[[package]] +name = "rgb" +version = "0.8.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.5", + "bitflags 2.4.1", + "serde", + "serde_derive", +] + [[package]] name = "roxmltree" version = "0.18.1" @@ -1713,6 +3692,22 @@ dependencies = [ "xmlparser", ] +[[package]] +name = "roxmltree" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" + +[[package]] +name = "rust-ini" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1725,6 +3720,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustix" version = "0.38.28" @@ -1734,7 +3743,7 @@ dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.12", "windows-sys 0.52.0", ] @@ -1761,6 +3770,15 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -1781,7 +3799,7 @@ dependencies = [ "ab_glyph", "log", "memmap2 0.5.10", - "smithay-client-toolkit", + "smithay-client-toolkit 0.16.1 (git+https://github.com/pop-os/client-toolkit?branch=wayland-resize)", "tiny-skia 0.8.4", ] @@ -1811,6 +3829,17 @@ dependencies = [ "syn 2.0.41", ] +[[package]] +name = "serde_repr" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + [[package]] name = "serde_yaml" version = "0.8.26" @@ -1823,6 +3852,17 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + [[package]] name = "signal-hook" version = "0.3.17" @@ -1860,6 +3900,21 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simplecss" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a11be7c62927d9427e9f40f3444d5499d868648e2edbc4e2116de69e7ec0e89d" +dependencies = [ + "log", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -1884,6 +3939,24 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +[[package]] +name = "smithay-client-toolkit" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" +dependencies = [ + "bitflags 1.3.2", + "dlib", + "lazy_static", + "log", + "memmap2 0.5.10", + "nix 0.24.3", + "pkg-config", + "wayland-client 0.29.5", + "wayland-cursor", + "wayland-protocols", +] + [[package]] name = "smithay-client-toolkit" version = "0.16.1" @@ -1903,30 +3976,63 @@ dependencies = [ ] [[package]] -name = "softbuffer" -version = "0.2.0" -source = "git+https://github.com/pop-os/softbuffer.git?branch=cosmic#e11ceac52589f9cad0cac95f86382c1f5fa9f440" +name = "smithay-clipboard" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" dependencies = [ + "smithay-client-toolkit 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.29.5", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "softbuffer" +version = "0.3.3" +source = "git+https://github.com/pop-os/softbuffer?tag=v0.3-cosmic#6f0371ccece51d124c6c5d37082189df0dc5f9ba" +dependencies = [ + "as-raw-xcb-connection", "bytemuck", "cfg_aliases", "cocoa", - "core-graphics", - "fastrand", - "foreign-types 0.3.2", + "core-graphics 0.23.1", + "drm", + "fastrand 2.0.1", + "foreign-types 0.5.0", + "js-sys", "log", - "nix 0.26.4", + "memmap2 0.9.3", "objc", "raw-window-handle", "redox_syscall 0.4.1", - "thiserror", + "rustix 0.38.28", + "tiny-xlib", "wasm-bindgen", "wayland-backend", - "wayland-client 0.30.2", - "wayland-sys 0.30.1", + "wayland-client 0.31.1", + "wayland-sys 0.31.1", "web-sys", - "windows-sys 0.42.0", - "x11-dl", - "x11rb", + "windows-sys 0.48.0", + "x11rb 0.12.0", ] [[package]] @@ -1960,11 +4066,26 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "svg_fmt" @@ -1972,6 +4093,16 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" +[[package]] +name = "svgtypes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e44e288cd960318917cbd540340968b90becc8bc81f171345d706e7a89d9d70" +dependencies = [ + "kurbo", + "siphasher", +] + [[package]] name = "swash" version = "0.1.8" @@ -2013,6 +4144,30 @@ dependencies = [ "libc", ] +[[package]] +name = "taffy" +version = "0.3.11" +source = "git+https://github.com/DioxusLabs/taffy?rev=7781c70#7781c70241f7f572130c13106f2a869a9cf80885" +dependencies = [ + "arrayvec", + "grid", + "num-traits", + "slotmap", +] + +[[package]] +name = "tempfile" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +dependencies = [ + "cfg-if 1.0.0", + "fastrand 2.0.1", + "redox_syscall 0.4.1", + "rustix 0.38.28", + "windows-sys 0.48.0", +] + [[package]] name = "termcolor" version = "1.4.0" @@ -2042,6 +4197,17 @@ dependencies = [ "syn 2.0.41", ] +[[package]] +name = "tiff" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + [[package]] name = "tiny-skia" version = "0.8.4" @@ -2093,6 +4259,18 @@ dependencies = [ "strict-num", ] +[[package]] +name = "tiny-xlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" +dependencies = [ + "as-raw-xcb-connection", + "ctor", + "libloading 0.8.1", + "tracing", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2108,6 +4286,24 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio 0.8.10", + "num_cpus", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.5", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "toml_datetime" version = "0.6.5" @@ -2125,12 +4321,60 @@ dependencies = [ "winnow", ] +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + [[package]] name = "ttf-parser" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset 0.9.0", + "tempfile", + "winapi 0.3.9", +] + [[package]] name = "unicode-bidi" version = "0.3.14" @@ -2161,6 +4405,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-properties" version = "0.1.0" @@ -2179,6 +4432,12 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + [[package]] name = "unicode-width" version = "0.1.11" @@ -2191,6 +4450,79 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "usvg" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b0a51b72ab80ca511d126b77feeeb4fb1e972764653e61feac30adc161a756" +dependencies = [ + "base64 0.21.5", + "log", + "pico-args", + "usvg-parser", + "usvg-text-layout", + "usvg-tree", + "xmlwriter", +] + +[[package]] +name = "usvg-parser" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd4e3c291f45d152929a31f0f6c819245e2921bfd01e7bd91201a9af39a2bdc" +dependencies = [ + "data-url", + "flate2", + "imagesize", + "kurbo", + "log", + "roxmltree 0.19.0", + "simplecss", + "siphasher", + "svgtypes", + "usvg-tree", +] + +[[package]] +name = "usvg-text-layout" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d383a3965de199d7f96d4e11a44dd859f46e86de7f3dca9a39bf82605da0a37c" +dependencies = [ + "fontdb", + "kurbo", + "log", + "rustybuzz", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "usvg-tree", +] + +[[package]] +name = "usvg-tree" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee3d202ebdb97a6215604b8f5b4d6ef9024efd623cf2e373a6416ba976ec7d3" +dependencies = [ + "rctree", + "strict-num", + "svgtypes", + "tiny-skia-path 0.11.3", +] + [[package]] name = "utf8parse" version = "0.2.1" @@ -2229,6 +4561,22 @@ dependencies = [ "quote", ] +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2302,18 +4650,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] -name = "wayland-backend" -version = "0.1.2" +name = "wasm-timer" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b48e27457e8da3b2260ac60d0a94512f5cba36448679f3747c0865b7893ed8" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wayland-backend" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" dependencies = [ "cc", "downcast-rs", - "io-lifetimes", "nix 0.26.4", "scoped-tls", "smallvec", - "wayland-sys 0.30.1", + "wayland-sys 0.31.1", ] [[package]] @@ -2334,14 +4696,14 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.30.2" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" +checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "nix 0.26.4", "wayland-backend", - "wayland-scanner 0.30.1", + "wayland-scanner 0.31.0", ] [[package]] @@ -2392,9 +4754,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.30.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" +checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" dependencies = [ "proc-macro2", "quick-xml", @@ -2414,13 +4776,13 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", - "lazy_static", "log", + "once_cell", "pkg-config", ] @@ -2434,6 +4796,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + [[package]] name = "wgpu" version = "0.18.0" @@ -2442,7 +4810,7 @@ checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24" dependencies = [ "arrayvec", "cfg-if 1.0.0", - "flume", + "flume 0.11.0", "js-sys", "log", "naga", @@ -2594,6 +4962,31 @@ 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", + "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" version = "0.51.1" @@ -2613,6 +5006,28 @@ dependencies = [ "windows-targets 0.48.5", ] +[[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" @@ -2626,21 +5041,6 @@ dependencies = [ "windows_x86_64_msvc 0.36.1", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -2878,7 +5278,7 @@ dependencies = [ "bitflags 1.3.2", "cfg_aliases", "core-foundation", - "core-graphics", + "core-graphics 0.22.3", "dispatch", "instant", "libc", @@ -2892,7 +5292,7 @@ dependencies = [ "raw-window-handle", "redox_syscall 0.3.5", "sctk-adwaita", - "smithay-client-toolkit", + "smithay-client-toolkit 0.16.1 (git+https://github.com/pop-os/client-toolkit?branch=wayland-resize)", "wasm-bindgen", "wayland-client 0.29.5", "wayland-commons", @@ -2913,7 +5313,7 @@ dependencies = [ "bitflags 1.3.2", "cfg_aliases", "core-foundation", - "core-graphics", + "core-graphics 0.22.3", "dispatch", "instant", "libc", @@ -2963,14 +5363,27 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.11.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" +checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" dependencies = [ - "gethostname", + "gethostname 0.2.3", + "nix 0.22.3", + "winapi 0.3.9", + "winapi-wsapoll", +] + +[[package]] +name = "x11rb" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" +dependencies = [ + "as-raw-xcb-connection", + "gethostname 0.3.0", "libc", "libloading 0.7.4", - "nix 0.25.1", + "nix 0.26.4", "once_cell", "winapi 0.3.9", "winapi-wsapoll", @@ -2979,11 +5392,11 @@ dependencies = [ [[package]] name = "x11rb-protocol" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" +checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" dependencies = [ - "nix 0.25.1", + "nix 0.26.4", ] [[package]] @@ -2992,6 +5405,22 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +[[package]] +name = "xdg" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" + +[[package]] +name = "xdg-home" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +dependencies = [ + "nix 0.26.4", + "winapi 0.3.9", +] + [[package]] name = "xml-rs" version = "0.8.19" @@ -3004,6 +5433,18 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "xxhash-rust" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53be06678ed9e83edb1745eb72efc0bbcd7b5c3c35711a860906aed827a13d61" + [[package]] name = "yaml-rust" version = "0.4.5" @@ -3019,6 +5460,73 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" +[[package]] +name = "zbus" +version = "3.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "byteorder", + "derivative", + "enumflags2", + "event-listener 2.5.3", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.26.4", + "once_cell", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tokio", + "tracing", + "uds_windows", + "winapi 0.3.9", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "3.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + [[package]] name = "zeno" version = "0.2.3" @@ -3044,3 +5552,51 @@ dependencies = [ "quote", "syn 2.0.41", ] + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zvariant" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "url", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/Cargo.toml b/Cargo.toml index 58133b1..d3b53a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,36 +7,19 @@ edition = "2021" [dependencies] alacritty_terminal = "0.19" -bytemuck = "1.14" env_logger = "0.10" log = "0.4" -tiny-skia = "0.11" +tokio = { version = "1.35", features = ["sync"] } [dependencies.cosmic-text] git = "https://github.com/pop-os/cosmic-text.git" branch = "refactor" -[dependencies.glyphon] -git = "https://github.com/jackpot51/glyphon.git" -branch = "refactor" -optional = true - -[dependencies.pollster] -version = "0.3" -optional = true - -[dependencies.softbuffer] -git = "https://github.com/pop-os/softbuffer.git" -branch = "cosmic" - -[dependencies.wgpu] -version = "0.18" -optional = true - -[dependencies.winit] -git = "https://github.com/pop-os/winit.git" -branch = "master" +[dependencies.libcosmic] +git = "https://github.com/pop-os/libcosmic.git" +default-features = false +features = ["tokio", "winit"] [features] -default = [] -wgpu = ["dep:glyphon", "dep:pollster", "dep:wgpu"] +default = ["wgpu"] +wgpu = ["libcosmic/wgpu"] diff --git a/src/main.rs b/src/main.rs index 15371a0..6a2fdce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,430 +1,282 @@ -use alacritty_terminal::{ - ansi::{Color, NamedColor}, - config::{Config, PtyConfig}, - event::{Event as TermEvent, EventListener, Notify, OnResize, WindowSize}, - event_loop::{EventLoop as PtyEventLoop, Notifier}, - grid::Dimensions, - index::{Column, Line, Point}, - sync::FairMutex, - term::{ - cell::Flags, - color::{Colors, Rgb}, +// Copyright 2023 System76 +// SPDX-License-Identifier: GPL-3.0-only + +use alacritty_terminal::event::Event as TermEvent; +use cosmic::{ + app::{Command, Core, Settings}, + cosmic_theme, executor, + iced::{ + self, + futures::SinkExt, + subscription::{self, Subscription}, + widget::row, + window, Alignment, Length, }, - tty, Term, -}; -use cosmic_text::{ - Attrs, AttrsList, Buffer, BufferLine, Family, FontSystem, Metrics, Shaping, Style, SwashCache, - Weight, Wrap, -}; -use std::{mem, rc::Rc, sync::Arc, time::Instant}; -use winit::{ - event::{ - ElementState, Event as WinitEvent, KeyboardInput, ModifiersState, VirtualKeyCode, - WindowEvent, - }, - event_loop::{ControlFlow, EventLoopBuilder, EventLoopProxy}, - window::WindowBuilder, + iced_core::Size, + style, + widget::{self, segmented_button}, + ApplicationExt, Element, }; +use std::{any::TypeId, sync::Mutex}; +use tokio::sync::mpsc; -use self::renderer::Renderer; -mod renderer; +use self::terminal::Terminal; +mod terminal; -#[derive(Clone, Copy, Debug)] -struct Size { - width: f32, - height: f32, - cell_width: f32, - cell_height: f32, -} +use self::terminal_box::terminal_box; +mod terminal_box; -impl Dimensions for Size { - fn total_lines(&self) -> usize { - self.screen_lines() - } - - fn screen_lines(&self) -> usize { - (self.height / self.cell_height).floor() as usize - } - - fn columns(&self) -> usize { - (self.width / self.cell_width).floor() as usize - } -} - -impl From for WindowSize { - fn from(size: Size) -> Self { - Self { - num_lines: size.screen_lines() as u16, - num_cols: size.columns() as u16, - cell_width: size.cell_width as u16, - cell_height: size.cell_height as u16, - } - } -} - -#[derive(Clone)] -struct EventProxy(EventLoopProxy); - -impl EventListener for EventProxy { - fn send_event(&self, event: TermEvent) { - let _ = self.0.send_event(event); - } -} - -fn colors() -> Colors { - let mut colors = Colors::default(); - - // These colors come from `ransid`: https://gitlab.redox-os.org/redox-os/ransid/-/blob/master/src/color.rs - let encode_rgb = |r: u8, g: u8, b: u8| -> Rgb { Rgb { r, g, b } }; - for value in 0..=255 { - let color = match value { - 0 => encode_rgb(0x00, 0x00, 0x00), - 1 => encode_rgb(0x80, 0x00, 0x00), - 2 => encode_rgb(0x00, 0x80, 0x00), - 3 => encode_rgb(0x80, 0x80, 0x00), - 4 => encode_rgb(0x00, 0x00, 0x80), - 5 => encode_rgb(0x80, 0x00, 0x80), - 6 => encode_rgb(0x00, 0x80, 0x80), - 7 => encode_rgb(0xc0, 0xc0, 0xc0), - 8 => encode_rgb(0x80, 0x80, 0x80), - 9 => encode_rgb(0xff, 0x00, 0x00), - 10 => encode_rgb(0x00, 0xff, 0x00), - 11 => encode_rgb(0xff, 0xff, 0x00), - 12 => encode_rgb(0x00, 0x00, 0xff), - 13 => encode_rgb(0xff, 0x00, 0xff), - 14 => encode_rgb(0x00, 0xff, 0xff), - 15 => encode_rgb(0xff, 0xff, 0xff), - 16..=231 => { - let convert = |value: u8| -> u8 { - match value { - 0 => 0, - _ => value * 0x28 + 0x28, - } - }; - - let r = convert((value - 16) / 36 % 6); - let g = convert((value - 16) / 6 % 6); - let b = convert((value - 16) % 6); - encode_rgb(r, g, b) - } - 232..=255 => { - let gray = (value - 232) * 10 + 8; - encode_rgb(gray, gray, gray) - } - }; - colors[value as usize] = Some(color); - } - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::White]; - colors[NamedColor::Background] = colors[NamedColor::Black]; - /*TODO - colors[NamedColor::Cursor] = colors[NamedColor::]; - colors[NamedColor::DimBlack] = colors[NamedColor::]; - colors[NamedColor::DimRed] = colors[NamedColor::]; - colors[NamedColor::DimGreen] = colors[NamedColor::]; - colors[NamedColor::DimYellow] = colors[NamedColor::]; - colors[NamedColor::DimBlue] = colors[NamedColor::]; - colors[NamedColor::DimMagenta] = colors[NamedColor::]; - colors[NamedColor::DimCyan] = colors[NamedColor::]; - colors[NamedColor::DimWhite] = colors[NamedColor::]; - */ - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite]; - //TODO colors[NamedColor::DimForeground] = colors[NamedColor::]; - - colors -} - -fn main() { +/// Runs application with these settings +#[rustfmt::skip] +fn main() -> Result<(), Box> { env_logger::init(); - let mut font_system = FontSystem::new(); - let mut swash_cache = SwashCache::new(); - let metrics = Metrics::new(14.0, 20.0); - //TODO: set color to default fg - let default_attrs = Attrs::new().family(Family::Monospace); - let mut buffer = Buffer::new_empty(metrics); - buffer.set_wrap(&mut font_system, Wrap::None); - let (cell_width, cell_height) = { - // Use size of space to determine cell size - buffer.set_text(&mut font_system, " ", default_attrs, Shaping::Advanced); - let layout = buffer.line_layout(&mut font_system, 0).unwrap(); - (layout[0].w, metrics.line_height) - }; - println!("{}, {}", cell_width, cell_height); - let event_loop = EventLoopBuilder::::with_user_event().build(); - let event_loop_proxy = event_loop.create_proxy(); - let window = Rc::new(WindowBuilder::new().build(&event_loop).unwrap()); - let (width, height) = { - let inner_size = window.inner_size(); - (inner_size.width as f32, inner_size.height as f32) - }; + let settings = Settings::default() + .antialiasing(true) + .client_decorations(true) + .debug(false) + .default_icon_theme("Pop") + .default_text_size(16.0) + .scale_factor(1.0) + .size(Size::new(1024., 768.)) + .theme(cosmic::Theme::dark()); - let config = Config::default(); - let mut dimensions = Size { - width, - height, - cell_width, - cell_height, - }; - let event_proxy = EventProxy(event_loop_proxy); - let term = Arc::new(FairMutex::new(Term::new( - &config, - &dimensions, - event_proxy.clone(), - ))); - let colors = colors(); + cosmic::app::run::(settings, ())?; - let pty_config = PtyConfig::default(); - let window_id = 0; - let pty = tty::new(&pty_config, dimensions.into(), window_id).unwrap(); - - let pty_event_loop = PtyEventLoop::new(term.clone(), event_proxy, pty, pty_config.hold, false); - let mut notifier = Notifier(pty_event_loop.channel()); - let pty_join_handle = pty_event_loop.spawn(); - - let mut renderer = Renderer::new(window.clone()).unwrap(); - let mut modifiers = ModifiersState::default(); - event_loop.run(move |event, _elwt, control_flow| { - *control_flow = ControlFlow::Wait; - - match event { - WinitEvent::RedrawRequested(window_id) if window_id == window.id() => { - let instant = Instant::now(); - - renderer.render(&mut buffer, &mut font_system, &mut swash_cache); - - println!("draw {:?}", instant.elapsed()); - } - WinitEvent::WindowEvent { - event: WindowEvent::ReceivedCharacter(c), - window_id, - } if window_id == window.id() => { - match (modifiers.logo(), modifiers.ctrl(), modifiers.alt()) { - (true, _, _) => {} // Ignore super - (false, _, true) => { - // Alt keys - let mut buf = [0x1B, 0, 0, 0, 0]; - let str = c.encode_utf8(&mut buf[1..]); - notifier.notify(str.as_bytes().to_vec()); - } - (false, _, false) => { - let mut buf = [0, 0, 0, 0]; - let str = c.encode_utf8(&mut buf); - notifier.notify(str.as_bytes().to_vec()); - } - } - } - WinitEvent::WindowEvent { - event: - WindowEvent::KeyboardInput { - input: - KeyboardInput { - state: ElementState::Pressed, - virtual_keycode: Some(virtual_keycode), - .. - }, - .. - }, - window_id, - } if window_id == window.id() => { - match (modifiers.logo(), modifiers.ctrl(), modifiers.alt()) { - (true, _, _) => {} // Ignore super - (false, true, _) => { - // Control keys will use ReceivedCharacter instead - } - (false, false, true) => { - //TODO: support Alt keys without character - } - (false, false, false) => match virtual_keycode { - VirtualKeyCode::Up => { - notifier.notify(b"\x1B[A".as_slice()); - } - VirtualKeyCode::Down => { - notifier.notify(b"\x1B[B".as_slice()); - } - VirtualKeyCode::Right => { - notifier.notify(b"\x1B[C".as_slice()); - } - VirtualKeyCode::Left => { - notifier.notify(b"\x1B[D".as_slice()); - } - VirtualKeyCode::End => { - notifier.notify(b"\x1B[F".as_slice()); - } - VirtualKeyCode::Home => { - notifier.notify(b"\x1B[H".as_slice()); - } - _ => {} - }, - } - } - WinitEvent::WindowEvent { - event: WindowEvent::ModifiersChanged(new_modifiers), - window_id, - } if window_id == window.id() => { - modifiers = new_modifiers; - } - WinitEvent::WindowEvent { - event: WindowEvent::Resized(physical_size), - window_id, - } if window_id == window.id() => { - let instant = Instant::now(); - - dimensions.width = physical_size.width as f32; - dimensions.height = physical_size.height as f32; - - notifier.on_resize(dimensions.into()); - - term.lock().resize(dimensions); - - buffer.set_size( - &mut font_system, - dimensions.width as f32, - dimensions.height as f32, - ); - - renderer.resize(physical_size.width, physical_size.height); - - println!("resize {:?}", instant.elapsed()); - } - WinitEvent::WindowEvent { - event: WindowEvent::CloseRequested, - window_id, - } if window_id == window.id() => { - term.lock().exit(); - } - WinitEvent::UserEvent(user_event) => { - println!("{:?}", user_event); - match user_event { - //TODO: other error codes? - TermEvent::Exit => *control_flow = ControlFlow::ExitWithCode(0), - TermEvent::PtyWrite(text) => notifier.notify(text.into_bytes()), - TermEvent::Title(title) => { - window.set_title(&title); - } - _ => {} - } - - let instant = Instant::now(); - - //TODO: is redraw needed after all events? - //TODO: use LineDamageBounds - { - let mut last_point = Point::new(Line(0), Column(0)); - let mut text = String::new(); - let mut attrs_list = AttrsList::new(default_attrs); - let term_guard = term.lock(); - let grid = term_guard.grid(); - for indexed in grid.display_iter() { - if indexed.point.line != last_point.line { - let line_i = last_point.line.0 as usize; - while line_i >= buffer.lines.len() { - buffer.lines.push(BufferLine::new( - "", - AttrsList::new(default_attrs), - Shaping::Advanced, - )); - buffer.set_redraw(true); - } - - if buffer.lines[line_i].set_text(text.clone(), attrs_list.clone()) { - buffer.set_redraw(true); - } - - text.clear(); - attrs_list.clear_spans(); - } - //TODO: use indexed.point.column? - - //TODO: skip leading spacer? - if indexed.cell.flags.contains(Flags::WIDE_CHAR_SPACER) { - // Skip wide spacers (cells after wide characters) - continue; - } - - let start = text.len(); - text.push(indexed.cell.c); - if let Some(zerowidth) = indexed.cell.zerowidth() { - for &c in zerowidth { - text.push(c); - } - } - let end = text.len(); - - let convert_color = |color| { - let rgb = match color { - Color::Named(named_color) => match colors[named_color] { - Some(rgb) => rgb, - None => { - eprintln!("missing named color {:?}", named_color); - Rgb::default() - } - }, - Color::Spec(rgb) => rgb, - Color::Indexed(index) => match colors[index as usize] { - Some(rgb) => rgb, - None => { - eprintln!("missing indexed color {}", index); - Rgb::default() - } - }, - }; - cosmic_text::Color::rgb(rgb.r, rgb.g, rgb.b) - }; - - let mut attrs = default_attrs; - let mut fg = convert_color(indexed.cell.fg); - let mut bg = convert_color(indexed.cell.bg); - //TODO: better handling of cursor - if indexed.point == grid.cursor.point { - mem::swap(&mut fg, &mut bg); - } - attrs = attrs.color(fg); - // Use metadata as background color - attrs = attrs.metadata(bg.0 as usize); - //TODO: more flags - if indexed.cell.flags.contains(Flags::BOLD) { - attrs = attrs.weight(Weight::BOLD); - } - if indexed.cell.flags.contains(Flags::ITALIC) { - attrs = attrs.style(Style::Italic); - } - if attrs != attrs_list.defaults() { - attrs_list.add_span(start..end, attrs); - } - - last_point = indexed.point; - } - - //TODO: do not repeat! - let line_i = last_point.line.0 as usize; - while line_i >= buffer.lines.len() { - buffer.lines.push(BufferLine::new( - "", - AttrsList::new(default_attrs), - Shaping::Advanced, - )); - buffer.set_redraw(true); - } - - if buffer.lines[line_i].set_text(text, attrs_list) { - buffer.set_redraw(true); - } - } - - buffer.shape_until_scroll(&mut font_system, true); - - if buffer.redraw() { - window.request_redraw(); - } - - println!("buffer update {:?}", instant.elapsed()); - } - _ => {} - } - }); - - //TODO: hangs after event loop exit pty_join_handle.join().unwrap(); + Ok(()) +} + +/// Messages that are used specifically by our [`App`]. +#[derive(Clone, Debug)] +pub enum Message { + TabActivate(segmented_button::Entity), + TabClose(segmented_button::Entity), + TabNew, + TermEvent(segmented_button::Entity, TermEvent), + TermEventTx(mpsc::Sender<(segmented_button::Entity, TermEvent)>), +} + +/// The [`App`] stores application-specific state. +pub struct App { + core: Core, + tab_model: segmented_button::Model, + term_event_tx_opt: Option>, +} + +/// Implement [`cosmic::Application`] to integrate with COSMIC. +impl cosmic::Application for App { + /// Default async executor to use with the app. + type Executor = executor::Default; + + /// Argument received [`cosmic::Application::new`]. + type Flags = (); + + /// Message type specific to our [`App`]. + type Message = Message; + + /// The unique application ID to supply to the window manager. + const APP_ID: &'static str = "org.cosmic.AppDemo"; + + fn core(&self) -> &Core { + &self.core + } + + fn core_mut(&mut self) -> &mut Core { + &mut self.core + } + + /// Creates the application, and optionally emits command on initialize. + fn init(core: Core, input: Self::Flags) -> (Self, Command) { + let mut app = App { + core, + tab_model: segmented_button::ModelBuilder::default().build(), + term_event_tx_opt: None, + }; + + let command = app.update_title(); + + (app, command) + } + + /// Handle application events here. + fn update(&mut self, message: Self::Message) -> Command { + match message { + Message::TabActivate(entity) => { + self.tab_model.activate(entity); + return self.update_title(); + } + Message::TabClose(entity) => { + // Activate closest item + if let Some(position) = self.tab_model.position(entity) { + if position > 0 { + self.tab_model.activate_position(position - 1); + } else { + self.tab_model.activate_position(position + 1); + } + } + + // Remove item + self.tab_model.remove(entity); + + // If that was the last tab, close window + if self.tab_model.iter().next().is_none() { + return window::close(window::Id::MAIN); + } + + return self.update_title(); + } + Message::TabNew => match &self.term_event_tx_opt { + Some(term_event_tx) => { + let entity = self + .tab_model + .insert() + .text("New Terminal") + .closable() + .activate() + .id(); + let terminal = Terminal::new(entity, term_event_tx.clone()); + self.tab_model + .data_set::>(entity, Mutex::new(terminal)); + } + None => { + log::warn!("tried to create new tab before having event channel"); + } + }, + Message::TermEvent(entity, event) => match event { + TermEvent::Bell => { + //TODO: audible or visible bell options? + } + TermEvent::ColorRequest(index, f) => { + if let Some(terminal) = self.tab_model.data::>(entity) { + let terminal = terminal.lock().unwrap(); + let rgb = terminal.colors()[index].unwrap_or_default(); + let text = f(rgb); + terminal.input(text.into_bytes()); + } + } + TermEvent::Exit => { + return self.update(Message::TabClose(entity)); + } + TermEvent::PtyWrite(text) => { + if let Some(terminal) = self.tab_model.data::>(entity) { + let terminal = terminal.lock().unwrap(); + terminal.input(text.into_bytes()); + } + } + TermEvent::ResetTitle => { + self.tab_model.text_set(entity, "New Terminal"); + return self.update_title(); + } + TermEvent::TextAreaSizeRequest(f) => { + if let Some(terminal) = self.tab_model.data::>(entity) { + let terminal = terminal.lock().unwrap(); + let text = f(terminal.size().into()); + terminal.input(text.into_bytes()); + } + } + TermEvent::Title(title) => { + self.tab_model.text_set(entity, title); + return self.update_title(); + } + TermEvent::Wakeup => { + if let Some(terminal) = self.tab_model.data::>(entity) { + let mut terminal = terminal.lock().unwrap(); + terminal.update(); + } + } + _ => { + println!("TODO: {:?}", event); + } + }, + Message::TermEventTx(term_event_tx) => { + self.term_event_tx_opt = Some(term_event_tx); + } + } + + Command::none() + } + + /// Creates a view after each update. + fn view(&self) -> Element { + let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; + + let mut tab_column = widget::column::with_capacity(1); + + tab_column = tab_column.push( + row![ + widget::view_switcher::horizontal(&self.tab_model) + .button_height(32) + .button_spacing(space_xxs) + .on_activate(Message::TabActivate) + .on_close(Message::TabClose) + .width(Length::Shrink), + widget::button(widget::icon::from_name("list-add-symbolic").size(16).icon()) + .on_press(Message::TabNew) + .padding(space_xxs) + .style(style::Button::Icon) + ] + .align_items(Alignment::Center), + ); + + match self + .tab_model + .data::>(self.tab_model.active()) + { + Some(terminal) => { + //TODO + tab_column = tab_column.push(terminal_box(terminal)); + } + None => { + //TODO + } + } + + let content: Element<_> = tab_column.into(); + + // Uncomment to debug layout: + //content.explain(cosmic::iced::Color::WHITE) + content + } + + fn subscription(&self) -> Subscription { + struct TerminalEventWorker; + subscription::channel( + TypeId::of::(), + 100, + |mut output| async move { + let (event_tx, mut event_rx) = mpsc::channel(100); + output.send(Message::TermEventTx(event_tx)).await.unwrap(); + + // Create first terminal tab + output.send(Message::TabNew).await.unwrap(); + + while let Some((entity, event)) = event_rx.recv().await { + output + .send(Message::TermEvent(entity, event)) + .await + .unwrap(); + } + + panic!("terminal event channel closed"); + }, + ) + } +} + +impl App +where + Self: cosmic::Application, +{ + fn update_title(&mut self) -> Command { + let (header_title, window_title) = match self.tab_model.text(self.tab_model.active()) { + Some(tab_title) => ( + tab_title.to_string(), + format!("{tab_title} — COSMIC Terminal"), + ), + None => ("No Tab Open".to_string(), "COSMIC Terminal".to_string()), + }; + self.set_header_title(header_title); + self.set_window_title(window_title) + } } diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs deleted file mode 100644 index 75b5a47..0000000 --- a/src/renderer/mod.rs +++ /dev/null @@ -1,60 +0,0 @@ -use cosmic_text::{Buffer, FontSystem, SwashCache}; -use std::rc::Rc; -use winit::window::Window; - -pub use self::software::SoftwareRenderer; -pub mod software; - -#[cfg(feature = "wgpu")] -pub use self::wgpu::WgpuRenderer; -#[cfg(feature = "wgpu")] -pub mod wgpu; - -pub enum Renderer { - Software(SoftwareRenderer), - #[cfg(feature = "wgpu")] - Wgpu(WgpuRenderer), -} - -impl Renderer { - pub fn new(window: Rc) -> Result { - #[cfg(feature = "wgpu")] - match WgpuRenderer::new(window.clone()) { - Ok(renderer) => return Ok(Self::Wgpu(renderer)), - Err(err) => { - log::error!("failed to use hardware rendering: {}", err); - } - } - - SoftwareRenderer::new(window).map(Renderer::Software) - } - - pub fn render( - &mut self, - buffer: &mut Buffer, - font_system: &mut FontSystem, - swash_cache: &mut SwashCache, - ) { - match self { - Self::Software(renderer) => { - renderer.render(buffer, font_system, swash_cache); - } - #[cfg(feature = "wgpu")] - Self::Wgpu(renderer) => { - renderer.render(buffer, font_system, swash_cache); - } - } - } - - pub fn resize(&mut self, width: u32, height: u32) { - match self { - Self::Software(renderer) => { - renderer.resize(width, height); - } - #[cfg(feature = "wgpu")] - Self::Wgpu(renderer) => { - renderer.resize(width, height); - } - } - } -} diff --git a/src/renderer/software.rs b/src/renderer/software.rs deleted file mode 100644 index 6bee1e0..0000000 --- a/src/renderer/software.rs +++ /dev/null @@ -1,141 +0,0 @@ -use cosmic_text::{Buffer, FontSystem, SwashCache, SwashContent}; -use std::{rc::Rc, slice}; -use tiny_skia::{ColorU8, Paint, Pixmap, PixmapPaint, PixmapRef, Rect, Transform}; -use winit::window::Window; - -pub struct SoftwareRenderer { - pub window: Rc, - pub context: softbuffer::GraphicsContext, -} - -impl SoftwareRenderer { - pub fn new(window: Rc) -> Result { - let context = unsafe { softbuffer::GraphicsContext::new(&*window, &*window) } - .map_err(|err| format!("failed to create context: {}", err))?; - Ok(Self { window, context }) - } - - pub fn render( - &mut self, - buffer: &mut Buffer, - font_system: &mut FontSystem, - swash_cache: &mut SwashCache, - ) { - let (width, height) = { - let size = self.window.inner_size(); - (size.width, size.height) - }; - - let mut pixmap = Pixmap::new(width, height).unwrap(); - //TODO: configurable background - pixmap.fill(tiny_skia::Color::from_rgba8(0, 0, 0, 0xFF)); - - let line_height = buffer.metrics().line_height; - let mut paint = Paint::default(); - paint.anti_alias = false; - let pixmap_paint = PixmapPaint::default(); - let transform = Transform::identity(); - for run in buffer.layout_runs() { - for glyph in run.glyphs.iter() { - let physical_glyph = glyph.physical((0., 0.), 1.0); - - let glyph_color = match glyph.color_opt { - Some(some) => some, - None => cosmic_text::Color::rgb(0xFF, 0xFF, 0xFF), - }; - - let background_color = cosmic_text::Color(glyph.metadata as u32); - if background_color.0 != 0xFF000000 { - //TODO: Have to swap RGB for BGR - paint.set_color_rgba8( - background_color.b(), - background_color.g(), - background_color.r(), - background_color.a(), - ); - pixmap.fill_rect( - Rect::from_xywh(glyph.x, run.line_top, glyph.w, line_height).unwrap(), - &paint, - transform, - None, - ); - } - - match swash_cache.get_image(font_system, physical_glyph.cache_key) { - Some(image) if !image.data.is_empty() => { - let mut data = Vec::with_capacity( - (image.placement.width * image.placement.height) as usize, - ); - match image.content { - SwashContent::Mask => { - let mut i = 0; - while i < image.data.len() { - //TODO: Have to swap RGB for BGR - data.push( - ColorU8::from_rgba( - glyph_color.b(), - glyph_color.g(), - glyph_color.r(), - image.data[i], - ) - .premultiply(), - ); - i += 1; - } - } - SwashContent::Color => { - let mut i = 0; - while i < image.data.len() { - //TODO: Have to swap RGB for BGR - data.push( - ColorU8::from_rgba( - image.data[i + 2], - image.data[i + 1], - image.data[i], - image.data[i + 3], - ) - .premultiply(), - ); - i += 4; - } - } - SwashContent::SubpixelMask => { - todo!("TODO: SubpixelMask"); - } - } - - let glyph_pixmap = PixmapRef::from_bytes( - unsafe { - slice::from_raw_parts(data.as_ptr() as *const u8, data.len() * 4) - }, - image.placement.width, - image.placement.height, - ) - .unwrap(); - pixmap.draw_pixmap( - physical_glyph.x + image.placement.left, - run.line_y as i32 + physical_glyph.y - image.placement.top, - glyph_pixmap, - &pixmap_paint, - transform, - None, - ); - } - _ => {} - } - } - } - buffer.set_redraw(false); - - self.context.set_buffer( - bytemuck::cast_slice(pixmap.data()), - width as u16, - height as u16, - ); - } - - pub fn resize(&mut self, width: u32, height: u32) { - //TODO: resize image here for better performance - self.window.request_redraw(); - } -} diff --git a/src/renderer/wgpu.rs b/src/renderer/wgpu.rs deleted file mode 100644 index 95026ab..0000000 --- a/src/renderer/wgpu.rs +++ /dev/null @@ -1,145 +0,0 @@ -use glyphon::{ - Attrs, Buffer, Color, Family, FontSystem, Metrics, Resolution, Shaping, SwashCache, TextArea, - TextAtlas, TextBounds, TextRenderer, -}; -use std::{error::Error, rc::Rc}; -use wgpu::{ - CommandEncoderDescriptor, CompositeAlphaMode, Device, DeviceDescriptor, Features, Instance, - InstanceDescriptor, Limits, LoadOp, MultisampleState, Operations, PresentMode, Queue, - RenderPassColorAttachment, RenderPassDescriptor, RequestAdapterOptions, Surface, - SurfaceConfiguration, TextureFormat, TextureUsages, TextureViewDescriptor, -}; -use winit::window::Window; - -pub struct WgpuRenderer { - pub window: Rc, - pub device: Device, - pub queue: Queue, - pub surface: Surface, - pub config: SurfaceConfiguration, - pub atlas: TextAtlas, - pub text_renderer: TextRenderer, -} - -impl WgpuRenderer { - async fn new_async(window: Rc) -> Result { - let size = window.inner_size(); - - let instance = Instance::new(InstanceDescriptor::default()); - let adapter = instance - .request_adapter(&RequestAdapterOptions::default()) - .await - .ok_or(format!("failed to request adapter"))?; - let (device, queue) = adapter - .request_device( - &DeviceDescriptor { - label: None, - features: Features::empty(), - limits: Limits::downlevel_defaults(), - }, - None, - ) - .await - .map_err(|err| format!("failed to request device: {}", err))?; - let surface = unsafe { instance.create_surface(&*window) } - .map_err(|err| format!("failed to create surface: {}", err))?; - let swapchain_format = TextureFormat::Bgra8UnormSrgb; - let mut config = SurfaceConfiguration { - usage: TextureUsages::RENDER_ATTACHMENT, - format: swapchain_format, - width: size.width, - height: size.height, - present_mode: PresentMode::Fifo, - alpha_mode: CompositeAlphaMode::Opaque, - view_formats: vec![], - }; - surface.configure(&device, &config); - - let mut atlas = TextAtlas::new(&device, &queue, swapchain_format); - let mut text_renderer = - TextRenderer::new(&mut atlas, &device, MultisampleState::default(), None); - Ok(Self { - window, - device, - queue, - surface, - config, - atlas, - text_renderer, - }) - } - - pub fn new(window: Rc) -> Result { - pollster::block_on(Self::new_async(window)) - } - - pub fn render( - &mut self, - buffer: &mut Buffer, - font_system: &mut FontSystem, - swash_cache: &mut SwashCache, - ) { - self.text_renderer - .prepare( - &self.device, - &self.queue, - font_system, - &mut self.atlas, - Resolution { - width: self.config.width, - height: self.config.height, - }, - [TextArea { - buffer: &buffer, - left: 0.0, - top: 0.0, - scale: 1.0, - bounds: TextBounds { - left: 0, - top: 0, - right: self.config.width as i32, - bottom: self.config.height as i32, - }, - default_color: Color::rgb(255, 255, 255), - }], - swash_cache, - ) - .unwrap(); - - let frame = self.surface.get_current_texture().unwrap(); - let view = frame.texture.create_view(&TextureViewDescriptor::default()); - let mut encoder = self - .device - .create_command_encoder(&CommandEncoderDescriptor { label: None }); - { - let mut pass = encoder.begin_render_pass(&RenderPassDescriptor { - label: None, - color_attachments: &[Some(RenderPassColorAttachment { - view: &view, - resolve_target: None, - ops: Operations { - load: LoadOp::Clear(wgpu::Color::BLACK), - store: wgpu::StoreOp::Store, - }, - })], - depth_stencil_attachment: None, - timestamp_writes: None, - occlusion_query_set: None, - }); - - self.text_renderer.render(&self.atlas, &mut pass).unwrap(); - } - - self.queue.submit(Some(encoder.finish())); - frame.present(); - - self.atlas.trim(); - } - - pub fn resize(&mut self, width: u32, height: u32) { - self.config.width = width; - self.config.height = height; - self.surface.configure(&self.device, &self.config); - self.window.request_redraw(); - } -} diff --git a/src/terminal.rs b/src/terminal.rs new file mode 100644 index 0000000..bbe123e --- /dev/null +++ b/src/terminal.rs @@ -0,0 +1,433 @@ +use alacritty_terminal::{ + ansi::{Color, NamedColor}, + config::{Config, PtyConfig}, + event::{Event, EventListener, Notify, OnResize, WindowSize}, + event_loop::{EventLoop, Msg, Notifier, State}, + grid::Dimensions, + index::{Column, Line, Point}, + sync::FairMutex, + term::{ + cell::Flags, + color::{Colors, Rgb}, + }, + tty, Term, +}; +use cosmic::{iced::advanced::graphics::text::font_system, widget::segmented_button}; +use cosmic_text::{ + Attrs, AttrsList, Buffer, BufferLine, Family, FontSystem, Metrics, Shaping, Style, Weight, Wrap, +}; +use std::{ + borrow::Cow, + mem, + sync::{Arc, Weak}, + thread::JoinHandle, + time::Instant, +}; +use tokio::sync::mpsc; + +#[derive(Clone, Copy, Debug)] +pub struct Size { + width: u32, + height: u32, + cell_width: f32, + cell_height: f32, +} + +impl Dimensions for Size { + fn total_lines(&self) -> usize { + self.screen_lines() + } + + fn screen_lines(&self) -> usize { + ((self.height as f32) / self.cell_height).floor() as usize + } + + fn columns(&self) -> usize { + ((self.width as f32) / self.cell_width).floor() as usize + } +} + +impl From for WindowSize { + fn from(size: Size) -> Self { + Self { + num_lines: size.screen_lines() as u16, + num_cols: size.columns() as u16, + cell_width: size.cell_width as u16, + cell_height: size.cell_height as u16, + } + } +} + +#[derive(Clone)] +struct EventProxy( + segmented_button::Entity, + mpsc::Sender<(segmented_button::Entity, Event)>, +); + +impl EventListener for EventProxy { + fn send_event(&self, event: Event) { + //TODO: handle error + let _ = self.1.blocking_send((self.0, event)); + } +} + +fn colors() -> Colors { + let mut colors = Colors::default(); + + // These colors come from `ransid`: https://gitlab.redox-os.org/redox-os/ransid/-/blob/master/src/color.rs + let encode_rgb = |r: u8, g: u8, b: u8| -> Rgb { Rgb { r, g, b } }; + for value in 0..=255 { + let color = match value { + /* Naive colors + 0 => encode_rgb(0x00, 0x00, 0x00), + 1 => encode_rgb(0x80, 0x00, 0x00), + 2 => encode_rgb(0x00, 0x80, 0x00), + 3 => encode_rgb(0x80, 0x80, 0x00), + 4 => encode_rgb(0x00, 0x00, 0x80), + 5 => encode_rgb(0x80, 0x00, 0x80), + 6 => encode_rgb(0x00, 0x80, 0x80), + 7 => encode_rgb(0xc0, 0xc0, 0xc0), + 8 => encode_rgb(0x80, 0x80, 0x80), + 9 => encode_rgb(0xff, 0x00, 0x00), + 10 => encode_rgb(0x00, 0xff, 0x00), + 11 => encode_rgb(0xff, 0xff, 0x00), + 12 => encode_rgb(0x00, 0x00, 0xff), + 13 => encode_rgb(0xff, 0x00, 0xff), + 14 => encode_rgb(0x00, 0xff, 0xff), + 15 => encode_rgb(0xff, 0xff, 0xff), + */ + // Pop colors (from pop-desktop gsettings) + 0 => encode_rgb(51, 51, 51), + 1 => encode_rgb(204, 0, 0), + 2 => encode_rgb(78, 154, 6), + 3 => encode_rgb(196, 160, 0), + 4 => encode_rgb(52, 101, 164), + 5 => encode_rgb(117, 80, 123), + 6 => encode_rgb(6, 152, 154), + 7 => encode_rgb(211, 215, 207), + 8 => encode_rgb(136, 128, 124), + 9 => encode_rgb(241, 93, 34), + 10 => encode_rgb(115, 196, 143), + 11 => encode_rgb(255, 206, 81), + 12 => encode_rgb(72, 185, 199), + 13 => encode_rgb(173, 127, 168), + 14 => encode_rgb(52, 226, 226), + 15 => encode_rgb(238, 238, 236), + /* Indexed colors */ + 16..=231 => { + let convert = |value: u8| -> u8 { + match value { + 0 => 0, + _ => value * 0x28 + 0x28, + } + }; + + let r = convert((value - 16) / 36 % 6); + let g = convert((value - 16) / 6 % 6); + let b = convert((value - 16) % 6); + encode_rgb(r, g, b) + } + 232..=255 => { + let gray = (value - 232) * 10 + 8; + encode_rgb(gray, gray, gray) + } + }; + colors[value as usize] = Some(color); + } + + // Set special colors + // Pop colors (from pop-desktop gsettings) + colors[NamedColor::Foreground] = Some(encode_rgb(242, 242, 242)); + colors[NamedColor::Background] = Some(encode_rgb(51, 51, 51)); + /*TODO + colors[NamedColor::Cursor] = colors[NamedColor::]; + colors[NamedColor::DimBlack] = colors[NamedColor::]; + colors[NamedColor::DimRed] = colors[NamedColor::]; + colors[NamedColor::DimGreen] = colors[NamedColor::]; + colors[NamedColor::DimYellow] = colors[NamedColor::]; + colors[NamedColor::DimBlue] = colors[NamedColor::]; + colors[NamedColor::DimMagenta] = colors[NamedColor::]; + colors[NamedColor::DimCyan] = colors[NamedColor::]; + colors[NamedColor::DimWhite] = colors[NamedColor::]; + */ + colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite]; + //TODO colors[NamedColor::DimForeground] = colors[NamedColor::]; + + colors +} + +fn convert_color(colors: &Colors, color: Color) -> cosmic_text::Color { + let rgb = match color { + Color::Named(named_color) => match colors[named_color] { + Some(rgb) => rgb, + None => { + log::warn!("missing named color {:?}", named_color); + Rgb::default() + } + }, + Color::Spec(rgb) => rgb, + Color::Indexed(index) => match colors[index as usize] { + Some(rgb) => rgb, + None => { + log::warn!("missing indexed color {}", index); + Rgb::default() + } + }, + }; + cosmic_text::Color::rgb(rgb.r, rgb.g, rgb.b) +} + +pub struct Terminal { + metrics: Metrics, + default_attrs: Attrs<'static>, + buffer: Arc, + size: Size, + term: Arc>>, + colors: Colors, + notifier: Notifier, + pty_join_handle: JoinHandle<(EventLoop, State)>, +} + +impl Terminal { + //TODO: error handling + pub fn new( + entity: segmented_button::Entity, + event_tx: mpsc::Sender<(segmented_button::Entity, Event)>, + ) -> Self { + let colors = colors(); + + let metrics = Metrics::new(14.0, 20.0); + //TODO: set color to default fg + let default_attrs = Attrs::new() + .family(Family::Monospace) + .color(convert_color(&colors, Color::Named(NamedColor::Foreground))) + .metadata(convert_color(&colors, Color::Named(NamedColor::Background)).0 as usize); + let mut buffer = Buffer::new_empty(metrics); + + let (cell_width, cell_height) = { + let mut font_system = font_system().write().unwrap(); + let mut font_system = font_system.raw(); + buffer.set_wrap(&mut font_system, Wrap::None); + + // Use size of space to determine cell size + buffer.set_text(&mut font_system, " ", default_attrs, Shaping::Advanced); + let layout = buffer.line_layout(&mut font_system, 0).unwrap(); + (layout[0].w, metrics.line_height) + }; + + let config = Config::default(); + let mut size = Size { + width: (80.0 * cell_width).ceil() as u32, + height: (24.0 * cell_height).ceil() as u32, + cell_width, + cell_height, + }; + let event_proxy = EventProxy(entity, event_tx); + let term = Arc::new(FairMutex::new(Term::new( + &config, + &size, + event_proxy.clone(), + ))); + + let window_id = 0; + let pty = tty::new(&config.pty_config, size.into(), window_id).unwrap(); + + let pty_event_loop = EventLoop::new( + term.clone(), + event_proxy, + pty, + config.pty_config.hold, + false, + ); + let notifier = Notifier(pty_event_loop.channel()); + let pty_join_handle = pty_event_loop.spawn(); + + Self { + colors, + metrics, + default_attrs, + buffer: Arc::new(buffer), + size, + term, + notifier, + pty_join_handle, + } + } + + pub fn buffer_weak(&self) -> Weak { + Arc::downgrade(&self.buffer) + } + + /// Get the internal [`Buffer`] + pub fn with_buffer T, T>(&self, f: F) -> T { + f(&self.buffer) + } + + /// Get the internal [`Buffer`], mutably + pub fn with_buffer_mut T, T>(&mut self, f: F) -> T { + f(Arc::make_mut(&mut self.buffer)) + } + + pub fn colors(&self) -> &Colors { + &self.colors + } + + pub fn default_attrs(&self) -> &Attrs<'static> { + &self.default_attrs + } + + pub fn size(&self) -> Size { + self.size + } + + pub fn redraw(&self) -> bool { + self.buffer.redraw() + } + + pub fn set_redraw(&mut self, redraw: bool) { + self.with_buffer_mut(|buffer| buffer.set_redraw(redraw)); + } + + pub fn input>>(&self, input: I) { + self.notifier.notify(input); + } + + pub fn resize(&mut self, width: u32, height: u32, scale_factor: f32) { + //TODO: check scale factor + if width != self.size.width || height != self.size.height { + let instant = Instant::now(); + + self.size.width = width; + self.size.height = height; + + self.notifier.on_resize(self.size.into()); + self.term.lock().resize(self.size); + + let metrics = self.metrics.scale(scale_factor); + self.with_buffer_mut(|buffer| { + let mut font_system = font_system().write().unwrap(); + buffer.set_metrics_and_size( + font_system.raw(), + metrics, + (width as f32) * scale_factor, + (height as f32) * scale_factor, + ); + }); + + log::debug!("resize {:?}", instant.elapsed()); + } + } + + pub fn update(&mut self) -> bool { + let instant = Instant::now(); + + //TODO: is redraw needed after all events? + //TODO: use LineDamageBounds + { + let mut buffer = Arc::make_mut(&mut self.buffer); + + let mut last_point = Point::new(Line(0), Column(0)); + let mut text = String::new(); + let mut attrs_list = AttrsList::new(self.default_attrs); + { + let term_guard = self.term.lock(); + let grid = term_guard.grid(); + for indexed in grid.display_iter() { + if indexed.point.line != last_point.line { + let line_i = last_point.line.0 as usize; + while line_i >= buffer.lines.len() { + buffer.lines.push(BufferLine::new( + "", + AttrsList::new(self.default_attrs), + Shaping::Advanced, + )); + buffer.set_redraw(true); + } + + if buffer.lines[line_i].set_text(text.clone(), attrs_list.clone()) { + buffer.set_redraw(true); + } + + text.clear(); + attrs_list.clear_spans(); + } + //TODO: use indexed.point.column? + + //TODO: skip leading spacer? + if indexed.cell.flags.contains(Flags::WIDE_CHAR_SPACER) { + // Skip wide spacers (cells after wide characters) + continue; + } + + let start = text.len(); + text.push(indexed.cell.c); + if let Some(zerowidth) = indexed.cell.zerowidth() { + for &c in zerowidth { + text.push(c); + } + } + let end = text.len(); + + let mut attrs = self.default_attrs; + let mut fg = convert_color(&self.colors, indexed.cell.fg); + let mut bg = convert_color(&self.colors, indexed.cell.bg); + //TODO: better handling of cursor + if indexed.point == grid.cursor.point { + mem::swap(&mut fg, &mut bg); + } + attrs = attrs.color(fg); + // Use metadata as background color + attrs = attrs.metadata(bg.0 as usize); + //TODO: more flags + if indexed.cell.flags.contains(Flags::BOLD) { + attrs = attrs.weight(Weight::BOLD); + } + if indexed.cell.flags.contains(Flags::ITALIC) { + attrs = attrs.style(Style::Italic); + } + if attrs != attrs_list.defaults() { + attrs_list.add_span(start..end, attrs); + } + + last_point = indexed.point; + } + } + + //TODO: do not repeat! + let line_i = last_point.line.0 as usize; + while line_i >= buffer.lines.len() { + buffer.lines.push(BufferLine::new( + "", + AttrsList::new(self.default_attrs), + Shaping::Advanced, + )); + buffer.set_redraw(true); + } + + if buffer.lines[line_i].set_text(text, attrs_list) { + buffer.set_redraw(true); + } + + if buffer.lines.len() != line_i + 1 { + buffer.lines.truncate(line_i + 1); + buffer.set_redraw(true); + } + + { + let mut font_system = font_system().write().unwrap(); + buffer.shape_until_scroll(font_system.raw(), true); + } + } + + log::debug!("buffer update {:?}", instant.elapsed()); + + self.buffer.redraw() + } +} + +impl Drop for Terminal { + fn drop(&mut self) { + // Ensure shutdown on terminal drop + let _ = self.notifier.0.send(Msg::Shutdown); + } +} diff --git a/src/terminal_box.rs b/src/terminal_box.rs new file mode 100644 index 0000000..c8b8f90 --- /dev/null +++ b/src/terminal_box.rs @@ -0,0 +1,617 @@ +// SPDX-License-Identifier: GPL-3.0-only + +use cosmic::{ + iced::{ + advanced::graphics::text::{font_system, Raw}, + event::{Event, Status}, + keyboard::{Event as KeyEvent, KeyCode, Modifiers}, + mouse::{self, Button, Event as MouseEvent, ScrollDelta}, + Color, Element, Length, Padding, Point, Rectangle, Size, Vector, + }, + iced_core::{ + clipboard::Clipboard, + image, + layout::{self, Layout}, + renderer::{self, Quad}, + text, + widget::{self, tree, Widget}, + Shell, + }, +}; +use cosmic_text::{Action, Edit, Metrics, Motion, Scroll}; +use std::{ + cell::Cell, + cmp, + sync::Mutex, + time::{Duration, Instant}, +}; + +use crate::Terminal; + +pub struct TerminalBox<'a, Message> { + terminal: &'a Mutex, + padding: Padding, + click_timing: Duration, + context_menu: Option, + on_context_menu: Option) -> Message + 'a>>, +} + +impl<'a, Message> TerminalBox<'a, Message> +where + Message: Clone, +{ + pub fn new(terminal: &'a Mutex) -> Self { + Self { + terminal, + padding: Padding::new(0.0), + click_timing: Duration::from_millis(500), + context_menu: None, + on_context_menu: None, + } + } + + pub fn padding>(mut self, padding: P) -> Self { + self.padding = padding.into(); + self + } + + pub fn click_timing(mut self, click_timing: Duration) -> Self { + self.click_timing = click_timing; + self + } + + pub fn context_menu(mut self, position: Point) -> Self { + self.context_menu = Some(position); + self + } + + pub fn on_context_menu( + mut self, + on_context_menu: impl Fn(Option) -> Message + 'a, + ) -> Self { + self.on_context_menu = Some(Box::new(on_context_menu)); + self + } +} + +pub fn terminal_box<'a, Message>(terminal: &'a Mutex) -> TerminalBox<'a, Message> +where + Message: Clone, +{ + TerminalBox::new(terminal) +} + +impl<'a, Message, Renderer> Widget for TerminalBox<'a, Message> +where + Message: Clone, + Renderer: + renderer::Renderer + image::Renderer + text::Renderer, +{ + fn tag(&self) -> tree::Tag { + tree::Tag::of::() + } + + fn state(&self) -> tree::State { + tree::State::new(State::new()) + } + + fn width(&self) -> Length { + Length::Fill + } + + fn height(&self) -> Length { + Length::Fill + } + + fn layout( + &self, + _tree: &mut widget::Tree, + _renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + let limits = limits.width(Length::Fill).height(Length::Fill); + + let mut terminal = self.terminal.lock().unwrap(); + //TODO: set size? + terminal.with_buffer_mut(|buffer| { + let mut font_system = font_system().write().unwrap(); + buffer.shape_until_scroll(font_system.raw(), true); + }); + + terminal.with_buffer(|buffer| { + let mut layout_lines = 0; + for line in buffer.lines.iter() { + match line.layout_opt() { + Some(layout) => layout_lines += layout.len(), + None => (), + } + } + + let height = layout_lines as f32 * buffer.metrics().line_height; + let size = Size::new(limits.max().width, height); + + layout::Node::new(limits.resolve(size)) + }) + } + + fn mouse_interaction( + &self, + tree: &widget::Tree, + layout: Layout<'_>, + cursor_position: mouse::Cursor, + _viewport: &Rectangle, + _renderer: &Renderer, + ) -> mouse::Interaction { + let state = tree.state.downcast_ref::(); + + match &state.dragging { + Some(Dragging::Scrollbar { .. }) => return mouse::Interaction::Idle, + _ => {} + } + + if let Some(p) = cursor_position.position_in(layout.bounds()) { + let scale_factor = state.scale_factor.get(); + let terminal = self.terminal.lock().unwrap(); + let buffer_size = terminal.with_buffer(|buffer| buffer.size()); + + let x_logical = p.x - self.padding.left; + let y_logical = p.y - self.padding.top; + let x = x_logical * scale_factor; + let y = y_logical * scale_factor; + if x >= 0.0 && x < buffer_size.0 && y >= 0.0 && y < buffer_size.1 { + return mouse::Interaction::Text; + } + } + + mouse::Interaction::Idle + } + + fn draw( + &self, + tree: &widget::Tree, + renderer: &mut Renderer, + _theme: &Renderer::Theme, + style: &renderer::Style, + layout: Layout<'_>, + _cursor_position: mouse::Cursor, + viewport: &Rectangle, + ) { + let instant = Instant::now(); + + let state = tree.state.downcast_ref::(); + + let mut terminal = self.terminal.lock().unwrap(); + + //TODO: make this configurable + let scrollbar_w = 0.0; + + let view_position = + layout.position() + [self.padding.left as f32, self.padding.top as f32].into(); + let view_w = cmp::min(viewport.width as i32, layout.bounds().width as i32) + - self.padding.horizontal() as i32; + let view_h = cmp::min(viewport.height as i32, layout.bounds().height as i32) + - self.padding.vertical() as i32 + - scrollbar_w as i32; + let scale_factor = style.scale_factor as f32; + + if view_w <= 0 || view_h <= 0 { + // Zero sized image + return; + } + + // Ensure terminal is the right size + terminal.resize(view_w as u32, view_h as u32, scale_factor); + + // Cache scale factor + state.scale_factor.set(scale_factor); + + // Ensure terminal is shaped + terminal.with_buffer_mut(|buffer| { + let mut font_system = font_system().write().unwrap(); + buffer.shape_until_scroll(font_system.raw(), true); + }); + + // Render default background + { + let background_color = cosmic_text::Color(terminal.default_attrs().metadata as u32); + renderer.fill_quad( + Quad { + bounds: Rectangle::new(view_position, Size::new(view_w as f32, view_h as f32)), + border_radius: 0.0.into(), + border_width: 0.0, + border_color: Color::TRANSPARENT, + }, + Color::new( + background_color.r() as f32 / 255.0, + background_color.g() as f32 / 255.0, + background_color.b() as f32 / 255.0, + background_color.a() as f32 / 255.0, + ), + ); + } + + // Render cell backgrounds that do not match default + terminal.with_buffer(|buffer| { + let line_height = buffer.metrics().line_height; + for run in buffer.layout_runs() { + for glyph in run.glyphs.iter() { + if glyph.metadata != terminal.default_attrs().metadata { + let background_color = cosmic_text::Color(glyph.metadata as u32); + renderer.fill_quad( + Quad { + bounds: Rectangle::new( + view_position + Vector::new(glyph.x, run.line_top), + Size::new(glyph.w, line_height), + ), + border_radius: 0.0.into(), + border_width: 0.0, + border_color: Color::TRANSPARENT, + }, + Color::new( + background_color.r() as f32 / 255.0, + background_color.g() as f32 / 255.0, + background_color.b() as f32 / 255.0, + background_color.a() as f32 / 255.0, + ), + ); + } + } + } + }); + + renderer.fill_raw(Raw { + buffer: terminal.buffer_weak(), + position: view_position, + color: Color::new(1.0, 1.0, 1.0, 1.0), // TODO + clip_bounds: Rectangle::new(view_position, Size::new(view_w as f32, view_h as f32)), + }); + + /*TODO + // Draw scrollbar + let scrollbar_alpha = match &state.dragging { + Some(Dragging::Scrollbar { .. }) => 0.5, + _ => 0.25, + }; + renderer.fill_quad( + Quad { + bounds: state.scrollbar_rect.get() + Vector::new(view_position.x, view_position.y), + border_radius: 0.0.into(), + border_width: 0.0, + border_color: Color::TRANSPARENT, + }, + Color::new(1.0, 1.0, 1.0, scrollbar_alpha), + ); + */ + + let duration = instant.elapsed(); + log::debug!("redraw {}, {}: {:?}", view_w, view_h, duration); + } + + fn on_event( + &mut self, + tree: &mut widget::Tree, + event: Event, + layout: Layout<'_>, + cursor_position: mouse::Cursor, + _renderer: &Renderer, + _clipboard: &mut dyn Clipboard, + shell: &mut Shell<'_, Message>, + _viewport: &Rectangle, + ) -> Status { + let state = tree.state.downcast_mut::(); + let scale_factor = state.scale_factor.get(); + let scrollbar_rect = state.scrollbar_rect.get(); + let mut terminal = self.terminal.lock().unwrap(); + let buffer_size = terminal.with_buffer(|buffer| buffer.size()); + let mut font_system = font_system().write().unwrap(); + + let mut status = Status::Ignored; + match event { + //TODO: Alt keys when they are control characters + Event::Keyboard(KeyEvent::KeyPressed { + key_code, + modifiers, + }) => match key_code { + KeyCode::Backspace => { + terminal.input(b"\x08".as_slice()); + status = Status::Captured; + } + KeyCode::Tab => { + if modifiers.shift() { + terminal.input(b"\x1B[Z".as_slice()); + } else { + terminal.input(b"\t".as_slice()); + } + status = Status::Captured; + } + KeyCode::Enter => { + terminal.input(b"\n".as_slice()); + status = Status::Captured; + } + KeyCode::Escape => { + terminal.input(b"\x1B".as_slice()); + status = Status::Captured; + } + KeyCode::Up => { + terminal.input(b"\x1B[A".as_slice()); + status = Status::Captured; + } + KeyCode::Down => { + terminal.input(b"\x1B[B".as_slice()); + status = Status::Captured; + } + KeyCode::Right => { + terminal.input(b"\x1B[C".as_slice()); + status = Status::Captured; + } + KeyCode::Left => { + terminal.input(b"\x1B[D".as_slice()); + status = Status::Captured; + } + KeyCode::End => { + terminal.input(b"\x1B[F".as_slice()); + status = Status::Captured; + } + KeyCode::Home => { + terminal.input(b"\x1B[H".as_slice()); + status = Status::Captured; + } + KeyCode::Insert => { + terminal.input(b"\x1B[2~".as_slice()); + status = Status::Captured; + } + KeyCode::Delete => { + terminal.input(b"\x1B[3~".as_slice()); + status = Status::Captured; + } + KeyCode::PageUp => { + terminal.input(b"\x1B[5~".as_slice()); + status = Status::Captured; + } + KeyCode::PageDown => { + terminal.input(b"\x1B[6~".as_slice()); + status = Status::Captured; + } + //TODO: F1-F12 keys + _ => (), + }, + Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => { + state.modifiers = modifiers; + } + Event::Keyboard(KeyEvent::CharacterReceived(character)) => { + match ( + state.modifiers.logo(), + state.modifiers.control(), + state.modifiers.alt(), + ) { + (true, _, _) => { + // Ignore super + } + (false, true, _) => { + // Handle ctrl for control characters (Ctrl-A to Ctrl-Z) + if character.is_control() { + let mut buf = [0, 0, 0, 0]; + let str = character.encode_utf8(&mut buf); + terminal.input(str.as_bytes().to_vec()); + } + } + (false, false, true) => { + if !character.is_control() { + // Handle alt for non-control characters + let mut buf = [0x1B, 0, 0, 0, 0]; + let str = character.encode_utf8(&mut buf[1..]); + terminal.input(str.as_bytes().to_vec()); + } + } + (false, false, false) => { + // Handle no modifiers for non-control characters + if !character.is_control() { + let mut buf = [0, 0, 0, 0]; + let str = character.encode_utf8(&mut buf); + terminal.input(str.as_bytes().to_vec()); + } + } + } + status = Status::Captured; + } + /*TODO + Event::Mouse(MouseEvent::ButtonPressed(button)) => { + if let Some(p) = cursor_position.position_in(layout.bounds()) { + // Handle left click drag + if let Button::Left = button { + let x_logical = p.x - self.padding.left; + let y_logical = p.y - self.padding.top; + let x = x_logical * scale_factor; + let y = y_logical * scale_factor; + if x >= 0.0 && x < buffer_size.0 && y >= 0.0 && y < buffer_size.1 { + let click_kind = + if let Some((click_kind, click_time)) = state.click.take() { + if click_time.elapsed() < self.click_timing { + match click_kind { + ClickKind::Single => ClickKind::Double, + ClickKind::Double => ClickKind::Triple, + ClickKind::Triple => ClickKind::Single, + } + } else { + ClickKind::Single + } + } else { + ClickKind::Single + }; + match click_kind { + ClickKind::Single => editor.action(Action::Click { + x: x as i32, + y: y as i32, + }), + ClickKind::Double => editor.action(Action::DoubleClick { + x: x as i32, + y: y as i32, + }), + ClickKind::Triple => editor.action(Action::TripleClick { + x: x as i32, + y: y as i32, + }), + } + state.click = Some((click_kind, Instant::now())); + state.dragging = Some(Dragging::Buffer); + } else if scrollbar_rect.contains(Point::new(x_logical, y_logical)) { + state.dragging = Some(Dragging::Scrollbar { + start_y: y, + start_scroll: editor.with_buffer(|buffer| buffer.scroll()), + }); + } else if x_logical >= scrollbar_rect.x + && x_logical < (scrollbar_rect.x + scrollbar_rect.width) + { + editor.with_buffer_mut(|buffer| { + let scroll_line = + ((y / buffer.size().1) * buffer.lines.len() as f32) as i32; + buffer.set_scroll(Scroll::new( + scroll_line.try_into().unwrap_or_default(), + 0, + )); + state.dragging = Some(Dragging::Scrollbar { + start_y: y, + start_scroll: buffer.scroll(), + }); + }); + } + } + + // Update context menu state + if let Some(on_context_menu) = &self.on_context_menu { + shell.publish((on_context_menu)(match self.context_menu { + Some(_) => None, + None => match button { + Button::Right => Some(p), + _ => None, + }, + })); + } + + status = Status::Captured; + } + } + Event::Mouse(MouseEvent::ButtonReleased(Button::Left)) => { + state.dragging = None; + status = Status::Captured; + } + Event::Mouse(MouseEvent::CursorMoved { .. }) => { + if let Some(dragging) = &state.dragging { + if let Some(p) = cursor_position.position() { + let x_logical = (p.x - layout.bounds().x) - self.padding.left; + let y_logical = (p.y - layout.bounds().y) - self.padding.top; + let x = x_logical * scale_factor; + let y = y_logical * scale_factor; + match dragging { + Dragging::Buffer => { + editor.action(Action::Drag { + x: x as i32, + y: y as i32, + }); + } + Dragging::Scrollbar { + start_y, + start_scroll, + } => { + editor.with_buffer_mut(|buffer| { + let scroll_offset = (((y - start_y) / buffer.size().1) + * buffer.lines.len() as f32) + as i32; + buffer.set_scroll(Scroll::new( + (start_scroll.line as i32 + scroll_offset) + .try_into() + .unwrap_or_default(), + 0, + )); + }); + } + } + } + status = Status::Captured; + } + } + Event::Mouse(MouseEvent::WheelScrolled { delta }) => { + if let Some(_p) = cursor_position.position_in(layout.bounds()) { + match delta { + ScrollDelta::Lines { x, y } => { + //TODO: this adjustment is just a guess! + state.scroll_pixels = 0.0; + let lines = (-y * 6.0) as i32; + if lines != 0 { + editor.action(Action::Scroll { lines }); + } + status = Status::Captured; + } + ScrollDelta::Pixels { x, y } => { + //TODO: this adjustment is just a guess! + state.scroll_pixels -= y * 6.0; + let mut lines = 0; + let metrics = editor.with_buffer(|buffer| buffer.metrics()); + while state.scroll_pixels <= -metrics.line_height { + lines -= 1; + state.scroll_pixels += metrics.line_height; + } + while state.scroll_pixels >= metrics.line_height { + lines += 1; + state.scroll_pixels -= metrics.line_height; + } + if lines != 0 { + editor.action(Action::Scroll { lines }); + } + status = Status::Captured; + } + } + } + } + */ + _ => (), + } + + status + } +} + +impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> +where + Message: Clone + 'a, + Renderer: + renderer::Renderer + image::Renderer + text::Renderer, +{ + fn from(terminal_box: TerminalBox<'a, Message>) -> Self { + Self::new(terminal_box) + } +} + +enum ClickKind { + Single, + Double, + Triple, +} + +enum Dragging { + Buffer, + Scrollbar { start_y: f32, start_scroll: Scroll }, +} + +pub struct State { + modifiers: Modifiers, + click: Option<(ClickKind, Instant)>, + dragging: Option, + scale_factor: Cell, + scroll_pixels: f32, + scrollbar_rect: Cell>, +} + +impl State { + /// Creates a new [`State`]. + pub fn new() -> State { + State { + modifiers: Modifiers::empty(), + click: None, + dragging: None, + scale_factor: Cell::new(1.0), + scroll_pixels: 0.0, + scrollbar_rect: Cell::new(Rectangle::default()), + } + } +}