From a6ba02aa36a81ed1ef492e62ad671351b70b9a58 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:37:15 -0400 Subject: [PATCH 1/7] Initial winit 0.23 support --- imgui-examples/Cargo.lock | 529 ++++++++++++++++++++++++++++++--- imgui-winit-support/Cargo.toml | 5 +- imgui-winit-support/src/lib.rs | 120 +++++++- 3 files changed, 597 insertions(+), 57 deletions(-) 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( From b32917f68cf5b802dd0fba07b362ed31a59c2753 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Fri, 2 Oct 2020 12:41:41 -0400 Subject: [PATCH 2/7] Switch to published crates.io version of winit 0.23 --- imgui-winit-support/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 091e1db..dbff667 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -14,7 +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 } +winit-23 = { version = "0.23", package = "winit", optional = true } [features] default = ["winit-23"] From 13c5cc0606955c685cdeff3c44884248c8aad4da Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Fri, 2 Oct 2020 23:29:13 -0400 Subject: [PATCH 3/7] Switch to crates.io version of imgui for imgui-winit-support --- imgui-winit-support/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index dbff667..f6cacd3 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -10,7 +10,7 @@ license = "MIT/Apache-2.0" categories = ["gui"] [dependencies] -imgui = { version = "0.5.0", path = "../" } +imgui = "0.5.0" 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 } From 4b22569aacd39097c66a41ccef240bb86ebe06e1 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Mon, 5 Oct 2020 12:15:15 -0400 Subject: [PATCH 4/7] Fix some of imgui-glium-renderer --- imgui-examples/Cargo.lock | 483 +++++-------------------- imgui-examples/Cargo.toml | 2 +- imgui-examples/examples/support/mod.rs | 4 +- imgui-glium-renderer/Cargo.toml | 2 +- imgui-winit-support/Cargo.toml | 2 +- 5 files changed, 92 insertions(+), 401 deletions(-) diff --git a/imgui-examples/Cargo.lock b/imgui-examples/Cargo.lock index 1982fb9..673dc80 100644 --- a/imgui-examples/Cargo.lock +++ b/imgui-examples/Cargo.lock @@ -27,20 +27,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" -[[package]] -name = "andrew" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" -dependencies = [ - "bitflags", - "line_drawing 0.7.0", - "rusttype 0.7.9", - "walkdir", - "xdg", - "xml-rs", -] - [[package]] name = "andrew" version = "0.3.0" @@ -48,8 +34,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1ea80a5089cac999ffd4a91888154076a961d27387b0f7a6cd2d4dddb636b9" dependencies = [ "bitflags", - "line_drawing 0.8.0", - "rusttype 0.9.2", + "line_drawing", + "rusttype", "walkdir", "xdg", "xml-rs", @@ -61,21 +47,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" -[[package]] -name = "android_log-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e" - -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits 0.2.12", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -120,17 +91,6 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" -[[package]] -name = "calloop" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" -dependencies = [ - "mio", - "mio-extras", - "nix 0.14.1", -] - [[package]] name = "calloop" version = "0.6.4" @@ -138,7 +98,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59561a8b3968ba4bda0c46f42e0568507c5d26e94c3b6f2a0c730cbecd83ff3a" dependencies = [ "log", - "nix 0.18.0", + "nix", ] [[package]] @@ -184,15 +144,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "cloudabi" version = "0.1.0" @@ -202,21 +153,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "cocoa" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" -dependencies = [ - "bitflags", - "block", - "core-foundation 0.7.0", - "core-graphics 0.19.2", - "foreign-types", - "libc", - "objc", -] - [[package]] name = "cocoa" version = "0.23.0" @@ -410,8 +346,8 @@ checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.21", - "quote 1.0.7", + "proc-macro2", + "quote", "strsim", "syn", ] @@ -423,7 +359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core", - "quote 1.0.7", + "quote", "syn", ] @@ -443,8 +379,8 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" dependencies = [ - "proc-macro2 1.0.21", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -460,7 +396,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" dependencies = [ - "libloading 0.6.3", + "libloading", ] [[package]] @@ -544,6 +480,21 @@ name = "glium" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030bb23a12fac7e589b002c5e131e89348df88f91b56e3f3dbc4249527eeebf9" +dependencies = [ + "backtrace", + "fnv", + "gl_generator", + "lazy_static", + "memoffset", + "smallvec", + "takeable-option", +] + +[[package]] +name = "glium" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eeec7b733d14519e2541f4cc8a1230de9143d4ec439dd51b6c048d8ec991759" dependencies = [ "backtrace", "fnv", @@ -557,29 +508,29 @@ dependencies = [ [[package]] name = "glutin" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9666c8fd9afd008f6559e2468c35e11aad1d110d525bb3b354e4138ec0e20f" +checksum = "ed94c05751b6948879d2b15d49930e16ecc0144e51fcb8cd873686d6c4b5ebed" dependencies = [ "android_glue", "cgl", - "cocoa 0.20.2", - "core-foundation 0.7.0", - "core-graphics 0.19.2", + "cocoa", + "core-foundation 0.9.1", "glutin_egl_sys", "glutin_emscripten_sys", "glutin_gles2_sys", "glutin_glx_sys", "glutin_wgl_sys", "lazy_static", - "libloading 0.5.2", + "libloading", "log", "objc", "osmesa-sys", - "parking_lot 0.10.2", - "wayland-client 0.23.6", + "parking_lot", + "wayland-client", + "wayland-egl", "winapi 0.3.9", - "winit 0.22.2", + "winit", ] [[package]] @@ -665,10 +616,10 @@ name = "imgui" version = "0.5.0" dependencies = [ "bitflags", - "glium", + "glium 0.27.0", "imgui-sys", "lazy_static", - "parking_lot 0.11.0", + "parking_lot", ] [[package]] @@ -676,7 +627,7 @@ name = "imgui-examples" version = "0.0.0" dependencies = [ "clipboard", - "glium", + "glium 0.28.0", "image", "imgui", "imgui-glium-renderer", @@ -687,7 +638,7 @@ dependencies = [ name = "imgui-glium-renderer" version = "0.5.0" dependencies = [ - "glium", + "glium 0.28.0", "imgui", ] @@ -703,7 +654,7 @@ name = "imgui-winit-support" version = "0.6.0" dependencies = [ "imgui", - "winit 0.23.0", + "winit", ] [[package]] @@ -774,16 +725,6 @@ version = "0.2.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi 0.3.9", -] - [[package]] name = "libloading" version = "0.6.3" @@ -794,15 +735,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "line_drawing" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -dependencies = [ - "num-traits 0.2.12", -] - [[package]] name = "line_drawing" version = "0.8.0" @@ -812,15 +744,6 @@ dependencies = [ "num-traits 0.1.43", ] -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.1" @@ -947,17 +870,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "ndk" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" -dependencies = [ - "jni-sys", - "ndk-sys 0.1.0", - "num_enum", -] - [[package]] name = "ndk" version = "0.2.0" @@ -965,25 +877,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94dc511dd67c2cf232264be20fb98ad0ea93666727d3f6f75429d53e696d6366" dependencies = [ "jni-sys", - "ndk-sys 0.2.0", + "ndk-sys", "num_enum", "thiserror", ] -[[package]] -name = "ndk-glue" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1730ee2e3de41c3321160a6da815f008c4006d71b095880ea50e17cf52332b8" -dependencies = [ - "android_log-sys", - "lazy_static", - "libc", - "log", - "ndk 0.1.0", - "ndk-sys 0.1.0", -] - [[package]] name = "ndk-glue" version = "0.2.0" @@ -993,9 +891,9 @@ dependencies = [ "lazy_static", "libc", "log", - "ndk 0.2.0", + "ndk", "ndk-macro", - "ndk-sys 0.2.0", + "ndk-sys", ] [[package]] @@ -1006,17 +904,11 @@ checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" dependencies = [ "darling", "proc-macro-crate", - "proc-macro2 1.0.21", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] -[[package]] -name = "ndk-sys" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" - [[package]] name = "ndk-sys" version = "0.2.0" @@ -1034,19 +926,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "nix" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "void", -] - [[package]] name = "nix" version = "0.18.0" @@ -1146,8 +1025,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.21", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -1192,15 +1071,6 @@ 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 0.2.12", -] - [[package]] name = "osmesa-sys" version = "0.1.2" @@ -1219,16 +1089,6 @@ dependencies = [ "ttf-parser", ] -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", -] - [[package]] name = "parking_lot" version = "0.11.0" @@ -1236,22 +1096,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" dependencies = [ "instant", - "lock_api 0.4.1", - "parking_lot_core 0.8.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if", - "cloudabi 0.0.3", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "lock_api", + "parking_lot_core", ] [[package]] @@ -1261,7 +1107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ "cfg-if", - "cloudabi 0.1.0", + "cloudabi", "instant", "libc", "redox_syscall", @@ -1302,31 +1148,13 @@ dependencies = [ "toml", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c" dependencies = [ - "unicode-xid 0.2.1", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "unicode-xid", ] [[package]] @@ -1335,7 +1163,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.21", + "proc-macro2", ] [[package]] @@ -1384,26 +1212,6 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -[[package]] -name = "rusttype" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" -dependencies = [ - "rusttype 0.8.3", -] - -[[package]] -name = "rusttype" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" -dependencies = [ - "approx", - "ordered-float", - "stb_truetype", -] - [[package]] name = "rusttype" version = "0.9.2" @@ -1469,49 +1277,24 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" -[[package]] -name = "smithay-client-toolkit" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" -dependencies = [ - "andrew 0.2.1", - "bitflags", - "dlib", - "lazy_static", - "memmap", - "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", + "andrew", "bitflags", "byteorder", - "calloop 0.6.4", + "calloop", "dlib", "lazy_static", "log", "memmap", - "nix 0.18.0", - "wayland-client 0.28.0", + "nix", + "wayland-client", "wayland-cursor", - "wayland-protocols 0.28.0", -] - -[[package]] -name = "stb_truetype" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", + "wayland-protocols", ] [[package]] @@ -1526,9 +1309,9 @@ version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b" dependencies = [ - "proc-macro2 1.0.21", - "quote 1.0.7", - "unicode-xid 0.2.1", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -1552,8 +1335,8 @@ 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", + "proc-macro2", + "quote", "syn", ] @@ -1583,12 +1366,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.1" @@ -1601,12 +1378,6 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - [[package]] name = "walkdir" version = "2.3.1" @@ -1618,23 +1389,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wayland-client" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" -dependencies = [ - "bitflags", - "calloop 0.4.4", - "downcast-rs", - "libc", - "mio", - "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" @@ -1644,21 +1398,11 @@ dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.18.0", + "nix", "scoped-tls", - "wayland-commons 0.28.0", - "wayland-scanner 0.28.0", - "wayland-sys 0.28.0", -] - -[[package]] -name = "wayland-commons" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" -dependencies = [ - "nix 0.14.1", - "wayland-sys 0.23.6", + "wayland-commons", + "wayland-scanner", + "wayland-sys", ] [[package]] @@ -1667,10 +1411,10 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01868f14a3f272e6cea0e0f573dd0e3a263552ae99dc5ef9016bd0fbf35f9c2d" dependencies = [ - "nix 0.18.0", + "nix", "once_cell", "smallvec", - "wayland-sys 0.28.0", + "wayland-sys", ] [[package]] @@ -1679,21 +1423,19 @@ 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", + "nix", + "wayland-client", "xcursor", ] [[package]] -name = "wayland-protocols" -version = "0.23.6" +name = "wayland-egl" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" +checksum = "bacd89dedd1006507464c418b9b717ff7e90dd2cc78917675c825de3b1645b6f" dependencies = [ - "bitflags", - "wayland-client 0.23.6", - "wayland-commons 0.23.6", - "wayland-scanner 0.23.6", + "wayland-client", + "wayland-sys", ] [[package]] @@ -1703,20 +1445,9 @@ 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]] -name = "wayland-scanner" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "xml-rs", + "wayland-client", + "wayland-commons", + "wayland-scanner", ] [[package]] @@ -1725,21 +1456,11 @@ 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", + "proc-macro2", + "quote", "xml-rs", ] -[[package]] -name = "wayland-sys" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" -dependencies = [ - "dlib", - "lazy_static", -] - [[package]] name = "wayland-sys" version = "0.28.0" @@ -1794,44 +1515,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "winit" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" -dependencies = [ - "bitflags", - "cocoa 0.20.2", - "core-foundation 0.7.0", - "core-graphics 0.19.2", - "core-video-sys", - "dispatch", - "instant", - "lazy_static", - "libc", - "log", - "mio", - "mio-extras", - "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 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5bc559da567d8aa671bbcd08304d49e982c7bf2cb91e10288b9188931c1b772" dependencies = [ "bitflags", - "cocoa 0.23.0", + "cocoa", "core-foundation 0.9.1", "core-graphics 0.22.1", "core-video-sys", @@ -1842,15 +1533,15 @@ dependencies = [ "log", "mio", "mio-extras", - "ndk 0.2.0", - "ndk-glue 0.2.0", - "ndk-sys 0.2.0", + "ndk", + "ndk-glue", + "ndk-sys", "objc", - "parking_lot 0.11.0", + "parking_lot", "percent-encoding", "raw-window-handle", - "smithay-client-toolkit 0.12.0", - "wayland-client 0.28.0", + "smithay-client-toolkit", + "wayland-client", "winapi 0.3.9", "x11-dl", ] diff --git a/imgui-examples/Cargo.toml b/imgui-examples/Cargo.toml index a3d9fcc..ea4b152 100644 --- a/imgui-examples/Cargo.toml +++ b/imgui-examples/Cargo.toml @@ -11,7 +11,7 @@ publish = false [dev-dependencies] clipboard = "0.5" -glium = { version = "0.27", default-features = true } +glium = { version = "0.28", default-features = true } image = "0.23" imgui = { path = "../" } imgui-glium-renderer = { path = "../imgui-glium-renderer" } diff --git a/imgui-examples/examples/support/mod.rs b/imgui-examples/examples/support/mod.rs index ca36a72..e4d6e92 100644 --- a/imgui-examples/examples/support/mod.rs +++ b/imgui-examples/examples/support/mod.rs @@ -45,7 +45,7 @@ pub fn init(title: &str) -> System { { let gl_window = display.gl_window(); let window = gl_window.window(); - platform.attach_window(imgui.io_mut(), &window, HiDpiMode::Rounded); + platform.attach_window(imgui.io_mut(), window, HiDpiMode::Rounded); } let hidpi_factor = platform.hidpi_factor(); @@ -103,7 +103,7 @@ impl System { Event::MainEventsCleared => { let gl_window = display.gl_window(); platform - .prepare_frame(imgui.io_mut(), &gl_window.window()) + .prepare_frame(imgui.io_mut(), gl_window.window()) .expect("Failed to prepare frame"); gl_window.window().request_redraw(); } diff --git a/imgui-glium-renderer/Cargo.toml b/imgui-glium-renderer/Cargo.toml index b0743fc..081c9a2 100644 --- a/imgui-glium-renderer/Cargo.toml +++ b/imgui-glium-renderer/Cargo.toml @@ -10,5 +10,5 @@ license = "MIT/Apache-2.0" categories = ["gui", "rendering"] [dependencies] -glium = { version = "0.27", default-features = false } +glium = { version = "0.28", default-features = false } imgui = { version = "0.5.0", path = "../", features = ["glium"] } diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index f6cacd3..dbff667 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -10,7 +10,7 @@ license = "MIT/Apache-2.0" categories = ["gui"] [dependencies] -imgui = "0.5.0" +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 } From a5222843445ef62fa917504bc2c635e36548465f Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Mon, 5 Oct 2020 12:16:48 -0400 Subject: [PATCH 5/7] Bump imgui-glium-renderer version --- imgui-glium-renderer/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui-glium-renderer/Cargo.toml b/imgui-glium-renderer/Cargo.toml index 081c9a2..5d80c5d 100644 --- a/imgui-glium-renderer/Cargo.toml +++ b/imgui-glium-renderer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imgui-glium-renderer" -version = "0.5.0" +version = "0.6.0" edition = "2018" authors = ["Joonas Javanainen ", "imgui-rs contributors"] description = "Glium renderer for the imgui crate" From 009eba22497b716ee7b59e9a9efd3ebdfa739f41 Mon Sep 17 00:00:00 2001 From: Max de Danschutter Date: Mon, 9 Nov 2020 14:35:13 +0100 Subject: [PATCH 6/7] Update dependency --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index deb2f4b..4a726e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ exclude = [ [dependencies] bitflags = "1.0" -glium = { version = "0.27", default-features = false, optional = true } +glium = { version = "0.28", default-features = false, optional = true } gfx = { version = "0.18", optional = true } imgui-sys = { version = "0.5.0", path = "imgui-sys" } lazy_static = "1.1" From 6658b91f25239f46be6b5fb254c79d3b7b961506 Mon Sep 17 00:00:00 2001 From: Max de Danschutter Date: Tue, 10 Nov 2020 10:08:03 +0100 Subject: [PATCH 7/7] Updated the changelog, readme, and CI (minimum rust support 1.41) --- .github/workflows/ci.yml | 12 +++++++++++- CHANGELOG.markdown | 5 +++++ README.markdown | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b804eab..ccf1c05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,11 @@ jobs: with: command: check args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 + - name: Run cargo check (imgui-winit-support with winit-23) + uses: actions-rs/cargo@v1 + with: + command: check + args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23 - name: Run cargo fmt uses: actions-rs/cargo@v1 with: @@ -110,7 +115,7 @@ jobs: rust: - stable - beta - - 1.40.0 + - 1.41.0 os: - ubuntu-latest - macos-latest @@ -174,3 +179,8 @@ jobs: with: command: test args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 + - name: Run cargo test (imgui-winit-support with winit-23) + uses: actions-rs/cargo@v1 + with: + command: test + args: --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23 diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index ed9eff4..2e1fee0 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -2,6 +2,11 @@ ## [Unreleased] +### Changed + +- Upgrade to winit 0.23 +- Bump minimum Rust version to 1.41 + ## [0.5.0] - 2020-09-20 ### Added diff --git a/README.markdown b/README.markdown index a732329..a9bc5b5 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,7 @@ **Still fairly experimental!** -Minimum Rust version: 1.40 +Minimum Rust version: 1.41 Wrapped Dear ImGui version: 1.78