diff --git a/Cargo.lock b/Cargo.lock index 553996ae..3d27ff6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,7 +41,7 @@ checksum = "134d0acf6acb667c89d3332999b1a5df4edbc8d6113910f392ebb73f2b03bb56" dependencies = [ "accesskit", "accesskit_consumer", - "objc2", + "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", ] @@ -68,7 +68,7 @@ checksum = "9eac0a7f2d7cd7a93b938af401d3d8e8b7094217989a7c25c55a953023436e31" dependencies = [ "accesskit", "accesskit_consumer", - "arrayvec 0.7.6", + "arrayvec", "once_cell", "paste", "windows 0.48.0", @@ -129,6 +129,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "alsa" version = "0.7.1" @@ -262,15 +268,6 @@ version = "1.0.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72" -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] - [[package]] name = "approx" version = "0.5.1" @@ -281,10 +278,10 @@ dependencies = [ ] [[package]] -name = "arrayvec" -version = "0.5.2" +name = "arrayref" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -298,6 +295,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[package]] +name = "ash" +version = "0.37.3+1.3.251" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +dependencies = [ + "libloading 0.7.4", +] + [[package]] name = "assert_no_alloc" version = "1.1.2" @@ -365,21 +371,6 @@ dependencies = [ "futures-lite 1.13.0", ] -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.4", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - [[package]] name = "async-io" version = "1.13.0" @@ -439,17 +430,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-net" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" -dependencies = [ - "async-io 1.13.0", - "blocking", - "futures-lite 1.13.0", -] - [[package]] name = "async-process" version = "1.8.1" @@ -496,33 +476,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-task" version = "4.7.1" @@ -618,22 +571,10 @@ dependencies = [ ] [[package]] -name = "baseview" -version = "0.1.0" -source = "git+https://github.com/RustAudio/baseview.git?rev=1d9806d5bd92275d0d8142d9c9c90198757b9b25#1d9806d5bd92275d0d8142d9c9c90198757b9b25" -dependencies = [ - "cocoa", - "core-foundation", - "keyboard-types", - "nix 0.22.3", - "objc", - "raw-window-handle 0.4.3", - "uuid", - "winapi", - "x11", - "xcb 0.9.0", - "xcb-util", -] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "baseview" @@ -641,7 +582,7 @@ version = "0.1.0" source = "git+https://github.com/RustAudio/baseview.git?rev=2c1b1a7b0fef1a29a5150a6a8f6fef6a0cbab8c4#2c1b1a7b0fef1a29a5150a6a8f6fef6a0cbab8c4" dependencies = [ "cocoa", - "core-foundation", + "core-foundation 0.9.4", "keyboard-types", "nix 0.22.3", "objc", @@ -649,7 +590,7 @@ dependencies = [ "uuid", "winapi", "x11", - "xcb 0.9.0", + "xcb", "xcb-util", ] @@ -659,7 +600,7 @@ version = "0.1.0" source = "git+https://github.com/RustAudio/baseview.git?rev=45465c5f46abed6c6ce370fffde5edc8e4cd5aa3#45465c5f46abed6c6ce370fffde5edc8e4cd5aa3" dependencies = [ "cocoa", - "core-foundation", + "core-foundation 0.9.4", "keyboard-types", "nix 0.22.3", "objc", @@ -676,7 +617,7 @@ version = "0.1.0" source = "git+https://github.com/RustAudio/baseview.git?rev=579130ecb4f9f315ae52190af42f0ea46aeaa4a2#579130ecb4f9f315ae52190af42f0ea46aeaa4a2" dependencies = [ "cocoa", - "core-foundation", + "core-foundation 0.9.4", "keyboard-types", "nix 0.22.3", "objc", @@ -707,6 +648,21 @@ dependencies = [ "syn 2.0.75", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -740,7 +696,7 @@ version = "0.1.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", ] [[package]] @@ -750,7 +706,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" dependencies = [ "block-sys", - "objc2-encode", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.2", ] [[package]] @@ -779,6 +744,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + [[package]] name = "bytemuck" version = "1.17.0" @@ -817,6 +788,32 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "981520c98f422fcc584dc1a95c334e6953900b9106bc47a9839b81790009eb21" +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.6.0", + "log", + "polling 3.7.3", + "rustix 0.38.34", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop", + "rustix 0.38.34", + "wayland-backend", + "wayland-client", +] + [[package]] name = "camino" version = "1.1.9" @@ -894,6 +891,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "cgl" version = "0.3.2" @@ -903,12 +906,6 @@ dependencies = [ "libc", ] -[[package]] -name = "checked_int_cast" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" - [[package]] name = "chrono" version = "0.4.38" @@ -991,12 +988,42 @@ dependencies = [ ] [[package]] -name = "cmake" -version = "0.1.51" +name = "clipboard-win" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" dependencies = [ - "cc", + "error-code", +] + +[[package]] +name = "clipboard_macos" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7f4aaa047ba3c3630b080bb9860894732ff23e2aee290a418909aa6d5df38f" +dependencies = [ + "objc2 0.5.2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "clipboard_wayland" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003f886bc4e2987729d10c1db3424e7f80809f3fc22dbc16c685738887cb37b8" +dependencies = [ + "smithay-clipboard", +] + +[[package]] +name = "clipboard_x11" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4274ea815e013e0f9f04a2633423e14194e408a0576c943ce3d14ca56c50031c" +dependencies = [ + "thiserror", + "x11rb 0.13.1", ] [[package]] @@ -1008,9 +1035,9 @@ dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types", + "core-foundation 0.9.4", + "core-graphics 0.22.3", + "foreign-types 0.3.2", "libc", "objc", ] @@ -1023,12 +1050,22 @@ checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" dependencies = [ "bitflags 1.3.2", "block", - "core-foundation", - "core-graphics-types", + "core-foundation 0.9.4", + "core-graphics-types 0.1.3", "libc", "objc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -1041,6 +1078,37 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "combine" version = "4.6.7" @@ -1076,27 +1144,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "copypasta" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" -dependencies = [ - "clipboard-win", - "objc", - "objc-foundation", - "objc_id", - "smithay-clipboard", - "x11-clipboard 0.5.3", -] - [[package]] name = "copypasta" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "133fc8675ee3a4ec9aa513584deda9aa0faeda3586b87f7f0f2ba082c66fb172" dependencies = [ - "clipboard-win", + "clipboard-win 3.1.1", "objc", "objc-foundation", "objc_id", @@ -1109,7 +1163,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb85422867ca93da58b7f95fb5c0c10f6183ed6e1ef8841568968a896d3a858" dependencies = [ - "clipboard-win", + "clipboard-win 3.1.1", "objc", "objc-foundation", "objc_id", @@ -1126,6 +1180,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1139,9 +1203,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types", + "core-foundation 0.9.4", + "core-graphics-types 0.1.3", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", + "core-graphics-types 0.2.0", + "foreign-types 0.5.0", "libc", ] @@ -1152,19 +1229,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "libc", ] [[package]] -name = "core-text" -version = "19.2.0" +name = "core-graphics-types" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "core-foundation", - "core-graphics", - "foreign-types", + "bitflags 2.6.0", + "core-foundation 0.10.0", "libc", ] @@ -1194,7 +1270,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a7847ca018a67204508b77cb9e6de670125075f7464fff5f673023378fa34f5" dependencies = [ - "core-foundation", + "core-foundation 0.9.4", "core-foundation-sys", "coremidi-sys", ] @@ -1214,13 +1290,36 @@ version = "0.8.0" source = "git+https://github.com/pop-os/cosmic-text?rev=79275d15e857428e9b8874f28413197e878f3788#79275d15e857428e9b8874f28413197e878f3788" dependencies = [ "aliasable", - "fontdb", + "fontdb 0.14.1", "libm", "log", "rangemap", - "rustybuzz", + "rustybuzz 0.7.0", + "swash", + "sys-locale", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", +] + +[[package]] +name = "cosmic-text" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fd57d82eb4bfe7ffa9b1cec0c05e2fd378155b47f255a67983cb4afe0e80c2" +dependencies = [ + "bitflags 2.6.0", + "fontdb 0.16.2", + "log", + "rangemap", + "rayon", + "rustc-hash 1.1.0", + "rustybuzz 0.14.1", + "self_cell 1.0.4", "swash", "sys-locale", + "ttf-parser 0.21.1", "unicode-bidi", "unicode-linebreak", "unicode-script", @@ -1340,6 +1439,12 @@ dependencies = [ "realfft", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -1378,10 +1483,27 @@ dependencies = [ ] [[package]] -name = "cty" -version = "0.2.2" +name = "ctor-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f791803201ab277ace03903de1594460708d2d54df6053f2d9e82f592b19e3b" + +[[package]] +name = "cursor-icon" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + +[[package]] +name = "d3d12" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" +dependencies = [ + "bitflags 2.6.0", + "libloading 0.7.4", + "winapi", +] [[package]] name = "dasp_sample" @@ -1389,6 +1511,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" +[[package]] +name = "data-url" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" + [[package]] name = "deranged" version = "0.3.11" @@ -1446,29 +1574,8 @@ dependencies = [ ] [[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dispatch" -version = "0.2.0" +name = "dispatch" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" @@ -1498,6 +1605,45 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "drm" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98888c4bbd601524c11a7ed63f814b8825f420514f78e96f752c437ae9cbb5d1" +dependencies = [ + "bitflags 2.6.0", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "rustix 0.38.34", +] + +[[package]] +name = "drm-ffi" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c98727e48b7ccb4f4aea8cfe881e5b07f702d17b7875991881b41af7278d53" +dependencies = [ + "drm-sys", + "rustix 0.38.34", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd39dde40b6e196c2e8763f23d119ddb1a8714534bf7d77fa97a65b0feda3986" +dependencies = [ + "libc", + "linux-raw-sys 0.6.5", +] + [[package]] name = "dtoa" version = "1.0.9" @@ -1513,18 +1659,6 @@ dependencies = [ "dtoa", ] -[[package]] -name = "dwrote" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" -dependencies = [ - "lazy_static", - "libc", - "winapi", - "wio", -] - [[package]] name = "ecolor" version = "0.27.2" @@ -1642,6 +1776,22 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + +[[package]] +name = "etagere" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e2f1e3be19fb10f549be8c1bf013e8675b4066c445e36eb76d2ebb2f54ee495" +dependencies = [ + "euclid", + "svg_fmt", +] + [[package]] name = "euclid" version = "0.22.10" @@ -1690,14 +1840,10 @@ dependencies = [ ] [[package]] -name = "expat-sys" -version = "2.1.6" +name = "fast-srgb8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" -dependencies = [ - "cmake", - "pkg-config", -] +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" [[package]] name = "fastrand" @@ -1735,9 +1881,9 @@ dependencies = [ "glow 0.12.3", "image", "imgref", - "lru", + "lru 0.10.1", "rgb", - "rustybuzz", + "rustybuzz 0.7.0", "unicode-bidi", "unicode-segmentation", "wasm-bindgen", @@ -1755,19 +1901,16 @@ dependencies = [ ] [[package]] -name = "float-ord" -version = "0.2.0" +name = "float-cmp" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" [[package]] name = "float_next_after" -version = "0.1.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc612c5837986b7104a87a0df74a5460931f1c5274be12f8d0f40aa2f30d632" -dependencies = [ - "num-traits", -] +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" [[package]] name = "fluent-bundle" @@ -1810,37 +1953,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "font-kit" -version = "0.10.1" +name = "font-types" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c9a156ec38864999bc9c4156e5f3b50224d4a5578028a64e5a3875caa9ee28" +checksum = "8f0189ccb084f77c5523e08288d418cbaa09c451a08515678a0aa265df9a8b60" dependencies = [ - "bitflags 1.3.2", - "byteorder", - "core-foundation", - "core-graphics", - "core-text", - "dirs-next", - "dwrote", - "float-ord", - "freetype", - "lazy_static", - "libc", - "log", - "pathfinder_geometry", - "pathfinder_simd", - "servo-fontconfig", - "walkdir", - "winapi", + "bytemuck", ] [[package]] -name = "font-types" -version = "0.6.0" +name = "fontconfig-parser" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0189ccb084f77c5523e08288d418cbaa09c451a08515678a0aa265df9a8b60" +checksum = "c1fcfcd44ca6e90c921fee9fa665d530b21ef1327a4c1a6c5250ea44b776ada7" dependencies = [ - "bytemuck", + "roxmltree", ] [[package]] @@ -1856,41 +1983,75 @@ dependencies = [ "ttf-parser 0.19.2", ] +[[package]] +name = "fontdb" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2 0.9.5", + "slotmap", + "tinyvec", + "ttf-parser 0.20.0", +] + +[[package]] +name = "fontdb" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2 0.9.5", + "slotmap", + "tinyvec", + "ttf-parser 0.21.1", +] + [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "foreign-types" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] [[package]] -name = "freetype" -version = "0.7.0" +name = "foreign-types-macros" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ - "freetype-sys", - "libc", + "proc-macro2", + "quote", + "syn 2.0.75", ] [[package]] -name = "freetype-sys" -version = "0.13.1" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" -dependencies = [ - "cmake", - "libc", - "pkg-config", -] +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "futures" @@ -2115,6 +2276,16 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gif" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.29.0" @@ -2134,12 +2305,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.10.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579160312273c954cc51bd440f059dde741029ac8daf8c84fece76cb77f62c15" -dependencies = [ - "version_check", -] +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" [[package]] name = "glob" @@ -2147,30 +2315,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "glow" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "glow" version = "0.12.3" @@ -2195,18 +2339,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "glow_glyph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4e62c64947b9a24fe20e2bba9ad819ecb506ef5c8df7ffc4737464c6df9510" -dependencies = [ - "bytemuck", - "glow 0.11.2", - "glyph_brush", - "log", -] - [[package]] name = "glutin" version = "0.30.10" @@ -2214,15 +2346,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc93b03242719b8ad39fb26ed2b01737144ce7bd4bfc7adadcef806596760fe" dependencies = [ "bitflags 1.3.2", - "cfg_aliases", + "cfg_aliases 0.1.1", "cgl", - "core-foundation", + "core-foundation 0.9.4", "dispatch", "glutin_egl_sys", "glutin_glx_sys", - "glutin_wgl_sys", + "glutin_wgl_sys 0.4.0", "libloading 0.7.4", - "objc2", + "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", "raw-window-handle 0.5.2", "windows-sys 0.45.0", @@ -2235,7 +2367,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "629a873fc04062830bfe8f97c03773bcd7b371e23bcc465d0a61448cd1588fa4" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.1.1", "glutin", "raw-window-handle 0.5.2", "winit", @@ -2271,52 +2403,95 @@ dependencies = [ ] [[package]] -name = "glyph_brush" -version = "0.7.9" +name = "glutin_wgl_sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca26e3a8a43052ca015c0b1ce055035ff5bc47afddff5b01c7141e0c3e3a2a1" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" dependencies = [ - "glyph_brush_draw_cache", - "glyph_brush_layout", - "ordered-float", - "rustc-hash 2.0.0", - "twox-hash", + "gl_generator", ] [[package]] -name = "glyph_brush_draw_cache" -version = "0.1.6" +name = "goblin" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6c910def52365fef3f439a6b50a4d5c11b28eec4cf6c191f6dfea18e88d7f" +checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" dependencies = [ - "ab_glyph", - "crossbeam-channel", - "crossbeam-deque", - "linked-hash-map", - "rayon", - "rustc-hash 2.0.0", + "log", + "plain", + "scroll", ] [[package]] -name = "glyph_brush_layout" -version = "0.2.4" +name = "gpu-alloc" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1e288bfd2f6c0313f78bf5aa538356ad481a3bb97e9b7f93220ab0066c5992" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "ab_glyph", - "approx 0.5.1", - "xi-unicode", + "bitflags 2.6.0", + "gpu-alloc-types", ] [[package]] -name = "goblin" -version = "0.6.1" +name = "gpu-alloc-types" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ "log", - "plain", - "scroll", + "presser", + "thiserror", + "winapi", + "windows 0.52.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" +dependencies = [ + "bitflags 2.6.0", + "gpu-descriptor-types", + "hashbrown", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "guillotiere" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" +dependencies = [ + "euclid", + "svg_fmt", +] + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", ] [[package]] @@ -2324,6 +2499,25 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hassle-rs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" +dependencies = [ + "bitflags 2.6.0", + "com", + "libc", + "libloading 0.7.4", + "thiserror", + "widestring", + "winapi", +] [[package]] name = "heck" @@ -2358,6 +2552,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + [[package]] name = "iana-time-zone" version = "0.1.60" @@ -2383,94 +2583,170 @@ dependencies = [ [[package]] name = "iced_baseview" -version = "0.0.3" -source = "git+https://github.com/robbert-vdh/iced_baseview.git?branch=feature/update-baseview#df3a852a15cf0e9fcc8d2b32f5718e56780beaf3" +version = "0.1.0" +source = "git+https://github.com/BillyDM/iced_baseview.git?rev=a0842a8205c852127981e27de6342cf2e665562f#a0842a8205c852127981e27de6342cf2e665562f" dependencies = [ - "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=1d9806d5bd92275d0d8142d9c9c90198757b9b25)", - "copypasta 0.7.1", - "iced_core", - "iced_futures", - "iced_glow", + "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=579130ecb4f9f315ae52190af42f0ea46aeaa4a2)", + "cfg-if", "iced_graphics", - "iced_native", + "iced_renderer", + "iced_runtime", + "iced_widget", "keyboard-types", - "raw-window-handle 0.4.3", + "log", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", + "thiserror", + "window_clipboard", ] [[package]] name = "iced_core" -version = "0.4.0" -source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0013a238275494641bf8f1732a23a808196540dc67b22ff97099c044ae4c8a1c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", + "bytes", + "glam", + "log", + "num-traits", + "once_cell", "palette", - "wasm-timer", + "rustc-hash 2.0.0", + "smol_str", + "thiserror", + "web-time", ] [[package]] name = "iced_futures" -version = "0.3.0" -source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c04a6745ba2e80f32cf01e034fd00d853aa4f4cd8b91888099cb7aaee0d5d7c" dependencies = [ - "async-std", "futures", + "iced_core", "log", - "smol", - "tokio", + "rustc-hash 2.0.0", "wasm-bindgen-futures", "wasm-timer", ] [[package]] -name = "iced_glow" -version = "0.2.0" -source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +name = "iced_glyphon" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c3bb56f1820ca252bc1d0994ece33d233a55657c0c263ea7cb16895adbde82" dependencies = [ - "bytemuck", - "euclid", - "glow 0.11.2", - "glow_glyph", - "glyph_brush", - "iced_graphics", - "iced_native", - "log", + "cosmic-text 0.12.1", + "etagere", + "lru 0.12.5", + "rustc-hash 2.0.0", + "wgpu", ] [[package]] name = "iced_graphics" -version = "0.2.0" -source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba25a18cfa6d5cc160aca7e1b34f73ccdff21680fa8702168c09739767b6c66f" dependencies = [ + "bitflags 2.6.0", "bytemuck", - "font-kit", - "glam", - "iced_native", - "iced_style", - "lyon", - "qrcode", - "raw-window-handle 0.4.3", + "cosmic-text 0.12.1", + "half", + "iced_core", + "iced_futures", + "image", + "kamadak-exif", + "log", + "lyon_path", + "once_cell", + "raw-window-handle 0.6.2", + "rustc-hash 2.0.0", "thiserror", + "unicode-segmentation", ] [[package]] -name = "iced_native" -version = "0.4.0" -source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +name = "iced_renderer" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73558208059f9e622df2bf434e044ee2f838ce75201a023cf0ca3e1244f46c2a" +dependencies = [ + "iced_graphics", + "iced_tiny_skia", + "iced_wgpu", + "log", + "thiserror", +] + +[[package]] +name = "iced_runtime" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348b5b2c61c934d88ca3b0ed1ed913291e923d086a66fa288ce9669da9ef62b5" dependencies = [ + "bytes", "iced_core", "iced_futures", - "iced_style", - "num-traits", - "twox-hash", - "unicode-segmentation", + "raw-window-handle 0.6.2", + "thiserror", ] [[package]] -name = "iced_style" -version = "0.3.0" -source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +name = "iced_tiny_skia" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c625d368284fcc43b0b36b176f76eff1abebe7959dd58bd8ce6897d641962a50" dependencies = [ - "iced_core", + "bytemuck", + "cosmic-text 0.12.1", + "iced_graphics", + "kurbo 0.10.4", + "log", + "resvg", + "rustc-hash 2.0.0", + "softbuffer", + "tiny-skia", +] + +[[package]] +name = "iced_wgpu" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15708887133671d2bcc6c1d01d1f176f43a64d6cdc3b2bf893396c3ee498295f" +dependencies = [ + "bitflags 2.6.0", + "bytemuck", + "futures", + "glam", + "guillotiere", + "iced_glyphon", + "iced_graphics", + "log", + "lyon", + "once_cell", + "resvg", + "rustc-hash 2.0.0", + "thiserror", + "wgpu", +] + +[[package]] +name = "iced_widget" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81429e1b950b0e4bca65be4c4278fea6678ea782030a411778f26fa9f8983e1d" +dependencies = [ + "iced_renderer", + "iced_runtime", + "num-traits", + "once_cell", + "rustc-hash 2.0.0", + "thiserror", + "unicode-segmentation", ] [[package]] @@ -2486,6 +2762,12 @@ dependencies = [ "png", ] +[[package]] +name = "imagesize" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" + [[package]] name = "imgref" version = "1.10.1" @@ -2623,6 +2905,12 @@ dependencies = [ "libc", ] +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + [[package]] name = "js-sys" version = "0.3.70" @@ -2632,6 +2920,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kamadak-exif" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" +dependencies = [ + "mutate_once", +] + [[package]] name = "keyboard-types" version = "0.6.2" @@ -2641,6 +2938,17 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading 0.8.5", + "pkg-config", +] + [[package]] name = "khronos_api" version = "3.1.0" @@ -2648,12 +2956,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] -name = "kv-log-macro" -version = "1.0.7" +name = "kurbo" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" dependencies = [ - "log", + "arrayvec", + "smallvec", +] + +[[package]] +name = "kurbo" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89234b2cc610a7dd927ebde6b41dd1a5d4214cffaef4cf1fb2195d592f92518f" +dependencies = [ + "arrayvec", + "smallvec", ] [[package]] @@ -2717,22 +3036,6 @@ dependencies = [ "redox_syscall 0.4.1", ] -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -2745,6 +3048,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "linux-raw-sys" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" + [[package]] name = "lock_api" version = "0.4.12" @@ -2760,9 +3069,6 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] [[package]] name = "loudness_war_winner" @@ -2777,11 +3083,17 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" + [[package]] name = "lyon" -version = "0.17.10" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf0510ed5e3e2fb80f3db2061ef5ca92d87bfda1a624bb1eacf3bd50226e4cbb" +checksum = "91e7f9cda98b5430809e63ca5197b06c7d191bf7e26dfc467d5a3f0290e2a74f" dependencies = [ "lyon_algorithms", "lyon_tessellation", @@ -2789,42 +3101,44 @@ dependencies = [ [[package]] name = "lyon_algorithms" -version = "0.17.7" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037f716541ba0d84d3de05c0069f8068baf73990d55980558b84d944c8a244a" +checksum = "a3bca95f9a4955b3e4a821fbbcd5edfbd9be2a9a50bb5758173e5358bfb4c623" dependencies = [ "lyon_path", - "sid", + "num-traits", ] [[package]] name = "lyon_geom" -version = "0.17.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d89ccbdafd83d259403e22061be27bccc3254bba65cdc5303250c4227c8c8e" +checksum = "8af69edc087272df438b3ee436c4bb6d7c04aa8af665cfd398feae627dbd8570" dependencies = [ - "arrayvec 0.5.2", + "arrayvec", "euclid", "num-traits", ] [[package]] name = "lyon_path" -version = "0.17.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0a59fdf767ca0d887aa61d1b48d4bbf6a124c1a45503593f7d38ab945bfbc0" +checksum = "8e0b8aec2f58586f6eef237985b9a9b7cb3a3aff4417c575075cf95bf925252e" dependencies = [ "lyon_geom", + "num-traits", ] [[package]] name = "lyon_tessellation" -version = "0.17.10" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7230e08dd0638048e46f387f255dbe7a7344a3e6705beab53242b5af25635760" +checksum = "579d42360a4b09846eff2feef28f538696c7d6c7439bfa65874ff3cbe0951b2c" dependencies = [ "float_next_after", "lyon_path", + "num-traits", ] [[package]] @@ -2859,18 +3173,18 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.5.10" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ "libc", ] [[package]] name = "memmap2" -version = "0.6.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -2902,6 +3216,21 @@ dependencies = [ "autocfg", ] +[[package]] +name = "metal" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" +dependencies = [ + "bitflags 2.6.0", + "block", + "core-graphics-types 0.1.3", + "foreign-types 0.5.0", + "log", + "objc", + "paste", +] + [[package]] name = "midi-consts" version = "0.1.0" @@ -2968,6 +3297,32 @@ dependencies = [ "smallvec", ] +[[package]] +name = "mutate_once" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" + +[[package]] +name = "naga" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" +dependencies = [ + "bit-set", + "bitflags 2.6.0", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "num-traits", + "rustc-hash 1.1.0", + "spirv", + "termcolor", + "thiserror", + "unicode-xid", +] + [[package]] name = "ndk" version = "0.7.0" @@ -3040,7 +3395,7 @@ version = "0.0.0" dependencies = [ "anyhow", "anymap", - "approx 0.5.1", + "approx", "assert_no_alloc", "atomic_float", "atomic_refcell", @@ -3050,7 +3405,7 @@ dependencies = [ "cfg-if", "clap", "clap-sys", - "core-foundation", + "core-foundation 0.9.4", "cpal", "crossbeam", "jack", @@ -3105,12 +3460,13 @@ name = "nih_plug_iced" version = "0.0.0" dependencies = [ "atomic_refcell", - "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=1d9806d5bd92275d0d8142d9c9c90198757b9b25)", + "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=579130ecb4f9f315ae52190af42f0ea46aeaa4a2)", "crossbeam", + "futures-util", "iced_baseview", "nih_plug", "nih_plug_assets", - "raw-window-handle 0.4.3", + "raw-window-handle 0.5.2", "serde", ] @@ -3233,6 +3589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3324,6 +3681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", + "objc_exception", ] [[package]] @@ -3344,23 +3702,131 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" [[package]] -name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.3.0-beta.3.patch-leaks.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +dependencies = [ + "block2 0.2.0-alpha.6", + "objc-sys 0.2.0-beta.2", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys 0.3.5", + "objc2-encode 4.0.3", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "2.0.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +dependencies = [ + "objc-sys 0.2.0-beta.2", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "block2", - "objc-sys", - "objc2-encode", + "bitflags 2.6.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", + "objc2-metal", ] [[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" +name = "objc_exception" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" dependencies = [ - "objc-sys", + "cc", ] [[package]] @@ -3426,16 +3892,7 @@ version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "libredox 0.0.2", -] - -[[package]] -name = "ordered-float" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" -dependencies = [ - "num-traits", + "libredox", ] [[package]] @@ -3459,26 +3916,26 @@ dependencies = [ [[package]] name = "palette" -version = "0.5.0" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05c0334468e62a4dfbda34b29110aa7d70d58c7fdb2c9857b5874dd9827cc59" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" dependencies = [ - "approx 0.3.2", - "num-traits", + "approx", + "fast-srgb8", "palette_derive", - "phf 0.8.0", - "phf_codegen", + "phf 0.11.2", ] [[package]] name = "palette_derive" -version = "0.5.0" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b4b5f600e60dd3a147fb57b4547033d382d1979eb087af310e91cb45a63b1f4" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" dependencies = [ + "by_address", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.75", ] [[package]] @@ -3547,25 +4004,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" -[[package]] -name = "pathfinder_geometry" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" -dependencies = [ - "log", - "pathfinder_simd", -] - -[[package]] -name = "pathfinder_simd" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf07ef4804cfa9aea3b04a7bbdd5a40031dbb6b4f2cbaf2b011666c80c5b4f2" -dependencies = [ - "rustc_version", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -3587,11 +4025,21 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ - "phf_macros", + "phf_macros 0.10.0", "phf_shared 0.10.0", "proc-macro-hack", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros 0.11.2", + "phf_shared 0.11.2", +] + [[package]] name = "phf_codegen" version = "0.8.0" @@ -3622,6 +4070,16 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + [[package]] name = "phf_macros" version = "0.10.0" @@ -3636,13 +4094,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.75", +] + [[package]] name = "phf_shared" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" dependencies = [ - "siphasher", + "siphasher 0.3.11", ] [[package]] @@ -3651,9 +4122,24 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "siphasher", + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher 0.3.11", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -3763,6 +4249,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "primal-check" version = "0.3.4" @@ -3806,6 +4298,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" + [[package]] name = "puberty_simulator" version = "0.1.0" @@ -3814,20 +4312,11 @@ dependencies = [ "realfft", ] -[[package]] -name = "qrcode" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" -dependencies = [ - "checked_int_cast", -] - [[package]] name = "quick-xml" -version = "0.22.0" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", ] @@ -3931,6 +4420,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "range-alloc" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" + [[package]] name = "rangemap" version = "1.5.1" @@ -3939,18 +4434,15 @@ checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "raw-window-handle" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" -dependencies = [ - "cty", -] +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "raw-window-handle" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rayon" @@ -4027,17 +4519,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom 0.2.15", - "libredox 0.1.3", - "thiserror", -] - [[package]] name = "reflink" version = "0.1.3" @@ -4076,6 +4557,28 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "resvg" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "944d052815156ac8fa77eaac055220e95ba0b01fa8887108ca710c03805d9051" +dependencies = [ + "gif", + "jpeg-decoder", + "log", + "pico-args", + "rgb", + "svgtypes", + "tiny-skia", + "usvg", +] + [[package]] name = "rgb" version = "0.8.48" @@ -4085,6 +4588,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "roxmltree" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" + [[package]] name = "rtrb" version = "0.2.3" @@ -4174,12 +4683,29 @@ dependencies = [ "libm", "smallvec", "ttf-parser 0.18.1", - "unicode-bidi-mirroring", - "unicode-ccc", + "unicode-bidi-mirroring 0.1.0", + "unicode-ccc 0.1.2", "unicode-general-category", "unicode-script", ] +[[package]] +name = "rustybuzz" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" +dependencies = [ + "bitflags 2.6.0", + "bytemuck", + "libm", + "smallvec", + "ttf-parser 0.21.1", + "unicode-bidi-mirroring 0.2.0", + "unicode-ccc 0.2.0", + "unicode-properties", + "unicode-script", +] + [[package]] name = "ryu" version = "1.0.18" @@ -4326,27 +4852,6 @@ dependencies = [ "serde", ] -[[package]] -name = "servo-fontconfig" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" -dependencies = [ - "libc", - "servo-fontconfig-sys", -] - -[[package]] -name = "servo-fontconfig-sys" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" -dependencies = [ - "expat-sys", - "freetype-sys", - "pkg-config", -] - [[package]] name = "sha1" version = "0.10.6" @@ -4364,15 +4869,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "sid" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5ac56c121948b4879bba9e519852c211bcdd8f014efff766441deff0b91bdb" -dependencies = [ - "num-traits", -] - [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -4388,6 +4884,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simplecss" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a11be7c62927d9427e9f40f3444d5499d868648e2edbc4e2116de69e7ec0e89d" +dependencies = [ + "log", +] + [[package]] name = "sine" version = "0.1.0" @@ -4401,6 +4906,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "skrifa" version = "0.20.0" @@ -4437,47 +4948,47 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay-client-toolkit" -version = "0.16.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 1.3.2", - "dlib", - "lazy_static", + "bitflags 2.6.0", + "calloop", + "calloop-wayland-source", + "cursor-icon", + "libc", "log", - "memmap2 0.5.10", - "nix 0.24.3", - "pkg-config", + "memmap2 0.9.5", + "rustix 0.38.34", + "thiserror", + "wayland-backend", "wayland-client", + "wayland-csd-frame", "wayland-cursor", "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner 0.31.5", + "xkeysym", ] [[package]] name = "smithay-clipboard" -version = "0.6.6" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" +checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" dependencies = [ + "libc", "smithay-client-toolkit", - "wayland-client", + "wayland-backend", ] [[package]] -name = "smol" -version = "1.3.0" +name = "smol_str" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" dependencies = [ - "async-channel 1.9.0", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-net", - "async-process", - "blocking", - "futures-lite 1.13.0", + "serde", ] [[package]] @@ -4494,10 +5005,42 @@ dependencies = [ name = "soft_vacuum" version = "0.1.0" dependencies = [ - "approx 0.5.1", + "approx", "nih_plug", ] +[[package]] +name = "softbuffer" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" +dependencies = [ + "as-raw-xcb-connection", + "bytemuck", + "cfg_aliases 0.2.1", + "core-graphics 0.24.0", + "drm", + "fastrand 2.1.0", + "foreign-types 0.5.0", + "js-sys", + "log", + "memmap2 0.9.5", + "objc2 0.5.2", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle 0.6.2", + "redox_syscall 0.5.3", + "rustix 0.38.34", + "tiny-xlib", + "wasm-bindgen", + "wayland-backend", + "wayland-client", + "wayland-sys", + "web-sys", + "windows-sys 0.59.0", + "x11rb 0.13.1", +] + [[package]] name = "spectral_compressor" version = "0.4.3" @@ -4512,6 +5055,15 @@ dependencies = [ "triple_buffer", ] +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4532,12 +5084,37 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "svg_fmt" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20e16a0f46cf5fd675563ef54f26e83e20f2366bcf027bcb3cc3ed2b98aaf2ca" + +[[package]] +name = "svgtypes" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794de53cc48eaabeed0ab6a3404a65f40b3e38c067e4435883a65d2aa4ca000e" +dependencies = [ + "kurbo 0.11.1", + "siphasher 1.0.1", +] + [[package]] name = "swash" version = "0.1.18" @@ -4657,19 +5234,58 @@ dependencies = [ ] [[package]] -name = "time-core" -version = "0.1.2" +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "png", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] [[package]] -name = "time-macros" -version = "0.2.18" +name = "tiny-xlib" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "1d52f22673960ad13af14ff4025997312def1223bfa7c8e4949d099e6b3d5d1c" dependencies = [ - "num-conv", - "time-core", + "as-raw-xcb-connection", + "ctor-lite", + "libloading 0.8.5", + "pkg-config", + "tracing", ] [[package]] @@ -4696,16 +5312,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tokio" -version = "1.39.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" -dependencies = [ - "backtrace", - "pin-project-lite", -] - [[package]] name = "toml" version = "0.7.8" @@ -4815,20 +5421,21 @@ checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" [[package]] name = "ttf-parser" -version = "0.24.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] -name = "twox-hash" -version = "1.6.3" +name = "ttf-parser" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "rand 0.8.5", - "static_assertions", -] +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" + +[[package]] +name = "ttf-parser" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" [[package]] name = "type-map" @@ -4911,12 +5518,24 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" +[[package]] +name = "unicode-bidi-mirroring" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" + [[package]] name = "unicode-ccc" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" +[[package]] +name = "unicode-ccc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" + [[package]] name = "unicode-general-category" version = "0.6.0" @@ -4935,6 +5554,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + [[package]] name = "unicode-script" version = "0.5.6" @@ -4947,6 +5572,51 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "usvg" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84ea542ae85c715f07b082438a4231c3760539d902e11d093847a0b22963032" +dependencies = [ + "base64", + "data-url", + "flate2", + "fontdb 0.18.0", + "imagesize", + "kurbo 0.11.1", + "log", + "pico-args", + "roxmltree", + "rustybuzz 0.14.1", + "simplecss", + "siphasher 1.0.1", + "strict-num", + "svgtypes", + "tiny-skia-path", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "xmlwriter", +] + [[package]] name = "utf8parse" version = "0.2.2" @@ -4962,12 +5632,6 @@ dependencies = [ "getrandom 0.2.15", ] -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - [[package]] name = "version_check" version = "0.9.5" @@ -5007,7 +5671,7 @@ dependencies = [ "bitflags 2.6.0", "chrono", "copypasta 0.8.2", - "cosmic-text", + "cosmic-text 0.8.0", "femtovg", "fluent-bundle", "fluent-langneg", @@ -5258,54 +5922,76 @@ dependencies = [ ] [[package]] -name = "wayland-client" -version = "0.29.5" +name = "wayland-backend" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" +checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" dependencies = [ - "bitflags 1.3.2", + "cc", "downcast-rs", - "libc", - "nix 0.24.3", + "rustix 0.38.34", "scoped-tls", - "wayland-commons", - "wayland-scanner", + "smallvec", "wayland-sys", ] [[package]] -name = "wayland-commons" -version = "0.29.5" +name = "wayland-client" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" +checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ - "nix 0.24.3", - "once_cell", - "smallvec", - "wayland-sys", + "bitflags 2.6.0", + "rustix 0.38.34", + "wayland-backend", + "wayland-scanner 0.31.5", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.6.0", + "cursor-icon", + "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.29.5" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" +checksum = "32b08bc3aafdb0035e7fe0fdf17ba0c09c268732707dca4ae098f60cb28c9e4c" dependencies = [ - "nix 0.24.3", + "rustix 0.38.34", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.29.5" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" +checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", + "wayland-backend", + "wayland-client", + "wayland-scanner 0.31.5", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", "wayland-client", - "wayland-commons", - "wayland-scanner", + "wayland-protocols", + "wayland-scanner 0.31.5", ] [[package]] @@ -5319,14 +6005,26 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "wayland-scanner" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + [[package]] name = "wayland-sys" -version = "0.29.5" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" +checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" dependencies = [ "dlib", - "lazy_static", + "log", + "once_cell", "pkg-config", ] @@ -5340,6 +6038,129 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "wgpu" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" +dependencies = [ + "arrayvec", + "cfg-if", + "cfg_aliases 0.1.1", + "js-sys", + "log", + "naga", + "parking_lot 0.11.2", + "profiling", + "raw-window-handle 0.6.2", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.6.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot 0.11.2", + "profiling", + "raw-window-handle 0.6.2", + "rustc-hash 1.1.0", + "smallvec", + "thiserror", + "web-sys", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfabcfc55fd86611a855816326b2d54c3b2fd7972c27ce414291562650552703" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.6.0", + "block", + "cfg_aliases 0.1.1", + "core-graphics-types 0.1.3", + "d3d12", + "glow 0.13.1", + "glutin_wgl_sys 0.5.0", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hassle-rs", + "js-sys", + "khronos-egl", + "libc", + "libloading 0.7.4", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot 0.11.2", + "profiling", + "range-alloc", + "raw-window-handle 0.6.2", + "renderdoc-sys", + "rustc-hash 1.1.0", + "smallvec", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" +dependencies = [ + "bitflags 2.6.0", + "js-sys", + "web-sys", +] + [[package]] name = "widestring" version = "1.1.0" @@ -5386,6 +6207,20 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "window_clipboard" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d" +dependencies = [ + "clipboard-win 5.4.0", + "clipboard_macos", + "clipboard_wayland", + "clipboard_x11", + "raw-window-handle 0.6.2", + "thiserror", +] + [[package]] name = "windows" version = "0.43.0" @@ -5421,6 +6256,16 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.54.0" @@ -5718,23 +6563,23 @@ checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" dependencies = [ "android-activity", "bitflags 1.3.2", - "cfg_aliases", - "core-foundation", - "core-graphics", + "cfg_aliases 0.1.1", + "core-foundation 0.9.4", + "core-graphics 0.22.3", "dispatch", "instant", "libc", "log", "mio", "ndk 0.7.0", - "objc2", + "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", "orbclient", "percent-encoding", "raw-window-handle 0.5.2", "redox_syscall 0.3.5", "wasm-bindgen", - "wayland-scanner", + "wayland-scanner 0.29.5", "web-sys", "windows-sys 0.45.0", "x11-dl", @@ -5749,15 +6594,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - [[package]] name = "x11" version = "2.21.0" @@ -5768,15 +6604,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x11-clipboard" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" -dependencies = [ - "xcb 0.10.1", -] - [[package]] name = "x11-clipboard" version = "0.7.1" @@ -5829,6 +6656,8 @@ dependencies = [ "as-raw-xcb-connection", "gethostname 0.4.3", "libc", + "libloading 0.8.5", + "once_cell", "rustix 0.38.34", "x11rb-protocol 0.13.1", ] @@ -5859,17 +6688,6 @@ dependencies = [ "x11", ] -[[package]] -name = "xcb" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" -dependencies = [ - "libc", - "log", - "quick-xml", -] - [[package]] name = "xcb-util" version = "0.3.0" @@ -5877,7 +6695,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43893e47f27bf7d81d489feef3a0e34a457e90bc314b7e74ad9bb3980e4c1c48" dependencies = [ "libc", - "xcb 0.9.0", + "xcb", ] [[package]] @@ -5897,10 +6715,10 @@ dependencies = [ ] [[package]] -name = "xi-unicode" -version = "0.3.0" +name = "xkeysym" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" @@ -5908,6 +6726,12 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + [[package]] name = "xtask" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 76929e8e..b91c16a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ repository = "https://github.com/robbert-vdh/nih-plug" [workspace] resolver = "2" + members = [ "nih_plug_derive", "nih_plug_egui", @@ -54,7 +55,14 @@ assert_process_allocs = ["dep:assert_no_alloc"] # Enables an export target for standalone binaries through the # `nih_export_standalone()` function. Disabled by default as this requires # building additional dependencies for audio and MIDI handling. -standalone = ["dep:baseview", "dep:clap", "dep:cpal", "dep:jack", "dep:midir", "dep:rtrb"] +standalone = [ + "dep:baseview", + "dep:clap", + "dep:cpal", + "dep:jack", + "dep:midir", + "dep:rtrb", +] # Enables the `nih_export_vst3!()` macro. Enabled by default. This feature # exists mostly for GPL-compliance reasons, since even if you don't use the VST3 # wrapper you might otherwise still include a couple (unused) symbols from the @@ -83,7 +91,7 @@ backtrace = "0.3.65" bitflags = "1.3" cfg-if = "1.0" # This supports CLAP 1.1.8 -clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", branch = "feature/cstr-macro" } +clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", branch = "feature/cstr-macro" } crossbeam = "0.8" log = { version = "0.4", features = ["std", "release_max_level_info"] } midi-consts = "0.1" @@ -95,14 +103,20 @@ serde_json = "1.0" widestring = "1.0.0-beta.1" # Used for the `assert_process_allocs` feature -assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "feature/nested-permit-forbid", features = ["backtrace", "log"], optional = true } +assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "feature/nested-permit-forbid", features = [ + "backtrace", + "log", +], optional = true } # Used for the `standalone` feature # NOTE: OpenGL support is not needed here, but rust-analyzer gets confused when # some crates do use it and others don't -baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2", features = ["opengl"], optional = true } +baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2", default_features = false, optional = true } # All the claps! -clap = { version = "4.1.8", features = ["derive", "wrap_help"], optional = true } +clap = { version = "4.1.8", features = [ + "derive", + "wrap_help", +], optional = true } cpal = { version = "0.15", optional = true } jack = { version = "0.11.4", optional = true } midir = { version = "0.9.1", optional = true } diff --git a/nih_plug_iced/Cargo.toml b/nih_plug_iced/Cargo.toml index 7b2c9839..723159a0 100644 --- a/nih_plug_iced/Cargo.toml +++ b/nih_plug_iced/Cargo.toml @@ -8,7 +8,7 @@ license = "ISC" description = "An adapter to use iced GUIs with NIH-plug" [features] -default = ["opengl"] +default = [] # NOTE: wgpu support has been removed from the iced-baseview fork out because # this old iced version uses a wgpu version that doesn't pin the web-sys @@ -20,53 +20,33 @@ default = ["opengl"] # wgpu = ["iced_baseview/wgpu", "baseview/opengl"] # Use OpenGL instead of wgpu for the rendering. This should increase platform # compatibility at the cost of some iced features not being available. -opengl = ["iced_baseview/glow"] +# opengl = ["iced_baseview/glow"] # Enables a debug view in native platforms (press F12) debug = ["iced_baseview/debug"] -# # Enables the `Image` widget, only supported by the wgpu backend -# wgpu_image = ["iced_baseview/wgpu_image"] -# # Enables the `Svg` widget, only supported by the wgpu backend -# wgpu_svg = ["iced_baseview/wgpu_svg"] - -# # Enables the `Canvas` widget for the wgpu backend -# wgpu_canvas = ["iced_baseview/wgpu_canvas"] -# Enables the `Canvas` widget for the OpenGL backend -opengl_canvas = ["iced_baseview/glow_canvas"] - -# # Enables the `QRCode` widget for the wgpu backend -# wgpu_qr_code = ["iced_baseview/wgpu_qr_code"] -# Enables the `QRCode` widget for the OpenGL backend -opengl_qr_code = ["iced_baseview/glow_qr_code"] - -# # Enables using system fonts for the wgpu backend -# wgpu_default_system_font = ["iced_baseview/wgpu_default_system_font"] -# Enables using system fonts for the OpenGL backend -opengl_default_system_font = ["iced_baseview/glow_default_system_font"] - -# Enables advanced color conversion via `palette` -palette = ["iced_baseview/palette"] - -# Enables `tokio` as the `executor::Default` on native platforms -tokio = ["iced_baseview/tokio"] -# Enables `async-std` as the `executor::Default` on native platforms -async-std = ["iced_baseview/async-std"] -# Enables `smol` as the `executor::Default` on native platforms -smol = ["iced_baseview/smol"] +wgpu = ["iced_baseview/wgpu"] +# Enables the `Image` widget, only supported by the wgpu backend +image = ["iced_baseview/image"] +# Enables the `Svg` widget, only supported by the wgpu backend +svg = ["iced_baseview/svg"] +# Enables the `Canvas` widget for the wgpu backend +canvas = ["iced_baseview/canvas"] [dependencies] -nih_plug = { path = "..", default-features = false } +nih_plug = { path = "..", default_features = false } nih_plug_assets = { git = "https://github.com/robbert-vdh/nih_plug_assets.git" } # The currently targeted version of baseview uses a different version of # `raw_window_handle` than NIH-plug, so we need to manually convert between them -raw-window-handle = "0.4" +raw-window-handle = "0.5" atomic_refcell = "0.1" -baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "1d9806d5bd92275d0d8142d9c9c90198757b9b25" } +baseview = { git = "https://github.com/RustAudio/baseview.git", rev = "579130ecb4f9f315ae52190af42f0ea46aeaa4a2" } crossbeam = "0.8" -# This targets iced 0.4 -iced_baseview = { git = "https://github.com/robbert-vdh/iced_baseview.git", branch = "feature/update-baseview", default-features = false } +# This targets iced 0.13 +iced_baseview = { git = "https://github.com/BillyDM/iced_baseview.git", rev = "a0842a8205c852127981e27de6342cf2e665562f", default_features = false } +futures-util = "0.3" + # To make the state persistable serde = { version = "1.0", features = ["derive"] } diff --git a/nih_plug_iced/README.md b/nih_plug_iced/README.md index 548a9d1a..c048e580 100644 --- a/nih_plug_iced/README.md +++ b/nih_plug_iced/README.md @@ -9,7 +9,7 @@ configurations. To use wgpu instead, include the crate with the following options: ```toml -nih_plug_iced = { git = "https://github.com/robbert-vdh/nih-plug.git", default-features = false, features = ["wgpu"] } +nih_plug_iced = { git = "https://github.com/robbert-vdh/nih-plug.git", default_features = false, features = ["wgpu"] } ``` Iced has many more optional features. Check the `Cargo.toml` file for more diff --git a/nih_plug_iced/src/assets.rs b/nih_plug_iced/src/assets.rs index 9a6db717..6a136b3f 100644 --- a/nih_plug_iced/src/assets.rs +++ b/nih_plug_iced/src/assets.rs @@ -1,46 +1,37 @@ //! Binary assets for use with `nih_plug_iced`. -use crate::Font; +use std::borrow::Cow; + +use crate::core::Font; // This module provides a re-export and simple font wrappers around the re-exported fonts. pub use nih_plug_assets::*; -pub const NOTO_SANS_REGULAR: Font = Font::External { - name: "Noto Sans Regular", - bytes: fonts::NOTO_SANS_REGULAR, -}; - -pub const NOTO_SANS_REGULAR_ITALIC: Font = Font::External { - name: "Noto Sans Regular Italic", - bytes: fonts::NOTO_SANS_REGULAR_ITALIC, -}; - -pub const NOTO_SANS_THIN: Font = Font::External { - name: "Noto Sans Thin", - bytes: fonts::NOTO_SANS_THIN, -}; - -pub const NOTO_SANS_THIN_ITALIC: Font = Font::External { - name: "Noto Sans Thin Italic", - bytes: fonts::NOTO_SANS_THIN_ITALIC, -}; - -pub const NOTO_SANS_LIGHT: Font = Font::External { - name: "Noto Sans Light", - bytes: fonts::NOTO_SANS_LIGHT, -}; - -pub const NOTO_SANS_LIGHT_ITALIC: Font = Font::External { - name: "Noto Sans Light Italic", - bytes: fonts::NOTO_SANS_LIGHT_ITALIC, -}; - -pub const NOTO_SANS_BOLD: Font = Font::External { - name: "Noto Sans Bold", - bytes: fonts::NOTO_SANS_BOLD, -}; - -pub const NOTO_SANS_BOLD_ITALIC: Font = Font::External { - name: "Noto Sans Bold Italic", - bytes: fonts::NOTO_SANS_BOLD_ITALIC, -}; +pub const NOTO_SANS_REGULAR: Font = Font::with_name("Noto Sans Regular"); +pub const NOTO_SANS_REGULAR_ITALIC: Font = Font::with_name("Noto Sans Regular Italic"); +pub const NOTO_SANS_THIN: Font = Font::with_name("Noto Sans Thin"); +pub const NOTO_SANS_THIN_ITALIC: Font = Font::with_name("Noto Sans Thin Italic"); +pub const NOTO_SANS_LIGHT: Font = Font::with_name("Noto Sans Light"); +pub const NOTO_SANS_LIGHT_ITALIC: Font = Font::with_name("Noto Sans Light Italic"); +pub const NOTO_SANS_BOLD: Font = Font::with_name("Noto Sans Bold"); +pub const NOTO_SANS_BOLD_ITALIC: Font = Font::with_name("Noto Sans Bold Italic"); + +/// Useful for initializing the Settings, like this: +/// ```rust,ignore +/// Settings { +/// ... +/// fonts: noto_sans_fonts_data().into_iter().collect(), +/// } +/// ``` +pub const fn noto_sans_fonts_data() -> [Cow<'static, [u8]>; 8] { + [ + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_REGULAR), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_REGULAR_ITALIC), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_THIN), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_THIN_ITALIC), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_LIGHT), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_LIGHT_ITALIC), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_BOLD), + Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_BOLD_ITALIC), + ] +} diff --git a/nih_plug_iced/src/editor.rs b/nih_plug_iced/src/editor.rs index d2984d27..05003404 100644 --- a/nih_plug_iced/src/editor.rs +++ b/nih_plug_iced/src/editor.rs @@ -1,20 +1,22 @@ //! And [`Editor`] implementation for iced. -use baseview::{WindowOpenOptions, WindowScalePolicy}; +use ::baseview::{WindowOpenOptions, WindowScalePolicy}; use crossbeam::atomic::AtomicCell; use crossbeam::channel; -pub use iced_baseview::*; +use iced_baseview::settings::IcedBaseviewSettings; use nih_plug::prelude::{Editor, GuiContext, ParentWindowHandle}; -use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; -use std::sync::atomic::Ordering; use std::sync::Arc; +use std::{borrow::Cow, sync::atomic::Ordering}; use crate::{wrapper, IcedEditor, IcedState, ParameterUpdate}; +pub use iced_baseview::*; + /// An [`Editor`] implementation that renders an iced [`Application`]. pub(crate) struct IcedEditorWrapper { pub(crate) iced_state: Arc, pub(crate) initialization_flags: E::InitializationFlags, + pub(crate) fonts: Vec>, /// The scaling factor reported by the host, if any. On macOS this will never be set and we /// should use the system scaling factor instead. @@ -25,32 +27,6 @@ pub(crate) struct IcedEditorWrapper { pub(crate) parameter_updates_receiver: Arc>, } -/// This version of `baseview` uses a different version of `raw_window_handle than NIH-plug, so we -/// need to adapt it ourselves. -struct ParentWindowHandleAdapter(nih_plug::editor::ParentWindowHandle); - -unsafe impl HasRawWindowHandle for ParentWindowHandleAdapter { - fn raw_window_handle(&self) -> RawWindowHandle { - match self.0 { - ParentWindowHandle::X11Window(window) => { - let mut handle = raw_window_handle::XcbHandle::empty(); - handle.window = window; - RawWindowHandle::Xcb(handle) - } - ParentWindowHandle::AppKitNsView(ns_view) => { - let mut handle = raw_window_handle::AppKitHandle::empty(); - handle.ns_view = ns_view; - RawWindowHandle::AppKit(handle) - } - ParentWindowHandle::Win32Hwnd(hwnd) => { - let mut handle = raw_window_handle::Win32Handle::empty(); - handle.hwnd = hwnd; - RawWindowHandle::Win32(handle) - } - } - } -} - impl Editor for IcedEditorWrapper { fn spawn( &self, @@ -62,8 +38,14 @@ impl Editor for IcedEditorWrapper { // TODO: iced_baseview does not have gracefuly error handling for context creation failures. // This will panic if the context could not be created. - let window = IcedWindow::>::open_parented( - &ParentWindowHandleAdapter(parent), + let window = iced_baseview::open_parented::, _>( + &parent, + // We use this wrapper to be able to pass the GUI context to the editor + ( + context, + self.parameter_updates_receiver.clone(), + self.initialization_flags.clone(), + ), Settings { window: WindowOpenOptions { title: String::from("iced window"), @@ -74,41 +56,13 @@ impl Editor for IcedEditorWrapper { scale: scaling_factor .map(|factor| WindowScalePolicy::ScaleFactor(factor as f64)) .unwrap_or(WindowScalePolicy::SystemScaleFactor), - - #[cfg(feature = "opengl")] - gl_config: Some(baseview::gl::GlConfig { - // FIXME: glow_glyph forgot to add an `#extension`, so this won't work under - // OpenGL 3.2 at the moment. With that change applied this should work on - // OpenGL 3.2/macOS. - version: (3, 3), - red_bits: 8, - blue_bits: 8, - green_bits: 8, - alpha_bits: 8, - depth_bits: 24, - stencil_bits: 8, - samples: None, - srgb: true, - double_buffer: true, - vsync: true, - ..Default::default() - }), - // FIXME: Rust analyzer always thinks baseview/opengl is enabled even if we - // don't explicitly enable it, so you'd get a compile error if this line - // is missing - #[cfg(not(feature = "opengl"))] - gl_config: None, }, iced_baseview: IcedBaseviewSettings { ignore_non_modifier_keys: false, always_redraw: true, }, - // We use this wrapper to be able to pass the GUI context to the editor - flags: ( - context, - self.parameter_updates_receiver.clone(), - self.initialization_flags.clone(), - ), + fonts: self.fonts.clone(), + ..Default::default() }, ); @@ -154,7 +108,7 @@ impl Editor for IcedEditorWrapper { /// The window handle used for [`IcedEditorWrapper`]. struct IcedEditorHandle { iced_state: Arc, - window: iced_baseview::WindowHandle, + window: iced_baseview::window::WindowHandle, } /// The window handle enum stored within 'WindowHandle' contains raw pointers. Is there a way around diff --git a/nih_plug_iced/src/lib.rs b/nih_plug_iced/src/lib.rs index a8ae536b..d548c23b 100644 --- a/nih_plug_iced/src/lib.rs +++ b/nih_plug_iced/src/lib.rs @@ -39,7 +39,7 @@ //! fn new( //! params: Self::InitializationFlags, //! context: Arc, -//! ) -> (Self, Command) { +//! ) -> (Self, Task) { //! let editor = FooEditor { //! params, //! context, @@ -47,7 +47,7 @@ //! foo_slider_state: Default::default(), //! }; //! -//! (editor, Command::none()) +//! (editor, Task::none()) //! } //! //! fn context(&self) -> &dyn GuiContext { @@ -56,14 +56,13 @@ //! //! fn update( //! &mut self, -//! _window: &mut WindowQueue, //! message: Self::Message, -//! ) -> Command { +//! ) -> Task { //! match message { //! Message::ParamUpdate(message) => self.handle_param_message(message), //! } //! -//! Command::none() +//! Task::none() //! } //! //! fn view(&mut self) -> Element<'_, Self::Message> { @@ -89,12 +88,14 @@ //! } //! ``` -use baseview::WindowScalePolicy; +use ::baseview::WindowScalePolicy; use crossbeam::atomic::AtomicCell; use crossbeam::channel; +use iced_baseview::futures::Subscription; use nih_plug::params::persist::PersistentField; use nih_plug::prelude::{Editor, GuiContext}; use serde::{Deserialize, Serialize}; +use std::borrow::Cow; // This doesn't need to be re-export but otherwise the compiler complains about // `hidden_glob_reexports` pub use std::fmt::Debug; @@ -126,6 +127,7 @@ mod wrapper; pub fn create_iced_editor( iced_state: Arc, initialization_flags: E::InitializationFlags, + fonts: Vec>, ) -> Option> { // We need some way to communicate parameter changes to the `IcedEditor` since parameter updates // come from outside of the editor's reactive model. This contains only capacity to store only @@ -147,6 +149,7 @@ pub fn create_iced_editor( parameter_updates_sender, parameter_updates_receiver: Arc::new(parameter_updates_receiver), + fonts, })) } @@ -162,12 +165,14 @@ pub trait IcedEditor: 'static + Send + Sync + Sized { type Message: 'static + Clone + Debug + Send; /// See [`Application::Flags`]. type InitializationFlags: 'static + Clone + Send + Sync; + /// See [`Application::Theme`] + type Theme: Default + DefaultStyle; /// See [`Application::new`]. This also receivs the GUI context in addition to the flags. fn new( initialization_fags: Self::InitializationFlags, context: Arc, - ) -> (Self, Command); + ) -> (Self, Task); /// Returns a reference to the GUI context. /// [`handle_param_message()`][Self::handle_param_message()] uses this to interact with the @@ -177,11 +182,7 @@ pub trait IcedEditor: 'static + Send + Sync + Sized { /// See [`Application::update`]. When receiving the variant that contains a /// [`widgets::ParamMessage`] you can call /// [`handle_param_message()`][Self::handle_param_message()] to handle the parameter update. - fn update( - &mut self, - window: &mut WindowQueue, - message: Self::Message, - ) -> Command; + fn update(&mut self, message: Self::Message) -> Task; /// See [`Application::subscription`]. fn subscription( @@ -192,13 +193,21 @@ pub trait IcedEditor: 'static + Send + Sync + Sized { } /// See [`Application::view`]. - fn view(&mut self) -> Element<'_, Self::Message>; + fn view(&self) -> Element<'_, Self::Message, Self::Theme, Renderer>; /// See [`Application::background_color`]. fn background_color(&self) -> Color { Color::WHITE } + fn theme(&self) -> Self::Theme { + Self::Theme::default() + } + + fn title(&self) -> String { + "nih_plug plugin".to_owned() + } + /// See [`Application::scale_policy`]. /// /// TODO: Is this needed? Editors shouldn't change the scale policy. @@ -206,20 +215,6 @@ pub trait IcedEditor: 'static + Send + Sync + Sized { WindowScalePolicy::SystemScaleFactor } - /// See [`Application::renderer_settings`]. - fn renderer_settings() -> iced_baseview::backend::settings::Settings { - iced_baseview::backend::settings::Settings { - // Enable some anti-aliasing by default. Since GUIs are likely very simple and most of - // the work will be on the CPU anyways this should not affect performance much. - antialiasing: Some(iced_baseview::backend::settings::Antialiasing::MSAAx4), - // Use Noto Sans as the default font as that renders a bit more cleanly than the default - // Lato font. This crate also contains other weights and versions of this font you can - // use for individual widgets. - default_font: Some(crate::assets::fonts::NOTO_SANS_REGULAR), - ..iced_baseview::backend::settings::Settings::default() - } - } - /// Handle a parameter update using the GUI context. fn handle_param_message(&self, message: ParamMessage) { // We can't use the fancy ParamSetter here because this needs to be type erased diff --git a/nih_plug_iced/src/widgets/generic_ui.rs b/nih_plug_iced/src/widgets/generic_ui.rs index 8e975a67..9a9df38d 100644 --- a/nih_plug_iced/src/widgets/generic_ui.rs +++ b/nih_plug_iced/src/widgets/generic_ui.rs @@ -1,33 +1,29 @@ //! A simple generic UI widget that renders all parameters in a [`Params`] object as a scrollable //! list of sliders and labels. -use atomic_refcell::AtomicRefCell; -use std::borrow::Borrow; -use std::collections::HashMap; +use crate::core::widget::{Id, Operation, Tree}; +use crate::core::{ + alignment, event, layout, renderer, text, Clipboard, Element, Layout, Length, Rectangle, Shell, + Size, Widget, +}; +use crate::widget::{self, row, scrollable, Column, Scrollable, Space}; use std::marker::PhantomData; use std::sync::Arc; use nih_plug::prelude::{Param, ParamFlags, ParamPtr, Params}; use super::{ParamMessage, ParamSlider}; -use crate::backend::Renderer; -use crate::text::Renderer as TextRenderer; -use crate::{ - alignment, event, layout, renderer, widget, Alignment, Clipboard, Element, Event, Layout, - Length, Point, Rectangle, Row, Scrollable, Shell, Space, Text, Widget, -}; /// A widget that can be used to create a generic UI with. This is used in conjuction with empty /// structs to emulate existential types. -pub trait ParamWidget { - /// The type of state stores by this parameter type. - type State: Default; - +pub trait ParamWidget { /// Create an [`Element`] for a widget for the specified parameter. fn into_widget_element<'a, P: Param>( param: &'a P, - state: &'a mut Self::State, - ) -> Element<'a, ParamMessage>; + ) -> Element<'a, ParamMessage, Theme, Renderer> + where + Theme: 'a, + Renderer: 'a; /// The same as [`into_widget_element()`][Self::into_widget_element()], but for a `ParamPtr`. /// @@ -35,14 +31,17 @@ pub trait ParamWidget { /// /// Undefined behavior of the `ParamPtr` does not point to a valid parameter. unsafe fn into_widget_element_raw<'a>( - param: &ParamPtr, - state: &'a mut Self::State, - ) -> Element<'a, ParamMessage> { + param: &'a ParamPtr, + ) -> Element<'a, ParamMessage, Theme, Renderer> + where + Theme: 'a, + Renderer: 'a, + { match param { - ParamPtr::FloatParam(p) => Self::into_widget_element(&**p, state), - ParamPtr::IntParam(p) => Self::into_widget_element(&**p, state), - ParamPtr::BoolParam(p) => Self::into_widget_element(&**p, state), - ParamPtr::EnumParam(p) => Self::into_widget_element(&**p, state), + ParamPtr::FloatParam(p) => Self::into_widget_element(&**p), + ParamPtr::IntParam(p) => Self::into_widget_element(&**p), + ParamPtr::BoolParam(p) => Self::into_widget_element(&**p), + ParamPtr::EnumParam(p) => Self::into_widget_element(&**p), } } } @@ -55,72 +54,72 @@ pub struct GenericSlider; /// determines what widget to use for this. /// /// TODO: There's no way to configure the individual widgets. -pub struct GenericUi<'a, W: ParamWidget> { - state: &'a mut State, - - params: Arc, +pub struct GenericUi { + // Hacky work around so we can borrow &ParamPtr and ensure references + // stay alive for the lifetime of this object. + params: Vec, + id: Option, width: Length, height: Length, - max_width: u32, - max_height: u32, + max_width: u16, + max_height: u16, + pad_scrollbar: bool, /// We don't emit any messages or store the actual widgets, but iced requires us to define some /// message type anyways. - _phantom: PhantomData, -} - -/// State for a [`GenericUi`]. -#[derive(Debug, Default)] -pub struct State { - /// The internal state for each parameter's widget. - scrollable_state: AtomicRefCell, - /// The internal state for each parameter's widget. - widget_state: AtomicRefCell>, + _phantom: PhantomData<(W, Theme, Renderer)>, } -impl<'a, W> GenericUi<'a, W> -where - W: ParamWidget, -{ +impl GenericUi { /// Creates a new [`GenericUi`] for all provided parameters. - pub fn new(state: &'a mut State, params: Arc) -> Self { + pub fn new(params: Arc) -> Self { + let params = params + .param_map() + .into_iter() + .map(|(_, ptr, _)| ptr) + .collect(); Self { - state, - + id: None, params, width: Length::Fill, height: Length::Fill, - max_width: u32::MAX, - max_height: u32::MAX, + max_width: u16::MAX, + max_height: u16::MAX, pad_scrollbar: false, _phantom: PhantomData, } } + /// Sets the [`Id`] of the [`Container`]. + pub fn id(mut self, id: Id) -> Self { + self.id = Some(id); + self + } + /// Sets the width of the [`GenericUi`]. - pub fn width(mut self, width: Length) -> Self { - self.width = width; + pub fn width(mut self, width: impl Into) -> Self { + self.width = width.into(); self } /// Sets the height of the [`GenericUi`]. - pub fn height(mut self, height: Length) -> Self { - self.height = height; + pub fn height(mut self, height: impl Into) -> Self { + self.height = height.into(); self } /// Sets the maximum width of the [`GenericUi`]. - pub fn max_width(mut self, width: u32) -> Self { + pub fn max_width(mut self, width: u16) -> Self { self.max_width = width; self } /// Sets the maximum height of the [`GenericUi`]. - pub fn max_height(mut self, height: u32) -> Self { + pub fn max_height(mut self, height: u16) -> Self { self.max_height = height; self } @@ -130,166 +129,203 @@ where self.pad_scrollbar = true; self } +} - /// Create a temporary [`Scrollable`]. This needs to be created on demand because it needs to - /// mutably borrow the `Scrollable`'s widget state. - fn with_scrollable_widget( +impl<'a, W, Theme, Renderer> GenericUi +where + W: ParamWidget, + Theme: scrollable::Catalog + widget::text::Catalog + 'a, + Renderer: text::Renderer + 'a, +{ + fn content( &'a self, - scrollable_state: &'a mut widget::scrollable::State, - widget_state: &'a mut HashMap, - renderer: R, - f: F, - ) -> T - where - F: FnOnce(Scrollable<'a, ParamMessage>, R) -> T, - R: Borrow, - { - let text_size = renderer.borrow().default_size(); - let spacing = (text_size as f32 * 0.2).round() as u16; - let padding = (text_size as f32 * 0.5).round() as u16; - - let mut scrollable = Scrollable::new(scrollable_state) - .width(self.width) - .height(self.height) - .max_width(self.max_width) - .max_height(self.max_height) - .spacing(spacing) - .padding(padding) - .align_items(Alignment::Center); - - // Make sure we already have widget state for each widget - let param_map = self.params.param_map(); - for (_, param_ptr, _) in ¶m_map { - let flags = unsafe { param_ptr.flags() }; - if flags.contains(ParamFlags::HIDE_IN_GENERIC_UI) { - continue; - } - - if !widget_state.contains_key(param_ptr) { - widget_state.insert(*param_ptr, Default::default()); - } - } - - for (_, param_ptr, _) in param_map { - let flags = unsafe { param_ptr.flags() }; - if flags.contains(ParamFlags::HIDE_IN_GENERIC_UI) { - continue; - } - - // SAFETY: We only borrow each item once, and the plugin framework statically asserted - // that parameter indices are unique and this widget state cannot outlive this - // function - let widget_state: &'a mut W::State = - unsafe { &mut *(widget_state.get_mut(¶m_ptr).unwrap() as *mut _) }; - - // Show the label next to the parameter for better use of the space - let mut row = Row::new() - .width(Length::Fill) - .align_items(Alignment::Center) - .spacing(spacing * 2) - .push( - Text::new(unsafe { param_ptr.name() }) - .height(20.into()) - .width(Length::Fill) - .horizontal_alignment(alignment::Horizontal::Right) - .vertical_alignment(alignment::Vertical::Center), - ) - .push(unsafe { W::into_widget_element_raw(¶m_ptr, widget_state) }); - if self.pad_scrollbar { - // There's already spacing applied, so this element doesn't actually need to hae any - // size of its own - row = row.push(Space::with_width(Length::Units(0))); - } - - scrollable = scrollable.push(row); - } - - f(scrollable, renderer) + renderer: Option<&Renderer>, + ) -> Scrollable<'a, ParamMessage, Theme, Renderer> { + let (spacing, padding) = match renderer { + Some(renderer) => ( + (renderer.default_size() * 0.2).0.round(), + (renderer.default_size() * 0.5).0.round(), + ), + None => (0.0, 0.0), + }; + + let content = Column::with_children( + self.params + .iter() + .filter(|param| is_hidden(*param)) + .map(|param| { + let row = row![ + widget::text(unsafe { param.name() }) + .height(20) + .width(Length::Fill) + .align_x(alignment::Horizontal::Right) + .align_y(alignment::Vertical::Center), + unsafe { W::into_widget_element_raw(param) } + ] + .width(Length::Fill) + .align_y(alignment::Vertical::Center) + .spacing(spacing * 2.0); + + if self.pad_scrollbar { + row.push(Space::with_width(0)) + } else { + row + } + }) + .map(Element::from), + ) + .align_x(alignment::Horizontal::Center) + .spacing(spacing) + .padding(padding) + .width(self.width) + .height(self.height) + .max_width(self.max_width); + + scrollable(content).spacing(spacing) } } -impl<'a, W> Widget for GenericUi<'a, W> +impl<'a, W, Theme, Renderer> Widget for GenericUi where - W: ParamWidget, + W: ParamWidget, + Theme: scrollable::Catalog + widget::text::Catalog + 'a, + Renderer: text::Renderer + 'a, { - fn width(&self) -> Length { - self.width + fn size(&self) -> iced_baseview::Size { + Size { + width: self.width, + height: self.height, + } } - fn height(&self) -> Length { - self.height + fn children(&self) -> Vec { + let content = self.content(None); + + vec![Tree::new( + &content as &dyn Widget, + )] } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - let mut scrollable_state = self.state.scrollable_state.borrow_mut(); - let mut widget_state = self.state.widget_state.borrow_mut(); - self.with_scrollable_widget( - &mut scrollable_state, - &mut widget_state, - renderer, - |scrollable, _| scrollable.layout(renderer, limits), - ) + fn layout( + &self, + tree: &mut Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.content(Some(renderer)) + .layout(&mut tree.children[0], renderer, limits) } fn draw( &self, + tree: &iced_baseview::core::widget::Tree, renderer: &mut Renderer, + theme: &Theme, style: &renderer::Style, layout: Layout<'_>, - cursor_position: Point, + cursor: iced_baseview::core::mouse::Cursor, viewport: &Rectangle, ) { - let mut scrollable_state = self.state.scrollable_state.borrow_mut(); - let mut widget_state = self.state.widget_state.borrow_mut(); - self.with_scrollable_widget( - &mut scrollable_state, - &mut widget_state, + self.content(Some(renderer)).draw( + &tree.children[0], renderer, - |scrollable, renderer| { - scrollable.draw(renderer, style, layout, cursor_position, viewport) - }, + theme, + style, + layout, + cursor, + viewport, ) } + fn operate( + &self, + tree: &mut Tree, + layout: Layout<'_>, + renderer: &Renderer, + operation: &mut dyn Operation, + ) { + operation.container(self.id.as_ref(), layout.bounds(), &mut |operation| { + self.content(Some(renderer)).operate( + tree, + layout.children().next().unwrap(), + renderer, + operation, + ) + }); + } + fn on_event( &mut self, - event: Event, + tree: &mut iced_baseview::core::widget::Tree, + event: event::Event, layout: Layout<'_>, - cursor_position: Point, + cursor: iced_baseview::core::mouse::Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, ParamMessage>, + viewport: &Rectangle, ) -> event::Status { - let mut scrollable_state = self.state.scrollable_state.borrow_mut(); - let mut widget_state = self.state.widget_state.borrow_mut(); - self.with_scrollable_widget( - &mut scrollable_state, - &mut widget_state, + self.content(Some(renderer)).on_event( + &mut tree.children[0], + event, + layout.children().next().unwrap(), + cursor, + renderer, + clipboard, + shell, + viewport, + ) + } + + fn mouse_interaction( + &self, + tree: &Tree, + layout: Layout<'_>, + cursor: iced_baseview::core::mouse::Cursor, + viewport: &Rectangle, + renderer: &Renderer, + ) -> iced_baseview::core::mouse::Interaction { + self.content(Some(renderer)).mouse_interaction( + &tree.children[0], + layout.children().next().unwrap(), + cursor, + viewport, renderer, - |mut scrollable, _| { - scrollable.on_event(event, layout, cursor_position, renderer, clipboard, shell) - }, ) } } -impl ParamWidget for GenericSlider { - type State = super::param_slider::State; +fn is_hidden(param_ptr: &ParamPtr) -> bool { + let flags = unsafe { param_ptr.flags() }; + flags.contains(ParamFlags::HIDE_IN_GENERIC_UI) +} - fn into_widget_element<'a, P: Param>( - param: &'a P, - state: &'a mut Self::State, - ) -> Element<'a, ParamMessage> { - ParamSlider::new(state, param).into() +impl ParamWidget for GenericSlider +where + Theme: widget::text_input::Catalog, + Renderer: text::Renderer, + Renderer::Font: From, +{ + fn into_widget_element<'a, P: Param>(param: &'a P) -> Element<'a, ParamMessage, Theme, Renderer> + where + Theme: 'a, + Renderer: 'a, + { + ParamSlider::new(param).into() } } -impl<'a, W: ParamWidget> GenericUi<'a, W> { +impl<'a, W, Theme, Renderer> GenericUi +where + W: ParamWidget + 'a, + Theme: scrollable::Catalog + widget::text::Catalog + 'a, + Renderer: text::Renderer + 'a, +{ /// Convert this [`GenericUi`] into an [`Element`] with the correct message. You should have a /// variant on your own message type that wraps around [`ParamMessage`] so you can forward those /// messages to /// [`IcedEditor::handle_param_message()`][crate::IcedEditor::handle_param_message()]. - pub fn map(self, f: F) -> Element<'a, Message> + pub fn map(self, f: F) -> Element<'a, Message, Theme, Renderer> where Message: 'static, F: Fn(ParamMessage) -> Message + 'static, @@ -298,11 +334,14 @@ impl<'a, W: ParamWidget> GenericUi<'a, W> { } } -impl<'a, W> From> for Element<'a, ParamMessage> +impl<'a, W, Theme, Renderer> From> + for Element<'a, ParamMessage, Theme, Renderer> where - W: ParamWidget, + W: ParamWidget + 'a, + Theme: scrollable::Catalog + widget::text::Catalog + 'a, + Renderer: text::Renderer + 'a, { - fn from(widget: GenericUi<'a, W>) -> Self { + fn from(widget: GenericUi) -> Self { Element::new(widget) } } diff --git a/nih_plug_iced/src/widgets/param_slider.rs b/nih_plug_iced/src/widgets/param_slider.rs index fb941562..a89730a6 100644 --- a/nih_plug_iced/src/widgets/param_slider.rs +++ b/nih_plug_iced/src/widgets/param_slider.rs @@ -1,20 +1,16 @@ -//! A slider that integrates with NIH-plug's [`Param`] types. - -use atomic_refcell::AtomicRefCell; use nih_plug::prelude::Param; use std::borrow::Borrow; -use crate::backend::widget; -use crate::backend::Renderer; -use crate::renderer::Renderer as GraphicsRenderer; -use crate::text::Renderer as TextRenderer; -use crate::{ - alignment, event, keyboard, layout, mouse, renderer, text, touch, Background, Clipboard, Color, - Element, Event, Font, Layout, Length, Point, Rectangle, Shell, Size, TextInput, Vector, Widget, +use crate::core::text::{Paragraph, Renderer as TextRenderer, Text}; +use crate::core::widget::tree::{self, Tree}; +use crate::core::{ + alignment, event, keyboard, layout, mouse, renderer, text, touch, Border, Clipboard, Color, + Element, Event, Font, Layout, Length, Pixels, Rectangle, Shell, Size, Vector, Widget, }; +use crate::widget::text_input; +use crate::widget::text_input::{Id, TextInput}; -use super::util; -use super::ParamMessage; +use super::{util, ParamMessage}; /// When shift+dragging a parameter, one pixel dragged corresponds to this much change in the /// noramlized parameter. @@ -28,19 +24,17 @@ const BORDER_WIDTH: f32 = 1.0; /// TODO: There are currently no styling options at all /// TODO: Handle scrolling for steps (and shift+scroll for smaller steps?) pub struct ParamSlider<'a, P: Param> { - state: &'a mut State, - param: &'a P, - height: Length, width: Length, - text_size: Option, - font: Font, + height: Length, + text_size: Option, + font: Option, } /// State for a [`ParamSlider`]. -#[derive(Debug, Default)] -pub struct State { +#[derive(Debug)] +struct State { keyboard_modifiers: keyboard::Modifiers, /// Will be set to `true` if we're dragging the parameter. Resetting the parameter or entering a /// text value should not initiate a drag. @@ -51,14 +45,26 @@ pub struct State { /// Track clicks for double clicks. last_click: Option, - /// State for the text input overlay that will be shown when this widget is alt+clicked. - text_input_state: AtomicRefCell, /// The text that's currently in the text input. If this is set to `None`, then the text input /// is not visible. text_input_value: Option, + text_input_id: Id, } -/// An internal message for intercep- I mean handling output from the embedded [`TextInpu`] widget. +impl Default for State { + fn default() -> Self { + Self { + text_input_id: Id::unique(), + keyboard_modifiers: Default::default(), + drag_active: Default::default(), + granular_drag_start_x_value: Default::default(), + last_click: Default::default(), + text_input_value: Default::default(), + } + } +} + +/// An internal message for intercep- I mean handling output from the embedded [`TextInput`] widget. #[derive(Debug, Clone)] enum TextInputMessage { /// A new value was entered in the text input dialog. @@ -67,48 +73,19 @@ enum TextInputMessage { Submit, } -/// The default text input style with the border removed. -struct TextInputStyle; - -impl widget::text_input::StyleSheet for TextInputStyle { - fn active(&self) -> widget::text_input::Style { - widget::text_input::Style { - background: Background::Color(Color::TRANSPARENT), - border_radius: 0.0, - border_width: 0.0, - border_color: Color::TRANSPARENT, - } - } - - fn focused(&self) -> widget::text_input::Style { - self.active() - } - - fn placeholder_color(&self) -> Color { - Color::from_rgb(0.7, 0.7, 0.7) - } - - fn value_color(&self) -> Color { - Color::from_rgb(0.3, 0.3, 0.3) - } - - fn selection_color(&self) -> Color { - Color::from_rgb(0.8, 0.8, 1.0) - } -} - impl<'a, P: Param> ParamSlider<'a, P> { + pub const DEFAULT_WIDTH: Length = Length::Fixed(180.0); + pub const DEFAULT_HEIGHT: Length = Length::Fixed(30.0); + /// Creates a new [`ParamSlider`] for the given parameter. - pub fn new(state: &'a mut State, param: &'a P) -> Self { + pub fn new(param: &'a P) -> Self { Self { - state, - param, - width: Length::Units(180), - height: Length::Units(30), + width: Self::DEFAULT_WIDTH, + height: Self::DEFAULT_HEIGHT, text_size: None, - font: ::Font::default(), + font: None, } } @@ -125,50 +102,68 @@ impl<'a, P: Param> ParamSlider<'a, P> { } /// Sets the text size of the [`ParamSlider`]. - pub fn text_size(mut self, size: u16) -> Self { + pub fn text_size(mut self, size: Pixels) -> Self { self.text_size = Some(size); self } /// Sets the font of the [`ParamSlider`]. pub fn font(mut self, font: Font) -> Self { - self.font = font; + self.font = Some(font); self } /// Create a temporary [`TextInput`] hooked up to [`State::text_input_value`] and outputting /// [`TextInputMessage`] messages and do something with it. This can be used to - fn with_text_input(&self, layout: Layout, renderer: R, current_value: &str, f: F) -> T + fn with_text_input( + &self, + layout: Layout, + renderer: BorrowedRenderer, + current_value: &str, + state: &State, + f: F, + ) -> T where - F: FnOnce(TextInput<'_, TextInputMessage>, Layout, R) -> T, - R: Borrow, + F: FnOnce(TextInput<'_, TextInputMessage, Theme, Renderer>, Layout, BorrowedRenderer) -> T, + Theme: text_input::Catalog, + Renderer: TextRenderer, + Renderer::Font: From, + BorrowedRenderer: Borrow, { - let mut text_input_state = self.state.text_input_state.borrow_mut(); - text_input_state.focus(); + let font = self + .font + .map(Renderer::Font::from) + .unwrap_or_else(|| renderer.borrow().default_font()); let text_size = self .text_size .unwrap_or_else(|| renderer.borrow().default_size()); - let text_width = renderer - .borrow() - .measure_width(current_value, text_size, self.font); - let text_input = TextInput::new( - &mut text_input_state, - "", - current_value, - TextInputMessage::Value, - ) - .font(self.font) - .size(text_size) - .width(Length::Units(text_width.ceil() as u16)) - .style(TextInputStyle) - .on_submit(TextInputMessage::Submit); + let text_width = Renderer::Paragraph::with_text(Text { + content: current_value, + bounds: layout.bounds().size(), + size: text_size, + font, + line_height: Default::default(), + horizontal_alignment: alignment::Horizontal::Center, + vertical_alignment: alignment::Vertical::Center, + shaping: Default::default(), + wrapping: Default::default(), + }) + .min_width(); + + let text_input = text_input("", current_value) + .id(state.text_input_id.clone()) + .font(font) + .size(text_size) + .width(text_width) + .on_input(TextInputMessage::Value) + .on_submit(TextInputMessage::Submit); // Make sure to not draw over the borders, and center the text let offset_node = layout::Node::with_children( Size { width: text_width, - height: layout.bounds().size().height - (BORDER_WIDTH * 2.0), + height: layout.bounds().shrink(BORDER_WIDTH).size().height, }, vec![layout::Node::new(layout.bounds().size())], ); @@ -204,66 +199,246 @@ impl<'a, P: Param> ParamSlider<'a, P> { } } -impl<'a, P: Param> Widget for ParamSlider<'a, P> { - fn width(&self) -> Length { - self.width +impl<'a, P, Theme, Renderer> Widget for ParamSlider<'a, P> +where + P: Param, + Theme: text_input::Catalog, + Renderer: TextRenderer, + Renderer::Font: From, +{ + fn tag(&self) -> tree::Tag { + tree::Tag::of::() } - fn height(&self) -> Length { - self.height + fn state(&self) -> tree::State { + tree::State::new(State::default()) } - fn layout(&self, _renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - let limits = limits.width(self.width).height(self.height); - let size = limits.resolve(Size::ZERO); + fn children(&self) -> Vec { + let input = text_input::("", ""); + + // One child to store text input state. + vec![Tree { + tag: input.tag(), + state: input.state(), + children: input.children(), + }] + } + + fn size(&self) -> Size { + Size { + width: self.width, + height: self.height, + } + } + + fn layout( + &self, + _tree: &mut Tree, + _renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + layout::atomic(limits, self.width, self.height) + } + + fn draw( + &self, + tree: &Tree, + renderer: &mut Renderer, + theme: &Theme, + style: &renderer::Style, + layout: Layout<'_>, + cursor: mouse::Cursor, + viewport: &Rectangle, + ) { + let state = tree.state.downcast_ref::(); + let bounds = layout.bounds(); + + let background_color = + if cursor.is_over(bounds) || state.drag_active || state.text_input_value.is_some() { + Color::new(0.5, 0.5, 0.5, 0.1) + } else { + Color::TRANSPARENT + }; + + renderer.fill_quad( + renderer::Quad { + bounds, + border: Border { + color: Color::BLACK, + width: BORDER_WIDTH, + radius: 0.0.into(), + }, + ..Default::default() + }, + background_color, + ); + + // Shrink bounds to inside of the border + let bounds = bounds.shrink(BORDER_WIDTH); + + if let Some(current_value) = &state.text_input_value { + self.with_text_input( + layout, + renderer, + current_value, + state, + |text_input, layout, renderer| { + text_input.draw( + &tree.children[0], + renderer, + theme, + layout, + cursor, + None, + viewport, + ); + }, + ); + } else { + // We'll visualize the difference between the current value and the default value if the + // default value lies somewhere in the middle and the parameter is continuous. Otherwise + // this appraoch looks a bit jarring. + let current_value = self.param.modulated_normalized_value(); + let default_value = self.param.default_normalized_value(); + + let fill_start_x = util::remap_rect_x_t( + &bounds, + if self.param.step_count().is_none() && (0.45..=0.55).contains(&default_value) { + default_value + } else { + 0.0 + }, + ); - layout::Node::new(size) + let fill_end_x = util::remap_rect_x_t(&bounds, current_value); + + let fill_color = Color::from_rgb8(196, 196, 196); + let fill_rect = Rectangle { + x: fill_start_x.min(fill_end_x), + width: (fill_end_x - fill_start_x).abs(), + ..bounds + }; + + renderer.fill_quad( + renderer::Quad { + bounds: fill_rect, + ..Default::default() + }, + fill_color, + ); + + // To make it more readable (and because it looks cool), the parts that overlap with the + // fill rect will be rendered in white while the rest will be rendered in black. + let display_value = self.param.to_string(); + + let text_size = self.text_size.unwrap_or_else(|| renderer.default_size()); + let font = self + .font + .map(Renderer::Font::from) + .unwrap_or_else(|| renderer.default_font()); + + let text_bounds = Rectangle { + x: bounds.center_x(), + y: bounds.center_y(), + ..bounds + }; + renderer.fill_text( + text::Text { + content: display_value.clone(), + font: font, + size: text_size, + bounds: text_bounds.size(), + horizontal_alignment: alignment::Horizontal::Center, + vertical_alignment: alignment::Vertical::Center, + line_height: text::LineHeight::Relative(1.0), + shaping: Default::default(), + wrapping: Default::default(), + }, + text_bounds.position(), + style.text_color, + *viewport, + ); + + // This will clip to the filled area + renderer.with_layer(fill_rect, |renderer| { + let filled_text_color = Color::from_rgb8(80, 80, 80); + renderer.fill_text( + text::Text { + content: display_value, + font: font, + size: text_size, + bounds: text_bounds.size(), + horizontal_alignment: alignment::Horizontal::Center, + vertical_alignment: alignment::Vertical::Center, + line_height: text::LineHeight::Relative(1.0), + shaping: Default::default(), + wrapping: Default::default(), + }, + text_bounds.position(), + filled_text_color, + *viewport, + ); + }); + } } fn on_event( &mut self, - event: Event, + tree: &mut Tree, + event: event::Event, layout: Layout<'_>, - cursor_position: Point, + cursor: mouse::Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, ParamMessage>, + viewport: &Rectangle, ) -> event::Status { + let state = tree.state.downcast_mut::(); + // The pressence of a value in `self.state.text_input_value` indicates that the field should // be focussed. The field handles defocussing by itself // FIMXE: This is super hacky, I have no idea how you can reuse the text input widget // otherwise. Widgets are not supposed to handle messages from other widgets, but // we'll do so anyways by using a special `TextInputMessage` type and our own // `Shell`. - let text_input_status = if let Some(current_value) = &self.state.text_input_value { + let text_input_status = if let Some(current_value) = &state.text_input_value { let event = event.clone(); let mut messages = Vec::new(); let mut text_input_shell = Shell::new(&mut messages); + let status = self.with_text_input( layout, renderer, current_value, - |mut text_input, layout, renderer| { + &state, + |mut text_input: TextInput, layout, renderer| { text_input.on_event( + &mut tree.children[0], event, layout, - cursor_position, + cursor, renderer, clipboard, &mut text_input_shell, + viewport, ) }, ); + // Check if text input is focused. + let text_input_state = tree.children[0] + .state + .downcast_ref::>(); + // Pressing escape will unfocus the text field, so we should propagate that change in // our own model - if self.state.text_input_state.borrow().is_focused() { + if text_input_state.is_focused() { for message in messages { match message { - TextInputMessage::Value(s) => self.state.text_input_value = Some(s), + TextInputMessage::Value(s) => state.text_input_value = Some(s), TextInputMessage::Submit => { - if let Some(normalized_value) = self - .state + if let Some(normalized_value) = state .text_input_value .as_ref() .and_then(|s| self.param.string_to_normalized_value(s)) @@ -274,12 +449,12 @@ impl<'a, P: Param> Widget for ParamSlider<'a, P> { } // And defocus the text input widget again - self.state.text_input_value = None; + state.text_input_value = None; } } } } else { - self.state.text_input_value = None; + state.text_input_value = None; } status @@ -290,83 +465,88 @@ impl<'a, P: Param> Widget for ParamSlider<'a, P> { return event::Status::Captured; } - // Compensate for the border when handling these events - let bounds = layout.bounds(); - let bounds = Rectangle { - x: bounds.x + BORDER_WIDTH, - y: bounds.y + BORDER_WIDTH, - width: bounds.width - (BORDER_WIDTH * 2.0), - height: bounds.height - (BORDER_WIDTH * 2.0), - }; - match event { Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) | Event::Touch(touch::Event::FingerPressed { .. }) => { - if bounds.contains(cursor_position) { - let click = mouse::Click::new(cursor_position, self.state.last_click); - self.state.last_click = Some(click); - if self.state.keyboard_modifiers.alt() { - // Alt+click should not start a drag, instead it should show the text entry - // widget - self.state.drag_active = false; - - // Changing the parameter happens in the TextInput event handler above - let mut text_input_state = self.state.text_input_state.borrow_mut(); - self.state.text_input_value = Some(self.param.to_string()); - text_input_state.move_cursor_to_end(); - text_input_state.select_all(); - } else if self.state.keyboard_modifiers.command() - || matches!(click.kind(), mouse::click::Kind::Double) - { - // Likewise resetting a parameter should not let you immediately drag it to a new value - self.state.drag_active = false; - - shell.publish(ParamMessage::BeginSetParameter(self.param.as_ptr())); - self.set_normalized_value(shell, self.param.default_normalized_value()); - shell.publish(ParamMessage::EndSetParameter(self.param.as_ptr())); - } else if self.state.keyboard_modifiers.shift() { - shell.publish(ParamMessage::BeginSetParameter(self.param.as_ptr())); - self.state.drag_active = true; - - // When holding down shift while clicking on a parameter we want to - // granuarly edit the parameter without jumping to a new value - self.state.granular_drag_start_x_value = - Some((cursor_position.x, self.param.modulated_normalized_value())); - } else { - shell.publish(ParamMessage::BeginSetParameter(self.param.as_ptr())); - self.state.drag_active = true; + let bounds = layout.bounds(); + + let Some(cursor_position) = cursor.position_over(bounds) else { + return event::Status::Ignored; + }; + + let click = + mouse::Click::new(cursor_position, mouse::Button::Left, state.last_click); + state.last_click = Some(click); + + if state.keyboard_modifiers.alt() { + // Alt+click should not start a drag, instead it should show the text entry + // widget + state.drag_active = false; + + let current_value = self.param.to_string(); + state.text_input_value = Some(current_value.clone()); + + let text_input_state = tree.children[0] + .state + .downcast_mut::>(); + text_input_state.select_all(); + text_input_state.move_cursor_to_end(); + text_input_state.focus(); + } else if state.keyboard_modifiers.command() + || matches!(click.kind(), mouse::click::Kind::Double) + { + // Likewise resetting a parameter should not let you immediately drag it to a new value + state.drag_active = false; - self.set_normalized_value( - shell, - util::remap_rect_x_coordinate(&bounds, cursor_position.x), - ); - self.state.granular_drag_start_x_value = None; - } + shell.publish(ParamMessage::BeginSetParameter(self.param.as_ptr())); + self.set_normalized_value(shell, self.param.default_normalized_value()); + shell.publish(ParamMessage::EndSetParameter(self.param.as_ptr())); + } else if state.keyboard_modifiers.shift() { + shell.publish(ParamMessage::BeginSetParameter(self.param.as_ptr())); + state.drag_active = true; + + // When holding down shift while clicking on a parameter we want to + // granuarly edit the parameter without jumping to a new value + state.granular_drag_start_x_value = + Some((cursor_position.x, self.param.modulated_normalized_value())); + } else { + shell.publish(ParamMessage::BeginSetParameter(self.param.as_ptr())); + state.drag_active = true; - return event::Status::Captured; + self.set_normalized_value( + shell, + util::remap_rect_x_coordinate(&bounds, cursor_position.x), + ); + state.granular_drag_start_x_value = None; } + + event::Status::Captured } Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) | Event::Touch(touch::Event::FingerLifted { .. } | touch::Event::FingerLost { .. }) => { - if self.state.drag_active { - shell.publish(ParamMessage::EndSetParameter(self.param.as_ptr())); - - self.state.drag_active = false; - - return event::Status::Captured; + if !state.drag_active { + return event::Status::Ignored; } + + shell.publish(ParamMessage::EndSetParameter(self.param.as_ptr())); + state.drag_active = false; + event::Status::Captured } Event::Mouse(mouse::Event::CursorMoved { .. }) | Event::Touch(touch::Event::FingerMoved { .. }) => { // Don't do anything when we just reset the parameter because that would be weird - if self.state.drag_active { - // If shift is being held then the drag should be more granular instead of - // absolute - if self.state.keyboard_modifiers.shift() { - let (drag_start_x, drag_start_value) = *self - .state - .granular_drag_start_x_value - .get_or_insert_with(|| { + if !state.drag_active { + return event::Status::Ignored; + } + + let bounds = layout.bounds(); + + // If shift is being held then the drag should be more granular instead of + // absolute + if let Some(cursor_position) = cursor.position() { + if state.keyboard_modifiers.shift() { + let (drag_start_x, drag_start_value) = + *state.granular_drag_start_x_value.get_or_insert_with(|| { (cursor_position.x, self.param.modulated_normalized_value()) }); @@ -379,190 +559,86 @@ impl<'a, P: Param> Widget for ParamSlider<'a, P> { ), ); } else { - self.state.granular_drag_start_x_value = None; + state.granular_drag_start_x_value = None; self.set_normalized_value( shell, util::remap_rect_x_coordinate(&bounds, cursor_position.x), ); } - - return event::Status::Captured; } + + event::Status::Captured } Event::Keyboard(keyboard::Event::ModifiersChanged(modifiers)) => { - self.state.keyboard_modifiers = modifiers; + state.keyboard_modifiers = modifiers; + let bounds = layout.bounds(); // If this happens while dragging, snap back to reality uh I mean the current screen // position - if self.state.drag_active - && self.state.granular_drag_start_x_value.is_some() + if state.drag_active + && state.granular_drag_start_x_value.is_some() && !modifiers.shift() { - self.state.granular_drag_start_x_value = None; + state.granular_drag_start_x_value = None; - self.set_normalized_value( - shell, - util::remap_rect_x_coordinate(&bounds, cursor_position.x), - ); + if let Some(cursor_position) = cursor.position() { + self.set_normalized_value( + shell, + util::remap_rect_x_coordinate(&bounds, cursor_position.x), + ); + } } - return event::Status::Captured; + event::Status::Captured } - _ => {} + _ => event::Status::Ignored, } - - event::Status::Ignored } fn mouse_interaction( &self, + _state: &Tree, layout: Layout<'_>, - cursor_position: Point, + cursor: mouse::Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> mouse::Interaction { - let bounds = layout.bounds(); - let is_mouse_over = bounds.contains(cursor_position); - - if is_mouse_over { + if cursor.is_over(layout.bounds()) { mouse::Interaction::Pointer } else { mouse::Interaction::default() } } - - fn draw( - &self, - renderer: &mut Renderer, - style: &renderer::Style, - layout: Layout<'_>, - cursor_position: Point, - _viewport: &Rectangle, - ) { - let bounds = layout.bounds(); - // I'm sure there's some philosophical meaning behind this - let bounds_without_borders = Rectangle { - x: bounds.x + BORDER_WIDTH, - y: bounds.y + BORDER_WIDTH, - width: bounds.width - (BORDER_WIDTH * 2.0), - height: bounds.height - (BORDER_WIDTH * 2.0), - }; - let is_mouse_over = bounds.contains(cursor_position); - - // The bar itself, show a different background color when the value is being edited or when - // the mouse is hovering over it to indicate that it's interactive - let background_color = - if is_mouse_over || self.state.drag_active || self.state.text_input_value.is_some() { - Color::new(0.5, 0.5, 0.5, 0.1) - } else { - Color::TRANSPARENT - }; - - renderer.fill_quad( - renderer::Quad { - bounds, - border_color: Color::BLACK, - border_width: BORDER_WIDTH, - border_radius: 0.0, - }, - background_color, - ); - - // Only draw the text input widget when it gets focussed. Otherwise, overlay the label with - // the slider. - if let Some(current_value) = &self.state.text_input_value { - self.with_text_input( - layout, - renderer, - current_value, - |text_input, layout, renderer| { - text_input.draw(renderer, layout, cursor_position, None) - }, - ) - } else { - // We'll visualize the difference between the current value and the default value if the - // default value lies somewhere in the middle and the parameter is continuous. Otherwise - // this appraoch looks a bit jarring. - let current_value = self.param.modulated_normalized_value(); - let default_value = self.param.default_normalized_value(); - let fill_start_x = util::remap_rect_x_t( - &bounds_without_borders, - if self.param.step_count().is_none() && (0.45..=0.55).contains(&default_value) { - default_value - } else { - 0.0 - }, - ); - let fill_end_x = util::remap_rect_x_t(&bounds_without_borders, current_value); - - let fill_color = Color::from_rgb8(196, 196, 196); - let fill_rect = Rectangle { - x: fill_start_x.min(fill_end_x), - width: (fill_end_x - fill_start_x).abs(), - ..bounds_without_borders - }; - renderer.fill_quad( - renderer::Quad { - bounds: fill_rect, - border_color: Color::TRANSPARENT, - border_width: 0.0, - border_radius: 0.0, - }, - fill_color, - ); - - // To make it more readable (and because it looks cool), the parts that overlap with the - // fill rect will be rendered in white while the rest will be rendered in black. - let display_value = self.param.to_string(); - let text_size = self.text_size.unwrap_or_else(|| renderer.default_size()) as f32; - let text_bounds = Rectangle { - x: bounds.center_x(), - y: bounds.center_y(), - ..bounds - }; - renderer.fill_text(text::Text { - content: &display_value, - font: self.font, - size: text_size, - bounds: text_bounds, - color: style.text_color, - horizontal_alignment: alignment::Horizontal::Center, - vertical_alignment: alignment::Vertical::Center, - }); - - // This will clip to the filled area - renderer.with_layer(fill_rect, |renderer| { - let filled_text_color = Color::from_rgb8(80, 80, 80); - renderer.fill_text(text::Text { - content: &display_value, - font: self.font, - size: text_size, - bounds: text_bounds, - color: filled_text_color, - horizontal_alignment: alignment::Horizontal::Center, - vertical_alignment: alignment::Vertical::Center, - }); - }); - } - } } -impl<'a, P: Param> ParamSlider<'a, P> { +impl<'a, P> ParamSlider<'a, P> +where + P: Param + 'a, +{ /// Convert this [`ParamSlider`] into an [`Element`] with the correct message. You should have a /// variant on your own message type that wraps around [`ParamMessage`] so you can forward those /// messages to /// [`IcedEditor::handle_param_message()`][crate::IcedEditor::handle_param_message()]. - pub fn map(self, f: F) -> Element<'a, Message> + pub fn map(self, f: F) -> Element<'a, Message, Theme, Renderer> where Message: 'static, F: Fn(ParamMessage) -> Message + 'static, + Theme: text_input::Catalog + 'a, + Renderer: TextRenderer + 'a, + Renderer::Font: From, { Element::from(self).map(f) } } -impl<'a, P: Param> From> for Element<'a, ParamMessage> { +impl<'a, P, Theme, Renderer> From> for Element<'a, ParamMessage, Theme, Renderer> +where + P: Param + 'a, + Theme: text_input::Catalog + 'a, + Renderer: TextRenderer + 'a, + Renderer::Font: From, +{ fn from(widget: ParamSlider<'a, P>) -> Self { Element::new(widget) } diff --git a/nih_plug_iced/src/widgets/peak_meter.rs b/nih_plug_iced/src/widgets/peak_meter.rs index 688d67d7..bce0204b 100644 --- a/nih_plug_iced/src/widgets/peak_meter.rs +++ b/nih_plug_iced/src/widgets/peak_meter.rs @@ -5,12 +5,11 @@ use std::marker::PhantomData; use std::time::Duration; use std::time::Instant; -use crate::backend::Renderer; -use crate::renderer::Renderer as GraphicsRenderer; -use crate::text::Renderer as TextRenderer; -use crate::{ - alignment, layout, renderer, text, Background, Color, Element, Font, Layout, Length, Point, - Rectangle, Size, Widget, +use crate::core::text::{self, Paragraph, Renderer as TextRenderer}; +use crate::core::widget::tree::{self, Tree}; +use crate::core::{ + alignment, layout, mouse, padding, renderer, Background, Border, Color, Element, Font, Layout, + Length, Pixels, Point, Rectangle, Size, Widget, }; /// The thickness of this widget's borders. @@ -22,9 +21,7 @@ const TICK_WIDTH: f32 = 1.0; /// /// TODO: There are currently no styling options at all /// TODO: Vertical peak meter, this is just a proof of concept to fit the gain GUI example. -pub struct PeakMeter<'a, Message> { - state: &'a mut State, - +pub struct PeakMeter { /// The current measured value in decibel. current_value_db: f32, @@ -33,8 +30,8 @@ pub struct PeakMeter<'a, Message> { height: Length, width: Length, - text_size: Option, - font: Font, + text_size: Option, + font: Option, /// We don't emit any messages, but iced requires us to define some message type anyways. _phantom: PhantomData, @@ -42,29 +39,27 @@ pub struct PeakMeter<'a, Message> { /// State for a [`PeakMeter`]. #[derive(Debug, Default)] -pub struct State { +struct State { /// The last peak value in decibel. held_peak_value_db: AtomicCell, /// When the last peak value was hit. last_held_peak_value: AtomicCell>, } -impl<'a, Message> PeakMeter<'a, Message> { +impl PeakMeter { /// Creates a new [`PeakMeter`] using the current measurement in decibel. This measurement can /// already have some form of smoothing applied to it. This peak slider widget can draw the last /// hold value for you. - pub fn new(state: &'a mut State, value_db: f32) -> Self { + pub fn new(value_db: f32) -> Self { Self { - state, - current_value_db: value_db, hold_time: None, - width: Length::Units(180), - height: Length::Units(30), + width: Length::Fixed(180.0), + height: Length::Fixed(30.0), text_size: None, - font: ::Font::default(), + font: None, _phantom: PhantomData, } @@ -77,71 +72,72 @@ impl<'a, Message> PeakMeter<'a, Message> { } /// Sets the width of the [`PeakMeter`]. - pub fn width(mut self, width: Length) -> Self { - self.width = width; + pub fn width(mut self, width: impl Into) -> Self { + self.width = width.into(); self } /// Sets the height of the [`PeakMeter`]. - pub fn height(mut self, height: Length) -> Self { - self.height = height; + pub fn height(mut self, height: impl Into) -> Self { + self.height = height.into(); self } /// Sets the text size of the [`PeakMeter`]'s ticks bar. - pub fn text_size(mut self, size: u16) -> Self { - self.text_size = Some(size); + pub fn text_size(mut self, size: impl Into) -> Self { + self.text_size = Some(size.into()); self } /// Sets the font of the [`PeakMeter`]'s ticks bar. pub fn font(mut self, font: Font) -> Self { - self.font = font; + self.font = Some(font); self } } -impl<'a, Message> Widget for PeakMeter<'a, Message> +impl Widget for PeakMeter where Message: Clone, + Renderer: TextRenderer, + Renderer::Font: From, { - fn width(&self) -> Length { - self.width + fn tag(&self) -> tree::Tag { + tree::Tag::of::() } - fn height(&self) -> Length { - self.height + fn state(&self) -> tree::State { + tree::State::new(State::default()) } - fn layout(&self, _renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - let limits = limits.width(self.width).height(self.height); - let size = limits.resolve(Size::ZERO); + fn size(&self) -> Size { + (self.width, self.height).into() + } - layout::Node::new(size) + fn layout( + &self, + _tree: &mut Tree, + _renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + layout::atomic(limits, self.width, self.height) } fn draw( &self, + tree: &Tree, renderer: &mut Renderer, + _theme: &Theme, style: &renderer::Style, layout: Layout<'_>, - _cursor_position: Point, - _viewport: &Rectangle, + _cursor: mouse::Cursor, + viewport: &Rectangle, ) { - let bounds = layout.bounds(); - let bar_bounds = Rectangle { - height: bounds.height / 2.0, - ..bounds - }; - let ticks_bounds = Rectangle { - y: bounds.y + (bounds.height / 2.0), - height: bounds.height / 2.0, - ..bounds - }; + let state = tree.state.downcast_ref::(); - let text_size = self - .text_size - .unwrap_or_else(|| (renderer.default_size() as f32 * 0.7).round() as u16); + let bounds = layout.bounds(); + let bar_bounds = bounds.shrink(padding::bottom(bounds.height / 2.0)); + let ticks_bounds = bounds.shrink(padding::top(bounds.height / 2.0)); // We'll draw a simple horizontal for [-90, 20] dB where we'll treat -80 as -infinity, with // a label containing the tick markers below it. If `.hold_time()` was called then we'll @@ -181,9 +177,12 @@ where renderer.fill_quad( renderer::Quad { bounds: tick_bounds, - border_radius: 0.0, - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + color: Color::TRANSPARENT, + width: 0.0, + radius: 0.0.into(), + }, + ..Default::default() }, Background::Color(tick_color), ); @@ -192,14 +191,14 @@ where // Draw the hold peak value if the hold time option has been set if let Some(hold_time) = self.hold_time { let now = Instant::now(); - let mut held_peak_value_db = self.state.held_peak_value_db.load(); - let last_peak_value = self.state.last_held_peak_value.load(); + let mut held_peak_value_db = state.held_peak_value_db.load(); + let last_peak_value = state.last_held_peak_value.load(); if self.current_value_db >= held_peak_value_db || last_peak_value.is_none() || now > last_peak_value.unwrap() + hold_time { - self.state.held_peak_value_db.store(self.current_value_db); - self.state.last_held_peak_value.store(Some(now)); + state.held_peak_value_db.store(self.current_value_db); + state.last_held_peak_value.store(Some(now)); held_peak_value_db = self.current_value_db; } @@ -211,9 +210,12 @@ where width: TICK_WIDTH, height: bar_bounds.height - (BORDER_WIDTH * 2.0), }, - border_radius: 0.0, - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + color: Color::TRANSPARENT, + width: 0.0, + radius: 0.0.into(), + }, + ..Default::default() }, Background::Color(Color::from_rgb(0.3, 0.3, 0.3)), ); @@ -223,13 +225,24 @@ where renderer.fill_quad( renderer::Quad { bounds: bar_bounds, - border_radius: 0.0, - border_width: BORDER_WIDTH, - border_color: Color::BLACK, + border: Border { + color: Color::BLACK, + width: BORDER_WIDTH, + radius: 0.0.into(), + }, + ..Default::default() }, Background::Color(Color::TRANSPARENT), ); + let text_size = self + .text_size + .unwrap_or_else(|| Pixels((renderer.default_size().0 * 0.7).round())); + let font = self + .font + .map(Renderer::Font::from) + .unwrap_or_else(|| renderer.default_font()); + // Beneath the bar we want to draw the names of the ticks for tick_db in text_ticks { let x_coordinate = db_to_x_coord(tick_db as f32); @@ -242,9 +255,12 @@ where width: TICK_WIDTH, height: ticks_bounds.height * 0.3, }, - border_radius: 0.0, - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + color: Color::TRANSPARENT, + width: 0.0, + radius: 0.0.into(), + }, + ..Default::default() }, Background::Color(Color::from_rgb(0.3, 0.3, 0.3)), ); @@ -254,47 +270,75 @@ where } else { tick_db.to_string() }; - renderer.fill_text(text::Text { - content: &tick_text, - font: self.font, - size: text_size as f32, - bounds: Rectangle { + renderer.fill_text( + text::Text { + content: tick_text, + font, + size: text_size, + bounds: ticks_bounds.size(), + horizontal_alignment: alignment::Horizontal::Center, + vertical_alignment: alignment::Vertical::Top, + line_height: Default::default(), + shaping: Default::default(), + wrapping: text::Wrapping::None, + }, + Point { x: x_coordinate, y: ticks_bounds.y + (ticks_bounds.height * 0.35), - ..ticks_bounds }, - color: style.text_color, - horizontal_alignment: alignment::Horizontal::Center, - vertical_alignment: alignment::Vertical::Top, - }); + style.text_color, + *viewport, + ); } // Every proper graph needs a unit label let zero_db_x_coordinate = db_to_x_coord(0.0); - let zero_db_text_width = renderer.measure_width("0", text_size, self.font); - renderer.fill_text(text::Text { - // The spacing looks a bit off if we start with a space here so we'll add a little - // offset to the x-coordinate instead - content: "dBFS", - font: self.font, - size: text_size as f32, - bounds: Rectangle { - x: zero_db_x_coordinate + (zero_db_text_width / 2.0) + (text_size as f32 * 0.2), + + let zero_db_text_width = Renderer::Paragraph::with_text(text::Text { + content: "0", + font, + size: text_size, + bounds: ticks_bounds.size(), + horizontal_alignment: alignment::Horizontal::Center, + vertical_alignment: alignment::Vertical::Top, + line_height: Default::default(), + shaping: Default::default(), + wrapping: text::Wrapping::None, + }) + .min_width(); + + renderer.fill_text( + text::Text { + // The spacing looks a bit off if we start with a space here so we'll add a little + // offset to the x-coordinate instead + content: "dBFS".into(), + font, + size: text_size, + bounds: ticks_bounds.size(), + horizontal_alignment: alignment::Horizontal::Left, + vertical_alignment: alignment::Vertical::Top, + line_height: Default::default(), + shaping: Default::default(), + wrapping: text::Wrapping::None, + }, + Point { + x: zero_db_x_coordinate + (zero_db_text_width / 2.0) + (text_size.0 * 0.2), y: ticks_bounds.y + (ticks_bounds.height * 0.35), - ..ticks_bounds }, - color: style.text_color, - horizontal_alignment: alignment::Horizontal::Left, - vertical_alignment: alignment::Vertical::Top, - }); + style.text_color, + *viewport, + ); } } -impl<'a, Message> From> for Element<'a, Message> +impl<'a, Theme, Message, Renderer> From> + for Element<'a, Message, Theme, Renderer> where - Message: 'a + Clone, + Message: Clone + 'a, + Renderer: TextRenderer + 'a, + Renderer::Font: From, { - fn from(widget: PeakMeter<'a, Message>) -> Self { + fn from(widget: PeakMeter) -> Self { Element::new(widget) } } diff --git a/nih_plug_iced/src/widgets/util.rs b/nih_plug_iced/src/widgets/util.rs index e755635b..cd61033e 100644 --- a/nih_plug_iced/src/widgets/util.rs +++ b/nih_plug_iced/src/widgets/util.rs @@ -1,6 +1,6 @@ //! Utilities for creating these widgets. -use crate::Rectangle; +use crate::core::Rectangle; /// Remap a `[0, 1]` value to an x-coordinate within this rectangle. The value will be clamped to /// `[0, 1]` if it isn't already in that range. diff --git a/nih_plug_iced/src/wrapper.rs b/nih_plug_iced/src/wrapper.rs index c149489e..f6deb90c 100644 --- a/nih_plug_iced/src/wrapper.rs +++ b/nih_plug_iced/src/wrapper.rs @@ -2,14 +2,15 @@ //! `nih_plug_iced`. use crossbeam::channel; +use futures_util::FutureExt; +use iced_baseview::{ + baseview::WindowScalePolicy, core::Element, futures::Subscription, window::WindowSubs, + Renderer, Task, +}; use nih_plug::prelude::GuiContext; use std::sync::Arc; -use crate::futures::FutureExt; -use crate::{ - futures, subscription, Application, Color, Command, Element, IcedEditor, ParameterUpdate, - Subscription, WindowQueue, WindowScalePolicy, WindowSubs, -}; +use crate::{IcedEditor, ParameterUpdate}; /// Wraps an `iced_baseview` [`Application`] around [`IcedEditor`]. Needed to allow editors to /// always receive a copy of the GUI context. @@ -30,6 +31,16 @@ pub enum Message { ParameterUpdate, } +impl Message { + fn into_editor_message(self) -> Option { + if let Message::EditorMessage(message) = self { + Some(message) + } else { + None + } + } +} + impl std::fmt::Debug for Message { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -48,7 +59,7 @@ impl Clone for Message { } } -impl Application for IcedEditorWrapperApplication { +impl iced_baseview::Application for IcedEditorWrapperApplication { type Executor = E::Executor; type Message = Message; type Flags = ( @@ -56,34 +67,30 @@ impl Application for IcedEditorWrapperApplication { Arc>, E::InitializationFlags, ); + type Theme = E::Theme; fn new( (context, parameter_updates_receiver, flags): Self::Flags, - ) -> (Self, Command) { - let (editor, command) = E::new(flags, context); + ) -> (Self, Task) { + let (editor, task) = E::new(flags, context); ( Self { editor, parameter_updates_receiver, }, - command.map(Message::EditorMessage), + task.map(Message::EditorMessage), ) } #[inline] - fn update( - &mut self, - window: &mut WindowQueue, - message: Self::Message, - ) -> Command { + fn update(&mut self, message: Self::Message) -> Task { match message { - Message::EditorMessage(message) => self - .editor - .update(window, message) - .map(Message::EditorMessage), + Message::EditorMessage(message) => { + self.editor.update(message).map(Message::EditorMessage) + } // This message only exists to force a redraw - Message::ParameterUpdate => Command::none(), + Message::ParameterUpdate => Task::none(), } } @@ -93,15 +100,17 @@ impl Application for IcedEditorWrapperApplication { window_subs: &mut WindowSubs, ) -> Subscription { // Since we're wrapping around `E::Message`, we need to do this transformation ourselves - let mut editor_window_subs = WindowSubs { - on_frame: match &window_subs.on_frame { - Some(Message::EditorMessage(message)) => Some(message.clone()), - _ => None, - }, - on_window_will_close: match &window_subs.on_window_will_close { - Some(Message::EditorMessage(message)) => Some(message.clone()), - _ => None, - }, + let on_frame = window_subs.on_frame.clone(); + let on_window_will_close = window_subs.on_window_will_close.clone(); + let mut editor_window_subs: WindowSubs = WindowSubs { + on_frame: Some(Arc::new(move || { + let cb = on_frame.clone(); + cb.and_then(|cb| cb().and_then(|m| m.into_editor_message())) + })), + on_window_will_close: Some(Arc::new(move || { + let cb = on_window_will_close.clone(); + cb.and_then(|cb| cb().and_then(|m| m.into_editor_message())) + })), }; let subscription = Subscription::batch([ @@ -109,50 +118,58 @@ impl Application for IcedEditorWrapperApplication { // into a stream that doesn't require consuming that receiver (which wouldn't work in // this case since the subscriptions function gets called repeatedly). So we'll just use // a crossbeam queue and this unfold instead. - subscription::unfold( + Subscription::run_with_id( "parameter updates", - self.parameter_updates_receiver.clone(), - |parameter_updates_receiver| match parameter_updates_receiver.try_recv() { - Ok(_) => futures::future::ready(( - Some(Message::ParameterUpdate), - parameter_updates_receiver, - )) - .boxed(), - Err(_) => futures::future::pending().boxed(), - }, + futures_util::stream::unfold( + self.parameter_updates_receiver.clone(), + |parameter_updates_receiver| match parameter_updates_receiver.try_recv() { + Ok(_) => futures_util::future::ready(Some(( + Message::ParameterUpdate, + parameter_updates_receiver, + ))) + .boxed(), + Err(channel::TryRecvError::Empty) => { + futures_util::future::pending().boxed() + } + Err(channel::TryRecvError::Disconnected) => { + futures_util::future::ready(None).boxed() + } + }, + ), ), self.editor .subscription(&mut editor_window_subs) - .map(Message::EditorMessage), + .map(|m| Message::EditorMessage(m)), ]); - if let Some(message) = editor_window_subs.on_frame { - window_subs.on_frame = Some(Message::EditorMessage(message)); + if let Some(message) = editor_window_subs.on_frame.as_ref() { + let message = Arc::clone(message); + window_subs.on_frame = Some(Arc::new(move || message().map(Message::EditorMessage))); } - if let Some(message) = editor_window_subs.on_window_will_close { - window_subs.on_window_will_close = Some(Message::EditorMessage(message)); + if let Some(message) = editor_window_subs.on_window_will_close.as_ref() { + let message = Arc::clone(message); + window_subs.on_window_will_close = + Some(Arc::new(move || message().map(Message::EditorMessage))); } subscription } #[inline] - fn view(&mut self) -> Element<'_, Self::Message> { + fn view(&self) -> Element<'_, Self::Message, Self::Theme, Renderer> { self.editor.view().map(Message::EditorMessage) } #[inline] - fn background_color(&self) -> Color { - self.editor.background_color() + fn scale_policy(&self) -> WindowScalePolicy { + WindowScalePolicy::SystemScaleFactor } - #[inline] - fn scale_policy(&self) -> WindowScalePolicy { - self.editor.scale_policy() + fn title(&self) -> String { + self.editor.title() } - #[inline] - fn renderer_settings() -> iced_baseview::backend::settings::Settings { - E::renderer_settings() + fn theme(&self) -> Self::Theme { + self.editor.theme() } } diff --git a/plugins/examples/gain_gui_iced/Cargo.toml b/plugins/examples/gain_gui_iced/Cargo.toml index ea4f8f3b..be23f224 100644 --- a/plugins/examples/gain_gui_iced/Cargo.toml +++ b/plugins/examples/gain_gui_iced/Cargo.toml @@ -8,10 +8,10 @@ license = "ISC" description = "A simple gain plugin with an iced GUI" [lib] -crate-type = ["cdylib"] +crate-type = ["cdylib", "lib"] [dependencies] nih_plug = { path = "../../../", features = ["assert_process_allocs"] } -nih_plug_iced = { path = "../../../nih_plug_iced" } +nih_plug_iced = { path = "../../../nih_plug_iced", features = ["wgpu"] } atomic_float = "0.1" diff --git a/plugins/examples/gain_gui_iced/src/editor.rs b/plugins/examples/gain_gui_iced/src/editor.rs index db2c31b7..c2921425 100644 --- a/plugins/examples/gain_gui_iced/src/editor.rs +++ b/plugins/examples/gain_gui_iced/src/editor.rs @@ -1,5 +1,7 @@ use atomic_float::AtomicF32; use nih_plug::prelude::{util, Editor, GuiContext}; +use nih_plug_iced::assets::noto_sans_fonts_data; +use nih_plug_iced::widget::{column, text, Space}; use nih_plug_iced::widgets as nih_widgets; use nih_plug_iced::*; use std::sync::Arc; @@ -17,7 +19,11 @@ pub(crate) fn create( peak_meter: Arc, editor_state: Arc, ) -> Option> { - create_iced_editor::(editor_state, (params, peak_meter)) + create_iced_editor::( + editor_state, + (params, peak_meter), + noto_sans_fonts_data().into(), + ) } struct GainEditor { @@ -25,9 +31,6 @@ struct GainEditor { context: Arc, peak_meter: Arc, - - gain_slider_state: nih_widgets::param_slider::State, - peak_meter_state: nih_widgets::peak_meter::State, } #[derive(Debug, Clone, Copy)] @@ -40,72 +43,57 @@ impl IcedEditor for GainEditor { type Executor = executor::Default; type Message = Message; type InitializationFlags = (Arc, Arc); + type Theme = Theme; fn new( (params, peak_meter): Self::InitializationFlags, context: Arc, - ) -> (Self, Command) { + ) -> (Self, Task) { let editor = GainEditor { params, context, peak_meter, - - gain_slider_state: Default::default(), - peak_meter_state: Default::default(), }; - (editor, Command::none()) + (editor, Task::none()) } fn context(&self) -> &dyn GuiContext { self.context.as_ref() } - fn update( - &mut self, - _window: &mut WindowQueue, - message: Self::Message, - ) -> Command { + fn update(&mut self, message: Self::Message) -> Task { match message { Message::ParamUpdate(message) => self.handle_param_message(message), } - Command::none() + Task::none() } - fn view(&mut self) -> Element<'_, Self::Message> { - Column::new() - .align_items(Alignment::Center) - .push( - Text::new("Gain GUI") - .font(assets::NOTO_SANS_LIGHT) - .size(40) - .height(50.into()) - .width(Length::Fill) - .horizontal_alignment(alignment::Horizontal::Center) - .vertical_alignment(alignment::Vertical::Bottom), - ) - .push( - Text::new("Gain") - .height(20.into()) - .width(Length::Fill) - .horizontal_alignment(alignment::Horizontal::Center) - .vertical_alignment(alignment::Vertical::Center), - ) - .push( - nih_widgets::ParamSlider::new(&mut self.gain_slider_state, &self.params.gain) - .map(Message::ParamUpdate), - ) - .push(Space::with_height(10.into())) - .push( - nih_widgets::PeakMeter::new( - &mut self.peak_meter_state, - util::gain_to_db(self.peak_meter.load(std::sync::atomic::Ordering::Relaxed)), - ) - .hold_time(Duration::from_millis(600)), - ) - .into() + fn view(&self) -> Element<'_, Self::Message> { + let title = text("Gain GUI") + .font(assets::NOTO_SANS_LIGHT) + .size(40) + .height(50) + .width(Length::Fill) + .align_x(alignment::Horizontal::Center) + .align_y(alignment::Vertical::Bottom); + + let text = text("Gain").height(20).width(Length::Fill).center(); + + column![ + title, + text, + nih_widgets::ParamSlider::new(&self.params.gain).map(Message::ParamUpdate), + Space::with_height(10), + nih_widgets::PeakMeter::new(util::gain_to_db( + self.peak_meter.load(std::sync::atomic::Ordering::Relaxed), + )) + .hold_time(Duration::from_millis(600)) + ] + .align_x(alignment::Horizontal::Center) + .into() } fn background_color(&self) -> nih_plug_iced::Color { diff --git a/plugins/examples/gain_gui_iced/src/lib.rs b/plugins/examples/gain_gui_iced/src/lib.rs index 15a30ca5..006c7aca 100644 --- a/plugins/examples/gain_gui_iced/src/lib.rs +++ b/plugins/examples/gain_gui_iced/src/lib.rs @@ -9,7 +9,7 @@ mod editor; const PEAK_METER_DECAY_MS: f64 = 150.0; /// This is mostly identical to the gain example, minus some fluff, and with a GUI. -struct Gain { +pub struct Gain { params: Arc, /// Needed to normalize the peak meter's response based on the sample rate. diff --git a/src/wrapper/standalone/wrapper.rs b/src/wrapper/standalone/wrapper.rs index 43476cc1..bd4ff58f 100644 --- a/src/wrapper/standalone/wrapper.rs +++ b/src/wrapper/standalone/wrapper.rs @@ -342,7 +342,7 @@ impl> Wrapper { height: height as f64, }, scale: scaling_policy, - gl_config: None, + // gl_config: None, }, move |window| { let parent_handle = match window.raw_window_handle() {