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/Cargo.toml b/Cargo.toml index e4f1377..cee6b37 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" 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 diff --git a/imgui-examples/Cargo.lock b/imgui-examples/Cargo.lock index 2f9500e..673dc80 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" @@ -23,13 +29,13 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "andrew" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" +checksum = "5e1ea80a5089cac999ffd4a91888154076a961d27387b0f7a6cd2d4dddb636b9" dependencies = [ "bitflags", "line_drawing", - "rusttype 0.7.9", + "rusttype", "walkdir", "xdg", "xml-rs", @@ -41,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", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -102,12 +93,11 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "calloop" -version = "0.4.4" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" +checksum = "59561a8b3968ba4bda0c46f42e0568507c5d26e94c3b6f2a0c730cbecd83ff3a" dependencies = [ - "mio", - "mio-extras", + "log", "nix", ] @@ -154,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" @@ -174,14 +155,30 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.20.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" +checksum = "c54201c07dcf3a5ca33fececb8042aed767ee4bfd5a0235a8ceabcda956044b2" dependencies = [ "bitflags", "block", - "core-foundation", - "core-graphics", + "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 +196,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 +216,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 +229,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 +266,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 +328,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", + "quote", + "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", + "syn", +] + [[package]] name = "deflate" version = "0.8.6" @@ -306,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", ] @@ -323,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]] @@ -407,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", @@ -420,27 +508,27 @@ 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", - "core-foundation", - "core-graphics", + "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", + "parking_lot", "wayland-client", + "wayland-egl", "winapi 0.3.9", "winit", ] @@ -499,6 +587,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 +605,7 @@ dependencies = [ "jpeg-decoder", "num-iter", "num-rational", - "num-traits", + "num-traits 0.2.12", "png", "scoped_threadpool", "tiff", @@ -522,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]] @@ -533,7 +627,7 @@ name = "imgui-examples" version = "0.0.0" dependencies = [ "clipboard", - "glium", + "glium 0.28.0", "image", "imgui", "imgui-glium-renderer", @@ -544,7 +638,7 @@ dependencies = [ name = "imgui-glium-renderer" version = "0.5.0" dependencies = [ - "glium", + "glium 0.28.0", "imgui", ] @@ -557,7 +651,7 @@ dependencies = [ [[package]] name = "imgui-winit-support" -version = "0.5.0" +version = "0.6.0" dependencies = [ "imgui", "winit", @@ -631,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" @@ -653,20 +737,11 @@ dependencies = [ [[package]] name = "line_drawing" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" +checksum = "f81902e542483002b103c6424d23e765c2e5a65f732923299053a601bce50ab2" dependencies = [ - "num-traits", -] - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", + "num-traits 0.1.43", ] [[package]] @@ -708,6 +783,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" @@ -791,34 +872,48 @@ dependencies = [ [[package]] name = "ndk" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" +checksum = "94dc511dd67c2cf232264be20fb98ad0ea93666727d3f6f75429d53e696d6366" dependencies = [ "jni-sys", "ndk-sys", "num_enum", + "thiserror", ] [[package]] name = "ndk-glue" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1730ee2e3de41c3321160a6da815f008c4006d71b095880ea50e17cf52332b8" +checksum = "0b6c938c36cd15ea13d0972fdceb3a03982d49967e5fd7508cf129c5300b66cc" dependencies = [ - "android_log-sys", "lazy_static", "libc", "log", "ndk", + "ndk-macro", "ndk-sys", ] [[package]] -name = "ndk-sys" -version = "0.1.0" +name = "ndk-macro" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de01535c8fca086732bb66c9bc7779d336c44088d42782cd11d5f2a7ace52f7e" [[package]] name = "net2" @@ -833,15 +928,24 @@ dependencies = [ [[package]] name = "nix" -version = "0.14.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" dependencies = [ "bitflags", "cc", "cfg-if", "libc", - "void", +] + +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "memchr", + "version_check", ] [[package]] @@ -851,7 +955,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 +966,7 @@ checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" dependencies = [ "autocfg", "num-integer", - "num-traits", + "num-traits 0.2.12", ] [[package]] @@ -873,7 +977,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]] @@ -912,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", ] @@ -953,13 +1066,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" [[package]] -name = "ordered-float" -version = "1.1.0" +name = "once_cell" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" -dependencies = [ - "num-traits", -] +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" [[package]] name = "osmesa-sys" @@ -971,13 +1081,12 @@ dependencies = [ ] [[package]] -name = "parking_lot" -version = "0.10.2" +name = "owned_ttf_parser" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", + "ttf-parser", ] [[package]] @@ -987,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]] @@ -1012,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", @@ -1053,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]] @@ -1086,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]] @@ -1137,22 +1214,12 @@ checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "rusttype" -version = "0.7.9" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" +checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" 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", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] @@ -1164,6 +1231,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" @@ -1206,28 +1279,29 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" [[package]] name = "smithay-client-toolkit" -version = "0.6.6" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" +checksum = "2ec5c077def8af49f9b5aeeb5fcf8079c638c6615c3a8f9305e2dea601de57f7" dependencies = [ "andrew", "bitflags", + "byteorder", + "calloop", "dlib", "lazy_static", + "log", "memmap", "nix", "wayland-client", + "wayland-cursor", "wayland-protocols", ] [[package]] -name = "stb_truetype" -version = "0.3.1" +name = "strsim" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", -] +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" @@ -1235,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]] @@ -1246,6 +1320,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", + "quote", + "syn", +] + [[package]] name = "tiff" version = "0.5.0" @@ -1267,10 +1361,10 @@ dependencies = [ ] [[package]] -name = "unicode-xid" -version = "0.1.0" +name = "ttf-parser" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] name = "unicode-xid" @@ -1279,10 +1373,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] -name = "void" -version = "1.0.2" +name = "version_check" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "walkdir" @@ -1297,16 +1391,15 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.23.6" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" +checksum = "5147ab4114fa29cbfbd3718c933d8a4487035ff589e2650f29135fc2bc165646" dependencies = [ "bitflags", - "calloop", "downcast-rs", "libc", - "mio", "nix", + "scoped-tls", "wayland-commons", "wayland-scanner", "wayland-sys", @@ -1314,19 +1407,42 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.23.6" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" +checksum = "01868f14a3f272e6cea0e0f573dd0e3a263552ae99dc5ef9016bd0fbf35f9c2d" dependencies = [ "nix", + "once_cell", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-cursor" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1380ceb13377afd20b1ef0045334e6a58cc8f1a80cda285b482a21556924d38" +dependencies = [ + "nix", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-egl" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bacd89dedd1006507464c418b9b717ff7e90dd2cc78917675c825de3b1645b6f" +dependencies = [ + "wayland-client", "wayland-sys", ] [[package]] name = "wayland-protocols" -version = "0.23.6" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" +checksum = "6d5c56e9eea77f3808cfb3c9e676056542eea4a33a7b0b6075f9bc24fb15f779" dependencies = [ "bitflags", "wayland-client", @@ -1336,23 +1452,24 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.23.6" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" +checksum = "525547bf3c058b8736236037aa510a80b2a29b88145ff02a987cc27f8f92f83c" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", + "proc-macro2", + "quote", "xml-rs", ] [[package]] name = "wayland-sys" -version = "0.23.6" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +checksum = "d3dc1723584b6d204bbc3d15e361ee6a20d863ba8d4237842284eb3ff4f1b9a4" dependencies = [ "dlib", "lazy_static", + "pkg-config", ] [[package]] @@ -1400,14 +1517,14 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" -version = "0.22.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" +checksum = "b5bc559da567d8aa671bbcd08304d49e982c7bf2cb91e10288b9188931c1b772" dependencies = [ "bitflags", "cocoa", - "core-foundation", - "core-graphics", + "core-foundation 0.9.1", + "core-graphics 0.22.1", "core-video-sys", "dispatch", "instant", @@ -1420,7 +1537,7 @@ dependencies = [ "ndk-glue", "ndk-sys", "objc", - "parking_lot 0.10.2", + "parking_lot", "percent-encoding", "raw-window-handle", "smithay-client-toolkit", @@ -1470,6 +1587,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-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..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" @@ -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 2e945dc..dbff667 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 = { version = "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(