diff --git a/imgui-examples/Cargo.lock b/imgui-examples/Cargo.lock index 2f9500e..1982fb9 100644 --- a/imgui-examples/Cargo.lock +++ b/imgui-examples/Cargo.lock @@ -1,5 +1,11 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2692800d602527d2b8fea50036119c37df74ab565b10e285706a3dcec0ec3e16" + [[package]] name = "addr2line" version = "0.13.0" @@ -28,13 +34,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" dependencies = [ "bitflags", - "line_drawing", + "line_drawing 0.7.0", "rusttype 0.7.9", "walkdir", "xdg", "xml-rs", ] +[[package]] +name = "andrew" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1ea80a5089cac999ffd4a91888154076a961d27387b0f7a6cd2d4dddb636b9" +dependencies = [ + "bitflags", + "line_drawing 0.8.0", + "rusttype 0.9.2", + "walkdir", + "xdg", + "xml-rs", +] + [[package]] name = "android_glue" version = "0.2.3" @@ -53,7 +73,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" dependencies = [ - "num-traits", + "num-traits 0.2.12", ] [[package]] @@ -108,7 +128,17 @@ checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" dependencies = [ "mio", "mio-extras", - "nix", + "nix 0.14.1", +] + +[[package]] +name = "calloop" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59561a8b3968ba4bda0c46f42e0568507c5d26e94c3b6f2a0c730cbecd83ff3a" +dependencies = [ + "log", + "nix 0.18.0", ] [[package]] @@ -180,8 +210,39 @@ checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" dependencies = [ "bitflags", "block", - "core-foundation", - "core-graphics", + "core-foundation 0.7.0", + "core-graphics 0.19.2", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c54201c07dcf3a5ca33fececb8042aed767ee4bfd5a0235a8ceabcda956044b2" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation 0.9.1", + "core-graphics 0.22.1", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation 0.9.1", + "core-graphics-types", "foreign-types", "libc", "objc", @@ -199,7 +260,17 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.7.0", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +dependencies = [ + "core-foundation-sys 0.8.1", "libc", ] @@ -209,6 +280,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +[[package]] +name = "core-foundation-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0af3b5e4601de3837c9332e29e0aae47a0d46ebfa246d12b82f564bac233393" + [[package]] name = "core-graphics" version = "0.19.2" @@ -216,7 +293,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.7.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc239bba52bab96649441699533a68de294a101533b0270b2d65aa402b29a7f9" +dependencies = [ + "bitflags", + "core-foundation 0.9.1", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation 0.9.1", "foreign-types", "libc", ] @@ -228,8 +330,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" dependencies = [ "cfg-if", - "core-foundation-sys", - "core-graphics", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", "libc", "objc", ] @@ -290,6 +392,41 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.21", + "quote 1.0.7", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote 1.0.7", + "syn", +] + [[package]] name = "deflate" version = "0.8.6" @@ -426,9 +563,9 @@ checksum = "9a9666c8fd9afd008f6559e2468c35e11aad1d110d525bb3b354e4138ec0e20f" dependencies = [ "android_glue", "cgl", - "cocoa", - "core-foundation", - "core-graphics", + "cocoa 0.20.2", + "core-foundation 0.7.0", + "core-graphics 0.19.2", "glutin_egl_sys", "glutin_emscripten_sys", "glutin_gles2_sys", @@ -440,9 +577,9 @@ dependencies = [ "objc", "osmesa-sys", "parking_lot 0.10.2", - "wayland-client", + "wayland-client 0.23.6", "winapi 0.3.9", - "winit", + "winit 0.22.2", ] [[package]] @@ -499,6 +636,12 @@ dependencies = [ "libc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "image" version = "0.23.9" @@ -511,7 +654,7 @@ dependencies = [ "jpeg-decoder", "num-iter", "num-rational", - "num-traits", + "num-traits 0.2.12", "png", "scoped_threadpool", "tiff", @@ -557,10 +700,10 @@ dependencies = [ [[package]] name = "imgui-winit-support" -version = "0.5.0" +version = "0.6.0" dependencies = [ "imgui", - "winit", + "winit 0.23.0", ] [[package]] @@ -657,7 +800,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" dependencies = [ - "num-traits", + "num-traits 0.2.12", +] + +[[package]] +name = "line_drawing" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81902e542483002b103c6424d23e765c2e5a65f732923299053a601bce50ab2" +dependencies = [ + "num-traits 0.1.43", ] [[package]] @@ -708,6 +860,12 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + [[package]] name = "memmap" version = "0.7.0" @@ -796,10 +954,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" dependencies = [ "jni-sys", - "ndk-sys", + "ndk-sys 0.1.0", "num_enum", ] +[[package]] +name = "ndk" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94dc511dd67c2cf232264be20fb98ad0ea93666727d3f6f75429d53e696d6366" +dependencies = [ + "jni-sys", + "ndk-sys 0.2.0", + "num_enum", + "thiserror", +] + [[package]] name = "ndk-glue" version = "0.1.0" @@ -810,8 +980,35 @@ dependencies = [ "lazy_static", "libc", "log", - "ndk", - "ndk-sys", + "ndk 0.1.0", + "ndk-sys 0.1.0", +] + +[[package]] +name = "ndk-glue" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6c938c36cd15ea13d0972fdceb3a03982d49967e5fd7508cf129c5300b66cc" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.2.0", + "ndk-macro", + "ndk-sys 0.2.0", +] + +[[package]] +name = "ndk-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2 1.0.21", + "quote 1.0.7", + "syn", ] [[package]] @@ -820,6 +1017,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" +[[package]] +name = "ndk-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de01535c8fca086732bb66c9bc7779d336c44088d42782cd11d5f2a7ace52f7e" + [[package]] name = "net2" version = "0.2.35" @@ -844,6 +1047,28 @@ dependencies = [ "void", ] +[[package]] +name = "nix" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", +] + +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "memchr", + "version_check", +] + [[package]] name = "num-integer" version = "0.1.43" @@ -851,7 +1076,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ "autocfg", - "num-traits", + "num-traits 0.2.12", ] [[package]] @@ -862,7 +1087,7 @@ checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" dependencies = [ "autocfg", "num-integer", - "num-traits", + "num-traits 0.2.12", ] [[package]] @@ -873,7 +1098,16 @@ checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138" dependencies = [ "autocfg", "num-integer", - "num-traits", + "num-traits 0.2.12", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.12", ] [[package]] @@ -952,13 +1186,19 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +[[package]] +name = "once_cell" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" + [[package]] name = "ordered-float" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" dependencies = [ - "num-traits", + "num-traits 0.2.12", ] [[package]] @@ -970,6 +1210,15 @@ dependencies = [ "shared_library", ] +[[package]] +name = "owned_ttf_parser" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" +dependencies = [ + "ttf-parser", +] + [[package]] name = "parking_lot" version = "0.10.2" @@ -1155,6 +1404,16 @@ dependencies = [ "stb_truetype", ] +[[package]] +name = "rusttype" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + [[package]] name = "same-file" version = "1.0.6" @@ -1164,6 +1423,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + [[package]] name = "scoped_threadpool" version = "0.1.9" @@ -1210,14 +1475,34 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" dependencies = [ - "andrew", + "andrew 0.2.1", "bitflags", "dlib", "lazy_static", "memmap", - "nix", - "wayland-client", - "wayland-protocols", + "nix 0.14.1", + "wayland-client 0.23.6", + "wayland-protocols 0.23.6", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ec5c077def8af49f9b5aeeb5fcf8079c638c6615c3a8f9305e2dea601de57f7" +dependencies = [ + "andrew 0.3.0", + "bitflags", + "byteorder", + "calloop 0.6.4", + "dlib", + "lazy_static", + "log", + "memmap", + "nix 0.18.0", + "wayland-client 0.28.0", + "wayland-cursor", + "wayland-protocols 0.28.0", ] [[package]] @@ -1229,6 +1514,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "syn" version = "1.0.41" @@ -1246,6 +1537,26 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36ae8932fcfea38b7d3883ae2ab357b0d57a02caaa18ebb4f5ece08beaec4aa0" +[[package]] +name = "thiserror" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +dependencies = [ + "proc-macro2 1.0.21", + "quote 1.0.7", + "syn", +] + [[package]] name = "tiff" version = "0.5.0" @@ -1266,6 +1577,12 @@ dependencies = [ "serde", ] +[[package]] +name = "ttf-parser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -1278,6 +1595,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + [[package]] name = "void" version = "1.0.2" @@ -1302,14 +1625,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" dependencies = [ "bitflags", - "calloop", + "calloop 0.4.4", "downcast-rs", "libc", "mio", - "nix", - "wayland-commons", - "wayland-scanner", - "wayland-sys", + "nix 0.14.1", + "wayland-commons 0.23.6", + "wayland-scanner 0.23.6", + "wayland-sys 0.23.6", +] + +[[package]] +name = "wayland-client" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5147ab4114fa29cbfbd3718c933d8a4487035ff589e2650f29135fc2bc165646" +dependencies = [ + "bitflags", + "downcast-rs", + "libc", + "nix 0.18.0", + "scoped-tls", + "wayland-commons 0.28.0", + "wayland-scanner 0.28.0", + "wayland-sys 0.28.0", ] [[package]] @@ -1318,8 +1657,31 @@ version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" dependencies = [ - "nix", - "wayland-sys", + "nix 0.14.1", + "wayland-sys 0.23.6", +] + +[[package]] +name = "wayland-commons" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01868f14a3f272e6cea0e0f573dd0e3a263552ae99dc5ef9016bd0fbf35f9c2d" +dependencies = [ + "nix 0.18.0", + "once_cell", + "smallvec", + "wayland-sys 0.28.0", +] + +[[package]] +name = "wayland-cursor" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1380ceb13377afd20b1ef0045334e6a58cc8f1a80cda285b482a21556924d38" +dependencies = [ + "nix 0.18.0", + "wayland-client 0.28.0", + "xcursor", ] [[package]] @@ -1329,9 +1691,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" dependencies = [ "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", + "wayland-client 0.23.6", + "wayland-commons 0.23.6", + "wayland-scanner 0.23.6", +] + +[[package]] +name = "wayland-protocols" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d5c56e9eea77f3808cfb3c9e676056542eea4a33a7b0b6075f9bc24fb15f779" +dependencies = [ + "bitflags", + "wayland-client 0.28.0", + "wayland-commons 0.28.0", + "wayland-scanner 0.28.0", ] [[package]] @@ -1345,6 +1719,17 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "wayland-scanner" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525547bf3c058b8736236037aa510a80b2a29b88145ff02a987cc27f8f92f83c" +dependencies = [ + "proc-macro2 1.0.21", + "quote 1.0.7", + "xml-rs", +] + [[package]] name = "wayland-sys" version = "0.23.6" @@ -1355,6 +1740,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "wayland-sys" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dc1723584b6d204bbc3d15e361ee6a20d863ba8d4237842284eb3ff4f1b9a4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + [[package]] name = "winapi" version = "0.2.8" @@ -1405,9 +1801,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" dependencies = [ "bitflags", - "cocoa", - "core-foundation", - "core-graphics", + "cocoa 0.20.2", + "core-foundation 0.7.0", + "core-graphics 0.19.2", "core-video-sys", "dispatch", "instant", @@ -1416,15 +1812,45 @@ dependencies = [ "log", "mio", "mio-extras", - "ndk", - "ndk-glue", - "ndk-sys", + "ndk 0.1.0", + "ndk-glue 0.1.0", + "ndk-sys 0.1.0", "objc", "parking_lot 0.10.2", "percent-encoding", "raw-window-handle", - "smithay-client-toolkit", - "wayland-client", + "smithay-client-toolkit 0.6.6", + "wayland-client 0.23.6", + "winapi 0.3.9", + "x11-dl", +] + +[[package]] +name = "winit" +version = "0.23.0" +source = "git+https://github.com/kchibisov/winit?branch=bump-winit-0.23#da461e01617e6147eb276068cd0542d9cddef253" +dependencies = [ + "bitflags", + "cocoa 0.23.0", + "core-foundation 0.9.1", + "core-graphics 0.22.1", + "core-video-sys", + "dispatch", + "instant", + "lazy_static", + "libc", + "log", + "mio", + "mio-extras", + "ndk 0.2.0", + "ndk-glue 0.2.0", + "ndk-sys 0.2.0", + "objc", + "parking_lot 0.11.0", + "percent-encoding", + "raw-window-handle", + "smithay-client-toolkit 0.12.0", + "wayland-client 0.28.0", "winapi 0.3.9", "x11-dl", ] @@ -1470,6 +1896,15 @@ dependencies = [ "log", ] +[[package]] +name = "xcursor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a481cfdefd35e1c50073ae33a8000d695c98039544659f5dc5dd71311b0d01" +dependencies = [ + "nom", +] + [[package]] name = "xdg" version = "2.2.0" diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 2e945dc..091e1db 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imgui-winit-support" -version = "0.5.0" +version = "0.6.0" edition = "2018" authors = ["Joonas Javanainen ", "imgui-rs contributors"] description = "winit support code for the imgui crate" @@ -14,6 +14,7 @@ imgui = { version = "0.5.0", path = "../" } winit-19 = { version = ">= 0.16, <= 0.19", package = "winit", optional = true } winit-20 = { version = ">= 0.20, <= 0.21", package = "winit", optional = true } winit-22 = { version = "0.22", package = "winit", optional = true } +winit-23 = { git = "https://github.com/kchibisov/winit", branch = "bump-winit-0.23", package = "winit", optional = true } [features] -default = ["winit-22"] +default = ["winit-23"] diff --git a/imgui-winit-support/src/lib.rs b/imgui-winit-support/src/lib.rs index 52b9469..425a59d 100644 --- a/imgui-winit-support/src/lib.rs +++ b/imgui-winit-support/src/lib.rs @@ -80,6 +80,9 @@ use winit_20 as winit; #[cfg(feature = "winit-22")] use winit_22 as winit; +#[cfg(feature = "winit-23")] +use winit_23 as winit; + use imgui::{self, BackendFlags, ConfigFlags, Context, ImString, Io, Key, Ui}; use std::cmp::Ordering; use winit::dpi::{LogicalPosition, LogicalSize}; @@ -90,7 +93,7 @@ use winit::{ TouchPhase, VirtualKeyCode, Window, WindowEvent, }; -#[cfg(any(feature = "winit-20", feature = "winit-22"))] +#[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] use winit::{ error::ExternalError, event::{ @@ -139,7 +142,7 @@ impl CursorSettings { _ => window.hide_cursor(true), } } - #[cfg(any(feature = "winit-20", feature = "winit-22"))] + #[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] fn apply(&self, window: &Window) { match self.cursor { Some(mouse_cursor) if !self.draw_cursor => { @@ -258,7 +261,7 @@ impl WinitPlatform { /// /// * framebuffer scale (= DPI factor) is set /// * display size is set - #[cfg(any(feature = "winit-20", feature = "winit-22"))] + #[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] pub fn attach_window(&mut self, io: &mut Io, window: &Window, hidpi_mode: HiDpiMode) { let (hidpi_mode, hidpi_factor) = hidpi_mode.apply(window.scale_factor()); self.hidpi_mode = hidpi_mode; @@ -291,7 +294,7 @@ impl WinitPlatform { /// /// This utility function is useful if you are using a DPI mode other than default, and want /// your application to use the same logical coordinates as imgui-rs. - #[cfg(any(feature = "winit-20", feature = "winit-22"))] + #[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] pub fn scale_size_from_winit( &self, window: &Window, @@ -325,7 +328,7 @@ impl WinitPlatform { /// /// This utility function is useful if you are using a DPI mode other than default, and want /// your application to use the same logical coordinates as imgui-rs. - #[cfg(any(feature = "winit-20", feature = "winit-22"))] + #[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] pub fn scale_pos_from_winit( &self, window: &Window, @@ -359,7 +362,7 @@ impl WinitPlatform { /// /// This utility function is useful if you are using a DPI mode other than default, and want /// your application to use the same logical coordinates as imgui-rs. - #[cfg(any(feature = "winit-20", feature = "winit-22"))] + #[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] pub fn scale_pos_for_winit( &self, window: &Window, @@ -463,7 +466,7 @@ impl WinitPlatform { /// * window size / dpi factor changes are applied /// * keyboard state is updated /// * mouse state is updated - #[cfg(any(feature = "winit-22"))] + #[cfg(any(feature = "winit-22", feature = "winit-23"))] pub fn handle_event(&mut self, io: &mut Io, window: &Window, event: &Event) { match *event { Event::WindowEvent { @@ -684,6 +687,107 @@ impl WinitPlatform { _ => (), } } + #[cfg(feature = "winit-23")] + fn handle_window_event(&mut self, io: &mut Io, window: &Window, event: &WindowEvent) { + match *event { + WindowEvent::Resized(physical_size) => { + let logical_size = physical_size.to_logical(window.scale_factor()); + let logical_size = self.scale_size_from_winit(window, logical_size); + io.display_size = [logical_size.width as f32, logical_size.height as f32]; + } + WindowEvent::ScaleFactorChanged { scale_factor, .. } => { + let hidpi_factor = match self.hidpi_mode { + ActiveHiDpiMode::Default => scale_factor, + ActiveHiDpiMode::Rounded => scale_factor.round(), + _ => return, + }; + // Mouse position needs to be changed while we still have both the old and the new + // values + if io.mouse_pos[0].is_finite() && io.mouse_pos[1].is_finite() { + io.mouse_pos = [ + io.mouse_pos[0] * (hidpi_factor / self.hidpi_factor) as f32, + io.mouse_pos[1] * (hidpi_factor / self.hidpi_factor) as f32, + ]; + } + self.hidpi_factor = hidpi_factor; + io.display_framebuffer_scale = [hidpi_factor as f32, hidpi_factor as f32]; + // Window size might change too if we are using DPI rounding + let logical_size = window.inner_size().to_logical(scale_factor); + let logical_size = self.scale_size_from_winit(window, logical_size); + io.display_size = [logical_size.width as f32, logical_size.height as f32]; + } + WindowEvent::KeyboardInput { + input: + KeyboardInput { + virtual_keycode: Some(key), + state, + .. + }, + .. + } => { + let pressed = state == ElementState::Pressed; + io.keys_down[key as usize] = pressed; + + // This is a bit redundant here, but we'll leave it in. The OS occasionally + // fails to send modifiers keys, but it doesn't seem to send false-positives, + // so double checking isn't terrible in case some system *doesn't* send + // device events sometimes. + match key { + VirtualKeyCode::LShift | VirtualKeyCode::RShift => io.key_shift = pressed, + VirtualKeyCode::LControl | VirtualKeyCode::RControl => io.key_ctrl = pressed, + VirtualKeyCode::LAlt | VirtualKeyCode::RAlt => io.key_alt = pressed, + VirtualKeyCode::LWin | VirtualKeyCode::RWin => io.key_super = pressed, + _ => (), + } + } + WindowEvent::ReceivedCharacter(ch) => { + // Exclude the backspace key ('\u{7f}'). Otherwise we will insert this char and then + // delete it. + if ch != '\u{7f}' { + io.add_input_character(ch) + } + } + WindowEvent::CursorMoved { position, .. } => { + let position = position.to_logical(window.scale_factor()); + let position = self.scale_pos_from_winit(window, position); + io.mouse_pos = [position.x as f32, position.y as f32]; + } + WindowEvent::MouseWheel { + delta, + phase: TouchPhase::Moved, + .. + } => match delta { + MouseScrollDelta::LineDelta(h, v) => { + io.mouse_wheel_h = h; + io.mouse_wheel = v; + } + MouseScrollDelta::PixelDelta(pos) => { + let pos = pos.to_logical::(self.hidpi_factor); + match pos.x.partial_cmp(&0.0) { + Some(Ordering::Greater) => io.mouse_wheel_h += 1.0, + Some(Ordering::Less) => io.mouse_wheel_h -= 1.0, + _ => (), + } + match pos.y.partial_cmp(&0.0) { + Some(Ordering::Greater) => io.mouse_wheel += 1.0, + Some(Ordering::Less) => io.mouse_wheel -= 1.0, + _ => (), + } + } + }, + WindowEvent::MouseInput { state, button, .. } => { + let pressed = state == ElementState::Pressed; + match button { + MouseButton::Left => io.mouse_down[0] = pressed, + MouseButton::Right => io.mouse_down[1] = pressed, + MouseButton::Middle => io.mouse_down[2] = pressed, + MouseButton::Other(idx @ 0..=4) => io.mouse_down[idx as usize] = pressed, + _ => (), + } + } + _ => (), + } + } /// Frame preparation callback. /// /// Call this before calling the imgui-rs context `frame` function. @@ -708,7 +812,7 @@ impl WinitPlatform { /// This function performs the following actions: /// /// * mouse cursor is repositioned (if requested by imgui-rs) - #[cfg(any(feature = "winit-20", feature = "winit-22"))] + #[cfg(any(feature = "winit-20", feature = "winit-22", feature = "winit-23"))] pub fn prepare_frame(&self, io: &mut Io, window: &Window) -> Result<(), ExternalError> { if io.want_set_mouse_pos { let logical_pos = self.scale_pos_for_winit(