diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-10-08 23:17:13 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-10-08 23:17:13 +0200 |
commit | 90da983894ddc465c713f875ef2efef28eb7da01 (patch) | |
tree | 5a8c673fa25501313fb931983e5051827af994c5 | |
parent | 10e2b6f0c5e1b7bcd7e36f08f47e5c3d21f4dc5f (diff) | |
download | FlightCore-feat/experimental-egui-support.tar.gz FlightCore-feat/experimental-egui-support.zip |
feat: egui proof-of-conceptfeat/experimental-egui-support
-rw-r--r-- | src-tauri/Cargo.lock | 1034 | ||||
-rw-r--r-- | src-tauri/Cargo.toml | 2 | ||||
-rw-r--r-- | src-tauri/src/main.rs | 347 |
3 files changed, 1246 insertions, 137 deletions
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 85445891..7d96a5a7 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -9,6 +9,91 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] +name = "ab_glyph" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1061f3ff92c2f65800df1f12fc7b4ff44ee14783104187dd04dfee6f11b0fd2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "accesskit" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" + +[[package]] +name = "accesskit_consumer" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04bb4d9e4772fe0d47df57d0d5dbe5d85dd05e2f37ae1ddb6b105e76be58fb00" +dependencies = [ + "accesskit", +] + +[[package]] +name = "accesskit_macos" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134d0acf6acb667c89d3332999b1a5df4edbc8d6113910f392ebb73f2b03bb56" +dependencies = [ + "accesskit", + "accesskit_consumer", + "objc2", + "once_cell", +] + +[[package]] +name = "accesskit_unix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e084cb5168790c0c112626175412dc5ad127083441a8248ae49ddf6725519e83" +dependencies = [ + "accesskit", + "accesskit_consumer", + "async-channel", + "atspi", + "futures-lite", + "serde", + "zbus", +] + +[[package]] +name = "accesskit_windows" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eac0a7f2d7cd7a93b938af401d3d8e8b7094217989a7c25c55a953023436e31" +dependencies = [ + "accesskit", + "accesskit_consumer", + "arrayvec", + "once_cell", + "paste", + "windows 0.48.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "825d23acee1bd6d25cbaa3ca6ed6e73faf24122a774ec33d52c5c86c6ab423c0" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "winit", +] + +[[package]] name = "addr2line" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -35,6 +120,17 @@ dependencies = [ ] [[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", +] + +[[package]] name = "aho-corasick" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -59,6 +155,30 @@ dependencies = [ ] [[package]] +name = "android-activity" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" +dependencies = [ + "android-properties", + "bitflags 1.3.2", + "cc", + "jni-sys", + "libc", + "log", + "ndk 0.7.0", + "ndk-context", + "ndk-sys 0.4.1+23.1.7779620", + "num_enum 0.6.1", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -88,6 +208,8 @@ dependencies = [ "chrono", "const_format", "dirs", + "eframe", + "egui", "glob", "json5", "libthermite", @@ -115,6 +237,35 @@ dependencies = [ ] [[package]] +name = "arboard" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac57f2b058a76363e357c056e4f74f1945bf734d37b8b3ef49066c4787dde0fc" +dependencies = [ + "clipboard-win", + "log", + "objc", + "objc-foundation", + "objc_id", + "parking_lot", + "thiserror", + "winapi", + "x11rb", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] name = "async-broadcast" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -267,6 +418,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[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", + "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" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -333,6 +511,25 @@ dependencies = [ ] [[package]] +name = "block-sys" +version = "0.1.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "block2" +version = "0.2.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +dependencies = [ + "block-sys", + "objc2-encode", +] + +[[package]] name = "blocking" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -389,6 +586,20 @@ name = "bytemuck" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +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.28", +] [[package]] name = "byteorder" @@ -451,6 +662,20 @@ dependencies = [ ] [[package]] +name = "calloop" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" +dependencies = [ + "bitflags 1.3.2", + "log", + "nix 0.25.1", + "slotmap", + "thiserror", + "vec_map", +] + +[[package]] name = "cargo_toml" version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -513,6 +738,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + +[[package]] name = "chrono" version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -538,6 +778,17 @@ dependencies = [ ] [[package]] +name = "clipboard-win" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +dependencies = [ + "error-code", + "str-buf", + "winapi", +] + +[[package]] name = "cocoa" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -911,6 +1162,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading 0.8.1", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] name = "dtoa" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -932,12 +1198,105 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] +name = "ecolor" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf4e52dbbb615cfd30cf5a5265335c217b5fd8d669593cea74a517d9c605af" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "eframe" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d9efede6c8905d3fc51a5ec9a506d4da4011bbcae0253d0304580fe40af3f5" +dependencies = [ + "bytemuck", + "cocoa", + "egui", + "egui-winit", + "egui_glow", + "glow", + "glutin", + "glutin-winit", + "image", + "js-sys", + "log", + "objc", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "static_assertions", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winapi", + "winit", +] + +[[package]] +name = "egui" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd69fed5fcf4fbb8225b24e80ea6193b61e17a625db105ef0c4d71dde6eb8b7" +dependencies = [ + "accesskit", + "ahash", + "epaint", + "log", + "nohash-hasher", +] + +[[package]] +name = "egui-winit" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c15479a96d9fadccf5dac690bdc6373b97b8e1c0dd28367058f25a5298da0195" +dependencies = [ + "accesskit_winit", + "arboard", + "egui", + "log", + "raw-window-handle", + "smithay-clipboard", + "web-time", + "webbrowser", + "winit", +] + +[[package]] +name = "egui_glow" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6726c08798822280038bbad2e32f4fc3cbed800cd51c6e34e99cd2d60cc1bc" +dependencies = [ + "bytemuck", + "egui", + "glow", + "log", + "memoffset 0.6.5", + "wasm-bindgen", + "web-sys", +] + +[[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] +name = "emath" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ef2b29de53074e575c18b694167ccbe6e5191f7b25fe65175a0d905a32eeec0" +dependencies = [ + "bytemuck", +] + +[[package]] name = "embed-resource" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1000,6 +1359,22 @@ dependencies = [ ] [[package]] +name = "epaint" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58067b840d009143934d91d8dcb8ded054d8301d7c11a517ace0a99bb1e1595e" +dependencies = [ + "ab_glyph", + "ahash", + "bytemuck", + "ecolor", + "emath", + "log", + "nohash-hasher", + "parking_lot", +] + +[[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1027,6 +1402,16 @@ dependencies = [ ] [[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 = "event-listener" version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1346,6 +1731,16 @@ dependencies = [ ] [[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] name = "getrandom" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1404,6 +1799,17 @@ dependencies = [ ] [[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] name = "glib" version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1468,6 +1874,82 @@ dependencies = [ ] [[package]] +name = "glow" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.30.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc93b03242719b8ad39fb26ed2b01737144ce7bd4bfc7adadcef806596760fe" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "cgl", + "core-foundation", + "dispatch", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading 0.7.4", + "objc2", + "once_cell", + "raw-window-handle", + "wayland-sys 0.30.1", + "windows-sys 0.45.0", + "x11-dl", +] + +[[package]] +name = "glutin-winit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "629a873fc04062830bfe8f97c03773bcd7b371e23bcc465d0a61448cd1588fa4" +dependencies = [ + "cfg_aliases", + "glutin", + "raw-window-handle", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af784eb26c5a68ec85391268e074f0aa618c096eadb5d6330b0911cf34fe57c5" +dependencies = [ + "gl_generator", + "windows-sys 0.45.0", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b53cb5fe568964aa066a3ba91eac5ecbac869fb0842cd0dc9e412434f1a1494" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef89398e90033fc6bc65e9bd42fd29bbbfd483bda5b56dc5562f455550618165" +dependencies = [ + "gl_generator", +] + +[[package]] name = "gobject-sys" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1601,6 +2083,15 @@ dependencies = [ ] [[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] name = "hostname" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1799,6 +2290,7 @@ dependencies = [ "color_quant", "num-rational", "num-traits", + "png", ] [[package]] @@ -1847,6 +2339,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -1946,6 +2441,22 @@ dependencies = [ ] [[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] name = "jni-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2018,6 +2529,12 @@ dependencies = [ ] [[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] name = "kuchiki" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2055,6 +2572,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] name = "libthermite" version = "0.7.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2209,6 +2746,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] name = "memoffset" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2233,6 +2788,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] name = "minisign-verify" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2255,6 +2816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", + "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] @@ -2285,8 +2847,22 @@ checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys", - "num_enum", + "ndk-sys 0.3.0", + "num_enum 0.5.11", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags 1.3.2", + "jni-sys", + "ndk-sys 0.4.1+23.1.7779620", + "num_enum 0.5.11", + "raw-window-handle", "thiserror", ] @@ -2306,6 +2882,15 @@ dependencies = [ ] [[package]] +name = "ndk-sys" +version = "0.4.1+23.1.7779620" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] + +[[package]] name = "new_debug_unreachable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2313,6 +2898,31 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" @@ -2331,12 +2941,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] name = "nom" version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" [[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] name = "notify-rust" version = "4.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2414,7 +3040,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", ] [[package]] @@ -2430,6 +3065,18 @@ dependencies = [ ] [[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] name = "objc" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2451,6 +3098,32 @@ dependencies = [ ] [[package]] +name = "objc-sys" +version = "0.2.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" + +[[package]] +name = "objc2" +version = "0.3.0-beta.3.patch-leaks.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +dependencies = [ + "block2", + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "2.0.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +dependencies = [ + "objc-sys", +] + +[[package]] name = "objc_exception" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2555,6 +3228,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] +name = "orbclient" +version = "0.3.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8378ac0dfbd4e7895f2d2c1f1345cab3836910baf3a300b000d04250f0c8428f" +dependencies = [ + "redox_syscall 0.3.5", +] + +[[package]] name = "ordered-stream" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2592,6 +3274,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] +name = "owned_ttf_parser" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "706de7e2214113d63a8238d1910463cfce781129a6f263d13fdb09ff64355ba4" +dependencies = [ + "ttf-parser", +] + +[[package]] name = "pango" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3391,6 +4082,19 @@ dependencies = [ ] [[package]] +name = "sctk-adwaita" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + +[[package]] name = "security-framework" version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3765,12 +4469,50 @@ dependencies = [ ] [[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] name = "smallvec" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[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", + "calloop", + "dlib", + "lazy_static", + "log", + "memmap2", + "nix 0.24.3", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" +dependencies = [ + "smithay-client-toolkit", + "wayland-client", +] + +[[package]] name = "socket2" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3865,10 +4607,22 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "533127ad49314bfe71c3d3fd36b3ebac3d24f40618092e70e1cfe8362c7fac79" dependencies = [ - "nom", + "nom 1.2.4", ] [[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" + +[[package]] name = "string_cache" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4028,13 +4782,13 @@ dependencies = [ "gtk", "image", "instant", - "jni", + "jni 0.20.0", "lazy_static", "libc", "log", - "ndk", + "ndk 0.6.0", "ndk-context", - "ndk-sys", + "ndk-sys 0.3.0", "objc", "once_cell", "parking_lot", @@ -4046,7 +4800,7 @@ dependencies = [ "unicode-segmentation", "uuid", "windows 0.39.0", - "windows-implement", + "windows-implement 0.39.0", "x11-dl", ] @@ -4397,6 +5151,31 @@ dependencies = [ ] [[package]] +name = "tiny-skia" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "png", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] name = "tinyvec" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4615,6 +5394,12 @@ dependencies = [ ] [[package]] +name = "ttf-parser" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" + +[[package]] name = "typenum" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4742,6 +5527,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] name = "version-compare" version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4896,6 +5687,91 @@ dependencies = [ ] [[package]] +name = "wayland-client" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" +dependencies = [ + "bitflags 1.3.2", + "downcast-rs", + "libc", + "nix 0.24.3", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-commons" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" +dependencies = [ + "nix 0.24.3", + "once_cell", + "smallvec", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" +dependencies = [ + "nix 0.24.3", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" +dependencies = [ + "bitflags 1.3.2", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" +dependencies = [ + "proc-macro2", + "quote", + "xml-rs", +] + +[[package]] +name = "wayland-sys" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + +[[package]] +name = "wayland-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +dependencies = [ + "dlib", + "lazy_static", + "log", + "pkg-config", +] + +[[package]] name = "web-sys" version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4906,6 +5782,33 @@ dependencies = [ ] [[package]] +name = "web-time" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8208e3fdbc243c8fd30805721869242a7f6de3e2e9f3b057652ab36e52ae1e87" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2c79b77f525a2d670cb40619d7d9c673d09e0666f72c591ebd7861f84a87e57" +dependencies = [ + "core-foundation", + "home", + "jni 0.21.1", + "log", + "ndk-context", + "objc", + "raw-window-handle", + "url", + "web-sys", +] + +[[package]] name = "webkit2gtk" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4970,7 +5873,7 @@ dependencies = [ "webview2-com-macros", "webview2-com-sys", "windows 0.39.0", - "windows-implement", + "windows-implement 0.39.0", ] [[package]] @@ -5025,6 +5928,15 @@ dependencies = [ ] [[package]] +name = "winapi-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +dependencies = [ + "winapi", +] + +[[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5049,7 +5961,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" dependencies = [ - "windows-implement", + "windows-implement 0.39.0", "windows_aarch64_msvc 0.39.0", "windows_i686_gnu 0.39.0", "windows_i686_msvc 0.39.0", @@ -5063,6 +5975,8 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ + "windows-implement 0.48.0", + "windows-interface", "windows-targets 0.48.1", ] @@ -5087,6 +6001,28 @@ dependencies = [ ] [[package]] +name = "windows-implement" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "windows-interface" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] name = "windows-metadata" version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5306,6 +6242,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] +name = "winit" +version = "0.28.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" +dependencies = [ + "android-activity", + "bitflags 1.3.2", + "cfg_aliases", + "core-foundation", + "core-graphics", + "dispatch", + "instant", + "libc", + "log", + "mio", + "ndk 0.7.0", + "objc2", + "once_cell", + "orbclient", + "percent-encoding", + "raw-window-handle", + "redox_syscall 0.3.5", + "sctk-adwaita", + "smithay-client-toolkit", + "wasm-bindgen", + "wayland-client", + "wayland-commons", + "wayland-protocols", + "wayland-scanner", + "web-sys", + "windows-sys 0.45.0", + "x11-dl", +] + +[[package]] name = "winnow" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5379,7 +6350,7 @@ dependencies = [ "webkit2gtk-sys", "webview2-com", "windows 0.39.0", - "windows-implement", + "windows-implement 0.39.0", ] [[package]] @@ -5404,6 +6375,28 @@ dependencies = [ ] [[package]] +name = "x11rb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507" +dependencies = [ + "gethostname", + "nix 0.24.3", + "winapi", + "winapi-wsapoll", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67" +dependencies = [ + "nix 0.24.3", +] + +[[package]] name = "xattr" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5413,16 +6406,31 @@ dependencies = [ ] [[package]] +name = "xcursor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" +dependencies = [ + "nom 7.1.3", +] + +[[package]] name = "xdg-home" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" dependencies = [ - "nix", + "nix 0.26.2", "winapi", ] [[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + +[[package]] name = "zbus" version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5446,7 +6454,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix", + "nix 0.26.2", "once_cell", "ordered-stream", "rand 0.8.5", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f1d26cf8..d62bca89 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -65,6 +65,8 @@ semver = "1.0" # simplified filesystem access glob = "0.3.1" dirs = "5" +egui = "0.23.0" +eframe = "0.23.0" [target.'cfg(windows)'.dependencies] # Windows API stuff diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 66bb98d2..5adb2361 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -46,6 +46,96 @@ struct NorthstarThunderstoreReleaseWrapper { #[derive(Default)] struct Counter(Arc<Mutex<i32>>); +/// We derive Deserialize/Serialize so we can persist app state on shutdown. +#[derive(serde::Deserialize, serde::Serialize)] +#[serde(default)] // if we add new fields, give them default values when deserializing old state +pub struct TemplateApp { + #[serde(skip)] + scale_factor: f32, +} + +impl Default for TemplateApp { + fn default() -> Self { + Self { + // Example stuff: + scale_factor: -1.0, + } + } +} + +impl TemplateApp { + /// Called once before the first frame. + pub fn new(cc: &eframe::CreationContext<'_>) -> Self { + // This is also where you can customized the look at feel of egui using + // `cc.egui_ctx.set_visuals` and `cc.egui_ctx.set_fonts`. + + // Load previous app state (if any). + // Note that you must enable the `persistence` feature for this to work. + // if let Some(storage) = cc.storage { + // return eframe::get_value(storage, eframe::APP_KEY).unwrap_or_default(); + // } + + Default::default() + } +} + +impl eframe::App for TemplateApp { + /// Called by the frame work to save state before shutdown. + // fn save(&mut self, storage: &mut dyn eframe::Storage) { + // eframe::set_value(storage, eframe::APP_KEY, self); + // } + + /// Called each time the UI needs repainting, which may be many times per second. + /// Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`. + fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { + let Self { scale_factor } = self; + + egui::TopBottomPanel::top("top_panel").show(ctx, |ui| { + ui.add(egui::Slider::new(scale_factor, 0.5..=5.0).text("Scaling factor")); + // Stupide way to use default scale until value was updated + if scale_factor > &mut 0.0 { + ctx.set_pixels_per_point(*scale_factor); + } + // The top panel is often a good place for a menu bar: + egui::menu::bar(ui, |ui| { + ui.menu_button("File", |ui| { + if ui.button("Quit").clicked() { + frame.close(); + } + }); + ui.label("| "); + egui::widgets::global_dark_light_mode_buttons(ui); + }); + }); + + egui::SidePanel::left("side_panel").show(ctx, |ui| { + egui::ScrollArea::vertical().show(ui, |ui| { + ui.heading("Side Panel"); + ui.label("Todo tabs here:"); + + ui.with_layout(egui::Layout::bottom_up(egui::Align::LEFT), |ui| { + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 0.0; + ui.label("powered by "); + ui.hyperlink_to("egui", "https://github.com/emilk/egui"); + ui.label(" and "); + ui.hyperlink_to( + "eframe", + "https://github.com/emilk/egui/tree/master/eframe", + ); + }); + }); + }); + }); + + egui::CentralPanel::default().show(ctx, |ui| { + // The central panel the region left after adding TopPanel's and SidePanel's + + ui.heading(format!("test")); + }); + } +} + fn main() { // Setup logger let mut log_builder = pretty_env_logger::formatted_builder(); @@ -66,131 +156,140 @@ fn main() { }, )); - match tauri::Builder::default() - .plugin(tauri_plugin_store::Builder::default().build()) - .setup(|app| { - let app_handle = app.app_handle(); - tauri::async_runtime::spawn(async move { - loop { - sleep(Duration::from_millis(2000)).await; - // println!("sending backend ping"); - app_handle.emit_all("backend-ping", "ping").unwrap(); - } - }); - let app_handle = app.app_handle(); - tauri::async_runtime::spawn(async move { - loop { - sleep(Duration::from_millis(2000)).await; - app_handle - .emit_all( - "ea-app-running-ping", - util::check_ea_app_or_origin_running(), - ) - .unwrap(); - } - }); - let app_handle = app.app_handle(); - tauri::async_runtime::spawn(async move { - loop { - sleep(Duration::from_millis(2000)).await; - app_handle - .emit_all("northstar-running-ping", util::check_northstar_running()) - .unwrap(); - } - }); - - // Emit updated player and server count to GUI - let app_handle = app.app_handle(); - tauri::async_runtime::spawn(async move { - loop { - sleep(REFRESH_DELAY).await; - app_handle - .emit_all( - "northstar-statistics", - util::get_server_player_count().await, - ) - .unwrap(); - } - }); - - Ok(()) - }) - .manage(Counter(Default::default())) - .invoke_handler(tauri::generate_handler![ - util::force_panic, - northstar::install::find_game_install_location, - get_flightcore_version_number, - northstar::get_northstar_version_number, - check_is_northstar_outdated, - verify_install_location, - get_host_os, - install_northstar_caller, - update_northstar, - northstar::launch_northstar, - northstar::launch_northstar_steam, - github::release_notes::check_is_flightcore_outdated, - repair_and_verify::get_log_list, - repair_and_verify::verify_game_files, - mod_management::set_mod_enabled_status, - repair_and_verify::disable_all_but_core, - util::is_debug_mode, - github::release_notes::get_northstar_release_notes, - linux_checks, - mod_management::get_installed_mods_and_properties, - install_mod_caller, - clean_up_download_folder_caller, - github::release_notes::get_newest_flightcore_version, - mod_management::delete_northstar_mod, - util::get_server_player_count, - util::kill_northstar, - mod_management::delete_thunderstore_mod, - install_northstar_proton_wrapper, - uninstall_northstar_proton_wrapper, - get_local_northstar_proton_wrapper_version, - open_repair_window, - thunderstore::query_thunderstore_packages_api, - github::get_list_of_tags, - github::compare_tags, - github::pull_requests::get_pull_requests_wrapper, - github::pull_requests::apply_launcher_pr, - github::pull_requests::apply_mods_pr, - github::pull_requests::get_launcher_download_link, - close_application, - development::install_git_main, - get_available_northstar_versions, - northstar::profile::fetch_profiles, - northstar::profile::validate_profile, - ]) - .run(tauri::generate_context!()) - { - Ok(()) => (), - Err(err) => { - // Failed to launch system native web view - - // Log error on Linux - #[cfg(not(target_os = "windows"))] - { - log::error!("{err}"); - } + let native_options = eframe::NativeOptions::default(); - // On Windows we can show an error window using Windows API to show how to install WebView2 - #[cfg(target_os = "windows")] - { - log::error!("WebView2 not installed: {err}"); - let dialog = MessageDialogBuilder::new( - "WebView2 not found", - "FlightCore requires WebView2 to run.\n\nClick OK to open installation instructions." - ) - .kind(MessageDialogKind::Error) - .buttons(MessageDialogButtons::Ok); - - if dialog.show() { - // Open the installation instructions URL in the user's default web browser - open::that("https://github.com/R2NorthstarTools/FlightCore/blob/main/docs/TROUBLESHOOTING.md#flightcore-wont-launch").unwrap(); - } - } - } - }; + eframe::run_native( + "FlightCore (egui edition)", + native_options, + Box::new(|cc| Box::new(TemplateApp::new(cc))), + ) + .unwrap(); + + // match tauri::Builder::default() + // .plugin(tauri_plugin_store::Builder::default().build()) + // .setup(|app| { + // let app_handle = app.app_handle(); + // tauri::async_runtime::spawn(async move { + // loop { + // sleep(Duration::from_millis(2000)).await; + // // println!("sending backend ping"); + // app_handle.emit_all("backend-ping", "ping").unwrap(); + // } + // }); + // let app_handle = app.app_handle(); + // tauri::async_runtime::spawn(async move { + // loop { + // sleep(Duration::from_millis(2000)).await; + // app_handle + // .emit_all( + // "ea-app-running-ping", + // util::check_ea_app_or_origin_running(), + // ) + // .unwrap(); + // } + // }); + // let app_handle = app.app_handle(); + // tauri::async_runtime::spawn(async move { + // loop { + // sleep(Duration::from_millis(2000)).await; + // app_handle + // .emit_all("northstar-running-ping", util::check_northstar_running()) + // .unwrap(); + // } + // }); + + // // Emit updated player and server count to GUI + // let app_handle = app.app_handle(); + // tauri::async_runtime::spawn(async move { + // loop { + // sleep(REFRESH_DELAY).await; + // app_handle + // .emit_all( + // "northstar-statistics", + // util::get_server_player_count().await, + // ) + // .unwrap(); + // } + // }); + + // Ok(()) + // }) + // .manage(Counter(Default::default())) + // .invoke_handler(tauri::generate_handler![ + // util::force_panic, + // northstar::install::find_game_install_location, + // get_flightcore_version_number, + // northstar::get_northstar_version_number, + // check_is_northstar_outdated, + // verify_install_location, + // get_host_os, + // install_northstar_caller, + // update_northstar, + // northstar::launch_northstar, + // northstar::launch_northstar_steam, + // github::release_notes::check_is_flightcore_outdated, + // repair_and_verify::get_log_list, + // repair_and_verify::verify_game_files, + // mod_management::set_mod_enabled_status, + // repair_and_verify::disable_all_but_core, + // util::is_debug_mode, + // github::release_notes::get_northstar_release_notes, + // linux_checks, + // mod_management::get_installed_mods_and_properties, + // install_mod_caller, + // clean_up_download_folder_caller, + // github::release_notes::get_newest_flightcore_version, + // mod_management::delete_northstar_mod, + // util::get_server_player_count, + // util::kill_northstar, + // mod_management::delete_thunderstore_mod, + // install_northstar_proton_wrapper, + // uninstall_northstar_proton_wrapper, + // get_local_northstar_proton_wrapper_version, + // open_repair_window, + // thunderstore::query_thunderstore_packages_api, + // github::get_list_of_tags, + // github::compare_tags, + // github::pull_requests::get_pull_requests_wrapper, + // github::pull_requests::apply_launcher_pr, + // github::pull_requests::apply_mods_pr, + // github::pull_requests::get_launcher_download_link, + // close_application, + // development::install_git_main, + // get_available_northstar_versions, + // northstar::profile::fetch_profiles, + // northstar::profile::validate_profile, + // ]) + // .run(tauri::generate_context!()) + // { + // Ok(()) => (), + // Err(err) => { + // // Failed to launch system native web view + + // // Log error on Linux + // #[cfg(not(target_os = "windows"))] + // { + // log::error!("{err}"); + // } + + // // On Windows we can show an error window using Windows API to show how to install WebView2 + // #[cfg(target_os = "windows")] + // { + // log::error!("WebView2 not installed: {err}"); + // let dialog = MessageDialogBuilder::new( + // "WebView2 not found", + // "FlightCore requires WebView2 to run.\n\nClick OK to open installation instructions." + // ) + // .kind(MessageDialogKind::Error) + // .buttons(MessageDialogButtons::Ok); + + // if dialog.show() { + // // Open the installation instructions URL in the user's default web browser + // open::that("https://github.com/R2NorthstarTools/FlightCore/blob/main/docs/TROUBLESHOOTING.md#flightcore-wont-launch").unwrap(); + // } + // } + // } + // }; } /// Returns true if linux compatible |