From f5a76dd55c5b92793bdceaad50b3d726e52c081c Mon Sep 17 00:00:00 2001 From: Brenno Lemos Date: Wed, 9 Aug 2023 15:49:37 -0300 Subject: [PATCH] Feature: introduce "Window Mode" for selecting windows under Hyprland (#20) * feat: allow parsing string to rect * feat: use string as error because of clap * feat: allow pre-set initial selection as command line option * feat: allow non-interactive mode with `--auto-capture` * chore: remove new cli parameters auto-capture and initial-selection * chore: remove new rect parsings * feat: introduce new window mode behind feature flag feat: add hyprland window mode support * fix: wrong import paths for wgpu_text re-export structures I couldn't find a reference on the documentation for these imports existing, but apparently they stopped suddenly. Also I had to bump wgpu's and wgpu_text's versions * feat: allow pre-selecting windows windows can be pre-selected by one the three options: - being focused - by cursor position - by (title, initial title, class, initial class)-matching regex * feat: allow auto-exiting by capturing image this requires a cli selection method to have been made * chore: document the new cli arguments * refactor: favor trait objects over type aliases feat: remove feature gates * chore: remove unused structures * feat: allow dragging windows' selections border to convert back into rectangle selection * chore: remove unused nightly feature * chore: better pattern matching against long enum path * chore: favor Contains trait over custom `cointains_point` * chore: prefer tuple over two integers for position * feat: check for handle changes before picking new window * feat: reverse hyprland window order apparently hyprland tends to keep new windows at a higher position in the array, though that's not always the case * feat: clear selection on mode change from window to rect * feat: make mouse-getting part of `CompositorBackend` * feat: favor window descriptor as universal struct rather than trait * chore: swap messy match statement for if-else chain * feat: better guarantee if hyprland is running or not * fix: regression when trying to move rectangular selection --- .gitignore | 5 +- Cargo.lock | 1077 +++++++++++++++++++--------- Cargo.toml | 7 +- src/main.rs | 3 + src/rendering.rs | 20 +- src/runtime_data.rs | 95 ++- src/sctk_impls/keyboard_handler.rs | 55 +- src/sctk_impls/pointer_handler.rs | 61 +- src/types.rs | 65 +- src/window/hyprland.rs | 73 ++ src/window/mod.rs | 54 ++ src/window/search.rs | 70 ++ 12 files changed, 1174 insertions(+), 411 deletions(-) create mode 100644 src/window/hyprland.rs create mode 100644 src/window/mod.rs create mode 100644 src/window/search.rs diff --git a/.gitignore b/.gitignore index b62e7fb..0674e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ result # nixago: ignore-linked-files -/treefmt.toml \ No newline at end of file +/treefmt.toml + +# VS Code user settings +/.vscode/settings.json diff --git a/Cargo.lock b/Cargo.lock index dd3d142..641e82e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,9 +20,9 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ "gimli", ] @@ -44,6 +44,21 @@ dependencies = [ "version_check", ] +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -53,6 +68,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys", +] + [[package]] name = "approx" version = "0.5.1" @@ -77,6 +141,17 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "async-trait" +version = "0.1.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -85,9 +160,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ "addr2line", "cc", @@ -127,9 +202,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "block" @@ -139,9 +214,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bytecount" @@ -166,7 +241,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.28", ] [[package]] @@ -175,12 +250,19 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + [[package]] name = "calloop" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a59225be45a478d772ce015d9743e49e92798ece9e34eda9a6aa2a6a7f40192" +checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" dependencies = [ + "bitflags 1.3.2", "log", "nix 0.25.1", "slotmap", @@ -190,11 +272,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "6c6b2562119bf28c3439f7f02db99faf0aa1a8cdfe5772a2ee155d32227239f0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -205,13 +288,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "time", "wasm-bindgen", @@ -220,40 +303,44 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.32" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ - "bitflags 1.3.2", + "clap_builder", "clap_derive", - "clap_lex", - "is-terminal", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.28", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "codespan-reporting" @@ -271,6 +358,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "com-rs" version = "0.2.1" @@ -283,6 +376,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed3d0b5ff30645a68f35ece8cea4556ca14ef8a1651455f789a099a0513532a6" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.3" @@ -295,9 +394,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core-graphics-types" @@ -321,9 +420,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -331,9 +430,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -342,100 +441,75 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", + "memoffset 0.9.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] [[package]] -name = "cxx" -version = "1.0.87" +name = "d3d12" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b61a7545f753a88bcbe0a70de1fcc0221e10bfc752f576754fa91e663db1622e" +checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", + "bitflags 2.3.3", + "libloading 0.8.0", + "winapi", ] [[package]] -name = "cxx-build" -version = "1.0.87" +name = "derive-new" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f464457d494b5ed6905c63b0c4704842aba319084a0a3561cdc1359536b53200" +checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" dependencies = [ - "cc", - "codespan-reporting", - "once_cell", "proc-macro2", "quote", - "scratch", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] -name = "cxxbridge-flags" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c7119ce3a3701ed81aca8410b9acf6fc399d2629d057b87e2efa4e63a3aaea" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.87" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e07508b90551e610910fa648a1878991d367064997a596135b86df30daf07e" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ + "convert_case", "proc-macro2", "quote", - "syn 1.0.107", + "rustc_version", + "syn 1.0.109", ] [[package]] -name = "d3d12" -version = "0.6.0" +name = "dlib" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", - "winapi", -] - -[[package]] -name = "derive-new" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", + "libloading 0.8.0", ] [[package]] -name = "dlib" -version = "0.5.0" +name = "doc-comment" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" -dependencies = [ - "libloading 0.7.4", -] +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "downcast-rs" @@ -445,9 +519,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "env_logger" @@ -462,13 +536,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.2.8" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys", ] [[package]] @@ -483,11 +557,17 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.8.0" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fdeflate" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" dependencies = [ - "instant", + "simd-adler32", ] [[package]] @@ -498,9 +578,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "miniz_oxide", @@ -523,24 +603,125 @@ dependencies = [ [[package]] name = "foreign-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ + "foreign-types-macros", "foreign-types-shared", ] +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "foreign-types-shared" -version = "0.1.1" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -553,11 +734,17 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "glow" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807edf58b70c0b5b2181dd39fe1839dbdb3ba02645630dc5f753e23da307f762" +checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" dependencies = [ "js-sys", "slotmap", @@ -605,21 +792,21 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", ] [[package]] @@ -632,7 +819,7 @@ dependencies = [ "log", "thiserror", "winapi", - "windows", + "windows 0.44.0", ] [[package]] @@ -681,27 +868,21 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "hermit-abi" -version = "0.2.6" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hexf-parse" @@ -709,35 +890,67 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "hyprland" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84219159a2b7df96e2e6a8b8806d97c94d7ba2f661a0d4dd843d66b59f0ca28" +dependencies = [ + "async-trait", + "derive_more", + "doc-comment", + "futures", + "hex", + "hyprland-macros", + "lazy_static", + "num-traits", + "paste", + "regex", + "serde", + "serde_json", + "serde_repr", + "strum 0.24.1", + "tokio", +] + +[[package]] +name = "hyprland-macros" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c941d3d52e979612af8cb94e8de49000c7fada2014a7791d173ab41339f4e4eb" +dependencies = [ + "quote", + "syn 2.0.28", +] + [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows 0.48.0", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "image" -version = "0.24.5" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" +checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" dependencies = [ "bytemuck", "byteorder", @@ -751,45 +964,42 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-lifetimes" -version = "1.0.3" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi", "libc", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes", + "hermit-abi", "rustix", - "windows-sys 0.42.0", + "windows-sys", ] +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + [[package]] name = "jobserver" version = "0.1.26" @@ -836,9 +1046,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.138" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -857,25 +1067,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "libwebp-sys" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439fd1885aa28937e7edcd68d2e793cb4a22f8733460d2519fbafd2b215672bf" -dependencies = [ - "cc", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.8" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "a5df1e76f0acef0058aa2164ccf74e610e716e7f9eeb3ee2283de7d43659d823" dependencies = [ "cc", + "glob", ] [[package]] @@ -886,15 +1088,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -923,9 +1125,18 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.8" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" dependencies = [ "libc", ] @@ -948,18 +1159,28 @@ 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.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "block", "core-graphics-types", "foreign-types", "log", "objc", + "paste", ] [[package]] @@ -970,21 +1191,33 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", ] [[package]] name = "naga" -version = "0.12.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cd00bd6180a8790f1c020ed258a46b8d73dd5bd6af104a238c9d71f806938e" +checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.3.3", "codespan-reporting", "hexf-parse", "indexmap", @@ -1024,9 +1257,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -1037,9 +1270,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.2" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -1068,20 +1301,20 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", ] @@ -1106,18 +1339,18 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.16.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "ordered-float" @@ -1130,20 +1363,14 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a252f1f8c11e84b3ab59d7a488e48e4478a93937e027076638c49536204639" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" dependencies = [ "libc", - "windows-sys 0.42.0", + "windows-sys", ] -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "owned_ttf_parser" version = "0.19.0" @@ -1171,35 +1398,54 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", ] +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "png" -version = "0.17.7" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +checksum = "59871cc5b6cce7eaccca5a802b4173377a1c2ba90654246789a8fa2334426d11" dependencies = [ "bitflags 1.3.2", "crc32fast", + "fdeflate", "flate2", "miniz_oxide", ] @@ -1216,35 +1462,11 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[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.107", - "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.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1257,18 +1479,18 @@ checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" [[package]] name = "quick-xml" -version = "0.23.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -1317,9 +1539,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -1327,9 +1549,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1339,31 +1561,42 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags 1.3.2", ] [[package]] -name = "redox_syscall" -version = "0.3.5" +name = "regex" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ - "bitflags 1.3.2", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-automata" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" dependencies = [ - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + [[package]] name = "renderdoc-sys" version = "1.0.0" @@ -1393,20 +1626,40 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" -version = "0.36.6" +version = "0.38.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.42.0", + "windows-sys", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "scoped-tls" version = "1.0.1" @@ -1415,34 +1668,80 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "scratch" -version = "1.0.3" +name = "semver" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.28", +] + +[[package]] +name = "serde_json" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", ] [[package]] @@ -1456,9 +1755,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smithay-client-toolkit" @@ -1471,19 +1770,29 @@ dependencies = [ "dlib", "lazy_static", "log", - "memmap2", - "nix 0.26.1", + "memmap2 0.5.10", + "nix 0.26.2", "pkg-config", "thiserror", "wayland-backend", "wayland-client 0.30.2", "wayland-cursor", - "wayland-protocols 0.30.0", + "wayland-protocols 0.30.1", "wayland-protocols-wlr", - "wayland-scanner 0.30.0", + "wayland-scanner 0.30.1", "xkbcommon", ] +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "spirv" version = "0.2.0+1.5.4" @@ -1506,11 +1815,55 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros 0.25.1", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.28", +] + [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -1519,9 +1872,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.22" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -1530,45 +1883,44 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ "cfg-if", "fastrand", - "libc", - "redox_syscall 0.2.16", - "remove_dir_all", - "winapi", + "redox_syscall", + "rustix", + "windows-sys", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.28", ] [[package]] @@ -1582,6 +1934,37 @@ dependencies = [ "winapi", ] +[[package]] +name = "tokio" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "tree_magic_mini" version = "3.0.3" @@ -1615,9 +1998,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-width" @@ -1631,6 +2014,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vec_map" version = "0.8.2" @@ -1676,7 +2065,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -1710,7 +2099,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1730,14 +2119,17 @@ dependencies = [ "clap", "env_logger", "fontconfig", + "hyprland", "image", "log", - "nix 0.26.1", + "nix 0.26.2", "pollster", "raw-window-handle", + "regex", "ron", "serde", "smithay-client-toolkit", + "strum 0.25.0", "wayland-backend", "wayland-client 0.30.2", "wgpu", @@ -1754,7 +2146,7 @@ dependencies = [ "cc", "downcast-rs", "io-lifetimes", - "nix 0.26.1", + "nix 0.26.2", "scoped-tls", "smallvec", "wayland-sys 0.30.1", @@ -1783,9 +2175,9 @@ checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" dependencies = [ "bitflags 1.3.2", "calloop", - "nix 0.26.1", + "nix 0.26.2", "wayland-backend", - "wayland-scanner 0.30.0", + "wayland-scanner 0.30.1", ] [[package]] @@ -1806,7 +2198,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0c3a0d5b4b688b07b0442362d3ed6bf04724fcc16cd69ab6285b90dbc487aa" dependencies = [ - "nix 0.26.1", + "nix 0.26.2", "wayland-client 0.30.2", "xcursor", ] @@ -1825,14 +2217,14 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fefbeb8a360abe67ab7c2efe1d297a1a50ee011f5460791bc18870c26bb84e2" +checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" dependencies = [ "bitflags 1.3.2", "wayland-backend", "wayland-client 0.30.2", - "wayland-scanner 0.30.0", + "wayland-scanner 0.30.1", ] [[package]] @@ -1844,8 +2236,8 @@ dependencies = [ "bitflags 1.3.2", "wayland-backend", "wayland-client 0.30.2", - "wayland-protocols 0.30.0", - "wayland-scanner 0.30.0", + "wayland-protocols 0.30.1", + "wayland-scanner 0.30.1", ] [[package]] @@ -1861,9 +2253,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4834c14b3edf1d9986c83ca79b1e7e3afbe9874c7c144702f6467063259ce45d" +checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" dependencies = [ "proc-macro2", "quick-xml", @@ -1902,18 +2294,18 @@ dependencies = [ [[package]] name = "webp" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf022f821f166079a407d000ab57e84de020e66ffbbf4edde999bc7d6e371cae" +checksum = "12ff0ebb440d1db63b778cb609db8a8abfda825a7841664a76a70b628502c7e1" dependencies = [ "libwebp-sys", ] [[package]] name = "wgpu" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3059ea4ddec41ca14f356833e2af65e7e38c0a8f91273867ed526fb9bafcca95" +checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce" dependencies = [ "arrayvec", "cfg-if", @@ -1935,13 +2327,13 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" +checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.3.2", + "bitflags 2.3.3", "codespan-reporting", "log", "naga", @@ -1958,19 +2350,18 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74851c2c8e5d97652e74c241d41b0656b31c924a45dcdecde83975717362cfa4" +checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 2.3.2", + "bitflags 2.3.3", "block", "core-graphics-types", "d3d12", - "foreign-types", "glow", "gpu-alloc", "gpu-allocator", @@ -2000,20 +2391,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b" +checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "js-sys", "web-sys", ] [[package]] name = "wgpu_text" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d2558d185d79fccd5fb5f0836f0198da4427ab3f41fe4be6b6811533598019" +checksum = "9256dee9ceee03841e2744f62113743fa8b6220ad7866fb49d86c31bfb6ebe33" dependencies = [ "bytemuck", "glyph_brush", @@ -2068,18 +2459,12 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.48.1", ] [[package]] @@ -2088,7 +2473,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -2108,9 +2493,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", @@ -2240,19 +2625,19 @@ checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" [[package]] name = "xkbcommon" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbee136714379ab22da0280207fdb7f47e0bb940adea97731b65598b8c7a92e" +checksum = "52db25b599e92bf6e3904134618728eeb7b49a5a4f38f107f92399bb9c496b88" dependencies = [ "libc", - "memmap2", + "memmap2 0.7.1", ] [[package]] name = "xml-rs" -version = "0.8.4" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" +checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" [[package]] name = "yeslogic-fontconfig-sys" diff --git a/Cargo.toml b/Cargo.toml index b3d1910..d8d1462 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,8 +20,11 @@ clap = { version = "4.0.32", features = ["derive"] } chrono = "0.4.23" env_logger = { version = "0.10.0", default-features = false, features = ["auto-color"] } log = "0.4.17" -wgpu = "0.16.1" +wgpu = "0.17.0" raw-window-handle = "0.5.2" pollster = "0.3.0" bytemuck = { version = "1.13.1", features = ["derive"] } -wgpu_text = "0.8.1" +wgpu_text = "0.8.3" +regex = "1.9.1" +hyprland = "0.3.8" +strum = { version = "0.25.0", features = ["derive", "strum_macros"] } diff --git a/src/main.rs b/src/main.rs index 160ecb1..c0556bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,9 @@ mod macros; mod runtime_data; mod traits; mod types; + +pub mod window; + mod sctk_impls { mod compositor_handler; mod keyboard_handler; diff --git a/src/rendering.rs b/src/rendering.rs index 6916980..41c3bce 100644 --- a/src/rendering.rs +++ b/src/rendering.rs @@ -1,7 +1,7 @@ use image::RgbaImage; use smithay_client_toolkit::output::OutputInfo; use wgpu::util::DeviceExt; -use wgpu_text::section::{HorizontalAlign, Layout, OwnedSection, OwnedText, VerticalAlign}; +use wgpu_text::glyph_brush::{HorizontalAlign, Layout, OwnedSection, OwnedText, VerticalAlign}; use crate::{ handles, @@ -61,9 +61,10 @@ pub struct MonSpecificRendering { /// Bind group for the resolve target texture ms_bind_group: wgpu::BindGroup, - pub brush: wgpu_text::TextBrush, + pub brush: wgpu_text::TextBrush, rect_mode_section: OwnedSection, display_mode_section: OwnedSection, + window_mode_section: OwnedSection, } impl Renderer { pub fn new(device: &wgpu::Device, config: &Config) -> Self { @@ -349,6 +350,7 @@ impl Renderer { if let Some(section) = match selection { Selection::Rectangle(None) => Some(&monitor.rendering.rect_mode_section), Selection::Display(None) => Some(&monitor.rendering.display_mode_section), + Selection::Window(None) => Some(&monitor.rendering.window_mode_section), _ => None, } { monitor @@ -551,6 +553,15 @@ impl MonSpecificRendering { .with_layout(layout) .with_screen_position(pos); + let window_mode_section = OwnedSection::default() + .add_text( + OwnedText::new("WINDOW MODE") + .with_scale((runtime_data.config.mode_text_size * info.scale_factor) as f32) + .with_color(runtime_data.config.text_color), + ) + .with_layout(layout) + .with_screen_position(pos); + Self { bg_bind_group, shade_vertex_buffer, @@ -563,6 +574,7 @@ impl MonSpecificRendering { brush, rect_mode_section, display_mode_section, + window_mode_section, shade_index_count: 0, sel_index_count: 0, } @@ -576,12 +588,14 @@ impl MonSpecificRendering { config: &Config, queue: &wgpu::Queue, ) { + let flatten_selection = selection.flattened(); + let (shade_vertices, shade_indices, sel_vertices, sel_indices): ( Vec<[f32; 2]>, Vec, Vec<[f32; 2]>, Vec, - ) = match selection { + ) = match flatten_selection { Selection::Rectangle(Some(selection)) => { match selection.extents.to_rect().constrain(mon_rect) { None => { diff --git a/src/runtime_data.rs b/src/runtime_data.rs index 486a9ef..26d37be 100644 --- a/src/runtime_data.rs +++ b/src/runtime_data.rs @@ -18,8 +18,17 @@ use smithay_client_toolkit::{ }; use crate::{ + handles, rendering::Renderer, - types::{Args, ExitState, MonitorIdentification}, + traits::{Contains, DistanceTo}, + types::{ + Args, ExitState, MonitorIdentification, RectangleSelection, SelectionModifier, + SelectionState, + }, + window::{ + hyprland::HyprlandBackend, CompositorBackend, FindWindowExt, InitializeBackend, + WindowDescriptor, + }, Config, Monitor, Rect, Selection, }; @@ -47,7 +56,7 @@ pub struct RuntimeData { pub selection: Selection, pub monitors: Vec, pub config: Config, - pub font: wgpu_text::font::FontArc, + pub font: wgpu_text::glyph_brush::ab_glyph::FontArc, pub image: DynamicImage, pub exit: ExitState, pub args: Args, @@ -58,10 +67,17 @@ pub struct RuntimeData { pub queue: wgpu::Queue, pub renderer: Renderer, + + pub compositor_backend: Option>, + pub windows: Vec, } impl RuntimeData { - pub fn new(qh: &QueueHandle, globals: &GlobalList, args: Args) -> Self { + pub fn get_preferred_backend() -> Option> { + HyprlandBackend::try_new().ok() + } + + pub fn new(qh: &QueueHandle, globals: &GlobalList, mut args: Args) -> Self { let output = Command::new(args.grim.as_ref().unwrap_or(&"grim".to_string())) .arg("-t") .arg("ppm") @@ -111,6 +127,44 @@ impl RuntimeData { let renderer = Renderer::new(&device, &config); + let compositor_backend = Self::get_preferred_backend(); + + let mut selection = Selection::default(); + let mut windows = Vec::default(); + let mut exit = ExitState::None; + + if let Some(ref compositor_backend) = compositor_backend { + (selection, windows, exit) = { + let windows = compositor_backend.get_all_windows(); + + let selection = { + if let Some(search_param) = args.window_search.take() { + Selection::from_window(windows.find_by_search_param(search_param).cloned()) + } else if args.window_under_cursor { + let mouse_pos = compositor_backend.get_mouse_position(); + Selection::from_window(windows.find_by_position(&mouse_pos).cloned()) + } else if args.active_window { + Selection::from_window(compositor_backend.get_focused()) + } else { + Selection::default() + } + }; + + if !args.auto_capture { + (selection, windows, ExitState::None) + } else if let Selection::Rectangle(Some(rect_sel)) = selection.flattened() { + ( + selection, + windows, + ExitState::ExitWithSelection(rect_sel.extents.to_rect()), + ) + } else { + // TODO: Auto-capture for monitors + (selection, windows, ExitState::None) + } + }; + } + RuntimeData { registry_state: RegistryState::new(globals), seat_state: SeatState::new(globals, qh), @@ -118,7 +172,7 @@ impl RuntimeData { compositor_state, layer_state: LayerShell::bind(globals, qh).expect("layer shell is not available"), shm_state: Shm::bind(globals, qh).expect("wl_shm is not available"), - selection: Selection::Rectangle(None), + selection, config, area: Rect::default(), monitors: Vec::new(), @@ -128,7 +182,7 @@ impl RuntimeData { keyboard: None, pointer: None, themed_pointer: None, - exit: ExitState::None, + exit, args, pointer_surface, instance, @@ -136,10 +190,12 @@ impl RuntimeData { device, queue, renderer, - font: wgpu_text::font::FontArc::try_from_vec( + font: wgpu_text::glyph_brush::ab_glyph::FontArc::try_from_vec( fs::read(fc_font.path).expect("Failed to load font"), ) .expect("Invalid font data"), + compositor_backend, + windows, } } @@ -192,4 +248,31 @@ impl RuntimeData { surface_texture.present(); monitor.wl_surface.commit(); } + + pub fn process_selection_handles( + rect_sel: &mut Option, + global_pos: (i32, i32), + handle_radius: i32, + ) -> SelectionState { + if let Some(selection) = rect_sel { + for (x, y, modifier) in handles!(selection.extents) { + if global_pos.distance_to(&(*x, *y)) <= handle_radius { + selection.modifier = Some(*modifier); + selection.active = true; + return SelectionState::HandlesChanged; + } + } + if selection.extents.to_rect().contains(&global_pos) { + selection.modifier = Some(SelectionModifier::Center( + global_pos.0, + global_pos.1, + selection.extents, + )); + selection.active = true; + return SelectionState::CenterChanged; + } + } + + SelectionState::Unchanged + } } diff --git a/src/sctk_impls/keyboard_handler.rs b/src/sctk_impls/keyboard_handler.rs index 74b34fa..c8cf089 100644 --- a/src/sctk_impls/keyboard_handler.rs +++ b/src/sctk_impls/keyboard_handler.rs @@ -52,34 +52,47 @@ impl KeyboardHandler for RuntimeData { // Switch selection mode keysyms::XKB_KEY_Tab => match &self.selection { Selection::Rectangle(_) => self.selection = Selection::Display(None), - Selection::Display(_) => self.selection = Selection::Rectangle(None), + Selection::Display(_) => { + if self.compositor_backend.is_some() { + self.selection = Selection::Window(None) + } else { + self.selection = Selection::Rectangle(None) + } + } + Selection::Window(_) => self.selection = Selection::Rectangle(None), }, // Exit with save if a valid selection exists - keysyms::XKB_KEY_Return => match &self.selection { - Selection::Rectangle(Some(selection)) => { - let mut rect = selection.extents.to_rect(); - // Alter coordinate space so the rect can be used to crop from the original image - rect.x -= self.area.x; - rect.y -= self.area.y; + keysyms::XKB_KEY_Return => { + let flattened_selection = self.selection.flattened(); + match flattened_selection { + Selection::Rectangle(Some(selection)) => { + let mut rect = selection.extents.to_rect(); + // Alter coordinate space so the rect can be used to crop from the original image + rect.x -= self.area.x; + rect.y -= self.area.y; - self.exit = ExitState::ExitWithSelection(rect) - } - Selection::Display(Some(selection)) => { - let monitor = self - .monitors - .iter() - .find(|monitor| monitor.wl_surface == selection.wl_surface) - .unwrap(); + self.exit = ExitState::ExitWithSelection(rect) + } + Selection::Display(Some(selection)) => { + let monitor = self + .monitors + .iter() + .find(|monitor| monitor.wl_surface == selection.wl_surface) + .unwrap(); - let mut rect = monitor.rect; + let mut rect = monitor.rect; - rect.x -= self.area.x; - rect.y -= self.area.y; + rect.x -= self.area.x; + rect.y -= self.area.y; - self.exit = ExitState::ExitWithSelection(rect) + self.exit = ExitState::ExitWithSelection(rect) + } + Selection::Window(_) => unreachable!( + "Window selection should have been flattened into Rectangle selection" + ), + _ => (), } - _ => (), - }, + } _ => (), } } diff --git a/src/sctk_impls/pointer_handler.rs b/src/sctk_impls/pointer_handler.rs index 7ad6582..62f77d6 100644 --- a/src/sctk_impls/pointer_handler.rs +++ b/src/sctk_impls/pointer_handler.rs @@ -6,10 +6,10 @@ use smithay_client_toolkit::{ }; use crate::{ - handles, runtime_data::RuntimeData, - traits::{Contains, DistanceTo, ToGlobal}, - types::{DisplaySelection, RectangleSelection, Selection, SelectionModifier}, + traits::ToGlobal, + types::{DisplaySelection, RectangleSelection, Selection, SelectionModifier, SelectionState}, + window::FindWindowExt, }; delegate_pointer!(RuntimeData); @@ -94,38 +94,43 @@ impl PointerHandler for RuntimeData { info!("Press {:x} @ {:?}", button, event.position); match &mut self.selection { - Selection::Rectangle(selection) => { - if let Some(selection) = selection { - for (x, y, modifier) in handles!(selection.extents) { - if global_pos.distance_to(&(*x, *y)) - <= self.config.handle_radius - { - selection.modifier = Some(*modifier); - selection.active = true; - return; - } - } - if selection.extents.to_rect().contains(&global_pos) { - selection.modifier = Some(SelectionModifier::Center( - global_pos.0, - global_pos.1, - selection.extents, - )); - selection.active = true; - return; - } + Selection::Rectangle(ref mut selection) => { + let handles_state = RuntimeData::process_selection_handles( + selection, + global_pos, + self.config.handle_radius, + ); + if let SelectionState::Unchanged = handles_state { + self.selection = Selection::Rectangle(Some( + RectangleSelection::new(global_pos.0, global_pos.1), + )); } - - self.selection = Selection::Rectangle(Some(RectangleSelection::new( - global_pos.0, - global_pos.1, - ))); } Selection::Display(_) => { self.selection = Selection::Display(Some(DisplaySelection::new( event.surface.clone(), ))); } + Selection::Window(_) => { + let mut flattened_selection = self.selection.flattened(); + if let Selection::Rectangle(ref mut rect_sel) = flattened_selection { + let handles_state = RuntimeData::process_selection_handles( + rect_sel, + global_pos, + self.config.handle_radius, + ); + if let SelectionState::HandlesChanged = handles_state { + self.selection = flattened_selection; + } else { + let win_sel = + self.windows.find_by_position(&global_pos).cloned(); + + if win_sel.is_some() { + self.selection = Selection::Window(win_sel); + } + } + } + } } } Release { button, .. } => { diff --git a/src/types.rs b/src/types.rs index 66b05b5..35a5ffe 100644 --- a/src/types.rs +++ b/src/types.rs @@ -19,9 +19,11 @@ use wayland_client::{ Connection, Proxy, QueueHandle, }; -use crate::{rendering::MonSpecificRendering, runtime_data::RuntimeData}; +use crate::{rendering::MonSpecificRendering, runtime_data::RuntimeData, window::WindowDescriptor}; -#[derive(Parser, Clone)] +use crate::window::search::WindowSearchParam; + +#[derive(Parser, Clone, Debug)] #[command(author, version, about)] pub struct Args { /// Copy the screenshot after exit @@ -39,9 +41,27 @@ pub struct Args { /// Save the image into a file #[command(subcommand)] pub save: Option, + + /// Pre-selects a window by its class, title or initial versions of the two. + /// The value passed can be a regex. + /// Examples: "class=Alacritty" , "title=.*Visual Studio Code.*" + #[arg(long, group = "capture-window")] + pub window_search: Option, + + /// Pre-selects the window under the mouse cursor. + #[arg(long, group = "capture-window")] + pub window_under_cursor: bool, + + /// Pre-selects the currently-focused window. + #[arg(long, group = "capture-window")] + pub active_window: bool, + + /// Automatically captures the pre-selected window, skipping interactive mode. + #[arg(long)] + pub auto_capture: bool, } -#[derive(Subcommand, Clone)] +#[derive(Subcommand, Clone, Debug)] pub enum SaveLocation { /// The path to save the image to Path { path: String }, @@ -108,7 +128,7 @@ pub struct Color { pub a: f32, } -impl From for wgpu_text::section::Color { +impl From for wgpu_text::glyph_brush::Color { fn from(val: Color) -> Self { [val.r, val.g, val.b, val.a] } @@ -312,17 +332,48 @@ pub enum SelectionModifier { Center(i32, i32, Extents), } +#[derive(Clone)] pub enum Selection { Rectangle(Option), Display(Option), + Window(Option), +} + +impl Default for Selection { + fn default() -> Self { + Self::Rectangle(None) + } } +impl Selection { + pub fn flattened(&self) -> Selection { + match self { + Self::Window(Some(window)) => Self::Rectangle(Some(RectangleSelection { + extents: window.rect.to_extents(), + modifier: None, + active: false, + })), + Self::Window(None) => Self::Rectangle(None), + _ => self.clone(), + } + } + + pub fn from_window(window: Option) -> Self { + match window { + Some(window) => Self::Window(Some(window)), + None => Self::Rectangle(None), + } + } +} + +#[derive(Debug, Clone, Copy)] pub struct RectangleSelection { pub extents: Extents, pub modifier: Option, pub active: bool, } +#[derive(Debug, Clone)] pub struct DisplaySelection { pub wl_surface: wl_surface::WlSurface, } @@ -369,6 +420,12 @@ pub struct RawWgpuHandles { display: RawDisplayHandle, } +pub enum SelectionState { + CenterChanged, + HandlesChanged, + Unchanged, +} + impl RawWgpuHandles { pub fn new(conn: &Connection, surface: &wl_surface::WlSurface) -> Self { let mut display_handle = WaylandDisplayHandle::empty(); diff --git a/src/window/hyprland.rs b/src/window/hyprland.rs new file mode 100644 index 0000000..26ed12b --- /dev/null +++ b/src/window/hyprland.rs @@ -0,0 +1,73 @@ +use std::collections::HashSet; + +use hyprland::{ + data::{Client, Clients, CursorPosition, Monitors}, + shared::{HyprData, HyprDataActiveOptional, WorkspaceId}, +}; + +use crate::types::Rect; + +use super::{CompositorBackend, CompositorNotAvailable, InitializeBackend, WindowDescriptor}; + +pub struct HyprlandBackend; + +impl CompositorBackend for HyprlandBackend { + fn get_all_windows(&self) -> Vec { + // TODO: Sepecial Workspaces don't appear under monitors, therefore + // windows from specials can't be focused yet. + let active_workspace_ids: HashSet = Monitors::get() + .unwrap() + .iter() + .map(|monitor| monitor.active_workspace.id) + .collect(); + + let mut windows: Vec<_> = Clients::get() + .unwrap() + .filter(|client| active_workspace_ids.contains(&client.workspace.id)) + .map(WindowDescriptor::from) + .collect(); + + windows.reverse(); + + windows + } + + fn get_focused(&self) -> Option { + Client::get_active() + .ok() + .flatten() + .map(WindowDescriptor::from) + } + + fn get_mouse_position(&self) -> (i32, i32) { + let CursorPosition { x, y } = CursorPosition::get().unwrap(); + (x as i32, y as i32) + } +} + +impl InitializeBackend for HyprlandBackend { + fn try_new() -> Result, super::CompositorNotAvailable> { + let mut env_vars = std::env::vars(); + match env_vars.find(|(key, _value)| key == "HYPRLAND_INSTANCE_SIGNATURE") { + Some(_) => Ok(Box::new(HyprlandBackend) as Box), + None => Err(CompositorNotAvailable::NotRunning), + } + } +} + +impl From for WindowDescriptor { + fn from(value: Client) -> Self { + Self { + initial_title: value.initial_title, + title: value.title, + initial_class: value.initial_class, + class: value.class, + rect: Rect { + x: value.at.0 as i32, + y: value.at.1 as i32, + width: value.size.0 as i32, + height: value.size.1 as i32, + }, + } + } +} diff --git a/src/window/mod.rs b/src/window/mod.rs new file mode 100644 index 0000000..eb24d61 --- /dev/null +++ b/src/window/mod.rs @@ -0,0 +1,54 @@ +use crate::{traits::Contains, types::Rect}; + +pub mod hyprland; +pub mod search; + +#[derive(Debug, Clone)] +pub struct WindowDescriptor { + pub initial_title: String, + pub title: String, + pub initial_class: String, + pub class: String, + pub rect: Rect, +} + +pub trait CompositorBackend { + fn get_all_windows(&self) -> Vec; + fn get_focused(&self) -> Option; + fn get_mouse_position(&self) -> (i32, i32); +} + +pub trait InitializeBackend { + fn try_new() -> Result, CompositorNotAvailable>; +} + +pub trait FindWindowExt { + fn find_by_position(&self, position: &(i32, i32)) -> Option<&WindowDescriptor>; + fn find_by_search_param(&self, param: search::WindowSearchParam) -> Option<&WindowDescriptor>; +} + +impl FindWindowExt for Vec { + fn find_by_position(&self, position: &(i32, i32)) -> Option<&WindowDescriptor> { + self.iter().find(|window| window.rect.contains(position)) + } + + fn find_by_search_param(&self, param: search::WindowSearchParam) -> Option<&WindowDescriptor> { + use search::WindowSearchAttribute::*; + + self.iter().find(|window| { + let attr_value = match param.attribute { + InitialTitle => &window.initial_title, + Title => &window.title, + InitialClass => &window.initial_class, + Class => &window.class, + }; + + param.value.is_match(attr_value) + }) + } +} + +pub enum CompositorNotAvailable { + NotInstalled, + NotRunning, +} diff --git a/src/window/search.rs b/src/window/search.rs new file mode 100644 index 0000000..368d4c6 --- /dev/null +++ b/src/window/search.rs @@ -0,0 +1,70 @@ +use std::str::FromStr; + +use regex::Regex; +use strum::EnumString; + +#[derive(Debug, Clone, Copy, EnumString, PartialEq)] +#[strum(serialize_all = "snake_case")] +pub enum WindowSearchAttribute { + InitialTitle, + Title, + InitialClass, + Class, +} + +#[derive(Debug, Clone)] +pub struct WindowSearchParam { + pub attribute: WindowSearchAttribute, + pub value: Regex, +} + +impl FromStr for WindowSearchParam { + type Err = String; + + fn from_str(s: &str) -> Result { + let (attribute, value) = s.split_once('=').ok_or( + " + Invalid search parameter. Search parameters should be in the form of + \"attribute=value\". Valid attributes are \"initial_title\", \"title\", + \"initial_class\", and \"class\". + ", + )?; + + let attribute: WindowSearchAttribute = attribute + .parse() + .map_err(|_| format!("Invalid search attribute \"{}\"", attribute))?; + + let value = Regex::new(value).map_err(|_| format!("Invalid search value \"{}\"", value))?; + + Ok(WindowSearchParam { attribute, value }) + } +} + +#[cfg(test)] +mod tests { + + use super::*; + + #[test] + fn test_window_search_param_from_str() { + use WindowSearchAttribute::*; + + let params_and_expected = [ + ("initial_title=^hello$", Title), + ("title=^hello$", Title), + ("initial_class=^hello$", InitialClass), + ("class=^hello$", Class), + ]; + + for (param_str, expected) in params_and_expected { + let param: Result = param_str.parse(); + + assert!(param.is_ok()); + + let param = param.unwrap(); + + assert_eq!(param.attribute, expected, "Parsing {param_str}"); + assert_eq!(param.value.as_str(), "^hello$"); + } + } +}