From 77079e51ce3807c307f7cfdf2a2a397845a36f47 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 12 Apr 2023 21:52:35 +0300 Subject: [PATCH] gui: fonts, navbar height --- Cargo.lock | 997 +++++++++++++----- Cargo.toml | 29 +- .../java/mw/gri/android/MainActivity.java | 5 +- src/grim.rs | 25 +- src/gui/app.rs | 66 ++ src/gui/mod.rs | 10 +- src/gui/renderer.rs | 328 ------ src/gui/root.rs | 0 8 files changed, 847 insertions(+), 613 deletions(-) create mode 100644 src/gui/app.rs delete mode 100644 src/gui/renderer.rs create mode 100644 src/gui/root.rs diff --git a/Cargo.lock b/Cargo.lock index 47e6b0d..27a5475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,67 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +[[package]] +name = "accesskit" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3083ac5a97521e35388ca80cf365b6be5210962cc59f11ee238cd92ac2fa9524" +dependencies = [ + "enumset", + "kurbo", +] + +[[package]] +name = "accesskit_consumer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f47393f706a2d2f9d1ebd109351f886afd256a09d2308861a6dec0853a625e2" +dependencies = [ + "accesskit", + "parking_lot 0.12.1", +] + +[[package]] +name = "accesskit_macos" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabafb94d8a4dd6b20fe4112f943756ff8dc9778e3d742fb5478bf7f000a3282" +dependencies = [ + "accesskit", + "accesskit_consumer", + "objc2", + "once_cell", + "parking_lot 0.12.1", +] + +[[package]] +name = "accesskit_windows" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662496f45a2e2ddff05e28d0a9fc2b319cc4f886d3664e3469c3d30800598962" +dependencies = [ + "accesskit", + "accesskit_consumer", + "arrayvec 0.7.2", + "once_cell", + "parking_lot 0.12.1", + "paste", + "windows 0.42.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f270416d033ab5b2a8fa72a976dfdad0db1ea194721f16cadbdb45ff219779f" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_windows", + "parking_lot 0.12.1", + "winit", +] + [[package]] name = "addr2line" version = "0.19.0" @@ -173,6 +234,12 @@ dependencies = [ "nodrop", ] +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.2" @@ -230,7 +297,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", "object", "rustc-demangle", ] @@ -380,7 +447,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] @@ -468,6 +535,15 @@ 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.24" @@ -530,6 +606,46 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation 0.9.3", + "core-graphics", + "foreign-types 0.3.2", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation 0.9.3", + "core-graphics-types", + "foreign-types 0.3.2", + "libc", + "objc", +] + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -540,12 +656,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "com-rs" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" - [[package]] name = "combine" version = "4.6.6" @@ -603,7 +713,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation 0.9.3", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -615,7 +725,19 @@ checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags 1.3.2", "core-foundation 0.9.3", - "foreign-types", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation 0.9.3", + "core-graphics", + "foreign-types 0.3.2", "libc", ] @@ -659,6 +781,29 @@ dependencies = [ "libc", ] +[[package]] +name = "crossfont" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21fd3add36ea31aba1520aa5288714dd63be506106753226d0eb387a93bc9c45" +dependencies = [ + "cocoa", + "core-foundation 0.9.3", + "core-foundation-sys 0.8.4", + "core-graphics", + "core-text", + "dwrote", + "foreign-types 0.5.0", + "freetype-rs", + "libc", + "log", + "objc", + "once_cell", + "pkg-config", + "servo-fontconfig", + "winapi 0.3.9", +] + [[package]] name = "crypto-mac" version = "0.11.1" @@ -678,6 +823,12 @@ dependencies = [ "sct", ] +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + [[package]] name = "cxx" version = "1.0.94" @@ -702,7 +853,7 @@ dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", "scratch", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] @@ -719,20 +870,54 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] name = "d3d12" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" dependencies = [ "bitflags 1.3.2", "libloading", "winapi 0.3.9", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote 1.0.26", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.9.0" @@ -793,6 +978,20 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dwrote" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "serde", + "serde_derive", + "winapi 0.3.9", + "wio", +] + [[package]] name = "easy-jsonrpc-mw" version = "0.5.4" @@ -820,58 +1019,74 @@ dependencies = [ [[package]] name = "ecolor" -version = "0.21.0" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b601108bca3af7650440ace4ca55b2daf52c36f2635be3587d77b16efd8d0691" dependencies = [ "bytemuck", ] [[package]] -name = "ecolor" -version = "0.21.0" +name = "eframe" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f99fe3cac305af9d6d92971af60d0f7ea4d783201ef1673571567b6699964d9" +checksum = "5ea929ec5819fef373728bb0e55003ce921975039cfec3ca8305bb024e5b7b32" dependencies = [ "bytemuck", + "egui", + "egui-wgpu", + "egui-winit", + "egui_glow", + "glow", + "glutin", + "js-sys", + "percent-encoding", + "raw-window-handle 0.5.2", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu", + "winit", ] [[package]] name = "egui" -version = "0.17.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a3cd1d47e12f7a17912595241622e373aa652a4e0fa90b3f9278f90a64aedf7" -dependencies = [ - "ahash 0.7.6", - "epaint 0.17.0", - "nohash-hasher", -] - -[[package]] -name = "egui" -version = "0.21.0" +checksum = "65a5e883a316e53866977450eecfbcac9c48109c2ab3394af29feb83fcde4ea9" dependencies = [ + "accesskit", "ahash 0.8.3", - "epaint 0.21.0", + "epaint", "nohash-hasher", "tracing", ] [[package]] -name = "egui" -version = "0.21.0" +name = "egui-wgpu" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6412a21e0bde7c0918f7fb44bbbb86b5e1f88e63c026a4e747cc7af02f76dfbe" +checksum = "d3a6edfac4c02455f5024dc7cda997629b94748571935773d1a0cfab8213c80a" dependencies = [ - "ahash 0.8.3", - "epaint 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nohash-hasher", + "bytemuck", + "egui", + "pollster 0.2.5", + "tracing", + "type-map", + "wgpu", + "winit", ] [[package]] name = "egui-winit" -version = "0.21.1" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5696bdbe60898b81157f07ae34fe02dbfd522174bd6e620942c269cd7307901f" dependencies = [ + "accesskit_winit", "arboard", - "egui 0.21.0", + "egui", "instant", "smithay-clipboard", "tracing", @@ -881,11 +1096,11 @@ dependencies = [ [[package]] name = "egui_demo_lib" -version = "0.21.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ac92d1776423b835012ac316bb0c27cd32bf0e21d82d183260732f0580a547" +checksum = "b191e5870e6cff885cf56d4e6c3a10ce0c66d9d855a92c1eaca96b0f1111c0aa" dependencies = [ - "egui 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", + "egui", "egui_extras", "enum-map", "tracing", @@ -894,53 +1109,34 @@ dependencies = [ [[package]] name = "egui_extras" -version = "0.21.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f051342e97dfa2445107cb7d2e720617f5c840199b5cb4fe0ffcf481fcf5cce" +checksum = "1975cd88ff7430f93b29e6b9868b648a8ff6a43b08b9ff8474ee0a648bd8f9a6" dependencies = [ - "egui 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", + "egui", "serde", ] [[package]] -name = "egui_wgpu_backend" -version = "0.22.0" +name = "egui_glow" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e3987dfe2ed2852a5b78aa5b1c5a0e39ffc14445e6611b00b61d653fd95535" +checksum = "6d4b5960cb1bae1c403a6c9027a745210a41913433b10c73b6e7d76a1017f8b4" dependencies = [ "bytemuck", - "egui 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wgpu", -] - -[[package]] -name = "egui_winit_platform" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea93cdf93d8a4b2515dba53e3c83ede5dcededb41cb3aea02e7ef267d60a7653" -dependencies = [ - "egui 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winit", + "egui", + "glow", + "memoffset", + "tracing", + "wasm-bindgen", + "web-sys", ] [[package]] name = "emath" -version = "0.17.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a977a80456be58a2c2d48e69c1d0baadef46cecef5a0c98df141c468da006f12" - -[[package]] -name = "emath" -version = "0.21.0" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "emath" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ecd80612937e0267909d5351770fe150004e24dab93954f69ca62eecd3f77e" +checksum = "5277249c8c3430e7127e4f2c40a77485e7baf11ae132ce9b3253a8ed710df0a0" dependencies = [ "bytemuck", ] @@ -975,6 +1171,27 @@ dependencies = [ "num-traits 0.1.43", ] +[[package]] +name = "enumset" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19be8061a06ab6f3a6cf21106c873578bf01bd42ad15e0311a9c76161cb1c753" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" +dependencies = [ + "darling", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", +] + [[package]] name = "env_logger" version = "0.8.4" @@ -1003,57 +1220,20 @@ dependencies = [ [[package]] name = "epaint" -version = "0.17.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033292846059f08e03a71e1b5db2ee6ab7c9622c3b48da21f4bd13258ebee2db" -dependencies = [ - "ab_glyph", - "ahash 0.7.6", - "atomic_refcell", - "emath 0.17.0", - "nohash-hasher", -] - -[[package]] -name = "epaint" -version = "0.21.0" +checksum = "de14b65fe5e423e0058f77a8beb2c863b056d0566d6c4ce0d097aa5814cb705a" dependencies = [ "ab_glyph", "ahash 0.8.3", "atomic_refcell", "bytemuck", - "ecolor 0.21.0", - "emath 0.21.0", + "ecolor", + "emath", "nohash-hasher", "parking_lot 0.12.1", ] -[[package]] -name = "epaint" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e78b5c58a1f7f621f9d546add2adce20636422c9b251e29f749e8a2f713c95" -dependencies = [ - "ab_glyph", - "ahash 0.8.3", - "atomic_refcell", - "bytemuck", - "ecolor 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "emath 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nohash-hasher", - "parking_lot 0.12.1", -] - -[[package]] -name = "epi" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95445deccef4d29fa30488d3f7f2e942dd343eef01228becc7cefd5b918176e" -dependencies = [ - "egui 0.17.0", - "tracing", -] - [[package]] name = "errno" version = "0.3.1" @@ -1085,6 +1265,16 @@ dependencies = [ "str-buf", ] +[[package]] +name = "expat-sys" +version = "2.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" +dependencies = [ + "cmake", + "pkg-config", +] + [[package]] name = "failure" version = "0.1.8" @@ -1116,6 +1306,15 @@ dependencies = [ "instant", ] +[[package]] +name = "fdeflate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +dependencies = [ + "simd-adler32", +] + [[package]] name = "flate2" version = "1.0.25" @@ -1123,7 +1322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -1138,7 +1337,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 2.0.14", ] [[package]] @@ -1147,6 +1367,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -1156,6 +1382,28 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "freetype-rs" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" +dependencies = [ + "bitflags 1.3.2", + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + [[package]] name = "fs2" version = "0.4.3" @@ -1250,7 +1498,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] @@ -1348,6 +1596,17 @@ dependencies = [ "url", ] +[[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 = "glob" version = "0.3.1" @@ -1356,9 +1615,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "glow" -version = "0.12.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e007a07a24de5ecae94160f141029e9a347282cfe25d1d58d85d845cf3130f1" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" dependencies = [ "js-sys", "slotmap", @@ -1366,6 +1625,58 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glutin" +version = "0.30.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89bab9ec7715de13d5d5402238e66f48e3a5ae636ebb45aba4013c962e2ff15" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "cgl", + "core-foundation 0.9.3", + "dispatch", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading", + "objc2", + "once_cell", + "raw-window-handle 0.5.2", + "wayland-sys 0.30.1", + "windows-sys 0.45.0", + "x11-dl", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5aaf0abb5c4148685b33101ae326a207946b4d3764d6cdc79f8316cdaa8367d" +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 = "gpu-alloc" version = "0.5.3" @@ -1385,19 +1696,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "gpu-allocator" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" -dependencies = [ - "backtrace", - "log", - "thiserror", - "winapi 0.3.9", - "windows 0.44.0", -] - [[package]] name = "gpu-descriptor" version = "0.2.3" @@ -1424,27 +1722,20 @@ version = "0.1.0" dependencies = [ "android_logger", "built", - "egui 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "egui-winit", + "eframe", + "egui", "egui_demo_lib", - "egui_wgpu_backend", - "egui_winit_platform", "env_logger 0.10.0", - "epi", "futures 0.3.28", - "grin_api", - "grin_chain", "grin_config", "grin_core", - "grin_keychain", - "grin_p2p", "grin_servers", - "grin_store", "grin_util", + "jni", "log", "openssl-sys", - "pollster", - "wgpu", + "pollster 0.3.0", + "tracing-subscriber", "winit", ] @@ -1736,21 +2027,6 @@ dependencies = [ "ahash 0.7.6", ] -[[package]] -name = "hassle-rs" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85" -dependencies = [ - "bitflags 1.3.2", - "com-rs", - "libc", - "libloading", - "thiserror", - "widestring", - "winapi 0.3.9", -] - [[package]] name = "heck" version = "0.3.3" @@ -1926,6 +2202,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -2076,6 +2358,21 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "kurbo" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a53776d271cfb873b17c618af0298445c88afc52837f3e948fa3fafd131f449" +dependencies = [ + "arrayvec 0.7.2", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2292,7 +2589,7 @@ dependencies = [ "bitflags 1.3.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -2312,6 +2609,16 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + [[package]] name = "mio" version = "0.6.23" @@ -2389,9 +2696,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eafe22a23b797c9bc227c6c896419b26b5bb88fa903417a3adaed08778850d5" +checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" dependencies = [ "bit-set", "bitflags 1.3.2", @@ -2417,7 +2724,7 @@ dependencies = [ "jni-sys", "ndk-sys", "num_enum", - "raw-window-handle", + "raw-window-handle 0.5.2", "thiserror", ] @@ -2504,6 +2811,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi 0.3.9", +] + [[package]] name = "num" version = "0.2.1" @@ -2650,9 +2967,9 @@ checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" [[package]] name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +version = "0.3.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "fe31e5425d3d0b89a15982c024392815da40689aceb34bad364d58732bcfd649" dependencies = [ "block2", "objc-sys", @@ -2741,18 +3058,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "orbclient" -version = "0.3.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9829e16c5e112e94efb5e2ad1fe17f8c1c99bb0fcdc8c65c44e935d904767d" -dependencies = [ - "cfg-if 1.0.0", - "redox_syscall 0.2.16", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "ordered-float" version = "1.1.1" @@ -2762,6 +3067,12 @@ dependencies = [ "num-traits 0.2.15", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owned_ttf_parser" version = "0.18.1" @@ -2829,6 +3140,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + [[package]] name = "pbkdf2" version = "0.8.0" @@ -2900,16 +3217,23 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "png" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +checksum = "aaeebc51f9e7d2c150d3f3bfeb667f2aa985db5ef1e3d212847bdedb488beeaa" dependencies = [ "bitflags 1.3.2", "crc32fast", + "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.1", ] +[[package]] +name = "pollster" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" + [[package]] name = "pollster" version = "0.3.0" @@ -3105,6 +3429,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + [[package]] name = "raw-window-handle" version = "0.5.2" @@ -3267,6 +3600,15 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +[[package]] +name = "safe_arch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -3315,13 +3657,12 @@ dependencies = [ [[package]] name = "sctk-adwaita" -version = "0.5.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" +checksum = "61270629cc6b4d77ec1907db1033d5c2e1a404c412743621981a871dc9c12339" dependencies = [ - "ab_glyph", + "crossfont", "log", - "memmap2", "smithay-client-toolkit", "tiny-skia", ] @@ -3360,9 +3701,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] @@ -3379,13 +3720,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] @@ -3411,6 +3752,27 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "servo-fontconfig" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" +dependencies = [ + "libc", + "servo-fontconfig-sys", +] + +[[package]] +name = "servo-fontconfig-sys" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" +dependencies = [ + "expat-sys", + "freetype-sys", + "pkg-config", +] + [[package]] name = "sha2" version = "0.9.9" @@ -3424,6 +3786,15 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "0.1.1" @@ -3439,6 +3810,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" + [[package]] name = "siphasher" version = "0.3.10" @@ -3537,12 +3914,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" -[[package]] -name = "strict-num" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df65f20698aeed245efdde3628a6b559ea1239bbb871af1b6e3b58c413b2bd1" - [[package]] name = "strsim" version = "0.8.0" @@ -3585,9 +3956,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", @@ -3654,7 +4025,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] @@ -3668,6 +4039,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", +] + [[package]] name = "time" version = "0.1.45" @@ -3681,27 +4062,27 @@ dependencies = [ [[package]] name = "tiny-skia" -version = "0.8.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfef3412c6975196fdfac41ef232f910be2bb37b9dd3313a49a1a6bc815a5bdb" +checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec 0.5.2", "bytemuck", "cfg-if 1.0.0", "png", + "safe_arch", "tiny-skia-path", ] [[package]] name = "tiny-skia-path" -version = "0.8.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b5edac058fc98f51c935daea4d805b695b38e2f151241cad125ade2a2ac20d" +checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" dependencies = [ "arrayref", "bytemuck", - "strict-num", ] [[package]] @@ -3845,21 +4226,9 @@ dependencies = [ "cfg-if 1.0.0", "log", "pin-project-lite 0.2.9", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", -] - [[package]] name = "tracing-core" version = "0.1.30" @@ -3867,6 +4236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", + "valuable", ] [[package]] @@ -3879,6 +4249,31 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + [[package]] name = "traitobject" version = "0.1.0" @@ -3897,6 +4292,15 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" +[[package]] +name = "type-map" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" +dependencies = [ + "rustc-hash", +] + [[package]] name = "typemap" version = "0.3.3" @@ -3989,6 +4393,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -4118,7 +4528,7 @@ dependencies = [ "scoped-tls", "wayland-commons", "wayland-scanner", - "wayland-sys", + "wayland-sys 0.29.5", ] [[package]] @@ -4130,7 +4540,7 @@ dependencies = [ "nix 0.24.3", "once_cell", "smallvec", - "wayland-sys", + "wayland-sys 0.29.5", ] [[package]] @@ -4178,6 +4588,18 @@ dependencies = [ "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.61" @@ -4200,7 +4622,7 @@ dependencies = [ "log", "ndk-context", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "url", "web-sys", ] @@ -4217,18 +4639,16 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.15.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d745a1b6d91d85c33defbb29f0eee0450e1d2614d987e14bf6baf26009d132d7" +checksum = "81f643110d228fd62a60c5ed2ab56c4d5b3704520bd50561174ec4ec74932937" dependencies = [ "arrayvec 0.7.2", - "cfg-if 1.0.0", "js-sys", "log", "naga", "parking_lot 0.12.1", - "profiling", - "raw-window-handle", + "raw-window-handle 0.5.2", "smallvec", "static_assertions", "wasm-bindgen", @@ -4241,20 +4661,21 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.15.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131408d940e335792645a98f03639573b0480e9e2e7cddbbab74f7c6d9f3fff" +checksum = "6000d1284ef8eec6076fd5544a73125fd7eb9b635f18dceeb829d826f41724ca" dependencies = [ "arrayvec 0.7.2", "bit-vec", "bitflags 1.3.2", + "cfg_aliases", "codespan-reporting", "fxhash", "log", "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle", + "raw-window-handle 0.5.2", "smallvec", "thiserror", "web-sys", @@ -4264,9 +4685,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.15.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdcf61a283adc744bb5453dd88ea91f3f86d5ca6b027661c6c73c7734ae0288b" +checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f" dependencies = [ "android_system_properties", "arrayvec 0.7.2", @@ -4276,16 +4697,13 @@ dependencies = [ "block", "core-graphics-types", "d3d12", - "foreign-types", + "foreign-types 0.3.2", "fxhash", "glow", "gpu-alloc", - "gpu-allocator", "gpu-descriptor", - "hassle-rs", "js-sys", "khronos-egl", - "libc", "libloading", "log", "metal", @@ -4294,7 +4712,7 @@ dependencies = [ "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.5.2", "renderdoc-sys", "smallvec", "thiserror", @@ -4306,13 +4724,11 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.15.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32444e121b0bd00cb02c0de32fde457a9491bd44e03e7a5db6df9b1da2f6f110" +checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6" dependencies = [ "bitflags 1.3.2", - "js-sys", - "web-sys", ] [[package]] @@ -4324,12 +4740,6 @@ dependencies = [ "libc", ] -[[package]] -name = "widestring" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" - [[package]] name = "winapi" version = "0.2.8" @@ -4384,11 +4794,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "0286ba339aa753e70765d521bb0242cc48e1194562bfa2a2ad7ac8a6de28f5d5" dependencies = [ - "windows-targets 0.42.2", + "windows-implement", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -4400,6 +4817,30 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-implement" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9539b6bd3eadbd9de66c9666b22d802b833da7e996bc06896142e09854a61767" +dependencies = [ + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4475,6 +4916,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -4487,6 +4934,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4499,6 +4952,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -4511,6 +4970,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -4535,6 +5000,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -4549,13 +5020,12 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winit" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f504e8c117b9015f618774f8d58cd4781f5a479bc41079c064f974cbb253874" +version = "0.27.2" +source = "git+https://github.com/rib/winit?branch=android-activity#b3ba646fc8b5e1ddcbf8f95f905f0fe809e49a2a" dependencies = [ "android-activity", "bitflags 1.3.2", - "cfg_aliases", + "cocoa", "core-foundation 0.9.3", "core-graphics", "dispatch", @@ -4564,21 +5034,19 @@ dependencies = [ "log", "mio 0.8.6", "ndk", - "objc2", + "objc", "once_cell", - "orbclient", + "parking_lot 0.12.1", "percent-encoding", - "raw-window-handle", - "redox_syscall 0.3.5", + "raw-window-handle 0.4.3", + "raw-window-handle 0.5.2", "sctk-adwaita", "smithay-client-toolkit", "wasm-bindgen", "wayland-client", - "wayland-commons", "wayland-protocols", - "wayland-scanner", "web-sys", - "windows-sys 0.45.0", + "windows-sys 0.36.1", "x11-dl", ] @@ -4591,6 +5059,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -4675,7 +5152,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2 1.0.56", "quote 1.0.26", - "syn 2.0.13", + "syn 2.0.14", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0e25f11..839624c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,14 +13,14 @@ build = "src/build/build.rs" [dependencies] log = "0.4" #android-activity = { version = "0.4", features = ["game-activity"] } -grin_api = "5.1.2" -grin_chain = "5.1.2" +#grin_api = "5.1.2" +#grin_chain = "5.1.2" grin_config = "5.1.2" grin_core = "5.1.2" -grin_keychain = "5.1.2" -grin_p2p = "5.1.2" +#grin_keychain = "5.1.2" +#grin_p2p = "5.1.2" grin_servers = "5.1.2" -grin_store = "5.1.2" +#grin_store = "5.1.2" grin_util = "5.1.2" openssl-sys = { version = "0.9.82", features = ["vendored"] } #grin_wallet_api = "5.1.0" @@ -29,31 +29,30 @@ openssl-sys = { version = "0.9.82", features = ["vendored"] } #grin_wallet_config = "5.1.0" #grin_wallet_util = "5.1.0" -egui = "0.21.0" -egui-winit = { version = "0.21.1", features = ['default', 'bytemuck', 'android-game-activity'] } -wgpu = "0.15.1" -egui_wgpu_backend = "0.22.0" -epi = "0.17.0" -egui_winit_platform = "0.18.0" +egui = "0.20.1" pollster = "0.3.0" -egui_demo_lib = "0.21.0" +tracing-subscriber = "0.3" +egui_demo_lib = "0.20.0" + +eframe = { version = "0.20.1", features = [ "wgpu" ] } ## grin_servers futures = "0.3" [patch.crates-io] -egui-winit = { path = '../egui/crates/egui-winit' } +winit = { git = "https://github.com/rib/winit", branch = "android-activity" } [build-dependencies] built = { version = "0.6.0", features = ["git2"]} [target.'cfg(not(target_os = "android"))'.dependencies] env_logger = "0.10.0" -winit = { version = "0.28.3" } +winit = { version = "0.27.2" } [target.'cfg(target_os = "android")'.dependencies] android_logger = "0.13.1" -winit = { version = "0.28.3", features = [ "android-game-activity" ] } +jni = "0.21.1" +winit = { version = "0.27.2", features = [ "android-game-activity" ] } [lib] name="grin_android" diff --git a/app/src/main/java/mw/gri/android/MainActivity.java b/app/src/main/java/mw/gri/android/MainActivity.java index 6356711..da6ccb0 100644 --- a/app/src/main/java/mw/gri/android/MainActivity.java +++ b/app/src/main/java/mw/gri/android/MainActivity.java @@ -22,7 +22,10 @@ public class MainActivity extends GameActivity { super.onCreate(savedInstanceState); int navBarHeight = Utils.getNavigationBarHeight(getApplicationContext()); -// int statusBarHeight = Utils.getStatusBarHeight(getApplicationContext()); findViewById(android.R.id.content).setPadding(0, 0, 0, navBarHeight); } + + public Integer getStatusBarHeight() { + return Utils.getStatusBarHeight(getApplicationContext()); + } } \ No newline at end of file diff --git a/src/grim.rs b/src/grim.rs index 8d04709..893debb 100644 --- a/src/grim.rs +++ b/src/grim.rs @@ -17,7 +17,8 @@ use log::LevelFilter::{Debug, Info, Trace, Warn}; #[cfg(target_os = "android")] use winit::platform::android::activity::AndroidApp; -use crate::gui::renderer::Event; +use eframe::{AppCreator, CreationContext, NativeOptions, Renderer}; +use crate::gui::{MainApp}; #[allow(dead_code)] #[cfg(target_os = "android")] @@ -32,10 +33,15 @@ fn android_main(app: AndroidApp) { } use winit::platform::android::EventLoopBuilderExtAndroid; - let event_loop = winit::event_loop::EventLoopBuilder::::with_user_event() - .with_android_app(app) - .build(); - crate::gui::start(event_loop); + let mut options = NativeOptions::default(); + options.event_loop_builder = Some(Box::new(move |builder| { + builder.with_android_app(app); + })); + + use crate::gui::AndroidUi; + start(options, Box::new(|_cc| Box::new(MainApp::new(_cc) + .with_status_bar_height(24.0) + ))); } #[allow(dead_code)] @@ -47,8 +53,13 @@ fn main() { .parse_default_env() .init(); - let event_loop = winit::event_loop::EventLoopBuilder::::with_user_event().build(); - crate::gui::start(event_loop); + let options = NativeOptions::default(); + start(options, Box::new(|_cc| Box::new(MainApp::new(_cc)))); +} + +fn start(mut options: NativeOptions, app_creator: AppCreator) { + options.renderer = Renderer::Wgpu; + eframe::run_native("Grim", options, app_creator); } mod built_info { diff --git a/src/gui/app.rs b/src/gui/app.rs new file mode 100644 index 0000000..c6cd797 --- /dev/null +++ b/src/gui/app.rs @@ -0,0 +1,66 @@ +// Copyright 2023 The Grim Developers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use egui::FontTweak; + +#[derive(Default)] +pub struct MainApp { + root: egui_demo_lib::DemoWindows, + status_bar_height: Option +} + +impl MainApp { + pub fn new(cc: &eframe::CreationContext<'_>) -> Self { + setup_fonts(&cc.egui_ctx); + Self::default() + } +} + +#[cfg(target_os = "android")] +impl crate::gui::AndroidUi for MainApp { + fn with_status_bar_height(mut self, value: f32) -> Self { + self.status_bar_height = Some(value); + self + } +} + +impl eframe::App for MainApp { + fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + egui::TopBottomPanel::top("top_padding_panel") + .resizable(false) + .exact_height(self.status_bar_height.unwrap_or(0.0)) + .show(ctx, |ui| {}); + self.root.ui(ctx); + } +} + +fn setup_fonts(ctx: &egui::Context) { + let mut fonts = egui::FontDefinitions::default(); + fonts.font_data.insert( + "jura".to_owned(), + egui::FontData::from_static(include_bytes!( + "../../fonts/jura.ttf" + )).tweak(FontTweak { + scale: 1.0, + y_offset_factor: -0.25, + y_offset: 0.0 + }), + ); + fonts + .families + .entry(egui::FontFamily::Proportional) + .or_default() + .insert(0, "jura".to_owned()); + ctx.set_fonts(fonts); +} \ No newline at end of file diff --git a/src/gui/mod.rs b/src/gui/mod.rs index e19a1b6..c0f877b 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -12,6 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -pub mod renderer; +mod app; +pub mod root; -pub use self::renderer::start; +pub use app::MainApp; + +#[cfg(target_os = "android")] +pub trait AndroidUi { + fn with_status_bar_height(self, value: f32) -> Self; +} \ No newline at end of file diff --git a/src/gui/renderer.rs b/src/gui/renderer.rs deleted file mode 100644 index 304da70..0000000 --- a/src/gui/renderer.rs +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright 2023 The Grin Developers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use std::iter; -use std::time::Instant; -use egui::FontDefinitions; -use egui_wgpu_backend::{RenderPass, ScreenDescriptor}; -use egui_winit_platform::{Platform, PlatformDescriptor}; -use log::{debug, error, trace, warn}; -use wgpu::{CompositeAlphaMode, InstanceDescriptor}; -use winit::event::Event::*; -use winit::event::StartCause; -use winit::event_loop::EventLoop; -use winit::event_loop::ControlFlow; -use winit::platform::run_return::EventLoopExtRunReturn; - -#[derive(Debug, Clone, Copy)] -pub enum Event { - RequestRedraw, -} - -pub fn start(mut event_loop: EventLoop) { - let window = winit::window::WindowBuilder::new() - .with_transparent(false) - .with_title("Grim") - .build(&event_loop) - .unwrap_or_else(|e| { - panic!( - "Failed to init window at {} line {} with error\n{:?}", - file!(), - line!(), - e - ) - }); - - let instance_descriptor = InstanceDescriptor::default(); - - let mut instance = wgpu::Instance::new(instance_descriptor); - - let mut size = window.inner_size(); - let outer_size = window.outer_size(); - - warn!("outer_size = {:?}", outer_size); - warn!("size = {:?}", size); - - let mut platform = Platform::new(PlatformDescriptor { - physical_width: size.width as u32, - physical_height: size.height as u32, - scale_factor: window.scale_factor(), - font_definitions: FontDefinitions::default(), - style: Default::default(), - }); - - #[cfg(target_os = "android")] - let mut platform = { - event_loop.run_return(|main_event, tgt, control_flow| { - control_flow.set_poll(); - warn!( - "Got event: {:?} at {} line {}", - &main_event, - file!(), - line!() - ); - match main_event { - NewEvents(e) => match e { - StartCause::ResumeTimeReached { .. } => {} - StartCause::WaitCancelled { .. } => {} - StartCause::Poll => {} - StartCause::Init => {} - }, - WindowEvent { - window_id, - ref event, - } => { - if let winit::event::WindowEvent::Resized(r) = event { - size = *r; - } - } - DeviceEvent { .. } => {} - UserEvent(_) => {} - Suspended => { - control_flow.set_poll(); - } - Resumed => { - if let Some(primary_mon) = tgt.primary_monitor() { - size = primary_mon.size(); - window.set_inner_size(size); - warn!( - "Set to new size: {:?} at {} line {}", - &size, - file!(), - line!() - ); - } else if let Some(other_mon) = tgt.available_monitors().next() { - size = other_mon.size(); - window.set_inner_size(size); - warn!( - "Set to new size: {:?} at {} line {}", - &size, - file!(), - line!() - ); - } - control_flow.set_exit(); - } - MainEventsCleared => {} - RedrawRequested(rdr) => {} - RedrawEventsCleared => {} - LoopDestroyed => {} - }; - platform.handle_event(&main_event); - }); - - Platform::new(PlatformDescriptor { - physical_width: size.width as u32, - physical_height: size.height as u32, - scale_factor: window.scale_factor(), - font_definitions: FontDefinitions::default(), - style: Default::default(), - }) - }; - - - warn!("WGPU new surface at {} line {}", file!(), line!()); - let mut surface = unsafe { instance.create_surface(&window).unwrap_or_else(|e| { - panic!( - "Failed to create surface at {} line {} with error\n{:?}", - file!(), - line!(), - e - ) - }) }; - - warn!("instance request_adapter at {} line {}", file!(), line!()); - // WGPU 0.11+ support force fallback (if HW implementation not supported), set it to true or false (optional). - let adapter = pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions { - power_preference: wgpu::PowerPreference::HighPerformance, - compatible_surface: Some(&surface), - force_fallback_adapter: false, - })) - .unwrap_or_else(|| panic!("Failed get adapter at {} line {}", file!(), line!())); - - warn!("adapter request_device at {} line {}", file!(), line!()); - let (device, queue) = pollster::block_on(adapter.request_device( - &wgpu::DeviceDescriptor { - features: wgpu::Features::default(), - limits: wgpu::Limits::downlevel_defaults(), - label: None, - }, - None, - )) - .unwrap_or_else(|e| { - panic!( - "Failed to request device at {} line {} with error\n{:?}", - file!(), - line!(), - e - ) - }); - - let surface_capabilities = surface.get_capabilities(&adapter); - let surface_format = surface_capabilities.formats[0]; - let mut surface_config = wgpu::SurfaceConfiguration { - usage: wgpu::TextureUsages::RENDER_ATTACHMENT, - format: surface_format, - width: size.width as u32, - height: size.height as u32, - present_mode: wgpu::PresentMode::AutoNoVsync, - alpha_mode: CompositeAlphaMode::Auto, - view_formats: vec![surface_format], - }; - - warn!("surface configure at {} line {}", file!(), line!()); - surface.configure(&device, &surface_config); - - warn!("RenderPass new at {} line {}", file!(), line!()); - let mut egui_rpass = RenderPass::new(&device, surface_format, 1); - - warn!("DemoWindows default at {} line {}", file!(), line!()); - // Display the demo application that ships with egui. - let mut demo_app = egui_demo_lib::DemoWindows::default(); - - let start_time = Instant::now(); - - let mut in_bad_state = false; - - warn!("Enter the loop"); - event_loop.run(move |event, _, control_flow| { - // Pass the winit events to the platform integration. - debug!("Got event: {:?} at {} line {}", &event, file!(), line!()); - platform.handle_event(&event); - match event { - RedrawRequested(..) => { - platform.update_time(start_time.elapsed().as_secs_f64()); - - let output_frame = match surface.get_current_texture() { - Ok(frame) => frame, - Err(wgpu::SurfaceError::Outdated) => { - // This error occurs when the app is minimized on Windows. - // Silently return here to prevent spamming the console with: - error!("The underlying surface has changed, and therefore the swap chain must be updated"); - in_bad_state = true; - return; - } - Err(wgpu::SurfaceError::Lost) => { - // This error occurs when the app is minimized on Windows. - // Silently return here to prevent spamming the console with: - error!("LOST surface, drop frame. Originally: \"The swap chain has been lost and needs to be recreated\""); - in_bad_state = true; - return; - } - Err(e) => { - error!("Dropped frame with error: {}", e); - return; - } - }; - let output_view = output_frame - .texture - .create_view(&wgpu::TextureViewDescriptor::default()); - - // Begin to draw the UI frame. - platform.begin_frame(); - - // Draw the demo application. - demo_app.ui(&platform.context()); - - // End the UI frame. We could now handle the output and draw the UI with the backend. - let full_output = platform.end_frame(Some(&window)); - let paint_jobs = platform.context().tessellate(full_output.shapes); - - let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor { - label: Some("encoder"), - }); - - // Upload all resources for the GPU. - let screen_descriptor = ScreenDescriptor { - physical_width: surface_config.width, - physical_height: surface_config.height, - scale_factor: window.scale_factor() as f32 - }; - let tdelta: egui::TexturesDelta = full_output.textures_delta; - egui_rpass - .add_textures(&device, &queue, &tdelta) - .expect("add texture ok"); - egui_rpass.update_buffers(&device, &queue, &paint_jobs, &screen_descriptor); - - // Record all render passes. - egui_rpass - .execute( - &mut encoder, - &output_view, - &paint_jobs, - &screen_descriptor, - Some(wgpu::Color::BLACK), - ) - .unwrap_or_else(|e| panic!("Failed to render pass at {} line {} with error\n{:?}", file!(), line!(), e)); - // Submit the commands. - queue.submit(iter::once(encoder.finish())); - - // Redraw egui - output_frame.present(); - - egui_rpass - .remove_textures(tdelta) - .expect("remove texture ok"); - - // Support reactive on windows only, but not on linux. - // if _output.needs_repaint { - // *control_flow = ControlFlow::Poll; - // } else { - // *control_flow = ControlFlow::Wait; - // } - } - MainEventsCleared | UserEvent(Event::RequestRedraw) => { - window.request_redraw(); - } - WindowEvent { event, .. } => match event { - winit::event::WindowEvent::Resized(size) => { - // Resize with 0 width and height is used by winit to signal a minimize event on Windows. - // See: https://github.com/rust-windowing/winit/issues/208 - // This solves an issue where the app would panic when minimizing on Windows. - if size.width > 0 && size.height > 0 { - surface_config.width = size.width; - surface_config.height = size.height; - surface.configure(&device, &surface_config); - } - } - winit::event::WindowEvent::CloseRequested => { - *control_flow = ControlFlow::Exit; - } - winit::event::WindowEvent::Focused(focused) => { - in_bad_state |= !focused; - }, - _ => {} - }, - Resumed => { - if in_bad_state { - //https://github.com/gfx-rs/wgpu/issues/2302 - warn!("WGPU new surface at {} line {}", file!(), line!()); - surface = unsafe { instance.create_surface(&window).unwrap_or_else(|e| { - panic!( - "Failed to create surface at {} line {} with error\n{:?}", - file!(), - line!(), - e - ) - }) }; - warn!("surface configure at {} line {}", file!(), line!()); - surface.configure(&device, &surface_config); - in_bad_state = false; - } - }, - Suspended => (), - _ => (), - } - }); -} \ No newline at end of file diff --git a/src/gui/root.rs b/src/gui/root.rs new file mode 100644 index 0000000..e69de29