From 56ed3b7c01db6428617ced78f2e8eb04196fc76a Mon Sep 17 00:00:00 2001 From: Enrico Lumetti Date: Wed, 24 Feb 2021 18:00:21 +0100 Subject: [PATCH] Update to druid 0.7.0 Closes #15 --- Cargo.lock | 858 +++++++++++++++++++++++++--------------- Cargo.toml | 11 +- src/main.rs | 48 +-- src/widget/tool_icon.rs | 14 +- 4 files changed, 574 insertions(+), 357 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abe61a2..7763b39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,10 +19,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "atk" -version = "0.8.0" +name = "associative-cache" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444daefa55f229af145ea58d77efd23725024ee1f6f3102743709aa6b18c663e" +checksum = "46016233fc1bb55c23b856fe556b7db6ccd05119a0a392e04f0b3b7c79058f16" + +[[package]] +name = "atk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812b4911e210bd51b24596244523c856ca749e6223c50a7fbbba3f89ee37c426" dependencies = [ "atk-sys", "bitflags", @@ -34,14 +40,14 @@ dependencies = [ [[package]] name = "atk-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e552c1776737a4c80110d06b36d099f47c727335f9aaa5d942a72b6863a8ec6f" +checksum = "f530e4af131d94cc4fa15c5c9d0348f0ef28bac64ba660b6b2a1cf2605dedfce" dependencies = [ "glib-sys", "gobject-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] @@ -69,9 +75,9 @@ checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" [[package]] name = "base64" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" @@ -94,18 +100,18 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -[[package]] -name = "boolinator" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" - [[package]] name = "bumpalo" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +[[package]] +name = "bytemuck" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" + [[package]] name = "byteorder" version = "1.3.4" @@ -114,9 +120,9 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "cairo-rs" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157049ba9618aa3a61c39d5d785102c04d3b1f40632a706c621a9aedc21e6084" +checksum = "c5c0f2e047e8ca53d0ff249c54ae047931d7a6ebe05d00af73e0ffeb6e34bdb8" dependencies = [ "bitflags", "cairo-sys-rs", @@ -124,17 +130,18 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", + "thiserror", ] [[package]] name = "cairo-sys-rs" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff65ba02cac715be836f63429ab00a767d48336efc5497c5637afb53b4f14d63" +checksum = "2ed2639b9ad5f1d6efa76de95558e11339e7318426d84ac4890b86c03e828ca7" dependencies = [ "glib-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] @@ -166,14 +173,30 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.20.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" dependencies = [ "bitflags", "block", - "core-foundation", - "core-graphics", + "cocoa-foundation", + "core-foundation 0.9.1", + "core-graphics 0.22.2", + "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", @@ -201,7 +224,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.2", "libc", ] @@ -211,6 +244,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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" + [[package]] name = "core-graphics" version = "0.19.2" @@ -218,7 +257,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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" +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", ] @@ -229,8 +293,20 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "131b3fd1f8bd5db9f2b398fa4fdb6008c64afc04d447c306ac2c7e98fba2a61d" dependencies = [ - "core-foundation", - "core-graphics", + "core-foundation 0.7.0", + "core-graphics 0.19.2", + "foreign-types", + "libc", +] + +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation 0.9.1", + "core-graphics 0.22.2", "foreign-types", "libc", ] @@ -253,40 +329,6 @@ dependencies = [ "matches", ] -[[package]] -name = "direct2d" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa6ff10857eb253d1ae16987ebfd27372f4129b0c7a3fa41466fbdf7e453e75" -dependencies = [ - "directwrite", - "dxgi", - "either", - "winapi", - "wio", -] - -[[package]] -name = "direct3d11" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "315aa929e68ba066cb6fb86f1b22af24f517e02fd9b5734c4d07e42cb9f4aefa" -dependencies = [ - "dxgi", - "winapi", - "wio", -] - -[[package]] -name = "directwrite" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdcd739e9351c411b8caf5cab32a27c818cfe06260595da121382ecdd22083d" -dependencies = [ - "winapi", - "wio", -] - [[package]] name = "discard" version = "1.0.4" @@ -295,8 +337,8 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "druid" -version = "0.6.0" -source = "git+https://github.com/doppioandante/druid?branch=v0.6.0_stiletto#f8f8a566b77795cfa10caf7f2861f9240d159e90" +version = "0.7.0" +source = "git+https://github.com/doppioandante/druid?branch=v0.7.0_stiletto#f0a6fd3f6bece1b1d10e261ce57673d7f6f1969a" dependencies = [ "console_log", "druid-derive", @@ -305,6 +347,7 @@ dependencies = [ "fluent-langneg", "fluent-syntax", "fnv", + "harfbuzz-sys", "im", "instant", "log", @@ -312,13 +355,13 @@ dependencies = [ "unic-langid", "unicode-segmentation", "usvg", - "xi-unicode", + "xi-unicode 0.3.0", ] [[package]] name = "druid-derive" -version = "0.3.1" -source = "git+https://github.com/doppioandante/druid?branch=v0.6.0_stiletto#f8f8a566b77795cfa10caf7f2861f9240d159e90" +version = "0.4.0" +source = "git+https://github.com/doppioandante/druid?branch=v0.7.0_stiletto#f0a6fd3f6bece1b1d10e261ce57673d7f6f1969a" dependencies = [ "proc-macro2", "quote", @@ -327,17 +370,19 @@ dependencies = [ [[package]] name = "druid-shell" -version = "0.6.0" -source = "git+https://github.com/doppioandante/druid?branch=v0.6.0_stiletto#f8f8a566b77795cfa10caf7f2861f9240d159e90" +version = "0.7.0" +source = "git+https://github.com/doppioandante/druid?branch=v0.7.0_stiletto#f0a6fd3f6bece1b1d10e261ce57673d7f6f1969a" dependencies = [ "anyhow", "bitflags", + "block", "cairo-rs", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cocoa", - "core-graphics", + "core-graphics 0.22.2", "foreign-types", "gdk", + "gdk-pixbuf", "gdk-sys", "gio", "glib", @@ -346,11 +391,13 @@ dependencies = [ "gtk-sys", "instant", "js-sys", + "keyboard-types", "kurbo", "lazy_static", "log", "objc", "piet-common", + "scopeguard", "time", "wasm-bindgen", "web-sys", @@ -359,13 +406,13 @@ dependencies = [ ] [[package]] -name = "dxgi" -version = "0.1.7" +name = "dwrote" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1639bbfd6765e92a40267d217a7acbac5b49320b68013f39a8e4376aa8c1e091" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" dependencies = [ - "boolinator", - "num", + "lazy_static", + "libc", "winapi", "wio", ] @@ -430,6 +477,18 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fontdb" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccfec742e7db963305c1d8fde9edef949b47b01e1664dae127489928633fbea8" +dependencies = [ + "log", + "memmap2", + "ttf-parser", + "uuid", +] + [[package]] name = "foreign-types" version = "0.3.2" @@ -467,31 +526,41 @@ dependencies = [ ] [[package]] -name = "fuchsia-cprng" -version = "0.1.1" +name = "futures" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" dependencies = [ "futures-core", + "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" [[package]] name = "futures-executor" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" dependencies = [ "futures-core", "futures-task", @@ -500,15 +569,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -517,24 +586,31 @@ dependencies = [ ] [[package]] -name = "futures-task" -version = "0.3.8" +name = "futures-sink" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" -dependencies = [ - "once_cell", -] +checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" + +[[package]] +name = "futures-task" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" dependencies = [ + "futures-channel", "futures-core", + "futures-io", "futures-macro", + "futures-sink", "futures-task", - "pin-project", + "memchr", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -552,9 +628,9 @@ dependencies = [ [[package]] name = "gdk" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbe5e8772fc0865c52460cdd7a59d7d47700f44d9809d1dd00eecceb769a7589" +checksum = "db00839b2a68a7a10af3fa28dfb3febaba3a20c3a9ac2425a33b7df1f84a6b7d" dependencies = [ "bitflags", "cairo-rs", @@ -572,9 +648,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e248220c46b329b097d4b158d2717f8c688f16dd76d0399ace82b3e98062bdd7" +checksum = "8f6dae3cb99dd49b758b88f0132f8d401108e63ae8edd45f432d42cdff99998a" dependencies = [ "gdk-pixbuf-sys", "gio", @@ -587,22 +663,22 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8991b060a9e9161bafd09bf4a202e6fd404f5b4dd1a08d53a1e84256fb34ab0" +checksum = "3bfe468a7f43e97b8d193a762b6c5cf67a7d36cacbc0b9291dbcae24bfea1e8f" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gdk-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6adf679e91d1bff0c06860287f80403e7db54c2d2424dce0a470023b56c88fbb" +checksum = "0a9653cfc500fd268015b1ac055ddbc3df7a5c9ea3f4ccef147b3957bd140d69" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -612,15 +688,28 @@ dependencies = [ "libc", "pango-sys", "pkg-config", + "system-deps", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", ] [[package]] name = "gio" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd10f9415cce39b53f8024bf39a21f84f8157afa52da53837b102e585a296a5" +checksum = "1fb60242bfff700772dae5d9e3a1f7aa2e4ebccf18b89662a16acb2822568561" dependencies = [ "bitflags", + "futures", "futures-channel", "futures-core", "futures-io", @@ -629,27 +718,29 @@ dependencies = [ "glib", "glib-sys", "gobject-sys", - "lazy_static", "libc", + "once_cell", + "thiserror", ] [[package]] name = "gio-sys" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fad225242b9eae7ec8a063bb86974aca56885014672375e5775dc0ea3533911" +checksum = "5e24fb752f8f5d2cf6bbc2c606fd2bc989c81c5e2fe321ab974d54f8b6344eac" dependencies = [ "glib-sys", "gobject-sys", "libc", - "pkg-config", + "system-deps", + "winapi", ] [[package]] name = "glib" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fb573a09841b6386ddf15fd4bc6655b4f5b106ca962f57ecaecde32a0061c0" +checksum = "0c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5" dependencies = [ "bitflags", "futures-channel", @@ -657,38 +748,55 @@ dependencies = [ "futures-executor", "futures-task", "futures-util", + "glib-macros", "glib-sys", "gobject-sys", - "lazy_static", "libc", + "once_cell", +] + +[[package]] +name = "glib-macros" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41486a26d1366a8032b160b59065a59fb528530a46a49f627e7048fb8c064039" +dependencies = [ + "anyhow", + "heck", + "itertools", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "glib-sys" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95856f3802f446c05feffa5e24859fe6a183a7cb849c8449afc35c86b1e316e2" +checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1" dependencies = [ "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gobject-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d1a804f62034eccf370006ccaef3708a71c31d561fee88564abe71177553d9" +checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" dependencies = [ "glib-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gtk" -version = "0.8.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e1e8d70290239c668594002d1b174fcc7d7ef5d26670ee141490ede8facf8f" +checksum = "2f022f2054072b3af07666341984562c8e626a79daa8be27b955d12d06a5ad6a" dependencies = [ "atk", "bitflags", @@ -705,17 +813,18 @@ dependencies = [ "glib-sys", "gobject-sys", "gtk-sys", - "lazy_static", "libc", + "once_cell", "pango", "pango-sys", + "pkg-config", ] [[package]] name = "gtk-sys" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53def660c7b48b00b510c81ef2d2fbd3c570f1527081d8d7947f471513e1a4c1" +checksum = "89acda6f084863307d948ba64a4b1ef674e8527dddab147ee4cdcc194c880457" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -726,7 +835,7 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "pkg-config", + "system-deps", ] [[package]] @@ -736,21 +845,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "845f3e65ec4e30b0b1b6e1c055900871f3776d3492cc76744e3fc5943a6129a9" dependencies = [ "cc", - "core-graphics", - "core-text", + "core-graphics 0.19.2", + "core-text 15.0.0", "foreign-types", "freetype", "pkg-config", ] [[package]] -name = "harfbuzz_rs" -version = "1.2.0" +name = "heck" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bba81dd6b356135f0b31c42447e49d45116adc2e02910070947a322c423aa5" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" dependencies = [ - "bitflags", - "harfbuzz-sys", + "unicode-segmentation", ] [[package]] @@ -769,7 +877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "111c1983f3c5bb72732df25cddacee9b546d08325fb584b5ebd38148be7b0246" dependencies = [ "bitmaps", - "rand_core 0.5.1", + "rand_core", "rand_xoshiro", "sized-chunks", "typenum", @@ -808,6 +916,15 @@ dependencies = [ "unic-langid", ] +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.6" @@ -824,10 +941,19 @@ dependencies = [ ] [[package]] -name = "kurbo" -version = "0.6.3" +name = "keyboard-types" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9be561444b7e4c4ac33b4fa36af1f996ccca1f14840ea1a09ba034289502ed" +checksum = "a989afac88279b0482f402d234b5fbd405bf1ad051308595b58de4e6de22346b" +dependencies = [ + "bitflags", +] + +[[package]] +name = "kurbo" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16cb54cd28cb3d2e964d9444ca185676a94fd9b7cce5f02b22c717947ed8e9a2" dependencies = [ "arrayvec", ] @@ -868,6 +994,12 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + [[package]] name = "memmap2" version = "0.1.0" @@ -887,84 +1019,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" -dependencies = [ - "num-integer", - "num-traits", - "rand", - "rustc-serialize", -] - -[[package]] -name = "num-complex" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" -dependencies = [ - "num-traits", - "rustc-serialize", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", - "rustc-serialize", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - [[package]] name = "objc" version = "0.2.7" @@ -982,65 +1036,69 @@ checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] name = "pango" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c6b728f1be8edb5f9f981420b651d5ea30bdb9de89f1f1262d0084a020577" +checksum = "9937068580bebd8ced19975938573803273ccbcbd598c58d4906efd4ac87c438" dependencies = [ "bitflags", "glib", "glib-sys", "gobject-sys", - "lazy_static", "libc", + "once_cell", "pango-sys", ] [[package]] name = "pango-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b93d84907b3cf0819bff8f13598ba72843bee579d5ebc2502e4b0367b4be7d" +checksum = "24d2650c8b62d116c020abd0cea26a4ed96526afda89b1c4ea567131fdefc890" dependencies = [ "glib-sys", "gobject-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] -name = "piet" -version = "0.1.0" +name = "pico-args" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256d71caa7e165076ed6d2f0cda83b97fb4a5db2b42fd9a0d06cc8ac2deb11d4" +checksum = "28b9b4df73455c861d7cbf8be42f01d3b373ed7f02e378d55fa84eafc6f638b1" + +[[package]] +name = "piet" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f6fc8efb51e16882094fbfcd4b931f59773be4176f2512c6248e081a1b41f" dependencies = [ "kurbo", + "unic-bidi", ] [[package]] name = "piet-cairo" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a118675088b503c35ba2a91c43170ce2f843d88762285e48e8fc23ebdc7055b5" +checksum = "91834682e7b19ae26cebc0f3ad83a36d4ae2e4f95b85f2c93a34873f38319d29" dependencies = [ "cairo-rs", "piet", "unicode-segmentation", - "xi-unicode", + "xi-unicode 0.2.1", ] [[package]] name = "piet-common" -version = "0.1.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b7472760c8f856e0a37a423f8af46708cdaaadc3032beb93891372ea2bfeeda" +checksum = "77cbcec97e9c07c2a95bfa0d6c475fe2e22ae436e5209f9b7e03685c472c3976" dependencies = [ "cairo-rs", - "cfg-if 0.1.10", - "core-graphics", - "direct2d", - "direct3d11", - "directwrite", - "dxgi", + "cairo-sys-rs", + "cfg-if 1.0.0", + "core-graphics 0.22.2", "piet", "piet-cairo", "piet-coregraphics", @@ -1052,61 +1110,51 @@ dependencies = [ [[package]] name = "piet-coregraphics" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54bbdad6e50184dfefe691f25b998defb2d1a832f65fc77043b08c07b1153475" +checksum = "5af1ce12cf0a1dc7f894f6f90ba62467d685a39b7f1d235516c8688f98e92d18" dependencies = [ - "core-foundation", - "core-foundation-sys", - "core-graphics", - "core-text", + "core-foundation 0.9.1", + "core-foundation-sys 0.8.2", + "core-graphics 0.22.2", + "core-text 19.2.0", + "foreign-types", "piet", ] [[package]] name = "piet-direct2d" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de6a8f033611d567c42c1b06803c169b1bd8b2bdc5c6a1daef0739165dd5c908" +checksum = "019643fceb3667f79d1ed38101218cbabbfeb55c95f1a918b678e32042928418" dependencies = [ + "associative-cache", + "dwrote", "piet", + "utf16_lit", "winapi", "wio", ] [[package]] name = "piet-web" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e812147c55d1dd8be983f50f3a117e1cef1785b70c7e0a5e286db39ba986710" +checksum = "051dd0e8856c9837af0204f72b11636c8afba271a458eb877c887580208fa0ab" dependencies = [ "js-sys", "piet", "unicode-segmentation", "wasm-bindgen", "web-sys", - "xi-unicode", + "xi-unicode 0.3.0", ] [[package]] -name = "pin-project" -version = "1.0.2" +name = "pin-project-lite" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" [[package]] name = "pin-utils" @@ -1120,6 +1168,39 @@ version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -1150,34 +1231,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" @@ -1190,7 +1243,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004" dependencies = [ - "rand_core 0.5.1", + "rand_core", ] [[package]] @@ -1199,15 +1252,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be9e29cb19c8fe84169fcb07f8f11e66bc9e6e0280efd4715c54818296f8a4a8" -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rental" version = "0.5.5" @@ -1231,19 +1275,13 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.11.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5001f134077069d87f77c8b9452b690df2445f7a43f1c7ca4a1af8dd505789d" +checksum = "dbf7d7b1ea646d380d0e8153158063a6da7efe30ddbf3184042848e3f8a6f671" dependencies = [ "xmlparser", ] -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1253,12 +1291,34 @@ dependencies = [ "semver", ] +[[package]] +name = "rustybuzz" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab463a295d00f3692e0974a0bfd83c7a9bcd119e27e07c2beecdb1b44a09d10" +dependencies = [ + "bitflags", + "bytemuck", + "smallvec", + "ttf-parser", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-general-category", + "unicode-script", +] + [[package]] name = "ryu" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + [[package]] name = "semver" version = "0.9.0" @@ -1437,6 +1497,24 @@ dependencies = [ "serde_json", ] +[[package]] +name = "strum" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" + +[[package]] +name = "strum_macros" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "svgtypes" version = "0.5.0" @@ -1458,6 +1536,41 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "system-deps" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" +dependencies = [ + "heck", + "pkg-config", + "strum", + "strum_macros", + "thiserror", + "toml", + "version-compare", +] + +[[package]] +name = "thiserror" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "time" version = "0.2.23" @@ -1503,10 +1616,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29738eedb4388d9ea620eeab9384884fc3f06f586a2eddb56bedc5885126c7c1" [[package]] -name = "ttf-parser" -version = "0.6.2" +name = "toml" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "ttf-parser" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ddb402ac6c2af6f7a2844243887631c4e94b51585b229fcfddb43958cd55ca" [[package]] name = "type-map" @@ -1523,6 +1645,37 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +[[package]] +name = "unic-bidi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1356b759fb6a82050666f11dce4b6fe3571781f1449f3ef78074e408d468ec09" +dependencies = [ + "matches", + "unic-ucd-bidi", +] + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + [[package]] name = "unic-langid" version = "0.9.0" @@ -1541,6 +1694,26 @@ dependencies = [ "tinystr", ] +[[package]] +name = "unic-ucd-bidi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1d568b51222484e1f8209ce48caa6b430bf352962b877d592c29ab31fb53d8c" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -1550,6 +1723,24 @@ dependencies = [ "matches", ] +[[package]] +name = "unicode-bidi-mirroring" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" + +[[package]] +name = "unicode-ccc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28ae07c514c335bbd0251147bb1de333e28ebc8f57d792014f919ed212d119f6" + +[[package]] +name = "unicode-general-category" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9af028e052a610d99e066b33304625dea9613170a2563314490a4e6ec5cf7f" + [[package]] name = "unicode-script" version = "0.5.2" @@ -1576,19 +1767,21 @@ checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "usvg" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d98fe4bbd8cfe811fb84dabebd670d26b1e633ecb4d3a4ef3a4b8c10252448d" +checksum = "05a7ff57fca79848360bd2c00072a8029543cf554fe49c4d0af247271434702e" dependencies = [ "base64", "data-url", "flate2", - "harfbuzz_rs", + "fontdb", "kurbo", "log", "memmap2", + "pico-args", "rctree", "roxmltree", + "rustybuzz", "simplecss", "siphasher", "svgtypes", @@ -1599,12 +1792,39 @@ dependencies = [ "xmlwriter", ] +[[package]] +name = "utf16_lit" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403231d2fb8f0f55daf24cd03571f4fc1bb856e0fa98c1832bbae3f6ff7e7a07" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "version-compare" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" + [[package]] name = "version_check" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasm-bindgen" version = "0.2.68" @@ -1706,6 +1926,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e71b85d8b1b8bfaf4b5c834187554d201a8cd621c2bbfa33efd41a3ecabd48b2" +[[package]] +name = "xi-unicode" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" + [[package]] name = "xmlparser" version = "0.13.3" diff --git a/Cargo.toml b/Cargo.toml index 6ca75fc..b2d6cf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,23 +6,24 @@ edition = "2018" [dependencies] log = "0.4" -druid = { version = "0.6.0", features = ["im", "svg"] } +druid = { version = "0.7.0", features = ["im", "svg"] } im = { version = "*" } serde = { version = "1.0", features = ["derive"] } #serde_bare = "0.3.0" serde_json = "1.0" [patch.crates-io] -druid = { git = "https://github.com/doppioandante/druid", branch = "v0.6.0_stiletto", features = ["im", "svg"] } +druid = { git = "https://github.com/doppioandante/druid", branch = "v0.7.0_stiletto", features = ["im", "svg"] } +#druid = { path = "../druid/druid/", features = ["im", "svg"] } [dependencies.gtk] -version = "0.8.1" +version = "0.9.2" features = ["v3_22"] [dependencies.gio] -version = "0.8.1" +version = "0.9.1" features = ["v2_56"] [dependencies.gdk] -version = "0.12.1" +version = "0.13.2" features = ["v3_22"] diff --git a/src/main.rs b/src/main.rs index eb54e93..162fa40 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,12 +19,10 @@ use log::{info, warn}; use druid::commands; use druid::im::vector; use druid::widget::prelude::*; -use druid::widget::{ - Align, Button, CrossAxisAlignment, Flex, List, ListGrowDirection, SizedBox, WidgetExt, -}; +use druid::widget::{Align, Button, CrossAxisAlignment, Flex, List, SizedBox, WidgetExt}; use druid::{ AppDelegate, AppLauncher, Color, Command, Data, DelegateCtx, Env, FileDialogOptions, FileSpec, - Lens, LocalizedString, Target, WindowDesc, + Handled, Lens, LocalizedString, Target, WindowDesc, }; use im::Vector; @@ -44,11 +42,11 @@ pub fn main() { let default_pen_params = CanvasToolParams::Pen { thickness: 2.0, - color: Color::rgb(0, 0, 0), + color: Color::rgb(0.0, 0.0, 0.0), }; let default_pen_params_2 = CanvasToolParams::Pen { thickness: 2.0, - color: Color::rgb(255, 0, 0), + color: Color::rgb(255.0, 0.0, 0.0), }; let canvas_data = StilettoState { canvas: CanvasState { @@ -106,22 +104,18 @@ fn build_ui() -> impl Widget { let save_buttons = Flex::row() .cross_axis_alignment(CrossAxisAlignment::Center) .with_child(Button::new("Open").on_click(move |ctx, _, _| { - ctx.submit_command( - Command::new( - druid::commands::SHOW_OPEN_PANEL, - open_dialog_options.clone(), - ), - None, - ) + ctx.submit_command(Command::new( + druid::commands::SHOW_OPEN_PANEL, + open_dialog_options.clone(), + Target::Auto, + )) })) .with_child(Button::new("Save").on_click(move |ctx, _, _| { - ctx.submit_command( - Command::new( - druid::commands::SHOW_SAVE_PANEL, - save_dialog_options.clone(), - ), - None, - ) + ctx.submit_command(Command::new( + druid::commands::SHOW_SAVE_PANEL, + save_dialog_options.clone(), + Target::Auto, + )) })); let tool_buttons = Flex::row() @@ -132,10 +126,10 @@ fn build_ui() -> impl Widget { .padding((8.0, 0.0)) .on_click(|ctx, tool_state, _| { tool_state.selected = true; - ctx.submit_command(stiletto::commands::UPDATE_TOOL, None); + ctx.submit_command(stiletto::commands::UPDATE_TOOL); }) }) - .grow(ListGrowDirection::Right) + .horizontal() .lens(StilettoState::tool_icons), 1.0, ); @@ -167,10 +161,10 @@ impl AppDelegate for Delegate { cmd: &Command, data: &mut StilettoState, _env: &Env, - ) -> bool { + ) -> Handled { use std::fs::File; - if let Some(Some(file_info)) = cmd.get(commands::SAVE_FILE) { + if let Some(file_info) = cmd.get(commands::SAVE_FILE_AS) { let res_file = File::create(file_info.path()); if let Ok(f) = res_file { let write_res = @@ -183,7 +177,7 @@ impl AppDelegate for Delegate { } else { warn!("Cannot create file: {:?}", res_file.err()); } - return true; + return Handled::Yes; } if let Some(file_info) = cmd.get(commands::OPEN_FILE) { if let Ok(f) = File::open(file_info.path()) { @@ -196,7 +190,7 @@ impl AppDelegate for Delegate { warn!("didn't work: {:?}", res_snapshot.err()); } } - return true; + return Handled::Yes; } if cmd.get(stiletto::commands::UPDATE_TOOL).is_some() { let old_tool = data.current_tool; @@ -214,6 +208,6 @@ impl AppDelegate for Delegate { )); } } - false + Handled::No } } diff --git a/src/widget/tool_icon.rs b/src/widget/tool_icon.rs index b9b4a0c..4bcfb36 100644 --- a/src/widget/tool_icon.rs +++ b/src/widget/tool_icon.rs @@ -17,7 +17,7 @@ use druid::widget::{Container, SizedBox, Svg, SvgData, ViewSwitcher, WidgetExt}; use druid::{Color, Data, UnitPoint}; -use crate::tool::{CanvasToolParams, CanvasToolType}; +use crate::tool::CanvasToolParams; #[derive(Clone, Data)] pub struct CanvasToolIconState { @@ -26,10 +26,6 @@ pub struct CanvasToolIconState { } impl CanvasToolIconState { - fn tool_type(&self) -> CanvasToolType { - self.tool_params.tool_type() - } - fn svg_data(&self) -> SvgData { match self.tool_params { CanvasToolParams::Pen { .. } => include_str!("../../icons/pen.svg") @@ -46,9 +42,9 @@ pub fn build_simple_tool_widget( width: f64, height: f64, padding: f64, -) -> ViewSwitcher { - ViewSwitcher::::new( - |tool_state, _| (tool_state.tool_type(), tool_state.selected), +) -> ViewSwitcher { + ViewSwitcher::::new( + |tool_state, _| tool_state.clone(), move |_, tool_state, _| { Box::new( Container::new( @@ -62,7 +58,7 @@ pub fn build_simple_tool_widget( ) .border( if tool_state.selected { - Color::rgb(10, 10, 10) + Color::rgb(10.0, 10.0, 10.0) } else { Color::BLACK },