diff --git a/Cargo.lock b/Cargo.lock index cbd70a1..9f09afb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,32 +1,21 @@ -[[package]] -name = "advapi32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "aho-corasick" -version = "0.6.8" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "apiw" version = "0.1.0" -source = "git+https://github.com/crlf0710/apiw-rs#80a52e403f5f5d4e4106543180e2132371520f70" +source = "git+https://github.com/crlf0710/apiw-rs#59becb9314adc5d1d6e89bb56c4f145699da6cc4" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "enum-primitive-derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -34,19 +23,29 @@ name = "atty" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "autocfg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "cc" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cfg-if" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -58,11 +57,11 @@ dependencies = [ "clamp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "concerto 0.1.0 (git+https://github.com/crlf0710/concerto-rs)", "domino 0.1.0 (git+https://github.com/crlf0710/domino-rs)", - "embed-resource 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "embed-resource 1.1.4 (git+https://github.com/nabijaczleweli/rust-embed-resource)", + "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -72,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -94,9 +93,9 @@ version = "0.1.0" source = "git+https://github.com/crlf0710/concerto-rs#4873c00e02fd41f9129aa6c3769a151a1cd70e18" dependencies = [ "fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", "vec-drain-where 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -115,36 +114,27 @@ name = "domino" version = "0.1.0" source = "git+https://github.com/crlf0710/domino-rs#5a6dcf3a2def79fce9725ab44e86f96773c11411" dependencies = [ - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "embed-resource" version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/nabijaczleweli/rust-embed-resource#7d4186445463c82970312e9534003786a42c7bdb" dependencies = [ - "winreg 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "enum-primitive-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "vswhom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "env_logger" -version = "0.5.13" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -154,66 +144,40 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" +name = "fuchsia-cprng" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "humantime" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "lazy_static" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "libc" -version = "0.2.43" +version = "0.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "log" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memchr" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "num-integer" @@ -223,14 +187,6 @@ dependencies = [ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "num-traits" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "num-traits" version = "0.2.6" @@ -249,11 +205,6 @@ name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "quote" version = "0.5.2" @@ -264,32 +215,111 @@ dependencies = [ [[package]] name = "rand" -version = "0.5.5" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.2.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.3.0" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "redox_syscall" -version = "0.1.40" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -297,27 +327,27 @@ name = "redox_termios" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "1.0.5" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.2" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -343,26 +373,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "slab" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smallvec" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "0.11.11" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "syn" @@ -374,14 +391,6 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "termcolor" version = "1.0.4" @@ -395,8 +404,8 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -405,27 +414,22 @@ name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "time" -version = "0.1.40" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ucd-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.0.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -433,17 +437,9 @@ name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "utf8-ranges" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -452,34 +448,32 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "void" -version = "1.0.2" +name = "vswhom" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "vswhom-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "winapi" -version = "0.2.8" +name = "vswhom-sys" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "winapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -487,10 +481,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -503,93 +497,89 @@ name = "wincolor" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winreg" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wio" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] -"checksum advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a" -"checksum aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a" +"checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c" "checksum apiw 0.1.0 (git+https://github.com/crlf0710/apiw-rs)" = "" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" +"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" -"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" +"checksum cc 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)" = "30f813bf45048a18eda9190fd3c6b78644146056740c43172a5a3699118588fd" +"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum clamp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0113a8ae379a061c89a71d57a809439f5ce550b6a76063ab5ba2b1cb180971f" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum concerto 0.1.0 (git+https://github.com/crlf0710/concerto-rs)" = "" "checksum derive_more 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46c7f14685a20f5dd08e7f754f2ea8cc064d8f4214ae21116c106a2768ba7b9b" "checksum domino 0.1.0 (git+https://github.com/crlf0710/domino-rs)" = "" -"checksum embed-resource 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "59edbe56442f96505f79c9116006f2e26c7f5655cccdc2c1546b2528c63bd612" -"checksum enum-primitive-derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b90e520ec62c1864c8c78d637acbfe8baf5f63240f2fb8165b8325c07812dd" -"checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" +"checksum embed-resource 1.1.4 (git+https://github.com/nabijaczleweli/rust-embed-resource)" = "" +"checksum env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b61fa891024a945da30a9581546e8cfaf5602c7b3f4c137a2805cf388f92075a" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" -"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" -"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" -"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)" = "bedcc7a809076656486ffe045abeeac163da1b558e963a31e29fbfbeba916917" +"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" +"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" -"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" -"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" -"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" -"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" -"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b9ea758282efe12823e0d952ddb269d2e1897227e464919a554f2a03ef1b832" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)" = "d32b3053e5ced86e4bc0411fec997389532bf56b000e66cb4884eeeb41413d69" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" -"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" +"checksum regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "559008764a17de49a3146b234641644ed37d118d1ef641a0bb573d146edc6ce0" +"checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" -"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +"checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" -"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" +"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" +"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" "checksum vec-drain-where 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23e040e1865e2f5fe63254b6077ef27361eb9048f607842091ecad3ce7fa5cab" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum vswhom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +"checksum vswhom-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc2f5402d3d0e79a069714f7b48e3ecc60be7775a2c049cb839457457a239532" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab" +"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" -"checksum winreg 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf285379f20d7f26abd990d9a566be9d31ab7a9d335299baaa1f0604f5f96af" -"checksum wio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a31e8a268d6941ffb7f8d7989fc93e4692bd3e75a27d400a72b4be1dadb213" +"checksum winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a" +"checksum wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" diff --git a/Cargo.toml b/Cargo.toml index df8b687..1d292e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,13 +8,13 @@ authors = ["CrLF0710 "] apiw = { git = "https://github.com/crlf0710/apiw-rs" } concerto = { git = "https://github.com/crlf0710/concerto-rs" } domino = { git = "https://github.com/crlf0710/domino-rs" } -rand = "0.5" +rand = "0.6" chrono = "0.4" clamp = "0.1" smallvec = "0.6" log = "0.4" -env_logger = "0.5" +env_logger = "0.6" [target.'cfg(windows)'.build-dependencies] -embed-resource = "1" +embed-resource = { git = "https://github.com/nabijaczleweli/rust-embed-resource" } diff --git a/res/CharlesMine.rc b/res/CharlesMine.rc index eeaa367..b92b100 100644 --- a/res/CharlesMine.rc +++ b/res/CharlesMine.rc @@ -115,6 +115,10 @@ BEGIN MENUITEM "Start R&ecording", IDM_ADVANCED_RECORD_RECORD MENUITEM "Start &Playback", IDM_ADVANCED_RECORD_PLAY MENUITEM "S&top Recording/Playback\tF12", IDM_ADVANCED_RECORD_STOP + MENUITEM SEPARATOR + MENUITEM "Zoom 1x" IDM_ADVANCED_ZOOM_1x + MENUITEM "Zoom 2x" IDM_ADVANCED_ZOOM_2x + MENUITEM "Zoom 3x" IDM_ADVANCED_ZOOM_3x END POPUP "&Help" BEGIN @@ -208,6 +212,10 @@ BEGIN MENUITEM "开始录像(&E)", IDM_ADVANCED_RECORD_RECORD MENUITEM "开始回放(&P)", IDM_ADVANCED_RECORD_PLAY MENUITEM "停止(&T)\tF12", IDM_ADVANCED_RECORD_STOP + MENUITEM SEPARATOR + MENUITEM "缩放 1x" IDM_ADVANCED_ZOOM_1x + MENUITEM "缩放 2x" IDM_ADVANCED_ZOOM_2x + MENUITEM "缩放 3x" IDM_ADVANCED_ZOOM_3x END POPUP "帮助(&H)" BEGIN diff --git a/res/Resource.h b/res/Resource.h index 6934339..4278315 100644 --- a/res/Resource.h +++ b/res/Resource.h @@ -38,7 +38,10 @@ #define IDM_ADVANCED_RECORD_RECORD 164 #define IDM_ADVANCED_RECORD_PLAY 166 #define IDM_ADVANCED_RECORD_STOP 167 -#define IDM_HELP_ABOUT 171 +#define IDM_ADVANCED_ZOOM_1x 170 +#define IDM_ADVANCED_ZOOM_2x 171 +#define IDM_ADVANCED_ZOOM_3x 172 +#define IDM_HELP_ABOUT 199 #define IDD_ABOUTBOX 201 #define IDD_CUSTOM_GAME 202 #define IDD_HERO_NAME 203 diff --git a/src/model.rs b/src/model.rs index 5dbc6be..e5952c1 100644 --- a/src/model.rs +++ b/src/model.rs @@ -615,6 +615,8 @@ pub enum ModelCommand { ToggleAllowMarks, + UpdateZoomRatio(model_config::ZoomRatio), + SaveMap(PathBuf), LoadMap(PathBuf), RestartGame, @@ -738,6 +740,14 @@ impl ::domino::mvc::Model for Model { } token.update_view_next(ViewCommand::UpdateUIAllowMarks(model_config::AllowMarks(new_state))); } + ModelCommand::UpdateZoomRatio(r) => { + { + let model = token.model_mut(); + model.config.zoom_ratio = r; + } + token.update_view_next(ViewCommand::UpdateZoomRatio(r)); + token.update_view_next(ViewCommand::UpdateUIZoomRatio(r)); + } ModelCommand::EffectNewGameButtonDown => { token.update_view_next(ViewCommand::SetButtonPressed(true)); } diff --git a/src/model_config.rs b/src/model_config.rs index 4d22d5f..263d86c 100644 --- a/src/model_config.rs +++ b/src/model_config.rs @@ -53,7 +53,7 @@ impl Default for BoardSetting { } } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, PartialEq)] pub struct AllowMarks(pub bool); impl Default for AllowMarks { @@ -62,10 +62,24 @@ impl Default for AllowMarks { } } +#[derive(Copy, Clone, Debug, PartialEq)] +pub enum ZoomRatio { + Zoom1x, + Zoom2x, + Zoom3x, +} + +impl Default for ZoomRatio { + fn default() -> Self { + ZoomRatio::Zoom1x + } +} + #[derive(Default)] pub struct Config{ pub board_setting: BoardSetting, pub allow_marks: AllowMarks, + pub zoom_ratio: ZoomRatio, } impl Config { diff --git a/src/ui_apiw.rs b/src/ui_apiw.rs index e9bb6cb..7916863 100644 --- a/src/ui_apiw.rs +++ b/src/ui_apiw.rs @@ -35,7 +35,7 @@ use apiw::application_support_functions::SaveFileDialogFlags; pub fn ui_alert(msg: &str) { MessageBoxBuilder::new() .message(msg) - .invoke(); + .invoke().unwrap(); } pub struct Ui; @@ -55,7 +55,7 @@ impl Ui { Self::create_main_window()?; THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.process_input(ControllerInput::Initialize); Ok(()) @@ -144,7 +144,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps request .route_create(|window: &ForeignWindow, _| -> apiw::Result { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.redirect_output_target(Some(window.clone())); window.invalidate()?; @@ -156,7 +156,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps let mut paint_dc = window.do_paint()?; THE_GAME.with(|game| { - let game = game.try_borrow().or_else(|_| apiw::last_error())?; + let game = game.try_borrow().or_else(|_| apiw::Error::last())?; game.mvc.sync_output_with_parameter(&mut paint_dc); Ok(()) })?; @@ -168,7 +168,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps THE_GAME.with(|game| { use apiw::windows_subsystem::window::MouseEventArgType; - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; let mut target = None; @@ -213,7 +213,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps match args.id() as isize { resources::IDM_FILE_NEW => { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.process_input(ControllerInput::ModelCommand( ModelCommand::NewGame)); @@ -222,7 +222,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps } resources::IDM_FILE_GAME_EASY | resources::IDM_FILE_GAME_MEDIUM | resources::IDM_FILE_GAME_HARD => { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; let boardsetting = match args.id() as isize { resources::IDM_FILE_GAME_EASY => model_config::BoardSetting::EASY, @@ -237,21 +237,38 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps } resources::IDM_FILE_MARK => { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.process_input(ControllerInput::ModelCommand( ModelCommand::ToggleAllowMarks)); Ok(()) })?; - } + }, + resources::IDM_ADVANCED_ZOOM_1x | resources::IDM_ADVANCED_ZOOM_2x | resources::IDM_ADVANCED_ZOOM_3x => { + THE_GAME.with(|game| { + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; + let game = &mut *game; + + game.mvc.process_input(ControllerInput::ModelCommand( + ModelCommand::UpdateZoomRatio( + match args.id() as isize { + resources::IDM_ADVANCED_ZOOM_1x => model_config::ZoomRatio::Zoom1x, + resources::IDM_ADVANCED_ZOOM_2x => model_config::ZoomRatio::Zoom2x, + resources::IDM_ADVANCED_ZOOM_3x => model_config::ZoomRatio::Zoom3x, + _ => unreachable!(), + } + ))); + Ok(()) + })?; + }, resources::IDM_FILE_EXIT => { window.destroy()?; }, resources::IDM_ADVANCED_LOADMAP => { if let Some(path) = Ui::call_open_file_dialog(window, 0, "cmm") { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.process_input(ControllerInput::ModelCommand( @@ -263,7 +280,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps resources::IDM_ADVANCED_SAVEMAP => { if let Some(path) = Ui::call_save_file_dialog(window, 0, "cmm") { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.process_input(ControllerInput::ModelCommand( @@ -274,7 +291,7 @@ BOOL HandleMapFile(bool bSave, UINT nFilterResID, LPCTSTR lpszDefExt, LPTSTR lps }, resources::IDM_ADVANCED_RESTART => { THE_GAME.with(|game| { - let mut game = game.try_borrow_mut().or_else(|_| apiw::last_error())?; + let mut game = game.try_borrow_mut().or_else(|_| apiw::Error::last())?; let game = &mut *game; game.mvc.process_input(ControllerInput::ModelCommand( diff --git a/src/view.rs b/src/view.rs index be31f1e..db3a3a1 100644 --- a/src/view.rs +++ b/src/view.rs @@ -1,6 +1,7 @@ use model::BlockShape; use model::GameButtonDisplayKind; use std::cell::Cell; +use std::num::NonZeroUsize; use model_config::{self, Config}; use view_assets::{self}; use view_assets::BlockSpriteSheet; @@ -275,11 +276,69 @@ impl LayoutState { } } +struct LayoutZoom { + ratio: NonZeroUsize, +} + +impl LayoutZoom { + fn new() -> Self { + Self::new_with_ratio(1) + } + + fn new_with_ratio(v: usize) -> Self { + LayoutZoom { + ratio: NonZeroUsize::new(v).unwrap() + } + } + fn update_dc(&self, dc: &mut UiScopedDC) -> UiResult<()> { + use apiw::extensions::draw_ext::{GraphicsMode, Transform}; + let v = self.ratio.get(); + if v == 1 { + return Ok(()); + } + let v = v as f32; + dc.set_graphics_mode(GraphicsMode::ADVANCED)?; + dc.set_world_transform(&Transform::new_with_values(&[ + v, 0.0, 0.0, v, 0.0, 0.0 + ]))?; + + Ok(()) + } + + fn zoom_size(&self, size: Size) -> Size { + let v = self.ratio.get(); + if v == 1 { + return size; + } + Size::new(size.cx() * v, size.cy() * v) + } + + fn unzoom_point(&self, point: Point) -> Point { + let v = self.ratio.get(); + if v == 1 { + return point; + } + Point::new(point.x() / v as isize, point.y() / v as isize) + } +} + +impl From for LayoutZoom { + fn from(r: model_config::ZoomRatio) -> Self { + match r { + model_config::ZoomRatio::Zoom1x => Self::new_with_ratio(1), + model_config::ZoomRatio::Zoom2x => Self::new_with_ratio(2), + model_config::ZoomRatio::Zoom3x => Self::new_with_ratio(3), + } + } +} + + pub struct View { assets: Assets, window: Option, layout_data: LayoutData, layout_state: LayoutState, + layout_zoom: LayoutZoom, } impl View { @@ -288,27 +347,37 @@ impl View { let block_area_dims = model.size(); let layout_data = LayoutData::new(block_area_dims); let layout_state= LayoutState::new(); + let layout_zoom = LayoutZoom::new(); View { assets, layout_data, layout_state, + layout_zoom, window: None, } } + pub fn update_zoom_ratio(&mut self, ratio: model_config::ZoomRatio) -> UiResult<()> { + self.layout_zoom = LayoutZoom::from(ratio); + self.adjust_window_layout().unwrap(); + Ok(()) + } + pub fn regenerate_layout_data(&mut self, (y, x): (usize, usize)) { self.layout_data = LayoutData::new((y, x)); } pub fn draw(&self, dc: &mut UiScopedDC, model: &Model, assets: &Assets) -> UiResult<()> { - dc.draw(ThreeDimBorder { - rect: Rect::new(Point::ORIGIN, self.layout_data.area_size), - border_pos: BorderPosition::Inner, - color_nw: RGBColor::WHITE, - color_se: RGBColor::GRAY, - })? + self.layout_zoom.update_dc(dc)?; + dc + .draw(ThreeDimBorder { + rect: Rect::new(Point::ORIGIN, self.layout_data.area_size), + border_pos: BorderPosition::Inner, + color_nw: RGBColor::WHITE, + color_se: RGBColor::GRAY, + })? .draw(ThreeDimBorder { rect: Rect::new( Point::new(LayoutData::BLOCK_AREA_X as _, LayoutData::BUTTONEDGE_TOP as _), @@ -361,6 +430,7 @@ impl View { } pub fn hit_test(&self, point: Point) -> GameTarget { + let point = self.layout_zoom.unzoom_point(point); let button_size = Size::new( GameButtonSpriteSheet::BUTTON_WIDTH, GameButtonSpriteSheet::BUTTON_HEIGHT, @@ -452,8 +522,10 @@ impl View { #[derive(Debug)] pub enum ViewCommand { Initialize, + UpdateZoomRatio(model_config::ZoomRatio), UpdateUIBoardSetting(model_config::BoardSetting), UpdateUIAllowMarks(model_config::AllowMarks), + UpdateUIZoomRatio(model_config::ZoomRatio), UpdateUIGameMode(model_gamemode::GameMode), SetButtonPressed(bool), SetBlockPressed(usize, usize, bool), @@ -480,11 +552,20 @@ impl ::domino::mvc::View for View { ViewCommand::Initialize => { let allow_marks = token.model().config().allow_marks.clone(); token.exec_command_next(ViewCommand::UpdateUIAllowMarks(allow_marks)); + let zoom_ratio = token.model().config().zoom_ratio.clone(); + token.exec_command_next(ViewCommand::UpdateUIZoomRatio(zoom_ratio)); let board_setting = token.model().config().board_setting.clone(); token.exec_command_next(ViewCommand::UpdateUIBoardSetting(board_setting)); let game_mode = token.model().game_mode(); token.exec_command_next(ViewCommand::UpdateUIGameMode(game_mode)); }, + ViewCommand::UpdateZoomRatio(v) => { + let view = token.view_mut(); + view.update_zoom_ratio(v)?; + if let Some(window) = view.window() { + window.invalidate()?; + } + }, ViewCommand::UpdateUIBoardSetting(v) => { let view = token.view_mut(); if let Some(window) = view.window() { @@ -516,6 +597,22 @@ impl ::domino::mvc::View for View { } } }, + ViewCommand::UpdateUIZoomRatio(v) => { + let view = token.view_mut(); + if let Some(window) = view.window() { + if let Some(mut menu) = window.menu().unwrap_or(None) { + for &(e, menu_item) in &[ + (model_config::ZoomRatio::Zoom1x, view_assets::resources::IDM_ADVANCED_ZOOM_1x), + (model_config::ZoomRatio::Zoom2x, view_assets::resources::IDM_ADVANCED_ZOOM_2x), + (model_config::ZoomRatio::Zoom3x, view_assets::resources::IDM_ADVANCED_ZOOM_3x), + ] { + let _ = menu + .item_by_command(menu_item as _) + .set_checked(v == e); + } + } + } + }, ViewCommand::UpdateUIGameMode(v) => { let view = token.view_mut(); if let Some(window) = view.window() { @@ -602,7 +699,7 @@ impl ::domino::mvc::View for View { impl View { fn adjust_window_layout(&self) -> UiResult<()> { if let Some(window) = self.window() { - let rect = Rect::new(Point::ORIGIN, self.layout_data.area_size); + let rect = Rect::new(Point::ORIGIN, self.layout_zoom.zoom_size(self.layout_data.area_size)); let new_rect = UiWindow::predict_window_rect_from_client_rect_and_window(rect, window)?; window.reposition_set_size(new_rect.size())?; window.invalidate_and_erase()?; diff --git a/src/view_assets.rs b/src/view_assets.rs index 314beb1..5360bbb 100644 --- a/src/view_assets.rs +++ b/src/view_assets.rs @@ -13,6 +13,7 @@ use std::cell::RefCell; use std::marker::PhantomData; #[allow(dead_code)] +#[allow(non_upper_case_globals)] pub(crate) mod resources { pub const IDC_MYICON: isize = 2; pub const IDD_CHARLESMINE_DIALOG: isize = 102; @@ -50,7 +51,10 @@ pub(crate) mod resources { pub const IDM_ADVANCED_RECORD_RECORD: isize = 164; pub const IDM_ADVANCED_RECORD_PLAY: isize = 166; pub const IDM_ADVANCED_RECORD_STOP: isize = 167; - pub const IDM_HELP_ABOUT: isize = 171; + pub const IDM_ADVANCED_ZOOM_1x: isize = 170; + pub const IDM_ADVANCED_ZOOM_2x: isize = 171; + pub const IDM_ADVANCED_ZOOM_3x: isize = 172; + pub const IDM_HELP_ABOUT: isize = 199; pub const IDD_ABOUTBOX: isize = 201; pub const IDD_CUSTOM_GAME: isize = 202; pub const IDD_HERO_NAME: isize = 203;