diff --git a/Cargo.lock b/Cargo.lock index 4e60530..106d5e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,86 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" +[[package]] +name = "accesskit" +version = "0.16.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" + +[[package]] +name = "accesskit_atspi_common" +version = "0.9.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "serde", + "thiserror 1.0.69", + "zvariant 3.15.2", +] + +[[package]] +name = "accesskit_consumer" +version = "0.24.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "immutable-chunkmap", +] + +[[package]] +name = "accesskit_macos" +version = "0.17.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_consumer", + "objc2 0.5.2", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", + "once_cell", +] + +[[package]] +name = "accesskit_unix" +version = "0.12.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_atspi_common", + "atspi", + "futures-lite 1.13.0", + "serde", + "tokio", + "tokio-stream", + "zbus 3.15.2", +] + +[[package]] +name = "accesskit_windows" +version = "0.22.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_consumer", + "paste", + "static_assertions", + "windows 0.54.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.22.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "raw-window-handle", + "winit", +] + [[package]] name = "addr2line" version = "0.24.2" @@ -76,6 +156,12 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "almost" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14" + [[package]] name = "alsa" version = "0.9.1" @@ -196,6 +282,21 @@ version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +[[package]] +name = "apply" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47b57fc4521e3cae26a4d45b5227f8fadee4c345be0fefd8d5d1711afb8aeb9" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "arbitrary" version = "1.4.2" @@ -242,38 +343,22 @@ dependencies = [ [[package]] name = "ashpd" -version = "0.6.8" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac22eda5891cc086690cb6fa10121c0390de0e3b04eb269f2d766b00d3f2d81" +checksum = "6cbdf310d77fd3aaee6ea2093db7011dc2d35d2eb3481e5607f1f8d942ed99df" dependencies = [ - "async-fs 2.1.3", - "async-net", "enumflags2", "futures-channel", "futures-util", - "once_cell", - "rand", - "serde", - "serde_repr", - "url", - "zbus 3.15.2", -] - -[[package]] -name = "ashpd" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3d60bee1a1d38c2077030f4788e1b4e31058d2e79a8cfc8f2b440bd44db290" -dependencies = [ - "async-fs 2.1.3", - "async-net", - "enumflags2", - "futures-channel", - "futures-util", - "rand", + "rand 0.9.2", + "raw-window-handle", "serde", "serde_repr", + "tokio", "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", "zbus 5.9.0", ] @@ -299,17 +384,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.5.0" @@ -336,44 +410,6 @@ dependencies = [ "slab", ] -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-fs" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f7e37c0ed80b2a977691c47dae8625cfb21e205827106c64f7c588766b2e50" -dependencies = [ - "async-lock 3.4.1", - "blocking", - "futures-lite 2.6.1", -] - -[[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.5.0", - "async-executor", - "async-io 2.5.0", - "async-lock 3.4.1", - "blocking", - "futures-lite 2.6.1", - "once_cell", -] - [[package]] name = "async-io" version = "1.13.0" @@ -432,17 +468,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-net" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" -dependencies = [ - "async-io 2.5.0", - "blocking", - "futures-lite 2.6.1", -] - [[package]] name = "async-process" version = "1.8.1" @@ -466,7 +491,7 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-io 2.5.0", "async-lock 3.4.1", "async-signal", @@ -507,32 +532,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "async-std" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 2.5.0", - "async-lock 3.4.1", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 2.6.1", - "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" @@ -571,6 +570,76 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" +[[package]] +name = "atomicwrites" +version = "0.4.2" +source = "git+https://github.com/jackpot51/rust-atomicwrites#043ab4859d53ffd3d55334685303d8df39c9f768" +dependencies = [ + "rustix 0.38.44", + "tempfile", + "windows-sys 0.48.0", +] + +[[package]] +name = "atspi" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6059f350ab6f593ea00727b334265c4dfc7fd442ee32d264794bd9bdc68e87ca" +dependencies = [ + "atspi-common", + "atspi-connection", + "atspi-proxies", +] + +[[package]] +name = "atspi-common" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92af95f966d2431f962bc632c2e68eda7777330158bf640c4af4249349b2cdf5" +dependencies = [ + "enumflags2", + "serde", + "static_assertions", + "zbus 3.15.2", + "zbus_names 2.6.1", + "zvariant 3.15.2", +] + +[[package]] +name = "atspi-connection" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c65e7d70f86d4c0e3b2d585d9bf3f979f0b19d635a336725a88d279f76b939" +dependencies = [ + "atspi-common", + "atspi-proxies", + "futures-lite 1.13.0", + "zbus 3.15.2", +] + +[[package]] +name = "atspi-proxies" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6495661273703e7a229356dcbe8c8f38223d697aacfaf0e13590a9ac9977bb52" +dependencies = [ + "atspi-common", + "serde", + "zbus 3.15.2", +] + +[[package]] +name = "auto_enums" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c170965892137a3a9aeb000b4524aa3cc022a310e709d848b6e1cdce4ab4781" +dependencies = [ + "derive_utils", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "autocfg" version = "1.5.0" @@ -642,35 +711,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bincode" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" -dependencies = [ - "bincode_derive", - "serde", - "unty", -] - -[[package]] -name = "bincode_derive" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" -dependencies = [ - "virtue", -] - [[package]] name = "bindgen" version = "0.72.0" @@ -691,24 +731,24 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.8.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" [[package]] name = "bit_field" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" [[package]] name = "bitflags" @@ -752,7 +792,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2", + "objc2 0.5.2", +] + +[[package]] +name = "block2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "340d2f0bdb2a43c1d3cd40513185b2bd7def0aa1052f956455114bc98f82dcf2" +dependencies = [ + "objc2 0.6.2", ] [[package]] @@ -761,7 +810,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-task", "futures-io", "futures-lite 2.6.1", @@ -780,6 +829,12 @@ version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +[[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.23.2" @@ -844,17 +899,6 @@ dependencies = [ "wayland-client", ] -[[package]] -name = "cargo-hot-protocol" -version = "0.1.0" -source = "git+https://github.com/hecrj/cargo-hot.git?rev=b8dc518b8640928178a501257e353b73bc06cf47#b8dc518b8640928178a501257e353b73bc06cf47" -dependencies = [ - "anyhow", - "bincode 2.0.1", - "log", - "subsecond", -] - [[package]] name = "cc" version = "1.2.33" @@ -927,7 +971,10 @@ checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", + "serde", + "wasm-bindgen", "windows-link", ] @@ -1000,43 +1047,71 @@ dependencies = [ [[package]] name = "clipboard_macos" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f4aaa047ba3c3630b080bb9860894732ff23e2aee290a418909aa6d5df38f" +version = "0.1.0" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" dependencies = [ - "objc2", - "objc2-app-kit", - "objc2-foundation", + "objc", + "objc-foundation", + "objc_id", ] [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003f886bc4e2987729d10c1db3424e7f80809f3fc22dbc16c685738887cb37b8" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" dependencies = [ + "dnd", + "mime 0.1.0", "smithay-clipboard", ] [[package]] name = "clipboard_x11" version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4274ea815e013e0f9f04a2633423e14194e408a0576c943ce3d14ca56c50031c" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" dependencies = [ "thiserror 1.0.69", "x11rb", ] [[package]] -name = "codespan-reporting" -version = "0.12.0" +name = "cocoa" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation", + "core-graphics-types", + "libc", + "objc", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "serde", "termcolor", - "unicode-width 0.2.1", + "unicode-width 0.1.14", ] [[package]] @@ -1057,6 +1132,37 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9226dbc05df4fb986f48d730b001532580883c4c06c5d1c213f4b34c1c157178" +[[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" @@ -1092,16 +1198,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1115,21 +1211,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", - "core-foundation 0.9.4", - "core-graphics-types 0.1.3", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" -dependencies = [ - "bitflags 2.9.2", - "core-foundation 0.10.1", - "core-graphics-types 0.2.0", + "core-foundation", + "core-graphics-types", "foreign-types", "libc", ] @@ -1141,19 +1224,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation 0.9.4", + "core-foundation", "libc", ] [[package]] -name = "core-graphics-types" -version = "0.2.0" +name = "core_maths" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" dependencies = [ - "bitflags 2.9.2", - "core-foundation 0.10.1", - "libc", + "libm", ] [[package]] @@ -1177,17 +1258,108 @@ dependencies = [ ] [[package]] -name = "cosmic-text" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da46a9d5a8905cc538a4a5bceb6a4510de7a51049c5588c0114efce102bcbbe8" +name = "cosmic-client-toolkit" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=178eb0b#178eb0b14a0e5c192f64f6dee6c40341a8e5ee51" +dependencies = [ + "cosmic-protocols", + "libc", + "smithay-client-toolkit", + "wayland-client", + "wayland-protocols", +] + +[[package]] +name = "cosmic-config" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" +dependencies = [ + "atomicwrites", + "cosmic-config-derive", + "cosmic-settings-daemon", + "dirs 6.0.0", + "futures-util", + "iced_futures", + "known-folders", + "notify", + "once_cell", + "ron 0.9.0", + "serde", + "tokio", + "tracing", + "xdg", + "zbus 5.9.0", +] + +[[package]] +name = "cosmic-config-derive" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" +dependencies = [ + "quote", + "syn 2.0.106", +] + +[[package]] +name = "cosmic-freedesktop-icons" +version = "0.3.0" +source = "git+https://github.com/pop-os/freedesktop-icons#8a05c322c482ff3c69cf34bacfee98907ac45307" +dependencies = [ + "dirs 5.0.1", + "ini_core", + "memmap2 0.9.7", + "thiserror 2.0.16", + "tracing", + "xdg", +] + +[[package]] +name = "cosmic-protocols" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=178eb0b#178eb0b14a0e5c192f64f6dee6c40341a8e5ee51" dependencies = [ "bitflags 2.9.2", - "fontdb 0.16.2", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "wayland-server", +] + +[[package]] +name = "cosmic-settings-config" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#19f10525ff00d76558147ea060bd856a87122353" +dependencies = [ + "cosmic-config", + "ron 0.9.0", + "serde", + "serde_with", + "thiserror 2.0.16", + "tracing", + "xkbcommon", +] + +[[package]] +name = "cosmic-settings-daemon" +version = "0.1.0" +source = "git+https://github.com/pop-os/dbus-settings-bindings#3b86984332be2c930a3536ab714b843c851fa8ca" +dependencies = [ + "zbus 5.9.0", +] + +[[package]] +name = "cosmic-text" +version = "0.14.2" +source = "git+https://github.com/pop-os/cosmic-text.git#f7033bb0433f6a9ba109007027781ba46ea9ba27" +dependencies = [ + "bitflags 2.9.2", + "fontdb 0.23.0", "log", "rangemap", "rustc-hash 1.1.0", - "rustybuzz", + "rustybuzz 0.14.1", "self_cell", "smol_str", "swash", @@ -1199,6 +1371,23 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cosmic-theme" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" +dependencies = [ + "almost", + "cosmic-config", + "csscolorparser", + "dirs 6.0.0", + "lazy_static", + "palette", + "ron 0.9.0", + "serde", + "serde_json", + "thiserror 2.0.16", +] + [[package]] name = "cpal" version = "0.15.3" @@ -1307,18 +1496,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" -[[package]] -name = "cryoglyph" -version = "0.1.0" -source = "git+https://github.com/iced-rs/cryoglyph.git?rev=453cedec0d2ec563bd7fa87e84a2319bcebb1ba3#453cedec0d2ec563bd7fa87e84a2319bcebb1ba3" -dependencies = [ - "cosmic-text", - "etagere", - "lru", - "rustc-hash 2.1.1", - "wgpu", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -1329,6 +1506,22 @@ dependencies = [ "typenum", ] +[[package]] +name = "css-color" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42aaeae719fd78ce501d77c6cdf01f7e96f26bcd5617a4903a1c2b97e388543a" + +[[package]] +name = "csscolorparser" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda6aace1fbef3aa217b27f4c8d7d071ef2a70a5ca51050b1f17d40299d3f16" +dependencies = [ + "phf", + "serde", +] + [[package]] name = "ctor-lite" version = "0.1.0" @@ -1342,17 +1535,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" [[package]] -name = "dark-light" -version = "2.0.0" +name = "d3d12" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e1a09f280e29a8b00bc7e81eca5ac87dca0575639c9422a5fa25a07bb884b8" +checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" dependencies = [ - "ashpd 0.10.3", - "async-std", - "objc2", - "objc2-foundation", - "web-sys", - "winreg", + "bitflags 2.9.2", + "libloading", + "winapi", ] [[package]] @@ -1420,6 +1610,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", + "serde", ] [[package]] @@ -1445,6 +1636,17 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "derive_utils" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "diff" version = "0.1.13" @@ -1469,7 +1671,16 @@ version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys 0.5.0", ] [[package]] @@ -1480,16 +1691,40 @@ checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", - "redox_users", + "redox_users 0.4.6", "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.5.2", + "windows-sys 0.60.2", +] + [[package]] name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "dispatch2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" +dependencies = [ + "bitflags 2.9.2", + "block2 0.6.1", + "libc", + "objc2 0.6.2", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -1510,6 +1745,18 @@ dependencies = [ "libloading", ] +[[package]] +name = "dnd" +version = "0.1.0" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +dependencies = [ + "bitflags 2.9.2", + "mime 0.1.0", + "raw-window-handle", + "smithay-client-toolkit", + "smithay-clipboard", +] + [[package]] name = "document-features" version = "0.2.11" @@ -1534,13 +1781,13 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dpi" version = "0.1.1" -source = "git+https://github.com/iced-rs/winit.git?rev=11414b6aa45699f038114e61b4ddf5102b2d3b4b#11414b6aa45699f038114e61b4ddf5102b2d3b4b" +source = "git+https://github.com/pop-os/winit.git?tag=iced-xdg-surface-0.13#1cc02bdab141072eaabad639d74b032fd0fcc62e" [[package]] name = "drm" -version = "0.12.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98888c4bbd601524c11a7ed63f814b8825f420514f78e96f752c437ae9cbb5d1" +checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" dependencies = [ "bitflags 2.9.2", "bytemuck", @@ -1551,9 +1798,9 @@ dependencies = [ [[package]] name = "drm-ffi" -version = "0.8.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c98727e48b7ccb4f4aea8cfe881e5b07f702d17b7875991881b41af7278d53" +checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" dependencies = [ "drm-sys", "rustix 0.38.44", @@ -1567,14 +1814,20 @@ checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" [[package]] name = "drm-sys" -version = "0.7.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd39dde40b6e196c2e8763f23d119ddb1a8714534bf7d77fa97a65b0feda3986" +checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" dependencies = [ "libc", "linux-raw-sys 0.6.5", ] +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "either" version = "1.15.0" @@ -1757,6 +2010,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + [[package]] name = "fastrand" version = "1.9.0" @@ -1772,6 +2031,26 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "fax" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" +dependencies = [ + "fax_derive", +] + +[[package]] +name = "fax_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "fd-lock" version = "4.0.4" @@ -1855,20 +2134,6 @@ dependencies = [ "roxmltree", ] -[[package]] -name = "fontdb" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" -dependencies = [ - "fontconfig-parser", - "log", - "memmap2", - "slotmap", - "tinyvec", - "ttf-parser 0.20.0", -] - [[package]] name = "fontdb" version = "0.18.0" @@ -1877,12 +2142,26 @@ checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" dependencies = [ "fontconfig-parser", "log", - "memmap2", + "memmap2 0.9.7", "slotmap", "tinyvec", "ttf-parser 0.21.1", ] +[[package]] +name = "fontdb" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2 0.9.7", + "slotmap", + "tinyvec", + "ttf-parser 0.25.1", +] + [[package]] name = "foreign-types" version = "0.5.0" @@ -1920,19 +2199,28 @@ dependencies = [ ] [[package]] -name = "freedesktop-icons" -version = "0.4.0" +name = "freedesktop-desktop-entry" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f87364ea709292a3b3f74014ce3ee78412c89807eea75a358c8e029b000994" +checksum = "de88bb3b555a4b38372082c5ede431e1e0e14f32be1d02998c6366eb4d2682ed" dependencies = [ - "dirs", - "ini_core", - "once_cell", - "thiserror 1.0.69", - "tracing", + "gettext-rs", + "log", + "memchr", + "thiserror 2.0.16", + "unicase", "xdg", ] +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + [[package]] name = "futures" version = "0.3.31" @@ -1984,7 +2272,7 @@ checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot", + "parking_lot 0.12.4", ] [[package]] @@ -2105,6 +2393,26 @@ dependencies = [ "wasi 0.14.2+wasi-0.2.4", ] +[[package]] +name = "gettext-rs" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44e92f7dc08430aca7ed55de161253a22276dfd69c5526e5c5e95d1f7cf338a" +dependencies = [ + "gettext-sys", + "locale_config", +] + +[[package]] +name = "gettext-sys" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb45773f5b8945f12aecd04558f545964f943dacda1b1155b3d738f5469ef661" +dependencies = [ + "cc", + "temp-dir", +] + [[package]] name = "gif" version = "0.13.3" @@ -2201,23 +2509,11 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "glow" -version = "0.16.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -2266,14 +2562,15 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.27.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" dependencies = [ "log", "presser", "thiserror 1.0.69", - "windows 0.58.0", + "winapi", + "windows 0.52.0", ] [[package]] @@ -2284,7 +2581,7 @@ checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" dependencies = [ "bitflags 2.9.2", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.15.5", ] [[package]] @@ -2296,6 +2593,12 @@ dependencies = [ "bitflags 2.9.2", ] +[[package]] +name = "grid" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df00eed8d1f0db937f6be10e46e8072b0671accb504cf0f959c5c52c679f5b9" + [[package]] name = "gstreamer" version = "0.23.7" @@ -2349,6 +2652,36 @@ dependencies = [ "system-deps 7.0.5", ] +[[package]] +name = "gstreamer-audio" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7ec7e0374298897e669db7c79544bc44df12011985e7dd5f38644edaf2caf4" +dependencies = [ + "cfg-if", + "glib", + "gstreamer", + "gstreamer-audio-sys", + "gstreamer-base", + "libc", + "once_cell", + "smallvec", +] + +[[package]] +name = "gstreamer-audio-sys" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5f3e09e7c04ec91d78c2a6ca78d50b574b9ed49fdf5e72f3693adca4306a87" +dependencies = [ + "glib-sys", + "gobject-sys", + "gstreamer-base-sys", + "gstreamer-sys", + "libc", + "system-deps 7.0.5", +] + [[package]] name = "gstreamer-base" version = "0.23.6" @@ -2376,6 +2709,36 @@ dependencies = [ "system-deps 7.0.5", ] +[[package]] +name = "gstreamer-pbutils" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf4bf5857fa22f910634e86a5bce33b5581a9e90caa4e32fd4a20bdd4c83ed0" +dependencies = [ + "glib", + "gstreamer", + "gstreamer-audio", + "gstreamer-pbutils-sys", + "gstreamer-video", + "libc", + "thiserror 2.0.16", +] + +[[package]] +name = "gstreamer-pbutils-sys" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304101f5fccbbe41e0169536777ddb7680c2c837e18575c22b30fc20cedfb76f" +dependencies = [ + "glib-sys", + "gobject-sys", + "gstreamer-audio-sys", + "gstreamer-sys", + "gstreamer-video-sys", + "libc", + "system-deps 7.0.5", +] + [[package]] name = "gstreamer-sys" version = "0.23.6" @@ -2388,6 +2751,37 @@ dependencies = [ "system-deps 7.0.5", ] +[[package]] +name = "gstreamer-video" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1318b599d77ca4f7702ecbdeac1672d6304cb16b7e5752fabb3ee8260449a666" +dependencies = [ + "cfg-if", + "futures-channel", + "glib", + "gstreamer", + "gstreamer-base", + "gstreamer-video-sys", + "libc", + "once_cell", + "thiserror 2.0.16", +] + +[[package]] +name = "gstreamer-video-sys" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a70f0947f12d253b9de9bc3fd92f981e4d025336c18389c7f08cdf388a99f5c" +dependencies = [ + "glib-sys", + "gobject-sys", + "gstreamer-base-sys", + "gstreamer-sys", + "libc", + "system-deps 7.0.5", +] + [[package]] name = "guillotiere" version = "0.6.2" @@ -2406,9 +2800,14 @@ checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", - "num-traits", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.15.5" @@ -2426,7 +2825,22 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown", + "hashbrown 0.15.5", +] + +[[package]] +name = "hassle-rs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" +dependencies = [ + "bitflags 2.9.2", + "com", + "libc", + "libloading", + "thiserror 1.0.69", + "widestring", + "winapi", ] [[package]] @@ -2498,6 +2912,15 @@ version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f" +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + [[package]] name = "iana-time-zone" version = "0.1.63" @@ -2525,81 +2948,58 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ + "dnd", + "iced_accessibility", "iced_core", - "iced_debug", - "iced_devtools", "iced_futures", "iced_renderer", - "iced_runtime", "iced_widget", "iced_winit", "image", + "mime 0.1.0", "thiserror 1.0.69", + "window_clipboard", ] [[package]] -name = "iced_beacon" -version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +name = "iced_accessibility" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ - "bincode 1.3.3", - "futures", - "iced_core", - "log", - "semver", - "serde", - "thiserror 1.0.69", - "tokio", + "accesskit", + "accesskit_winit", ] [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ "bitflags 2.9.2", "bytes", - "dark-light", + "dnd", "glam", - "lilt", + "iced_accessibility", "log", + "mime 0.1.0", "num-traits", + "once_cell", + "palette", + "raw-window-handle", "rustc-hash 2.1.1", "serde", "smol_str", "thiserror 1.0.69", "web-time", -] - -[[package]] -name = "iced_debug" -version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" -dependencies = [ - "cargo-hot-protocol", - "iced_beacon", - "iced_core", - "iced_futures", - "log", -] - -[[package]] -name = "iced_devtools" -version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" -dependencies = [ - "iced_debug", - "iced_program", - "iced_widget", - "log", + "window_clipboard", ] [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ "futures", "iced_core", @@ -2607,13 +3007,25 @@ dependencies = [ "rustc-hash 2.1.1", "tokio", "wasm-bindgen-futures", - "wasmtimer", + "wasm-timer", +] + +[[package]] +name = "iced_glyphon" +version = "0.6.0" +source = "git+https://github.com/pop-os/glyphon.git?tag=iced-0.14-dev#6ef9d12a20cfd0f7bdf38136a26ded9f7459ec8b" +dependencies = [ + "cosmic-text", + "etagere", + "lru", + "rustc-hash 2.1.1", + "wgpu", ] [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ "bitflags 2.9.2", "bytemuck", @@ -2625,25 +3037,17 @@ dependencies = [ "kamadak-exif", "log", "lyon_path", - "raw-window-handle 0.6.2", + "once_cell", + "raw-window-handle", "rustc-hash 2.1.1", "thiserror 1.0.69", "unicode-segmentation", ] -[[package]] -name = "iced_program" -version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" -dependencies = [ - "iced_graphics", - "iced_runtime", -] - [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2655,28 +3059,29 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ "bytes", + "dnd", + "iced_accessibility", "iced_core", - "iced_debug", "iced_futures", - "raw-window-handle 0.6.2", + "raw-window-handle", "thiserror 1.0.69", + "window_clipboard", ] [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ "bytemuck", "cosmic-text", - "iced_debug", "iced_graphics", "kurbo 0.10.4", "log", - "resvg", + "resvg 0.42.0", "rustc-hash 2.1.1", "softbuffer", "tiny-skia", @@ -2685,14 +3090,15 @@ dependencies = [ [[package]] name = "iced_video_player" version = "0.6.0" -source = "git+https://git.tfcconnection.org/chris/iced_video_player?branch=master#3e99427f5e430a81ac57dd448463eb59e3740276" +source = "git+https://github.com/jackpot51/iced_video_player.git?branch=cosmic#ff37a34f99814597db0e265e172dd5a85a03394a" dependencies = [ "glib", "gstreamer", "gstreamer-app", "gstreamer-base", - "iced", - "iced_wgpu", + "gstreamer-pbutils", + "html-escape", + "libcosmic", "log", "thiserror 1.0.69", "url", @@ -2701,52 +3107,72 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ + "as-raw-xcb-connection", "bitflags 2.9.2", "bytemuck", - "cryoglyph", + "cosmic-client-toolkit", "futures", "glam", "guillotiere", - "iced_debug", + "iced_glyphon", "iced_graphics", "log", "lyon", - "resvg", + "once_cell", + "raw-window-handle", + "resvg 0.42.0", "rustc-hash 2.1.1", + "rustix 0.38.44", "thiserror 1.0.69", + "tiny-xlib", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-sys", "wgpu", + "x11rb", ] [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ + "dnd", + "iced_accessibility", "iced_renderer", "iced_runtime", "log", "num-traits", + "once_cell", "ouroboros", "rustc-hash 2.1.1", "thiserror 1.0.69", "unicode-segmentation", + "window_clipboard", ] [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?branch=master#f9a6a3051d0a5e1c9f47ebe4071daf5621f8d9c1" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" dependencies = [ - "iced_debug", - "iced_program", + "dnd", + "iced_accessibility", + "iced_futures", + "iced_graphics", + "iced_runtime", "log", "rustc-hash 2.1.1", + "rustix 0.38.44", "thiserror 1.0.69", "tracing", "wasm-bindgen-futures", + "wayland-client", "web-sys", + "winapi", "window_clipboard", "winit", ] @@ -2866,9 +3292,9 @@ dependencies = [ [[package]] name = "image" -version = "0.25.6" +version = "0.25.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" dependencies = [ "bytemuck", "byteorder-lite", @@ -2876,8 +3302,9 @@ dependencies = [ "exr", "gif", "image-webp", + "moxcms", "num-traits", - "png", + "png 0.18.0", "qoi", "ravif", "rayon", @@ -2889,9 +3316,9 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6970fe7a5300b4b42e62c52efa0187540a5bef546c60edaf554ef595d2e6f0b" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" dependencies = [ "byteorder-lite", "quick-error", @@ -2903,12 +3330,38 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +[[package]] +name = "imagesize" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" + [[package]] name = "imgref" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" +[[package]] +name = "immutable-chunkmap" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f97096f508d54f8f8ab8957862eee2ccd628847b6217af1a335e1c44dee578" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.10.0" @@ -2916,7 +3369,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.5", + "serde", ] [[package]] @@ -2928,6 +3382,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "inotify" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +dependencies = [ + "bitflags 2.9.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + [[package]] name = "instant" version = "0.1.13" @@ -3089,6 +3563,35 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +[[package]] +name = "known-folders" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c644f4623d1c55eb60a9dac35e0858a59f982fb87db6ce34c872372b0a5b728f" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "kqueue" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + [[package]] name = "kurbo" version = "0.10.4" @@ -3110,15 +3613,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -3172,6 +3666,54 @@ version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +[[package]] +name = "libcosmic" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#29f38f83a38b550ae0de2b130fde9f2c36341fab" +dependencies = [ + "apply", + "ashpd", + "auto_enums", + "chrono", + "cosmic-config", + "cosmic-freedesktop-icons", + "cosmic-settings-config", + "cosmic-settings-daemon", + "cosmic-theme", + "css-color", + "derive_setters", + "freedesktop-desktop-entry", + "futures", + "iced", + "iced_accessibility", + "iced_core", + "iced_futures", + "iced_renderer", + "iced_runtime", + "iced_tiny_skia", + "iced_wgpu", + "iced_widget", + "iced_winit", + "image", + "lazy_static", + "libc", + "mime 0.3.17", + "palette", + "raw-window-handle", + "rfd", + "rustix 1.0.8", + "serde", + "shlex", + "slotmap", + "taffy", + "thiserror 2.0.16", + "tokio", + "tracing", + "unicode-segmentation", + "url", + "zbus 5.9.0", +] + [[package]] name = "libfuzzer-sys" version = "0.4.10" @@ -3220,15 +3762,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "lilt" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67562e5eff6b20553fa9be1c503356768420994e28f67e3eafe6f41910e57ad" -dependencies = [ - "web-time", -] - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -3265,6 +3798,19 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed" +[[package]] +name = "locale_config" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d2c35b16f4483f6c26f0e4e9550717a2f6575bcd6f12a53ff0c490a94a6934" +dependencies = [ + "lazy_static", + "objc", + "objc-foundation", + "regex", + "winapi", +] + [[package]] name = "lock_api" version = "0.4.13" @@ -3280,9 +3826,6 @@ name = "log" version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" -dependencies = [ - "value-bag", -] [[package]] name = "loop9" @@ -3295,9 +3838,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.16.0" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ea4e65087ff52f3862caff188d489f1fab49a0cb09e01b2e3f1a617b10aaed" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" [[package]] name = "lumina" @@ -3306,20 +3849,19 @@ dependencies = [ "clap", "colors-transform", "crisp", - "derive_setters", - "dirs", - "freedesktop-icons", + "dirs 5.0.1", "gstreamer", "gstreamer-app", - "iced", "iced_video_player", + "image", "lexpr", + "libcosmic", "miette", "pretty_assertions", "rayon", - "rfd", + "resvg 0.45.1", "rodio", - "ron", + "ron 0.8.1", "serde", "serde-lexpr", "sqlx", @@ -3438,12 +3980,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] -name = "memfd" -version = "0.6.4" +name = "memmap2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" dependencies = [ - "rustix 0.38.44", + "libc", ] [[package]] @@ -3475,13 +4017,13 @@ dependencies = [ [[package]] name = "metal" -version = "0.32.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ "bitflags 2.9.2", "block", - "core-graphics-types 0.2.0", + "core-graphics-types", "foreign-types", "log", "objc", @@ -3518,6 +4060,20 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "mime" +version = "0.1.0" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +dependencies = [ + "smithay-clipboard", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -3541,10 +4097,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", + "log", "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] +[[package]] +name = "moxcms" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08" +dependencies = [ + "num-traits", + "pxfm", +] + [[package]] name = "muldiv" version = "1.0.1" @@ -3559,28 +4126,23 @@ checksum = "13d2233c9842d08cfe13f9eac96e207ca6a2ea10b80259ebe8ad0268be27d2af" [[package]] name = "naga" -version = "26.0.0" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916cbc7cb27db60be930a4e2da243cf4bc39569195f22fd8ee419cd31d5b662c" +checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" dependencies = [ "arrayvec", "bit-set", "bitflags 2.9.2", - "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases 0.1.1", "codespan-reporting", - "half", - "hashbrown", "hexf-parse", - "indexmap", - "libm", + "indexmap 2.10.0", "log", - "num-traits", - "once_cell", "rustc-hash 1.1.0", "spirv", - "thiserror 2.0.16", - "unicode-ident", + "termcolor", + "thiserror 1.0.69", + "unicode-xid", ] [[package]] @@ -3608,7 +4170,7 @@ dependencies = [ "log", "ndk-sys 0.6.0+11769913", "num_enum", - "raw-window-handle 0.6.2", + "raw-window-handle", "thiserror 1.0.69", ] @@ -3704,6 +4266,30 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" +[[package]] +name = "notify" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" +dependencies = [ + "bitflags 2.9.2", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.60.2", +] + +[[package]] +name = "notify-types" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3736,7 +4322,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand", + "rand 0.8.5", "smallvec", "zeroize", ] @@ -3876,6 +4462,15 @@ dependencies = [ "objc2-encode", ] +[[package]] +name = "objc2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "561f357ba7f3a2a61563a186a163d0a3a5247e1089524a3981d49adb775078bc" +dependencies = [ + "objc2-encode", +] + [[package]] name = "objc2-app-kit" version = "0.2.2" @@ -3883,15 +4478,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ "bitflags 2.9.2", - "block2", + "block2 0.5.1", "libc", - "objc2", + "objc2 0.5.2", "objc2-core-data", "objc2-core-image", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-quartz-core", ] +[[package]] +name = "objc2-app-kit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" +dependencies = [ + "bitflags 2.9.2", + "block2 0.6.1", + "objc2 0.6.2", + "objc2-foundation 0.3.1", +] + [[package]] name = "objc2-cloud-kit" version = "0.2.2" @@ -3899,10 +4506,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ "bitflags 2.9.2", - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3911,9 +4518,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -3923,9 +4530,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ "bitflags 2.9.2", - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" +dependencies = [ + "bitflags 2.9.2", + "dispatch2", + "objc2 0.6.2", ] [[package]] @@ -3934,9 +4552,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", "objc2-metal", ] @@ -3946,10 +4564,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-contacts", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -3965,10 +4583,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ "bitflags 2.9.2", - "block2", + "block2 0.5.1", "dispatch", "libc", - "objc2", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" +dependencies = [ + "bitflags 2.9.2", + "objc2 0.6.2", + "objc2-core-foundation", ] [[package]] @@ -3977,10 +4606,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ - "block2", - "objc2", - "objc2-app-kit", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -3990,9 +4619,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ "bitflags 2.9.2", - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -4002,9 +4631,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ "bitflags 2.9.2", - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", "objc2-metal", ] @@ -4014,8 +4643,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "objc2", - "objc2-foundation", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -4025,13 +4654,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ "bitflags 2.9.2", - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-cloud-kit", "objc2-core-data", "objc2-core-image", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", "objc2-link-presentation", "objc2-quartz-core", "objc2-symbols", @@ -4045,9 +4674,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" dependencies = [ - "block2", - "objc2", - "objc2-foundation", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", ] [[package]] @@ -4057,10 +4686,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ "bitflags 2.9.2", - "block2", - "objc2", + "block2 0.5.1", + "objc2 0.5.2", "objc2-core-location", - "objc2-foundation", + "objc2-foundation 0.2.2", ] [[package]] @@ -4149,15 +4778,6 @@ dependencies = [ "libredox", ] -[[package]] -name = "ordered-float" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c1f9f56e534ac6a9b8a4600bdf0f530fb393b5f393e7b4d03489c3cf0c3f01" -dependencies = [ - "num-traits", -] - [[package]] name = "ordered-stream" version = "0.2.0" @@ -4213,12 +4833,48 @@ version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" +[[package]] +name = "palette" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +dependencies = [ + "approx", + "fast-srgb8", + "palette_derive", + "phf", + "serde", +] + +[[package]] +name = "palette_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +dependencies = [ + "by_address", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "parking" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.4" @@ -4226,7 +4882,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.11", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -4263,6 +4933,48 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pico-args" version = "0.5.0" @@ -4352,6 +5064,19 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "png" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" +dependencies = [ + "bitflags 2.9.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + [[package]] name = "polling" version = "2.8.0" @@ -4384,24 +5109,9 @@ dependencies = [ [[package]] name = "pollster" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" - -[[package]] -name = "portable-atomic" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" - -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", -] +checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" [[package]] name = "potential_utf" @@ -4503,6 +5213,15 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "pxfm" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e790881194f6f6e86945f0a42a6981977323669aeb6c40e9c7ec253133b96f8" +dependencies = [ + "num-traits", +] + [[package]] name = "qoi" version = "0.4.1" @@ -4559,8 +5278,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -4570,7 +5299,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -4582,6 +5321,15 @@ dependencies = [ "getrandom 0.2.16", ] +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + [[package]] name = "range-alloc" version = "0.1.4" @@ -4620,8 +5368,8 @@ dependencies = [ "once_cell", "paste", "profiling", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "simd_helpers", "system-deps 6.2.2", "thiserror 1.0.69", @@ -4644,12 +5392,6 @@ dependencies = [ "rgb", ] -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - [[package]] name = "raw-window-handle" version = "0.6.2" @@ -4686,6 +5428,15 @@ dependencies = [ "font-types", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -4715,6 +5466,37 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 2.0.16", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "regex" version = "1.11.1" @@ -4778,32 +5560,48 @@ dependencies = [ "rgb", "svgtypes", "tiny-skia", - "usvg", + "usvg 0.42.0", +] + +[[package]] +name = "resvg" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43" +dependencies = [ + "gif", + "image-webp", + "log", + "pico-args", + "rgb", + "svgtypes", + "tiny-skia", + "usvg 0.45.1", + "zune-jpeg", ] [[package]] name = "rfd" -version = "0.12.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9e7b57df6e8472152674607f6cc68aa14a748a3157a857a94f516e11aeacc2" +checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" dependencies = [ - "ashpd 0.6.8", - "async-io 1.13.0", - "block", - "dispatch", - "futures-util", + "ashpd", + "block2 0.6.1", + "dispatch2", "js-sys", "log", - "objc", - "objc-foundation", - "objc_id", + "objc2 0.6.2", + "objc2-app-kit 0.3.1", + "objc2-core-foundation", + "objc2-foundation 0.3.1", "pollster", - "raw-window-handle 0.5.2", + "raw-window-handle", "urlencoding", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -4841,6 +5639,19 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "ron" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63f3aa105dea217ef30d89581b65a4d527a19afc95ef5750be3890e8d3c5b837" +dependencies = [ + "base64 0.22.1", + "bitflags 2.9.2", + "serde", + "serde_derive", + "unicode-ident", +] + [[package]] name = "roxmltree" version = "0.20.0" @@ -4860,7 +5671,7 @@ dependencies = [ "num-traits", "pkcs1", "pkcs8", - "rand_core", + "rand_core 0.6.4", "signature", "spki", "subtle", @@ -4942,8 +5753,26 @@ dependencies = [ "libm", "smallvec", "ttf-parser 0.21.1", - "unicode-bidi-mirroring", - "unicode-ccc", + "unicode-bidi-mirroring 0.2.0", + "unicode-ccc 0.2.0", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "rustybuzz" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" +dependencies = [ + "bitflags 2.9.2", + "bytemuck", + "core_maths", + "log", + "smallvec", + "ttf-parser 0.25.1", + "unicode-bidi-mirroring 0.4.0", + "unicode-ccc 0.4.0", "unicode-properties", "unicode-script", ] @@ -4985,6 +5814,30 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -5005,7 +5858,7 @@ checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" dependencies = [ "ab_glyph", "log", - "memmap2", + "memmap2 0.9.7", "smithay-client-toolkit", "tiny-skia", ] @@ -5016,15 +5869,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749" -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" -dependencies = [ - "serde", -] - [[package]] name = "serde" version = "1.0.219" @@ -5061,6 +5905,7 @@ version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" dependencies = [ + "indexmap 2.10.0", "itoa", "memchr", "ryu", @@ -5099,6 +5944,38 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.0.4", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "sha1" version = "0.10.6" @@ -5152,7 +6029,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -5226,12 +6103,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ "bitflags 2.9.2", + "bytemuck", "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", - "memmap2", + "memmap2 0.9.7", + "pkg-config", "rustix 0.38.44", "thiserror 1.0.69", "wayland-backend", @@ -5241,16 +6120,17 @@ dependencies = [ "wayland-protocols", "wayland-protocols-wlr", "wayland-scanner", + "xkbcommon", "xkeysym", ] [[package]] name = "smithay-clipboard" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" +version = "0.8.0" +source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-5#5a3007def49eb678d1144850c9ee04b80707c56a" dependencies = [ "libc", + "raw-window-handle", "smithay-client-toolkit", "wayland-backend", ] @@ -5286,25 +6166,23 @@ dependencies = [ [[package]] name = "softbuffer" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" +version = "0.4.1" +source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#6e75b1ad7e98397d37cb187886d05969bc480995" dependencies = [ "as-raw-xcb-connection", "bytemuck", "cfg_aliases 0.2.1", - "core-graphics 0.24.0", + "cocoa", + "core-graphics", "drm", "fastrand 2.3.0", "foreign-types", "js-sys", "log", - "memmap2", - "objc2", - "objc2-foundation", - "objc2-quartz-core", - "raw-window-handle 0.6.2", - "redox_syscall 0.5.17", + "memmap2 0.9.7", + "objc", + "raw-window-handle", + "redox_syscall 0.4.1", "rustix 0.38.44", "tiny-xlib", "wasm-bindgen", @@ -5312,7 +6190,7 @@ dependencies = [ "wayland-client", "wayland-sys", "web-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", "x11rb", ] @@ -5373,9 +6251,9 @@ dependencies = [ "futures-intrusive", "futures-io", "futures-util", - "hashbrown", + "hashbrown 0.15.5", "hashlink", - "indexmap", + "indexmap 2.10.0", "log", "memchr", "once_cell", @@ -5458,7 +6336,7 @@ dependencies = [ "memchr", "once_cell", "percent-encoding", - "rand", + "rand 0.8.5", "rsa", "serde", "sha1", @@ -5496,7 +6374,7 @@ dependencies = [ "md-5", "memchr", "once_cell", - "rand", + "rand 0.8.5", "serde", "serde_json", "sha2", @@ -5589,34 +6467,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "subsecond" -version = "0.7.0-rc.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b14ed4d86ab065ffbfdb994fd3e44daf5244b02cb643bd52949d74b703f36605" -dependencies = [ - "js-sys", - "libc", - "libloading", - "memfd", - "memmap2", - "serde", - "subsecond-types", - "thiserror 2.0.16", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "subsecond-types" -version = "0.7.0-rc.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "275920a8a5634e47e12253971db85946798795bbe4d9dfc1debf23533d823983" -dependencies = [ - "serde", -] - [[package]] name = "subtle" version = "2.6.1" @@ -5884,6 +6734,17 @@ dependencies = [ "version-compare", ] +[[package]] +name = "taffy" +version = "0.3.11" +source = "git+https://github.com/DioxusLabs/taffy?rev=7781c70#7781c70241f7f572130c13106f2a869a9cf80885" +dependencies = [ + "arrayvec", + "grid", + "num-traits", + "slotmap", +] + [[package]] name = "target-lexicon" version = "0.12.16" @@ -5896,6 +6757,12 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" +[[package]] +name = "temp-dir" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83176759e9416cf81ee66cb6508dbfe9c96f20b8b56265a39917551c23c70964" + [[package]] name = "tempfile" version = "3.21.0" @@ -5989,13 +6856,16 @@ dependencies = [ [[package]] name = "tiff" -version = "0.9.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" dependencies = [ + "fax", "flate2", - "jpeg-decoder", + "half", + "quick-error", "weezl", + "zune-jpeg", ] [[package]] @@ -6042,7 +6912,7 @@ dependencies = [ "bytemuck", "cfg-if", "log", - "png", + "png 0.17.16", "tiny-skia-path", ] @@ -6107,9 +6977,11 @@ dependencies = [ "libc", "mio", "pin-project-lite", + "signal-hook-registry", "slab", "socket2 0.6.0", "tokio-macros", + "tracing", "windows-sys 0.59.0", ] @@ -6162,7 +7034,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap", + "indexmap 2.10.0", "toml_datetime", "winnow 0.5.40", ] @@ -6173,7 +7045,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap", + "indexmap 2.10.0", "serde", "serde_spanned", "toml_datetime", @@ -6244,12 +7116,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "ttf-parser" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" - [[package]] name = "ttf-parser" version = "0.21.1" @@ -6261,6 +7127,9 @@ name = "ttf-parser" version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" +dependencies = [ + "core_maths", +] [[package]] name = "typenum" @@ -6279,6 +7148,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + [[package]] name = "unicode-bidi" version = "0.3.18" @@ -6291,12 +7166,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" +[[package]] +name = "unicode-bidi-mirroring" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe" + [[package]] name = "unicode-ccc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" +[[package]] +name = "unicode-ccc" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" + [[package]] name = "unicode-ident" version = "1.0.18" @@ -6355,10 +7242,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] -name = "unty" -version = "0.0.4" +name = "unicode-xid" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" @@ -6388,12 +7275,12 @@ dependencies = [ "data-url", "flate2", "fontdb 0.18.0", - "imagesize", + "imagesize 0.12.0", "kurbo 0.11.3", "log", "pico-args", "roxmltree", - "rustybuzz", + "rustybuzz 0.14.1", "simplecss", "siphasher", "strict-num", @@ -6405,6 +7292,39 @@ dependencies = [ "xmlwriter", ] +[[package]] +name = "usvg" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef" +dependencies = [ + "base64 0.22.1", + "data-url", + "flate2", + "fontdb 0.23.0", + "imagesize 0.13.0", + "kurbo 0.11.3", + "log", + "pico-args", + "roxmltree", + "rustybuzz 0.20.1", + "simplecss", + "siphasher", + "strict-num", + "svgtypes", + "tiny-skia-path", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "xmlwriter", +] + +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + [[package]] name = "utf8_iter" version = "1.0.4" @@ -6434,12 +7354,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "value-bag" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" - [[package]] name = "vcpkg" version = "0.2.15" @@ -6458,12 +7372,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "virtue" -version = "0.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" - [[package]] name = "waker-fn" version = "1.2.0" @@ -6573,17 +7481,18 @@ dependencies = [ ] [[package]] -name = "wasmtimer" -version = "0.4.2" +name = "wasm-timer" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8d49b5d6c64e8558d9b1b065014426f35c18de636895d24893dbbd329743446" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ "futures", "js-sys", - "parking_lot", + "parking_lot 0.11.2", "pin-utils", - "slab", "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] @@ -6644,6 +7553,7 @@ dependencies = [ "wayland-backend", "wayland-client", "wayland-scanner", + "wayland-server", ] [[package]] @@ -6670,6 +7580,7 @@ dependencies = [ "wayland-client", "wayland-protocols", "wayland-scanner", + "wayland-server", ] [[package]] @@ -6683,6 +7594,19 @@ dependencies = [ "quote", ] +[[package]] +name = "wayland-server" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbd4f3aba6c9fba70445ad2a484c0ef0356c1a9459b1e8e435bedc1971a6222" +dependencies = [ + "bitflags 2.9.2", + "downcast-rs", + "rustix 1.0.8", + "wayland-backend", + "wayland-scanner", +] + [[package]] name = "wayland-sys" version = "0.31.7" @@ -6723,23 +7647,19 @@ checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" [[package]] name = "wgpu" -version = "26.0.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b6ff82bbf6e9206828e1a3178e851f8c20f1c9028e74dd3a8090741ccd5798" +checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433" dependencies = [ "arrayvec", - "bitflags 2.9.2", - "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases 0.1.1", "document-features", - "hashbrown", "js-sys", "log", "naga", - "parking_lot", - "portable-atomic", + "parking_lot 0.12.4", "profiling", - "raw-window-handle 0.6.2", + "raw-window-handle", "smallvec", "static_assertions", "wasm-bindgen", @@ -6752,67 +7672,34 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "26.0.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f62f1053bd28c2268f42916f31588f81f64796e2ff91b81293515017ca8bd9" +checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" dependencies = [ "arrayvec", - "bit-set", "bit-vec", "bitflags 2.9.2", - "cfg_aliases 0.2.1", + "cfg_aliases 0.1.1", "document-features", - "hashbrown", - "indexmap", + "indexmap 2.10.0", "log", "naga", "once_cell", - "parking_lot", - "portable-atomic", + "parking_lot 0.12.4", "profiling", - "raw-window-handle 0.6.2", + "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror 2.0.16", - "wgpu-core-deps-apple", - "wgpu-core-deps-emscripten", - "wgpu-core-deps-windows-linux-android", + "thiserror 1.0.69", "wgpu-hal", "wgpu-types", ] -[[package]] -name = "wgpu-core-deps-apple" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ae5fbde6a4cbebae38358aa73fcd6e0f15c6144b67ef5dc91ded0db125dbdf" -dependencies = [ - "wgpu-hal", -] - -[[package]] -name = "wgpu-core-deps-emscripten" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7670e390f416006f746b4600fdd9136455e3627f5bd763abf9a65daa216dd2d" -dependencies = [ - "wgpu-hal", -] - -[[package]] -name = "wgpu-core-deps-windows-linux-android" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720a5cb9d12b3d337c15ff0e24d3e97ed11490ff3f7506e7f3d98c68fa5d6f14" -dependencies = [ - "wgpu-hal", -] - [[package]] name = "wgpu-hal" -version = "26.0.4" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df2c64ac282a91ad7662c90bc4a77d4a2135bc0b2a2da5a4d4e267afc034b9e" +checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" dependencies = [ "android_system_properties", "arrayvec", @@ -6820,16 +7707,15 @@ dependencies = [ "bit-set", "bitflags 2.9.2", "block", - "bytemuck", - "cfg-if", - "cfg_aliases 0.2.1", - "core-graphics-types 0.2.0", + "cfg_aliases 0.1.1", + "core-graphics-types", + "d3d12", "glow", "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", - "hashbrown", + "hassle-rs", "js-sys", "khronos-egl", "libc", @@ -6837,36 +7723,31 @@ dependencies = [ "log", "metal", "naga", - "ndk-sys 0.6.0+11769913", + "ndk-sys 0.5.0+25.2.9519653", "objc", - "ordered-float", - "parking_lot", - "portable-atomic", - "portable-atomic-util", + "once_cell", + "parking_lot 0.12.4", "profiling", "range-alloc", - "raw-window-handle 0.6.2", + "raw-window-handle", "renderdoc-sys", + "rustc-hash 1.1.0", "smallvec", - "thiserror 2.0.16", + "thiserror 1.0.69", "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.58.0", - "windows-core 0.58.0", + "winapi", ] [[package]] name = "wgpu-types" -version = "26.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca7a8d8af57c18f57d393601a1fb159ace8b2328f1b6b5f80893f7d672c9ae2" +checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" dependencies = [ "bitflags 2.9.2", - "bytemuck", "js-sys", - "log", - "thiserror 2.0.16", "web-sys", ] @@ -6880,6 +7761,12 @@ dependencies = [ "wasite", ] +[[package]] +name = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + [[package]] name = "winapi" version = "0.3.9" @@ -6914,17 +7801,28 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", "clipboard_x11", - "raw-window-handle 0.6.2", + "dnd", + "mime 0.1.0", + "raw-window-handle", "thiserror 1.0.69", ] +[[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" @@ -6932,16 +7830,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ "windows-core 0.54.0", + "windows-implement 0.53.0", + "windows-interface 0.53.0", "windows-targets 0.52.6", ] [[package]] -name = "windows" -version = "0.58.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-core 0.58.0", "windows-targets 0.52.6", ] @@ -6955,19 +7854,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" -dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.61.2" @@ -6978,14 +7864,14 @@ dependencies = [ "windows-interface 0.59.1", "windows-link", "windows-result 0.3.4", - "windows-strings 0.4.2", + "windows-strings", ] [[package]] name = "windows-implement" -version = "0.58.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" dependencies = [ "proc-macro2", "quote", @@ -7005,9 +7891,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.58.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" dependencies = [ "proc-macro2", "quote", @@ -7040,15 +7926,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.3.4" @@ -7058,16 +7935,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-strings" version = "0.4.2" @@ -7367,34 +8234,34 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winit" -version = "0.30.8" -source = "git+https://github.com/iced-rs/winit.git?rev=11414b6aa45699f038114e61b4ddf5102b2d3b4b#11414b6aa45699f038114e61b4ddf5102b2d3b4b" +version = "0.30.5" +source = "git+https://github.com/pop-os/winit.git?tag=iced-xdg-surface-0.13#1cc02bdab141072eaabad639d74b032fd0fcc62e" dependencies = [ "ahash", "android-activity", "atomic-waker", "bitflags 2.9.2", - "block2", + "block2 0.5.1", "bytemuck", "calloop", "cfg_aliases 0.2.1", "concurrent-queue", - "core-foundation 0.9.4", - "core-graphics 0.23.2", + "core-foundation", + "core-graphics", "cursor-icon", "dpi", "js-sys", "libc", - "memmap2", + "memmap2 0.9.7", "ndk 0.9.0", - "objc2", - "objc2-app-kit", - "objc2-foundation", + "objc2 0.5.2", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", "objc2-ui-kit", "orbclient", "percent-encoding", "pin-project", - "raw-window-handle 0.6.2", + "raw-window-handle", "redox_syscall 0.4.1", "rustix 0.38.44", "sctk-adwaita", @@ -7434,16 +8301,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wit-bindgen-rt" version = "0.39.0" @@ -7513,6 +8370,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "xkbcommon" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13867d259930edc7091a6c41b4ce6eee464328c6ff9659b7e4c668ca20d4c91e" +dependencies = [ + "libc", + "memmap2 0.8.0", + "xkeysym", +] + [[package]] name = "xkbcommon-dl" version = "0.4.2" @@ -7531,6 +8399,9 @@ name = "xkeysym" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" +dependencies = [ + "bytemuck", +] [[package]] name = "xml-rs" @@ -7587,15 +8458,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ "async-broadcast 0.5.1", - "async-executor", - "async-fs 1.6.0", - "async-io 1.13.0", - "async-lock 2.8.0", "async-process 1.8.1", "async-recursion", - "async-task", "async-trait", - "blocking", "byteorder", "derivative", "enumflags2", @@ -7607,11 +8472,12 @@ dependencies = [ "nix 0.26.4", "once_cell", "ordered-stream", - "rand", + "rand 0.8.5", "serde", "serde_repr", "sha1", "static_assertions", + "tokio", "tracing", "uds_windows", "winapi", @@ -7645,6 +8511,7 @@ dependencies = [ "ordered-stream", "serde", "serde_repr", + "tokio", "tracing", "uds_windows", "windows-sys 0.59.0", @@ -7827,7 +8694,6 @@ dependencies = [ "libc", "serde", "static_assertions", - "url", "zvariant_derive 3.15.2", ] diff --git a/Cargo.toml b/Cargo.toml index 943bbd3..b9bc246 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ description = "A cli presentation system" [dependencies] clap = { version = "4.5.20", features = ["debug", "derive"] } -# libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["debug", "winit", "desktop", "winit_wgpu", "winit_tokio", "tokio", "rfd", "dbus-config", "a11y", "wgpu", "multi-window"] } lexpr = "0.2.7" miette = { version = "7.2.0", features = ["fancy"] } pretty_assertions = "1.4.1" @@ -33,23 +32,22 @@ gstreamer-app = "0.23" url = "2" colors-transform = "0.2.11" rayon = "1.11.0" -# resvg = "0.45.1" +resvg = "0.45.1" +image = "0.25.8" # femtovg = { version = "0.16.0", features = ["wgpu"] } # wgpu = "26.0.1" # mupdf = "0.5.0" -rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false } -derive_setters = "0.1.8" -freedesktop-icons = "0.4.0" +# rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false } -[dependencies.iced] -git = "https://github.com/iced-rs/iced" -branch = "master" -features = ["wgpu", "image", "advanced", "svg", "canvas", "hot", "debug", "lazy", "tokio"] +[dependencies.libcosmic] +git = "https://github.com/pop-os/libcosmic" +default-features = false +features = ["debug", "winit", "desktop", "winit_wgpu", "winit_tokio", "tokio", "rfd", "dbus-config", "a11y", "wgpu", "multi-window"] [dependencies.iced_video_player] -git = "https://git.tfcconnection.org/chris/iced_video_player" -branch = "master" -# branch = "cosmic" +git = "https://github.com/jackpot51/iced_video_player.git" +branch = "cosmic" +features = ["wgpu"] # [profile.dev] # opt-level = 3 diff --git a/src/core/model.rs b/src/core/model.rs index 8452cc1..a0afcd0 100644 --- a/src/core/model.rs +++ b/src/core/model.rs @@ -1,5 +1,6 @@ use std::mem::replace; +use cosmic::iced::Executor; use miette::{miette, Result}; use sqlx::{Connection, SqliteConnection}; diff --git a/src/core/service_items.rs b/src/core/service_items.rs index 15673d0..76e99cc 100644 --- a/src/core/service_items.rs +++ b/src/core/service_items.rs @@ -1,11 +1,12 @@ use std::borrow::Cow; use std::cmp::Ordering; use std::ops::Deref; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; +use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes}; use crisp::types::{Keyword, Symbol, Value}; -// use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes}; use miette::Result; +use resvg::usvg::fontdb; use tracing::{debug, error}; use crate::Slide; @@ -17,13 +18,13 @@ use super::videos::Video; use super::kinds::ServiceItemKind; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct ServiceItem { pub id: i32, pub title: String, pub database_id: i32, pub kind: ServiceItemKind, - pub slides: Arc<[Slide]>, + pub slides: Vec, // pub item: Box, } @@ -56,29 +57,29 @@ impl TryFrom<(Vec, String)> for ServiceItem { } } -// impl AllowedMimeTypes for ServiceItem { -// fn allowed() -> Cow<'static, [String]> { -// Cow::from(vec!["application/service-item".to_string()]) -// } -// } +impl AllowedMimeTypes for ServiceItem { + fn allowed() -> Cow<'static, [String]> { + Cow::from(vec!["application/service-item".to_string()]) + } +} -// impl AsMimeTypes for ServiceItem { -// fn available(&self) -> Cow<'static, [String]> { -// debug!(?self); -// Cow::from(vec!["application/service-item".to_string()]) -// } +impl AsMimeTypes for ServiceItem { + fn available(&self) -> Cow<'static, [String]> { + debug!(?self); + Cow::from(vec!["application/service-item".to_string()]) + } -// fn as_bytes( -// &self, -// mime_type: &str, -// ) -> Option> { -// debug!(?self); -// debug!(mime_type); -// let val = Value::from(self); -// let val = String::from(val); -// Some(Cow::from(val.into_bytes())) -// } -// } + fn as_bytes( + &self, + mime_type: &str, + ) -> Option> { + debug!(?self); + debug!(mime_type); + let val = Value::from(self); + let val = String::from(val); + Some(Cow::from(val.into_bytes())) + } +} impl From<&ServiceItem> for Value { fn from(value: &ServiceItem) -> Self { @@ -121,7 +122,7 @@ impl Default for ServiceItem { title: String::default(), database_id: 0, kind: ServiceItemKind::Content(Slide::default()), - slides: Arc::new([]), + slides: vec![], // item: Box::new(Image::default()), } } @@ -171,7 +172,7 @@ impl From<&Value> for ServiceItem { kind: ServiceItemKind::Content( slide.clone(), ), - slides: Arc::new([slide]), + slides: vec![slide], } } else if let Some(background) = list.get(background_pos) diff --git a/src/core/slide.rs b/src/core/slide.rs index 6400639..d1ef8b6 100644 --- a/src/core/slide.rs +++ b/src/core/slide.rs @@ -1,11 +1,13 @@ -// use iced::dialog::ashpd::url::Url; +// use cosmic::dialog::ashpd::url::Url; use crisp::types::{Keyword, Symbol, Value}; use iced_video_player::Video; use miette::{miette, Result}; +use resvg::usvg::fontdb; use serde::{Deserialize, Serialize}; use std::{ fmt::Display, path::{Path, PathBuf}, + sync::Arc, }; use tracing::error; @@ -13,6 +15,40 @@ use crate::ui::text_svg::{self, TextSvg}; use super::songs::Song; +#[derive( + Clone, Debug, Default, PartialEq, Serialize, Deserialize, +)] +pub struct Slide { + id: i32, + background: Background, + text: String, + font: String, + font_size: i32, + text_alignment: TextAlignment, + audio: Option, + video_loop: bool, + video_start_time: f32, + video_end_time: f32, + #[serde(skip)] + pub text_svg: Option, +} + +#[derive( + Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize, +)] +pub enum BackgroundKind { + #[default] + Image, + Video, +} + +#[derive(Debug, Clone, Default)] +struct Image { + pub source: String, + pub fit: String, + pub children: Vec, +} + #[derive( Clone, Copy, @@ -203,15 +239,6 @@ impl Display for ParseError { } } -#[derive( - Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize, -)] -pub enum BackgroundKind { - #[default] - Image, - Video, -} - impl From for BackgroundKind { fn from(value: String) -> Self { if value == "image" { @@ -222,24 +249,6 @@ impl From for BackgroundKind { } } -#[derive( - Clone, Debug, Default, PartialEq, Serialize, Deserialize, -)] -pub struct Slide { - id: i32, - background: Background, - text: String, - font: String, - font_size: i32, - text_alignment: TextAlignment, - audio: Option, - video_loop: bool, - video_start_time: f32, - video_end_time: f32, - #[serde(skip)] - pub text_svg: TextSvg, -} - impl From<&Slide> for Value { fn from(value: &Slide) -> Self { Self::List(vec![Self::Symbol(Symbol("slide".into()))]) @@ -252,6 +261,11 @@ impl Slide { self } + pub fn with_text_svg(mut self, text_svg: TextSvg) -> Self { + self.text_svg = Some(text_svg); + self + } + pub fn set_font(mut self, font: impl AsRef) -> Self { self.font = font.as_ref().into(); self @@ -275,6 +289,10 @@ impl Slide { self.text.clone() } + pub fn text_alignment(&self) -> TextAlignment { + self.text_alignment.clone() + } + pub fn font_size(&self) -> i32 { self.font_size } @@ -614,55 +632,22 @@ impl SlideBuilder { let Some(video_end_time) = self.video_end_time else { return Err(miette!("No video_end_time")); }; - if let Some(text_svg) = self.text_svg { - Ok(Slide { - background, - text, - font, - font_size, - text_alignment, - audio: self.audio, - video_loop, - video_start_time, - video_end_time, - text_svg, - ..Default::default() - }) - } else { - let text_svg = TextSvg::new(text.clone()) - .alignment(text_alignment) - .fill("#fff") - .shadow(text_svg::shadow(2, 2, 5, "#000000")) - .stroke(text_svg::stroke(3, "#000")) - .font( - text_svg::Font::from(font.clone()) - .size(font_size.try_into().unwrap()), - ) - .build(); - Ok(Slide { - background, - text, - font, - font_size, - text_alignment, - audio: self.audio, - video_loop, - video_start_time, - video_end_time, - text_svg, - ..Default::default() - }) - } + Ok(Slide { + background, + text, + font, + font_size, + text_alignment, + audio: self.audio, + video_loop, + video_start_time, + video_end_time, + text_svg: self.text_svg, + ..Default::default() + }) } } -#[derive(Debug, Clone, Default)] -struct Image { - pub source: String, - pub fit: String, - pub children: Vec, -} - impl Image { fn new() -> Self { Self { diff --git a/src/core/songs.rs b/src/core/songs.rs index 270bc00..20dbebb 100644 --- a/src/core/songs.rs +++ b/src/core/songs.rs @@ -1,5 +1,6 @@ use std::{collections::HashMap, option::Option, path::PathBuf}; +use cosmic::iced::Executor; use crisp::types::{Keyword, Symbol, Value}; use miette::{miette, IntoDiagnostic, Result}; use serde::{Deserialize, Serialize}; diff --git a/src/core/videos.rs b/src/core/videos.rs index 879c14a..c0c1dfb 100644 --- a/src/core/videos.rs +++ b/src/core/videos.rs @@ -7,6 +7,7 @@ use super::{ service_items::ServiceTrait, slide::Slide, }; +use cosmic::iced::Executor; use crisp::types::{Keyword, Symbol, Value}; use miette::{IntoDiagnostic, Result}; use serde::{Deserialize, Serialize}; diff --git a/src/main.rs b/src/main.rs index 6e85e37..5725086 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,27 +2,36 @@ use clap::{command, Parser}; use core::service_items::ServiceItem; use core::slide::*; use core::songs::Song; -use crisp::types::Value; -use iced::keyboard::{Key, Modifiers}; -use iced::theme::{self, Palette}; -use iced::widget::tooltip::Position as TPosition; -use iced::widget::{ - button, horizontal_space, mouse_area, slider, text, text_input, - tooltip, vertical_space, Space, +use cosmic::app::context_drawer::ContextDrawer; +use cosmic::app::{Core, Settings, Task}; +use cosmic::iced::keyboard::{Key, Modifiers}; +use cosmic::iced::window::{Mode, Position}; +use cosmic::iced::{self, event, window, Length, Padding, Point}; +use cosmic::iced_futures::Subscription; +use cosmic::iced_widget::{column, row}; +use cosmic::widget::dnd_destination::{ + dnd_destination, dnd_destination_for_data, }; -use iced::widget::{column, row}; -use iced::window::{Mode, Position}; -use iced::{self, event, window, Length, Padding, Point}; -use iced::{color, Subscription}; -use iced::{executor, Application, Element}; -use iced::{widget::Container, Theme}; -use iced::{Settings, Task}; +use cosmic::widget::nav_bar::nav_bar_style; +use cosmic::widget::segmented_button::Entity; +use cosmic::widget::text; +use cosmic::widget::tooltip::Position as TPosition; +use cosmic::widget::{ + button, horizontal_space, nav_bar, search_input, tooltip, + vertical_space, Space, +}; +use cosmic::widget::{icon, slider}; +use cosmic::{executor, Application, ApplicationExt, Element}; +use cosmic::{prelude::*, theme}; +use cosmic::{widget::Container, Theme}; +use crisp::types::Value; use lisp::parse_lisp; use miette::{miette, Result}; use rayon::prelude::*; -use std::collections::BTreeMap; +use resvg::usvg::fontdb; use std::fs::read_to_string; use std::path::PathBuf; +use std::sync::Arc; use tracing::{debug, level_filters::LevelFilter}; use tracing::{error, warn}; use tracing_subscriber::EnvFilter; @@ -31,7 +40,7 @@ use ui::presenter::{self, Presenter}; use ui::song_editor::{self, SongEditor}; use ui::EditorMode; -use crate::ui::widgets::icon; +use crate::ui::text_svg; pub mod core; pub mod lisp; @@ -64,34 +73,37 @@ fn main() -> Result<()> { .with_timer(timer) .init(); - // let settings; - // if args.ui { - // debug!("main view"); - // settings = iced::daemon::Settings::default() - // .debug(false) - // .is_daemon(true) - // .transparent(true); - // } else { - // debug!("window view"); - // settings = Settings::default() - // .debug(false) - // .no_main_window(true) - // .is_daemon(true); - // } + let args = Cli::parse(); - iced::daemon(App::init, App::update, App::view) - .settings(Settings::default()) - .subscription(App::subscription) - .theme(App::theme) - .title(App::title) - .run() + let settings; + if args.ui { + debug!("main view"); + settings = Settings::default() + .debug(false) + .is_daemon(true) + .transparent(true); + } else { + debug!("window view"); + settings = Settings::default() + .debug(false) + .no_main_window(true) + .is_daemon(true); + } + + cosmic::app::run::(settings, args) .map_err(|e| miette!("Invalid things... {}", e)) } +fn theme(_state: &App) -> Theme { + Theme::dark() +} + struct App { + core: Core, + nav_model: nav_bar::Model, file: PathBuf, presenter: Presenter, - windows: BTreeMap, + windows: Vec, service: Vec, current_item: (usize, usize), presentation_open: bool, @@ -103,6 +115,7 @@ struct App { song_editor: SongEditor, searching: bool, library_dragged_item: Option, + fontdb: Arc, } #[derive(Debug, Clone)] @@ -111,7 +124,7 @@ enum Message { Library(library::Message), SongEditor(song_editor::Message), File(PathBuf), - DndEnter(Vec), + DndEnter(Entity, Vec), DndDrop, OpenWindow, CloseWindow(Option), @@ -122,91 +135,49 @@ enum Message { Quit, Key(Key, Modifiers), None, - DndLeave(), + DndLeave(Entity), EditorToggle(bool), SearchFocus, ChangeServiceItem(usize), AddServiceItem(usize, ServiceItem), AddServiceItemDrop(usize), - AppendServiceItem(Option), + AppendServiceItem(ServiceItem), + AddService(Vec), } -#[derive(Debug, Clone)] -struct Window { - title: String, - scale_input: String, - current_scale: f64, - theme: Theme, -} +const HEADER_SPACE: u16 = 6; -impl Default for Window { - fn default() -> Self { - Self { - title: Default::default(), - scale_input: Default::default(), - current_scale: Default::default(), - theme: Theme::custom( - "Snazzy", - Palette { - background: color!(0x282a36), - text: color!(0xe2e4e5), - primary: color!(0x57c7ff), - success: color!(0x5af78e), - warning: color!(0xff9f43), - danger: color!(0xff5c57), - }, - ), - } - } -} - -const HEADER_SPACE: f32 = 6.0; - -impl App { +impl cosmic::Application for App { + type Executor = executor::Default; + type Flags = Cli; + type Message = Message; const APP_ID: &'static str = "lumina"; - fn title(&self, id: window::Id) -> String { - self.windows - .get(&id) - .map(|window| window.title.clone()) - .unwrap_or(String::from("Lumina")) + fn core(&self) -> &Core { + &self.core } - - fn init() -> (Self, Task) { + fn core_mut(&mut self) -> &mut Core { + &mut self.core + } + fn init( + core: Core, + input: Self::Flags, + ) -> (Self, Task) { debug!("init"); - let args = Cli::parse(); + let nav_model = nav_bar::Model::default(); - let mut batch = vec![]; - let mut windows = BTreeMap::new(); - if args.ui { - let settings = window::Settings { - ..Default::default() - }; - let (id, open) = window::open(settings); - batch - .push(open.map(|id| Message::WindowOpened(id, None))); - let window = Window { - title: "Lumina".into(), - scale_input: "".into(), - current_scale: 1.0, - theme: Theme::custom( - "Snazzy", - Palette { - background: color!(0x282a36), - text: color!(0xe2e4e5), - primary: color!(0x57c7ff), - success: color!(0x5af78e), - warning: color!(0xff9f43), - danger: color!(0xff5c57), - }, - ), - }; + let mut fontdb = fontdb::Database::new(); + fontdb.load_system_fonts(); + let fontdb = Arc::new(fontdb); - windows.insert(id, window); + let mut windows = vec![]; + + if input.ui { + windows.push(core.main_window_id().unwrap()); } - let items = match read_to_string(args.file) { + let items = match read_to_string(input.file) { Ok(lisp) => { - let mut slide_vector = vec![]; + let mut service_items = vec![]; let lisp = crisp::reader::read(&lisp); match lisp { Value::List(vec) => { @@ -217,12 +188,12 @@ impl App { // slide_vector.append(items); for value in vec { let mut inner_vector = parse_lisp(value); - slide_vector.append(&mut inner_vector); + service_items.append(&mut inner_vector); } } _ => todo!(), } - slide_vector + service_items } Err(e) => { warn!("Missing file or could not read: {e}"); @@ -230,22 +201,41 @@ impl App { } }; + let items: Vec = items + .into_par_iter() + .map(|mut item| { + item.slides = item + .slides + .into_par_iter() + .map(|mut slide| { + text_svg::text_svg_generator( + &mut slide, + Arc::clone(&fontdb), + ); + slide + }) + .collect(); + item + }) + .collect(); + let presenter = Presenter::with_items(items.clone()); - let song_editor = SongEditor::new(); + let song_editor = SongEditor::new(Arc::clone(&fontdb)); // for item in items.iter() { // nav_model.insert().text(item.title()).data(item.clone()); // } // nav_model.activate_position(0); - let mut app = App { presenter, - service: items, + core, + nav_model, + service: items.clone(), file: PathBuf::default(), windows, presentation_open: false, - cli_mode: !args.ui, + cli_mode: !input.ui, library: None, library_open: true, library_width: 60.0, @@ -254,156 +244,212 @@ impl App { searching: false, current_item: (0, 0), library_dragged_item: None, + fontdb: Arc::clone(&fontdb), }; - if args.ui { + let mut batch = vec![]; + + if input.ui { debug!("main view"); - // batch.push(app.update_title()) + batch.push(app.update_title()) } else { debug!("window view"); batch.push(app.show_window()) }; batch.push(app.add_library()); - // batch.push(app.add_service(items)); + // batch.push(app.add_service(items, Arc::clone(&fontdb))); let batch = Task::batch(batch); (app, batch) } - fn nav_bar(&self) -> Option> { - // if !self.core().nav_bar_active() { - // return None; - // } + // /// Allows COSMIC to integrate with your application's [`nav_bar::Model`]. + // fn nav_model(&self) -> Option<&nav_bar::Model> { + // Some(&self.nav_model) + // } - // let nav_model = self.nav_model()?; + // fn nav_bar(&self) -> Option>> { + // if !self.core().nav_bar_active() { + // return None; + // } - // let mut nav = iced::widget::nav_bar(nav_model, |id| { - // iced::Action::Iced(iced::app::Action::NavBar(id)) - // }) - // .on_dnd_drop::(|entity, data, action| { - // debug!(?entity); - // debug!(?data); - // debug!(?action); - // iced::Action::App(Message::DndDrop) - // }) - // .on_dnd_enter(|entity, data| { - // debug!("entered"); - // iced::Action::App(Message::DndEnter(entity, data)) - // }) - // .on_dnd_leave(|entity| { - // debug!("left"); - // iced::Action::App(Message::DndLeave(entity)) - // }) - // .drag_id(DragId::new()) - // .on_context(|id| { - // iced::Action::Iced( - // iced::app::Action::NavBarContext(id), - // ) - // }) - // .context_menu(None) - // .into_container() - // // XXX both must be shrink to avoid flex layout from ignoring it - // .width(Length::Shrink) - // .height(Length::Shrink); + // // let nav_model = self.nav_model()?; - let list = - self.service.iter().enumerate().map(|(index, item)| { - let icon = match item.kind { - core::kinds::ServiceItemKind::Song(_) => { - icon::from_name("folder-music-symbolic") - } - core::kinds::ServiceItemKind::Video(_) => { - icon::from_name("folder-videos-symbolic") - } - core::kinds::ServiceItemKind::Image(_) => { - icon::from_name("folder-pictures-symbolic") - } - core::kinds::ServiceItemKind::Presentation(_) => { - icon::from_name( - "x-office-presentation-symbolic", - ) - } - core::kinds::ServiceItemKind::Content(_) => { - icon::from_name( - "x-office-presentation-symbolic", - ) - } - }; - let button = - button(row![text(item.title.clone()), icon]) - .padding(5) - .width(Length::Fill) - .on_press(Message::ChangeServiceItem(index)); - let tooltip = tooltip( - button, - text(item.kind.to_string()), - TPosition::Right, - ); - mouse_area(tooltip) - .on_release(Message::AddServiceItemDrop(index)) - .into() - }); + // // let mut nav = cosmic::widget::nav_bar(nav_model, |id| { + // // cosmic::Action::Cosmic(cosmic::app::Action::NavBar(id)) + // // }) + // // .on_dnd_drop::(|entity, data, action| { + // // debug!(?entity); + // // debug!(?data); + // // debug!(?action); + // // cosmic::Action::App(Message::DndDrop) + // // }) + // // .on_dnd_enter(|entity, data| { + // // debug!("entered"); + // // cosmic::Action::App(Message::DndEnter(entity, data)) + // // }) + // // .on_dnd_leave(|entity| { + // // debug!("left"); + // // cosmic::Action::App(Message::DndLeave(entity)) + // // }) + // // .drag_id(DragId::new()) + // // .on_context(|id| { + // // cosmic::Action::Cosmic( + // // cosmic::app::Action::NavBarContext(id), + // // ) + // // }) + // // .context_menu(None) + // // .into_container() + // // // XXX both must be shrink to avoid flex layout from ignoring it + // // .width(Length::Shrink) + // // .height(Length::Shrink); - let end_index = self.service.len(); - let column = column![ - text("Service List").center().width(280), - column(list).spacing(10), - mouse_area(vertical_space(),).on_release( - Message::AppendServiceItem( - self.library_dragged_item.clone() - ) - ) - ] - .padding(10) - .spacing(10); - let padding = Padding::new(0.0).top(20); - let mut container = Container::new(column) - // .height(Length::Fill) - // .style(nav_bar_style) - .padding(padding); + // let list = self + // .service + // .iter() + // .enumerate() + // .map(|(index, item)| { + // let button = button::standard(item.title.clone()) + // .leading_icon({ + // match item.kind { + // core::kinds::ServiceItemKind::Song(_) => { + // icon::from_name("folder-music-symbolic") + // }, + // core::kinds::ServiceItemKind::Video(_) => { + // icon::from_name("folder-videos-symbolic") + // }, + // core::kinds::ServiceItemKind::Image(_) => { + // icon::from_name("folder-pictures-symbolic") + // }, + // core::kinds::ServiceItemKind::Presentation(_) => { + // icon::from_name("x-office-presentation-symbolic") + // }, + // core::kinds::ServiceItemKind::Content(_) => { + // icon::from_name("x-office-presentation-symbolic") + // }, + // } + // }) + // .class(cosmic::theme::style::Button::HeaderBar) + // .padding(5) + // .width(Length::Fill) + // .on_press(cosmic::Action::App(Message::ChangeServiceItem(index))); + // let tooltip = tooltip(button, + // text::body(item.kind.to_string()), + // TPosition::Right); + // dnd_destination(tooltip, vec!["application/service-item".into()]) + // .data_received_for::( move |item| { + // if let Some(item) = item { + // cosmic::Action::App(Message::AddServiceItem(index, item)) + // } else { + // cosmic::Action::None + // } + // }).on_drop(move |x, y| { + // debug!(x, y); + // cosmic::Action::App(Message::AddServiceItemDrop(index)) + // }).on_finish(move |mime, data, action, x, y| { + // debug!(mime, ?data, ?action, x, y); + // let Ok(item) = ServiceItem::try_from((data, mime)) else { + // return cosmic::Action::None; + // }; + // debug!(?item); + // cosmic::Action::App(Message::AddServiceItem(index, item)) + // }) + // .into() + // }); - // if !self.core().is_condensed() { - // container = container.max_width(280); - // } - Some(container.into()) - } + // let end_index = self.service.len(); + // let column = column![ + // text::heading("Service List").center().width(280), + // column(list).spacing(10), + // dnd_destination( + // vertical_space(), + // vec!["application/service-item".into()] + // ) + // .data_received_for::(|item| { + // if let Some(item) = item { + // cosmic::Action::App(Message::AppendServiceItem( + // item, + // )) + // } else { + // cosmic::Action::None + // } + // }) + // .on_finish( + // move |mime, data, action, x, y| { + // debug!(mime, ?data, ?action, x, y); + // let Ok(item) = + // ServiceItem::try_from((data, mime)) + // else { + // return cosmic::Action::None; + // }; + // debug!(?item); + // cosmic::Action::App(Message::AddServiceItem( + // end_index, item, + // )) + // } + // ) + // ] + // .padding(10) + // .spacing(10); + // let padding = Padding::new(0.0).top(20); + // let mut container = Container::new(column) + // // .height(Length::Fill) + // .style(nav_bar_style) + // .padding(padding); - fn header_start(&self) -> Vec> { + // if !self.core().is_condensed() { + // container = container.max_width(280); + // } + // Some(container.into()) + // } + + /// Called when a navigation item is selected. + // fn on_nav_select( + // &mut self, + // id: nav_bar::Id, + // ) -> Task { + // self.nav_model.activate(id); + // // debug!(?id); + // self.update_title() + // } + + fn header_start(&self) -> Vec> { vec![] } - fn header_center(&self) -> Vec> { - vec![text_input("Search...", "") + fn header_center(&self) -> Vec> { + vec![search_input("Search...", "") .on_input(|_| Message::None) - .on_submit(Message::None) + .on_submit(|_| Message::None) + .on_focus(Message::SearchFocus) .width(1200) .into()] } - fn header_end(&self) -> Vec> { + fn header_end(&self) -> Vec> { // let editor_toggle = toggler(self.editor_mode.is_some()) // .label("Editor") // .spacing(10) // .width(Length::Shrink) // .on_toggle(Message::EditorToggle); - let presenter_window = self.windows.len() > 1; - let presentation_button_text = if self.presentation_open { - text("End Presentation") + let presenter_window = self.windows.get(1); + let text = if self.presentation_open { + text::body("End Presentation") } else { - text("Present") + text::body("Present") }; let row = row![ tooltip( - button( + button::custom( row!( Container::new( icon::from_name("document-edit-symbolic") .scale(3) ) .center_y(Length::Fill), - text(if self.editor_mode.is_some() { + text::body(if self.editor_mode.is_some() { "Present Mode" } else { "Edit Mode" @@ -411,6 +457,7 @@ impl App { ) .spacing(5), ) + .class(cosmic::theme::style::Button::HeaderBar) .on_press(Message::EditorToggle( self.editor_mode.is_none(), )), @@ -418,7 +465,7 @@ impl App { TPosition::Bottom, ), tooltip( - button( + button::custom( row!( Container::new( icon::from_name( @@ -431,16 +478,16 @@ impl App { .scale(3) ) .center_y(Length::Fill), - presentation_button_text + text ) .spacing(5), ) + .class(cosmic::theme::style::Button::HeaderBar) .on_press({ if self.presentation_open { - // Message::CloseWindow( - // presenter_window.copied(), - // ) - Message::None + Message::CloseWindow( + presenter_window.copied(), + ) } else { Message::OpenWindow } @@ -449,14 +496,14 @@ impl App { TPosition::Bottom, ), tooltip( - button( + button::custom( row!( Container::new( icon::from_name("view-list-symbolic") .scale(3) ) .center_y(Length::Fill), - text(if self.library_open { + text::body(if self.library_open { "Close Library" } else { "Open Library" @@ -464,6 +511,7 @@ impl App { ) .spacing(5), ) + .class(cosmic::theme::style::Button::HeaderBar) .on_press(Message::LibraryToggle), "Open Library", TPosition::Bottom, @@ -474,23 +522,25 @@ impl App { vec![row] } - fn footer(&self) -> Option> { + fn footer(&self) -> Option> { let total_items_text = format!("Total Service Items: {}", self.service.len()); let total_slides_text = format!("Total Slides: {}", self.presenter.total_slides); - let row = - row![text(total_items_text), text(total_slides_text)] - .spacing(10); + let row = row![ + text::body(total_items_text), + text::body(total_slides_text) + ] + .spacing(10); Some( Container::new(row) .align_right(Length::Fill) - .padding([5, 0]) + .padding([5, 0, 0, 0]) .into(), ) } - fn subscription(&self) -> Subscription { + fn subscription(&self) -> Subscription { event::listen_with(|event, _, id| { // debug!(?event); match event { @@ -523,12 +573,32 @@ impl App { } } iced::Event::Touch(_touch) => None, - iced::Event::InputMethod(event) => todo!(), + iced::Event::A11y(_id, _action_request) => None, + iced::Event::Dnd(_dnd_event) => None, + iced::Event::PlatformSpecific(_platform_specific) => { + None + } } }) } - fn dialog(&self) -> Option> { + fn context_drawer( + &self, + ) -> Option< + cosmic::app::context_drawer::ContextDrawer, + > { + ContextDrawer { + title: Some("Context".into()), + header_actions: vec![], + header: Some("hi".into()), + content: "Sup".into(), + footer: Some("foot".into()), + on_close: Message::None, + }; + None + } + + fn dialog(&self) -> Option> { if self.searching { Some(text("hello").into()) } else { @@ -545,7 +615,11 @@ impl App { // debug!(?message); match self.song_editor.update(message) { song_editor::Action::Task(task) => { - task.map(|m| Message::SongEditor(m)) + task.map(|m| { + cosmic::Action::App(Message::SongEditor( + m, + )) + }) } song_editor::Action::UpdateSong(song) => { if let Some(library) = &mut self.library { @@ -567,9 +641,10 @@ impl App { video.set_muted(false); } match self.presenter.update(message) { - presenter::Action::Task(task) => { - task.map(|m| Message::Present(m)) - } + presenter::Action::Task(task) => task.map(|m| { + // debug!("Should run future"); + cosmic::Action::App(Message::Present(m)) + }), presenter::Action::None => Task::none(), presenter::Action::NextSlide => { let slide_index = self.current_item.1; @@ -597,7 +672,9 @@ impl App { match action { presenter::Action::Task(task) => { tasks.push(task.map(|m| { - Message::Present(m) + cosmic::Action::App( + Message::Present(m), + ) })) } _ => todo!(), @@ -616,9 +693,16 @@ impl App { match action { presenter::Action::Task( task, - ) => tasks.push(task.map( - |m| Message::Present(m), - )), + ) => { + tasks + .push(task.map(|m| { + cosmic::Action::App( + Message::Present( + m, + ), + ) + })) + } _ => todo!(), } } @@ -647,7 +731,9 @@ impl App { match action { presenter::Action::Task(task) => { tasks.push(task.map(|m| { - Message::Present(m) + cosmic::Action::App( + Message::Present(m), + ) })) } _ => todo!(), @@ -681,9 +767,16 @@ impl App { match action { presenter::Action::Task( task, - ) => tasks.push(task.map( - |m| Message::Present(m), - )), + ) => { + tasks + .push(task.map(|m| { + cosmic::Action::App( + Message::Present( + m, + ), + ) + })) + } _ => todo!(), } } @@ -704,7 +797,9 @@ impl App { } library::Action::Task(task) => { return task.map(|message| { - Message::Library(message) + cosmic::Action::App(Message::Library( + message, + )) }); } library::Action::None => return Task::none(), @@ -749,7 +844,29 @@ impl App { self.file = file; Task::none() } - Message::OpenWindow => self.show_window(), + Message::OpenWindow => { + let count = self.windows.len() + 1; + + let (id, spawn_window) = + window::open(window::Settings { + position: Position::Centered, + exit_on_close_request: count % 2 == 0, + decorations: false, + ..Default::default() + }); + + self.windows.push(id); + _ = self.set_window_title( + format!("window_{}", count), + id, + ); + + spawn_window.map(|id| { + cosmic::Action::App(Message::WindowOpened( + id, None, + )) + }) + } Message::CloseWindow(id) => { if let Some(id) = id { window::close(id) @@ -759,21 +876,27 @@ impl App { } Message::WindowOpened(id, _) => { debug!(?id, "Window opened"); - let main_id = - self.windows.first_key_value().unwrap().0; - if self.cli_mode || &id > main_id { - self.presentation_open = true; - if let Some(video) = &mut self.presenter.video { - video.set_muted(false); - } - window::set_mode(id, Mode::Fullscreen) - } else { - Task::none() - } + if self.cli_mode + || id > self.core.main_window_id().expect("Cosmic core seems to be missing a main window, was this started in cli mode?") + { + self.presentation_open = true; + if let Some(video) = &mut self.presenter.video { + video.set_muted(false); + } + window::change_mode(id, Mode::Fullscreen) + } else { + Task::none() + } } Message::WindowClosed(id) => { warn!("Closing window: {id}"); - self.windows.remove(&id); + let Some(window) = + self.windows.iter().position(|w| *w == id) + else { + error!("Nothing matches this window id: {id}"); + return Task::none(); + }; + self.windows.remove(window); // This closes the app if using the cli example if self.windows.is_empty() { self.update(Message::Quit) @@ -789,8 +912,9 @@ impl App { self.library_open = !self.library_open; Task::none() } - Message::Quit => iced::exit(), - Message::DndEnter(data) => { + Message::Quit => cosmic::iced::exit(), + Message::DndEnter(entity, data) => { + debug!(?entity); debug!(?data); Task::none() } @@ -810,6 +934,10 @@ impl App { // } let item = library.get_song(item).unwrap(); let item = ServiceItem::from(item); + self.nav_model + .insert() + .text(item.title.clone()) + .data(item); } Task::none() } @@ -817,8 +945,12 @@ impl App { self.library = Some(library); Task::none() } + Message::AddService(service) => { + self.service = service; + Task::none() + } Message::None => Task::none(), - Message::DndLeave() => { + Message::DndLeave(entity) => { // debug!(?entity); Task::none() } @@ -862,24 +994,14 @@ impl App { Task::none() } Message::AppendServiceItem(item) => { - if let Some(item) = item { - self.service.push(item); - } + self.service.push(item); Task::none() } } } // Main window view - fn view(&self, window: window::Id) -> Element { - if window == *self.windows.first_key_value().unwrap().0 { - self.main_view() - } else { - self.view_presenter() - } - } - - fn main_view(&self) -> Element { + fn view(&self) -> Element { let icon_left = icon::from_name("arrow-left"); let icon_right = icon::from_name("arrow-right"); @@ -888,30 +1010,25 @@ impl App { |video| video.duration().as_secs_f32(), ); - let video_button_icon = if let Some(video) = - &self.presenter.video - { - let (icon_name, tt) = if video.paused() { - ("media-play", "Play") + let video_button_icon = + if let Some(video) = &self.presenter.video { + let (icon_name, tooltip) = if video.paused() { + ("media-play", "Play") + } else { + ("media-pause", "Pause") + }; + button::icon(icon::from_name(icon_name)) + .tooltip(tooltip) + .on_press(Message::Present( + presenter::Message::StartVideo, + )) } else { - ("media-pause", "Pause") + button::icon(icon::from_name("media-play")) + .tooltip("Play") + .on_press(Message::Present( + presenter::Message::StartVideo, + )) }; - tooltip( - button(icon::from_name(icon_name)).on_press( - Message::Present(presenter::Message::StartVideo), - ), - tt, - TPosition::FollowCursor, - ) - } else { - tooltip( - button(icon::from_name("media-play")).on_press( - Message::Present(presenter::Message::StartVideo), - ), - "Play", - TPosition::FollowCursor, - ) - }; let slide_preview = column![ Space::with_height(Length::Fill), @@ -936,7 +1053,7 @@ impl App { .step(0.1) ) .center_x(Length::Fill) - .padding([7, 0]) + .padding([7, 0, 0, 0]) ] .padding(5) } else { @@ -947,14 +1064,23 @@ impl App { ] .spacing(3); + let service_list = Container::new(self.service_list()) + .padding(5) + .width(Length::FillPortion(2)); + let library = if self.library_open { - Container::new(if let Some(library) = &self.library { - library.view().map(Message::Library) - } else { - Space::new(0, 0).into() - }) - // .style(nav_bar_style) - .center(Length::FillPortion(2)) + Container::new( + Container::new( + if let Some(library) = &self.library { + library.view().map(Message::Library) + } else { + Space::new(0, 0).into() + }, + ) + .style(nav_bar_style), + ) + .padding(5) + .width(Length::FillPortion(2)) } else { Container::new(horizontal_space().width(0)) }; @@ -963,28 +1089,35 @@ impl App { self.song_editor.view().map(Message::SongEditor); let row = row![ - Container::new(tooltip( - button(icon_left.size(128)).width(128).on_press( - Message::Present(presenter::Message::PrevSlide) - ), - "Previous Slide", - TPosition::FollowCursor - )) + library, + service_list, + Container::new( + button::icon(icon_left) + .icon_size(128) + .tooltip("Previous Slide") + .width(128) + .on_press(Message::Present( + presenter::Message::PrevSlide + )) + .class(theme::style::Button::Transparent) + ) .center_y(Length::Fill) .align_right(Length::FillPortion(1)), Container::new(slide_preview) .center_y(Length::Fill) .width(Length::FillPortion(3)), - Container::new(tooltip( - button(icon_right.size(128)).width(128).on_press( - Message::Present(presenter::Message::NextSlide) - ), - "Next Slide", - TPosition::FollowCursor - )) + Container::new( + button::icon(icon_right) + .icon_size(128) + .tooltip("Next Slide") + .width(128) + .on_press(Message::Present( + presenter::Message::NextSlide + )) + .class(theme::style::Button::Transparent) + ) .center_y(Length::Fill) .align_left(Length::FillPortion(1)), - library ] .width(Length::Fill) .height(Length::Fill) @@ -1008,63 +1141,81 @@ impl App { } // View for presentation - fn view_presenter(&self) -> Element { + fn view_window(&self, _id: window::Id) -> Element { self.presenter.view().map(Message::Present) } +} - // fn update_title(&mut self) -> Task { - // let window_title = "Lumina"; - // self.windows.first_key_value().unwrap().1.title = - // window_title.to_string(); - // Task::none() - // } +impl App +where + Self: cosmic::Application, +{ + fn active_page_title(&self) -> &str { + let Some(label) = + self.nav_model.text(self.nav_model.active()) + else { + return "Lumina"; + }; + label + } + + fn update_title(&mut self) -> Task { + let header_title = self.active_page_title().to_owned(); + let window_title = format!("{header_title} — Lumina"); + self.core.main_window_id().map_or_else(Task::none, |id| { + self.set_window_title(window_title, id) + }) + } fn show_window(&mut self) -> Task { let (id, spawn_window) = window::open(window::Settings { position: Position::Centered, exit_on_close_request: true, decorations: false, - fullscreen: true, ..Default::default() }); - let window = Window { - title: "Presentation".into(), - scale_input: "".into(), - current_scale: 1.0, - theme: self.theme(id), - }; - self.windows.insert(id, window); - spawn_window.map(|id| Message::WindowOpened(id, None)) + self.windows.push(id); + _ = self.set_window_title("Lumina Presenter".to_owned(), id); + spawn_window.map(|id| { + cosmic::Action::App(Message::WindowOpened(id, None)) + }) } fn add_library(&mut self) -> Task { Task::perform(async move { Library::new().await }, |x| { - Message::AddLibrary(x) + cosmic::Action::App(Message::AddLibrary(x)) }) } - // fn add_service( - // &mut self, - // items: Vec, - // ) -> Task { - // Task::perform( - // async move { - // for item in items { - // debug!(?item, "Item to be appended"); - // let slides = item.to_slides().unwrap_or(vec![]); - // map.insert(item, slides); - // } - // let len = map.len(); - // debug!(len, "to be append: "); - // map - // }, - // |x| { - // let len = x.len(); - // debug!(len, "to append: "); - // iced::Action::App(Message::AppendService(x)) - // }, - // ) - // } + fn add_service( + &mut self, + items: Vec, + fontdb: Arc, + ) -> Task { + Task::perform( + async move { + let items: Vec = items + .into_par_iter() + .map(|mut item| { + item.slides = item + .slides + .into_par_iter() + .map(|mut slide| { + text_svg::text_svg_generator( + &mut slide, + Arc::clone(&fontdb), + ); + slide + }) + .collect(); + item + }) + .collect(); + items + }, + |x| cosmic::Action::App(Message::AddService(x)), + ) + } fn process_key_press( &mut self, @@ -1111,18 +1262,97 @@ impl App { } } - fn theme(&self, _window: window::Id) -> Theme { - Theme::custom( - "Snazzy", - Palette { - background: color!(0x282a36), - text: color!(0xe2e4e5), - primary: color!(0x57c7ff), - success: color!(0x5af78e), - warning: color!(0xff9f43), - danger: color!(0xff5c57), - }, - ) + fn service_list(&self) -> Element { + let list = self + .service + .iter() + .enumerate() + .map(|(index, item)| { + let button = button::standard(item.title.clone()) + .leading_icon({ + match item.kind { + core::kinds::ServiceItemKind::Song(_) => { + icon::from_name("folder-music-symbolic") + }, + core::kinds::ServiceItemKind::Video(_) => { + icon::from_name("folder-videos-symbolic") + }, + core::kinds::ServiceItemKind::Image(_) => { + icon::from_name("folder-pictures-symbolic") + }, + core::kinds::ServiceItemKind::Presentation(_) => { + icon::from_name("x-office-presentation-symbolic") + }, + core::kinds::ServiceItemKind::Content(_) => { + icon::from_name("x-office-presentation-symbolic") + }, + } + }) + .class(cosmic::theme::style::Button::HeaderBar) + .padding(5) + .width(Length::Fill) + .on_press(Message::ChangeServiceItem(index)); + let tooltip = tooltip(button, + text::body(item.kind.to_string()), + TPosition::Right); + dnd_destination(tooltip, vec!["application/service-item".into()]) + .data_received_for::( move |item| { + if let Some(item) = item { + Message::AddServiceItem(index, item) + } else { + Message::None + } + }).on_drop(move |x, y| { + debug!(x, y); + Message::AddServiceItemDrop(index) + }).on_finish(move |mime, data, action, x, y| { + debug!(mime, ?data, ?action, x, y); + let Ok(item) = ServiceItem::try_from((data, mime)) else { + return Message::None; + }; + debug!(?item); + Message::AddServiceItem(index, item) + }) + .into() + }); + + let end_index = self.service.len(); + let column = column![ + text::heading("Service List") + .center() + .width(Length::Fill), + iced::widget::horizontal_rule(1), + column(list).spacing(10), + dnd_destination( + vertical_space(), + vec!["application/service-item".into()] + ) + .data_received_for::(|item| { + item.map_or_else( + || Message::None, + |item| Message::AppendServiceItem(item), + ) + }) + .on_finish( + move |mime, data, action, x, y| { + debug!(mime, ?data, ?action, x, y); + let Ok(item) = + ServiceItem::try_from((data, mime)) + else { + return Message::None; + }; + debug!(?item); + Message::AddServiceItem(end_index, item) + } + ) + ] + .padding(10) + .spacing(10); + let mut container = Container::new(column) + // .height(Length::Fill) + .style(nav_bar_style); + + container.center(Length::FillPortion(2)).into() } } diff --git a/src/ui/double_ended_slider.rs b/src/ui/double_ended_slider.rs index 5431fc5..c388fbd 100644 --- a/src/ui/double_ended_slider.rs +++ b/src/ui/double_ended_slider.rs @@ -1,6 +1,6 @@ use std::ops::RangeInclusive; -use iced::Length; +use cosmic::iced::Length; struct DoubleSlider<'a, T, Message> { range: RangeInclusive, diff --git a/src/ui/library.rs b/src/ui/library.rs index 12e092b..5c67fa5 100644 --- a/src/ui/library.rs +++ b/src/ui/library.rs @@ -1,30 +1,30 @@ -use iced::{ - advanced::widget::{tree::State, Widget}, - alignment::Vertical, - futures::FutureExt, +use cosmic::{ + iced::{ + alignment::Vertical, clipboard::dnd::DndAction, + futures::FutureExt, Background, Border, Color, Length, + }, + iced_core::widget::tree::State, + iced_widget::{column, row as rowm, text as textm}, theme, widget::{ - button, column, container, horizontal_space, mouse_area, + button, container, horizontal_space, icon, mouse_area, responsive, row, scrollable, text, text_input, Container, - Space, + DndSource, Space, Widget, }, - Background, Border, Color, Element, Length, Task, + Element, Task, }; use miette::{IntoDiagnostic, Result}; use sqlx::{pool::PoolConnection, Sqlite, SqlitePool}; use tracing::{debug, error, warn}; -use crate::{ - core::{ - content::Content, - images::{update_image_in_db, Image}, - model::{LibraryKind, Model}, - presentations::{update_presentation_in_db, Presentation}, - service_items::ServiceItem, - songs::{update_song_in_db, Song}, - videos::{update_video_in_db, Video}, - }, - ui::widgets::icon, +use crate::core::{ + content::Content, + images::{update_image_in_db, Image}, + model::{LibraryKind, Model}, + presentations::{update_presentation_in_db, Presentation}, + service_items::ServiceItem, + songs::{update_song_in_db, Song}, + videos::{update_video_in_db, Video}, }; #[derive(Debug, Clone)] @@ -264,12 +264,18 @@ impl<'a> Library { let presentation_library = self.library_item(&self.presentation_library); let column = column![ + text::heading("Library").center().width(Length::Fill), + cosmic::iced::widget::horizontal_rule(1), song_library, image_library, video_library, presentation_library, - ]; - column.height(Length::Fill).spacing(5).into() + ] + .height(Length::Fill) + .padding(10) + .spacing(10) + .into(); + column } pub fn library_item( @@ -279,40 +285,40 @@ impl<'a> Library { where T: Content, { - let mut row = row![].spacing(5); + let mut row = row::().spacing(5); match &model.kind { LibraryKind::Song => { row = row .push(icon::from_name("folder-music-symbolic")); - row = - row.push(text("Songs").align_y(Vertical::Center)); + row = row + .push(textm!("Songs").align_y(Vertical::Center)); } LibraryKind::Video => { row = row .push(icon::from_name("folder-videos-symbolic")); row = row - .push(text("Videos").align_y(Vertical::Center)); + .push(textm!("Videos").align_y(Vertical::Center)); } LibraryKind::Image => { row = row.push(icon::from_name( "folder-pictures-symbolic", )); row = row - .push(text("Images").align_y(Vertical::Center)); + .push(textm!("Images").align_y(Vertical::Center)); } LibraryKind::Presentation => { row = row.push(icon::from_name( "x-office-presentation-symbolic", )); row = row.push( - text("Presentations").align_y(Vertical::Center), + textm!("Presentations").align_y(Vertical::Center), ); } }; let item_count = model.items.len(); row = row.push(horizontal_space()); row = row - .push(text!("{}", item_count).align_y(Vertical::Center)); + .push(textm!("{}", item_count).align_y(Vertical::Center)); row = row.push( icon::from_name({ if self.library_open == Some(model.kind) { @@ -332,26 +338,19 @@ impl<'a> Library { match self.library_hovered { Some(lib) => Background::Color( if lib == model.kind { - t.extended_palette() - .primary - .strong - .color + t.cosmic().button.hover.into() } else { - t.extended_palette() - .background - .base - .color + t.cosmic().button.base.into() }, ), None => Background::Color( - t.extended_palette() - .background - .base - .color, + t.cosmic().button.base.into(), ), } }) - .border(Border::default().rounded(5)) + .border(Border::default().rounded( + t.cosmic().corner_radii.radius_s, + )) }) .center_x(Length::Fill) .center_y(Length::Shrink); @@ -374,34 +373,65 @@ impl<'a> Library { let visual_item = self .single_item(index, item, model) .map(|_| Message::None); - mouse_area(visual_item) - // .on_drag(Message::DragItem( - // service_item.clone(), - // )) - .on_enter(Message::HoverItem(Some(( - model.kind, - index as i32, - )))) - .on_double_click(Message::OpenItem( - Some((model.kind, index as i32)), - )) - .on_exit(Message::HoverItem(None)) - .on_press(Message::SelectItem(Some( - (model.kind, index as i32), - ))) - .into() + DndSource::::new( + mouse_area(visual_item) + .on_drag(Message::DragItem(service_item.clone())) + .on_enter(Message::HoverItem( + Some(( + model.kind, + index as i32, + )), + )) + .on_double_click( + Message::OpenItem(Some(( + model.kind, + index as i32, + ))), + ) + .on_exit(Message::HoverItem(None)) + .on_press(Message::SelectItem( + Some(( + model.kind, + index as i32, + )), + )), + ) + .action(DndAction::Copy) + .drag_icon({ + let model = model.kind; + move |i| { + let state = State::None; + let icon = match model { + LibraryKind::Song => icon::from_name( + "folder-music-symbolic", + ).symbolic(true) + , + LibraryKind::Video => icon::from_name("folder-videos-symbolic"), + LibraryKind::Image => icon::from_name("folder-pictures-symbolic"), + LibraryKind::Presentation => icon::from_name("x-office-presentation-symbolic"), + }; + ( + icon.into(), + state, + i, + ) + }}) + .drag_content(move || { + service_item.to_owned() + }) + .into() }, ) }) - .spacing(2) - .width(Length::Fill), + .spacing(2) + .width(Length::Fill), ) - .spacing(5) - .height(Length::Fill); + .spacing(5) + .height(Length::Fill); - let library_toolbar = row!( + let library_toolbar = rowm!( text_input("Search...", ""), - button(icon::from_name("add")) + button::icon(icon::from_name("add")) ); let library_column = column![library_toolbar, items].spacing(3); @@ -422,36 +452,67 @@ impl<'a> Library { where T: Content, { - let item_text = Container::new(responsive(|size| { - text(elide_text(item.title(), size.width)) + let text = Container::new(responsive(|size| { + text::heading(elide_text(item.title(), size.width)) .center() - .wrapping(text::Wrapping::None) + .wrapping(textm::Wrapping::None) .into() })) .center_y(20) .center_x(Length::Fill); - let subtext = container(responsive(|size| { - if item.background().is_some() { - text(elide_text(item.subtext(), size.width)) - .style(text::primary) - .center() - .wrapping(text::Wrapping::None) - .into() + let subtext = container(responsive(move |size| { + let color: Color = if item.background().is_some() { + if let Some((library, selected)) = self.selected_item + { + if model.kind == library + && selected == index as i32 + { + theme::active().cosmic().control_0().into() + } else { + theme::active() + .cosmic() + .accent_text_color() + .into() + } + } else { + theme::active() + .cosmic() + .accent_text_color() + .into() + } } else { - text(elide_text(item.subtext(), size.width)) - .style(text::primary) - .center() - .wrapping(text::Wrapping::None) - .into() - } + if let Some((library, selected)) = self.selected_item + { + if model.kind == library + && selected == index as i32 + { + theme::active().cosmic().control_0().into() + } else { + theme::active() + .cosmic() + .destructive_text_color() + .into() + } + } else { + theme::active() + .cosmic() + .destructive_text_color() + .into() + } + }; + text::body(elide_text(item.subtext(), size.width)) + .center() + .wrapping(textm::Wrapping::None) + .class(color) + .into() })) .center_y(20) .center_x(Length::Fill); - let texts = column([item_text.into(), subtext.into()]); + let texts = column([text.into(), subtext.into()]); Container::new( - row![horizontal_space().width(0), texts] + rowm![horizontal_space().width(0), texts] .spacing(10) .align_y(Vertical::Center), ) @@ -466,9 +527,21 @@ impl<'a> Library { if model.kind == library && selected == index as i32 { - t.extended_palette().primary.strong.color + t.cosmic().accent.selected.into() } else { - t.extended_palette().primary.base.color + if let Some((library, hovered)) = + self.hovered_item + { + if model.kind == library + && hovered == index as i32 + { + t.cosmic().button.hover.into() + } else { + t.cosmic().button.base.into() + } + } else { + t.cosmic().button.base.into() + } } } else if let Some((library, hovered)) = self.hovered_item @@ -476,16 +549,20 @@ impl<'a> Library { if model.kind == library && hovered == index as i32 { - t.extended_palette().primary.strong.color + t.cosmic().button.hover.into() } else { - t.extended_palette().primary.base.color + t.cosmic().button.base.into() } } else { - t.extended_palette().background.strong.color + t.cosmic().button.base.into() }, )) - .border(Border::default().rounded(10)) + .border( + Border::default() + .rounded(t.cosmic().corner_radii.radius_m), + ) }) + .padding([3, 0]) .into() } diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index 03d81ce..86d7bc7 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -1,29 +1,36 @@ use miette::{IntoDiagnostic, Result}; use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc}; -use iced::{ - alignment::Horizontal, - border, - font::{Family, Stretch, Style, Weight}, - widget::{ - container, image, mouse_area, responsive, rich_text, - scrollable::{ - self, scroll_to, AbsoluteOffset, Direction, Id, Scrollbar, - }, - span, stack, text, vertical_rule, Column, Container, Row, - Space, +use cosmic::{ + iced::{ + alignment::Horizontal, + border, + font::{Family, Stretch, Style, Weight}, + Background, Border, Color, ContentFit, Font, Length, Shadow, + Vector, }, - Background, Border, Color, ContentFit, Element, Font, Length, - Shadow, Task, Vector, + iced_widget::{ + rich_text, + scrollable::{ + scroll_to, AbsoluteOffset, Direction, Scrollbar, + }, + span, stack, vertical_rule, + }, + prelude::*, + widget::{ + container, image, mouse_area, responsive, scrollable, text, + Column, Container, Id, Image, Row, Space, + }, + Task, }; -use iced_video_player::{Position, Video, VideoPlayer}; +use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer}; use rodio::{Decoder, OutputStream, Sink}; use tracing::{debug, error, info, warn}; use url::Url; use crate::{ core::{service_items::ServiceItem, slide::Slide}, - // ui::widgets::slide_text, + ui::text_svg, BackgroundKind, }; @@ -125,7 +132,9 @@ impl Presenter { Some(v) } Err(e) => { - error!("Had an error creating the video object: {e}, likely the first slide isn't a video"); + error!( + "Had an error creating the video object: {e}, likely the first slide isn't a video" + ); None } } @@ -141,6 +150,7 @@ impl Presenter { }; let total_slides: usize = items.iter().fold(0, |a, item| a + item.slides.len()); + Self { current_slide: items[0].slides[0].clone(), current_item: 0, @@ -161,7 +171,7 @@ impl Presenter { ) }, scroll_id: Id::unique(), - current_font: iced::font::Font::DEFAULT, + current_font: cosmic::font::default(), } } @@ -337,27 +347,27 @@ impl Presenter { return Action::Task(Task::perform( async move { tokio::task::spawn_blocking(move || { - // match gst_pbutils::MissingPluginMessage::parse(&element) { - // Ok(missing_plugin) => { - // let mut install_ctx = gst_pbutils::InstallPluginsContext::new(); - // install_ctx - // .set_desktop_id(&format!("{}.desktop", "org.chriscochrun.lumina")); - // let install_detail = missing_plugin.installer_detail(); - // println!("installing plugins: {}", install_detail); - // let status = gst_pbutils::missing_plugins::install_plugins_sync( - // &[&install_detail], - // Some(&install_ctx), - // ); - // info!("plugin install status: {}", status); - // info!( - // "gstreamer registry update: {:?}", - // gstreamer::Registry::update() - // ); - // } - // Err(err) => { - // warn!("failed to parse missing plugin message: {err}"); - // } - // } + match gst_pbutils::MissingPluginMessage::parse(&element) { + Ok(missing_plugin) => { + let mut install_ctx = gst_pbutils::InstallPluginsContext::new(); + install_ctx + .set_desktop_id(&format!("{}.desktop", "org.chriscochrun.lumina")); + let install_detail = missing_plugin.installer_detail(); + println!("installing plugins: {}", install_detail); + let status = gst_pbutils::missing_plugins::install_plugins_sync( + &[&install_detail], + Some(&install_ctx), + ); + info!("plugin install status: {}", status); + info!( + "gstreamer registry update: {:?}", + gstreamer::Registry::update() + ); + } + Err(err) => { + warn!("failed to parse missing plugin message: {err}"); + } + } Message::None }) .await @@ -370,7 +380,7 @@ impl Presenter { self.hovered_slide = slide; } Message::StartAudio => { - return Action::Task(self.start_audio()) + return Action::Task(self.start_audio()); } Message::EndAudio => { self.sink.1.stop(); @@ -442,7 +452,7 @@ impl Presenter { .style(move |t| { let mut style = container::Style::default(); - let theme = t; + let theme = t.cosmic(); let hovered = self.hovered_slide == Some(( item_index, @@ -452,25 +462,19 @@ impl Presenter { Some(Background::Color( if is_current_slide { theme - .extended_palette( - ) - .secondary - .strong - .color + .accent + .base + .into() } else if hovered { theme - .extended_palette( - ) - .secondary - .strong - .color + .accent + .hover + .into() } else { theme - .extended_palette( - ) - .background - .neutral - .color + .palette + .neutral_3 + .into() }, )); style.border = Border::default() @@ -503,7 +507,7 @@ impl Presenter { .padding(10), ) .interaction( - iced::mouse::Interaction::Pointer, + cosmic::iced::mouse::Interaction::Pointer, ) .on_move(move |_| { Message::HoveredSlide(Some(( @@ -521,11 +525,11 @@ impl Presenter { let row = Row::from_vec(slides) .spacing(10) .padding([20, 15]); - let label = text(item.title.clone()); + let label = text::body(item.title.clone()); let label_container = container(label) .align_top(Length::Fill) .align_left(Length::Fill) - .padding([0, 35]); + .padding([0, 0, 0, 35]); let divider = vertical_rule(2); items.push( container(stack!(row, label_container)) @@ -535,16 +539,15 @@ impl Presenter { items.push(divider.into()); }, ); - let row = scrollable::Scrollable::new( - container(Row::from_vec(items)).style(|t| { + let row = + scrollable(container(Row::from_vec(items)).style(|t| { let style = container::Style::default(); style.border(Border::default().width(2)) - }), - ) - .direction(Direction::Horizontal(Scrollbar::new())) - .height(Length::Fill) - .width(Length::Fill) - .id(self.scroll_id.clone()); + })) + .direction(Direction::Horizontal(Scrollbar::new())) + .height(Length::Fill) + .width(Length::Fill) + .id(self.scroll_id.clone()); row.into() } @@ -578,7 +581,7 @@ impl Presenter { // Container::new(container) // .style(move |t| { // let mut style = container::Style::default(); - // let theme = t.iced(); + // let theme = t.cosmic(); // let hovered = self.hovered_slide == slide_id; // style.background = Some(Background::Color( // if is_current_slide { @@ -617,7 +620,7 @@ impl Presenter { // .height(100) // .padding(10), // ) - // .interaction(iced::iced::mouse::Interaction::Pointer) + // .interaction(cosmic::iced::mouse::Interaction::Pointer) // .on_move(move |_| Message::HoveredSlide(slide_id)) // .on_exit(Message::HoveredSlide(-1)) // .on_press(Message::SlideChange(slide.clone())); @@ -640,7 +643,9 @@ impl Presenter { self.video = Some(v) } Err(e) => { - error!("Had an error creating the video object: {e}"); + error!( + "Had an error creating the video object: {e}" + ); self.video = None; } } @@ -702,92 +707,100 @@ pub(crate) fn slide_view( let slide_text = slide.text(); // let font = SvgFont::from(font).size(font_size.floor() as u8); - let text_container = if delegate { - // text widget based - let font_size = - scale_font(slide.font_size() as f32, width); - let lines = slide_text.lines(); - let text: Vec> = lines - .map(|t| { - rich_text::< - '_, - &str, - Message, - iced::Theme, - iced::Renderer, - >([span(format!("{}\n", t)) - .background( - Background::Color(Color::BLACK) - .scale_alpha(0.4), - ) - .border(border::rounded(10)) - .padding(10)]) - .size(font_size) - .font(font) - .center() - .into() - // let chars: Vec = t - // .chars() - // .map(|c| -> Span { - // let character: String = format!("{}/n", c); - // span(character) - // .size(font_size) - // .font(font) - // .background( - // Background::Color(Color::BLACK) - // .scale_alpha(0.4), - // ) - // .border(border::rounded(10)) - // .padding(10) - }) - .collect(); - let text = Column::with_children(text).spacing(26); - Container::new(text) - .center(Length::Fill) - .align_x(Horizontal::Left) - } else { - // SVG based - let text = slide.text_svg.view().map(|m| Message::None); - Container::new(text) - .center(Length::Fill) - .align_x(Horizontal::Left) - // text widget based - // let font_size = - // scale_font(slide.font_size() as f32, width); - // let lines = slide_text.lines(); - // let text: Vec> = lines - // .map(|t| { - // rich_text([span(format!("{}\n", t)) - // .background( - // Background::Color(Color::BLACK) - // .scale_alpha(0.4), - // ) - // .border(border::rounded(10)) - // .padding(10)]) - // .size(font_size) - // .font(font) - // .center() - // .into() - // // let chars: Vec = t - // // .chars() - // // .map(|c| -> Span { - // // let character: String = format!("{}/n", c); - // // span(character) - // // .size(font_size) - // // .font(font) - // // .background( - // // Background::Color(Color::BLACK) - // // .scale_alpha(0.4), - // // ) - // // .border(border::rounded(10)) - // // .padding(10) - // }) - // .collect(); - // let text = Column::with_children(text).spacing(26); - // Container::new(text) - // .center(Length::Fill) - // .align_x(Horizontal::Left) - }; + // let text_container = if delegate { + // // text widget based + // let font_size = + // scale_font(slide.font_size() as f32, width); + // let lines = slide_text.lines(); + // let text: Vec> = lines + // .map(|t| { + // rich_text([span(format!("{}\n", t)) + // .background( + // Background::Color(Color::BLACK) + // .scale_alpha(0.4), + // ) + // .border(border::rounded(10)) + // .padding(10)]) + // .size(font_size) + // .font(font) + // .center() + // .into() + // // let chars: Vec = t + // // .chars() + // // .map(|c| -> Span { + // // let character: String = format!("{}/n", c); + // // span(character) + // // .size(font_size) + // // .font(font) + // // .background( + // // Background::Color(Color::BLACK) + // // .scale_alpha(0.4), + // // ) + // // .border(border::rounded(10)) + // // .padding(10) + // }) + // .collect(); + // let text = Column::with_children(text).spacing(26); + // Container::new(text) + // .center(Length::Fill) + // .align_x(Horizontal::Left) + // } else { + // // SVG based + // let text: Element = + // if let Some(text) = &slide.text_svg { + // if let Some(handle) = &text.handle { + // debug!("we made it boys"); + // Image::new(handle) + // .content_fit(ContentFit::Cover) + // .width(Length::Fill) + // .height(Length::Fill) + // .into() + // } else { + // Space::with_width(0).into() + // } + // } else { + // Space::with_width(0).into() + // }; + // Container::new(text) + // .center(Length::Fill) + // .align_x(Horizontal::Left) + // // text widget based + // // let font_size = + // // scale_font(slide.font_size() as f32, width); + // // let lines = slide_text.lines(); + // // let text: Vec> = lines + // // .map(|t| { + // // rich_text([span(format!("{}\n", t)) + // // .background( + // // Background::Color(Color::BLACK) + // // .scale_alpha(0.4), + // // ) + // // .border(border::rounded(10)) + // // .padding(10)]) + // // .size(font_size) + // // .font(font) + // // .center() + // // .into() + // // // let chars: Vec = t + // // // .chars() + // // // .map(|c| -> Span { + // // // let character: String = format!("{}/n", c); + // // // span(character) + // // // .size(font_size) + // // // .font(font) + // // // .background( + // // // Background::Color(Color::BLACK) + // // // .scale_alpha(0.4), + // // // ) + // // // .border(border::rounded(10)) + // // // .padding(10) + // // }) + // // .collect(); + // // let text = Column::with_children(text).spacing(26); + // // Container::new(text) + // // .center(Length::Fill) + // // .align_x(Horizontal::Left) + // }; // let stroke_text_container = Container::new(stroke_text) // .center(Length::Fill) @@ -795,6 +808,21 @@ pub(crate) fn slide_view( // let text_stack = // stack!(stroke_text_container, text_container); + + let text: Element = + if let Some(text) = &slide.text_svg { + if let Some(handle) = &text.handle { + image(handle) + .content_fit(ContentFit::Cover) + .width(width) + .height(size.height) + .into() + } else { + Space::with_width(0).into() + } + } else { + Space::with_width(0).into() + }; let black = Container::new(Space::new(0, 0)) .style(|_| { container::background(Background::Color(Color::BLACK)) @@ -802,7 +830,7 @@ pub(crate) fn slide_view( .clip(true) .width(width) .height(size.height); - let container = match slide.background().kind { + let background = match slide.background().kind { BackgroundKind::Image => { let path = slide.background().path.clone(); Container::new( @@ -829,15 +857,15 @@ pub(crate) fn slide_view( } else if let Some(video) = &video { Container::new( VideoPlayer::new(video) - // .mouse_hidden(hide_mouse) + .mouse_hidden(hide_mouse) .width(width) .height(size.height) .on_end_of_stream(Message::EndVideo) .on_new_frame(Message::VideoFrame) - // .on_missing_plugin(Message::MissingPlugin) - // .on_warning(|w| { - // Message::Error(w.to_string()) - // }) + .on_missing_plugin(Message::MissingPlugin) + .on_warning(|w| { + Message::Error(w.to_string()) + }) .on_error(|e| { Message::Error(e.to_string()) }) @@ -851,11 +879,8 @@ pub(crate) fn slide_view( } } }; - let stack = stack!( - black, - container.center(Length::Fill), - text_container - ); + let stack = + stack!(black, background.center(Length::Fill), text); Container::new(stack).center(Length::Fill).into() }); // let vid = if let Some(video) = &video { diff --git a/src/ui/slide_editor.rs b/src/ui/slide_editor.rs index 94fc282..018e936 100644 --- a/src/ui/slide_editor.rs +++ b/src/ui/slide_editor.rs @@ -1,12 +1,14 @@ use std::{io, path::PathBuf}; -use iced::{ +use cosmic::{ + iced::{Color, Font, Length, Size}, + prelude::*, widget::{ self, canvas::{self, Program, Stroke}, container, Canvas, }, - Color, Font, Length, Renderer, Size, + Renderer, }; use tracing::debug; @@ -49,14 +51,14 @@ pub enum SlideError { #[derive(Debug, Default)] struct EditorProgram { - mouse_button_pressed: Option, + mouse_button_pressed: Option, } impl SlideEditor { pub fn view<'a>( &'a self, font: Font, - ) -> iced::Element<'a, SlideWidget> { + ) -> cosmic::Element<'a, SlideWidget> { container( widget::canvas(&self.program) .height(Length::Fill) @@ -66,9 +68,9 @@ impl SlideEditor { } } -/// Ensure to use the `iced::Theme and iced::Renderer` here +/// Ensure to use the `cosmic::Theme and cosmic::Renderer` here /// or else it will not compile -impl<'a> Program +impl<'a> Program for EditorProgram { type State = (); @@ -77,9 +79,9 @@ impl<'a> Program &self, state: &Self::State, renderer: &Renderer, - theme: &iced::Theme, - bounds: iced::Rectangle, - cursor: iced::mouse::Cursor, + theme: &cosmic::Theme, + bounds: cosmic::iced::Rectangle, + cursor: cosmic::iced_core::mouse::Cursor, ) -> Vec> { // We prepare a new `Frame` let mut frame = canvas::Frame::new(renderer, bounds.size()); @@ -88,7 +90,7 @@ impl<'a> Program // We create a `Path` representing a simple circle let circle = canvas::Path::circle(frame.center(), 50.0); let border = canvas::Path::rectangle( - iced::Point { x: 10.0, y: 10.0 }, + cosmic::iced::Point { x: 10.0, y: 10.0 }, Size::new(frame_rect.width, frame_rect.height), ); @@ -114,19 +116,21 @@ impl<'a> Program fn update( &self, _state: &mut Self::State, - event: &iced::Event, - bounds: iced::Rectangle, - _cursor: iced::mouse::Cursor, - ) -> std::option::Option> { + event: canvas::Event, + bounds: cosmic::iced::Rectangle, + _cursor: cosmic::iced_core::mouse::Cursor, + ) -> (canvas::event::Status, Option) { match event { - iced::Event::Mouse(event) => match event { - iced::mouse::Event::CursorEntered => { + canvas::Event::Mouse(event) => match event { + cosmic::iced::mouse::Event::CursorEntered => { debug!("cursor entered") } - iced::mouse::Event::CursorLeft => { + cosmic::iced::mouse::Event::CursorLeft => { debug!("cursor left") } - iced::mouse::Event::CursorMoved { position } => { + cosmic::iced::mouse::Event::CursorMoved { + position, + } => { if bounds.x < position.x && bounds.y < position.y && (bounds.width + bounds.x) > position.x @@ -135,34 +139,29 @@ impl<'a> Program debug!(?position, "cursor moved"); } } - iced::mouse::Event::ButtonPressed(button) => { + cosmic::iced::mouse::Event::ButtonPressed(button) => { // self.mouse_button_pressed = Some(button); debug!(?button, "mouse button pressed") } - iced::mouse::Event::ButtonReleased(button) => { - debug!(?button, "mouse button released") - } - iced::mouse::Event::WheelScrolled { delta } => { - debug!(?delta, "scroll wheel") - } + cosmic::iced::mouse::Event::ButtonReleased( + button, + ) => debug!(?button, "mouse button released"), + cosmic::iced::mouse::Event::WheelScrolled { + delta, + } => debug!(?delta, "scroll wheel"), }, - iced::Event::Touch(event) => debug!("test"), - iced::Event::Keyboard(event) => debug!("test"), - iced::Event::Keyboard(event) => todo!(), - iced::Event::Mouse(event) => todo!(), - iced::Event::Window(event) => todo!(), - iced::Event::Touch(event) => todo!(), - iced::Event::InputMethod(event) => todo!(), + canvas::Event::Touch(event) => debug!("test"), + canvas::Event::Keyboard(event) => debug!("test"), } - None + (canvas::event::Status::Ignored, None) } fn mouse_interaction( &self, _state: &Self::State, - _bounds: iced::Rectangle, - _cursor: iced::mouse::Cursor, - ) -> iced::mouse::Interaction { - iced::mouse::Interaction::default() + _bounds: cosmic::iced::Rectangle, + _cursor: cosmic::iced_core::mouse::Cursor, + ) -> cosmic::iced_core::mouse::Interaction { + cosmic::iced_core::mouse::Interaction::default() } } diff --git a/src/ui/song_editor.rs b/src/ui/song_editor.rs index 5ed479f..943379c 100644 --- a/src/ui/song_editor.rs +++ b/src/ui/song_editor.rs @@ -1,25 +1,27 @@ -use std::{io, path::PathBuf}; +use std::{io, path::PathBuf, sync::Arc}; -use dirs::font_dir; -use iced::{ - advanced::graphics::text::cosmic_text::fontdb, - font::{Family, Stretch, Style, Weight}, - widget::{ - button, column, combo_box, container, horizontal_space, row, - scrollable, text, text_editor, text_input, tooltip, - TextInput, +use cosmic::{ + dialog::file_chooser::open::Dialog, + iced::{ + font::{Family, Stretch, Style, Weight}, + Font, Length, }, - Element, Font, Length, Task, + iced_wgpu::graphics::text::cosmic_text::fontdb, + iced_widget::row, + theme, + widget::{ + button, column, combo_box, container, horizontal_space, icon, + scrollable, text, text_editor, text_input, + }, + Element, Task, }; +use dirs::font_dir; use iced_video_player::Video; use tracing::{debug, error}; use crate::{ core::{service_items::ServiceTrait, songs::Song}, - ui::{ - slide_editor::{self, SlideEditor}, - widgets::icon, - }, + ui::slide_editor::{self, SlideEditor}, Background, BackgroundKind, }; @@ -29,7 +31,7 @@ use super::presenter::slide_view; pub struct SongEditor { pub song: Option, title: String, - font_db: fontdb::Database, + font_db: Arc, fonts: Vec<(fontdb::ID, String)>, fonts_combo: combo_box::State, font_sizes: combo_box::State, @@ -70,11 +72,9 @@ pub enum Message { } impl SongEditor { - pub fn new() -> Self { + pub fn new(font_db: Arc) -> Self { let fonts = font_dir(); debug!(?fonts); - let mut font_db = fontdb::Database::new(); - font_db.load_system_fonts(); let mut fonts: Vec<(fontdb::ID, String)> = font_db .faces() .map(|f| { @@ -131,7 +131,7 @@ impl SongEditor { audio: PathBuf::new(), background: None, video: None, - current_font: iced::font::Font::DEFAULT, + current_font: cosmic::font::default(), ccli: "8".to_owned(), slide_state: SlideEditor::default(), } @@ -271,93 +271,100 @@ impl SongEditor { let slide_preview = container(self.slide_preview()) .width(Length::FillPortion(2)); - let column = column![ + let column = column::with_children(vec![ self.toolbar(), row![ container(self.left_column()) .center_x(Length::FillPortion(2)), container(slide_preview) .center_x(Length::FillPortion(3)) - ], - ] - .spacing(15); + ] + .into(), + ]) + .spacing(theme::active().cosmic().space_l()); column.into() } fn slide_preview(&self) -> Element { - if let Some(song) = &self.song { - if let Ok(slides) = song.to_slides() { - let slides = slides - .iter() - .enumerate() - .map(|(index, slide)| { - container( - slide_view( - slide.clone(), - if index == 0 { - &self.video - } else { - &None - }, - self.current_font, - false, - false, - ) - .map(|_| Message::None), - ) - .height(250) - .center_x(Length::Fill) - .padding([0, 20]) - .clip(true) - .into() - }) - .collect(); - scrollable(column(slides).spacing(20)) - .height(Length::Fill) - .width(Length::Fill) - .into() - } else { - horizontal_space().into() - } - } else { - horizontal_space().into() - } - // self.slide_state - // .view(Font::with_name("Quicksand Bold")) - // .map(|_s| Message::None) - // .into() + // if let Some(song) = &self.song { + // if let Ok(slides) = song.to_slides() { + // let slides = slides + // .iter() + // .enumerate() + // .map(|(index, slide)| { + // container( + // slide_view( + // slide.clone(), + // if index == 0 { + // &self.video + // } else { + // &None + // }, + // self.current_font, + // false, + // false, + // ) + // .map(|_| Message::None), + // ) + // .height(250) + // .center_x(Length::Fill) + // .padding([0, 20]) + // .clip(true) + // .into() + // }) + // .collect(); + // scrollable( + // column::with_children(slides) + // .spacing(theme::active().cosmic().space_l()), + // ) + // .height(Length::Fill) + // .width(Length::Fill) + // .into() + // } else { + // horizontal_space().into() + // } + // } else { + // horizontal_space().into() + // } + self.slide_state + .view(Font::with_name("Quicksand Bold")) + .map(|_s| Message::None) + .into() } fn left_column(&self) -> Element { - let title_input = text_input("song", self.title.as_ref()) - .on_input(|_| Message::ChangeTitle); + let title_input = text_input("song", &self.title) + .on_input(Message::ChangeTitle) + .label("Song Title"); let author_input = text_input("author", &self.author) - .on_input(|_| Message::ChangeAuthor); + .on_input(Message::ChangeAuthor) + .label("Song Author"); let verse_input = text_input( "Verse order", &self.verse_order, ) + .label("Verse Order") .on_input(Message::ChangeVerseOrder); let lyric_title = text("Lyrics"); - let lyric_input = column![ + let lyric_input = column::with_children(vec![ lyric_title.into(), text_editor(&self.lyrics) .on_action(Message::ChangeLyrics) .height(Length::Fill) .into(), - ] + ]) .spacing(5); - column![ + column::with_children(vec![ title_input.into(), author_input.into(), verse_input.into(), lyric_input.into(), - ] + ]) .spacing(25) .width(Length::FillPortion(2)) .into() @@ -392,20 +399,16 @@ order", ) }, ) - .width(200); + .width(theme::active().cosmic().space_xxl()); - let background_selector = button(row!( + let background_selector = button::icon( icon::from_name("folder-pictures-symbolic").scale(2), - "Background" - )) + ) + .label("Background") + .tooltip("Select an image or video background") .on_press(Message::PickBackground) .padding(10); - let background_selector = tooltip( - background_selector, - "Select an image or video background", - tooltip::Position::FollowCursor, - ); row![ font_selector, font_size, @@ -442,24 +445,25 @@ order", impl Default for SongEditor { fn default() -> Self { - Self::new() + let mut fontdb = fontdb::Database::new(); + fontdb.load_system_fonts(); + Self::new(Arc::new(fontdb)) } } async fn pick_background() -> Result { - // let dialog = - // AsyncFileDialog::new().set_title("Choose a background..."); - // dialog + let dialog = Dialog::new().title("Choose a background..."); + dialog + .open_file() + .await + .map_err(|_| SongError::DialogClosed) + .map(|file| file.url().to_file_path().unwrap()) + // rfd::AsyncFileDialog::new() + // .set_title("Choose a background...") // .pick_file() // .await - // .map_err(|_| SongError::DialogClosed) - // .map(|file| file.url().to_file_path().unwrap()) - rfd::AsyncFileDialog::new() - .set_title("Choose a background...") - .pick_file() - .await - .ok_or(SongError::DialogClosed) - .map(|file| file.path().to_owned()) + // .ok_or(SongError::DialogClosed) + // .map(|file| file.path().to_owned()) } #[derive(Debug, Clone)] diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs index d420123..3ac16ad 100644 --- a/src/ui/text_svg.rs +++ b/src/ui/text_svg.rs @@ -1,19 +1,29 @@ use std::{ fmt::Display, hash::{Hash, Hasher}, + io::Read, + path::PathBuf, + sync::Arc, }; use colors_transform::Rgb; -use iced::{ - font::{Style, Weight}, - widget::{container, svg::Handle, Svg}, - Element, Length, Size, +use cosmic::{ + iced::{ + font::{Style, Weight}, + ContentFit, Length, Size, + }, + prelude::*, + widget::{container, image::Handle, Image}, }; -use tracing::error; +use resvg::{ + tiny_skia::{self, Pixmap}, + usvg::{fontdb, Tree}, +}; +use tracing::{debug, error}; use crate::TextAlignment; -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default)] pub struct TextSvg { text: String, font: Font, @@ -21,7 +31,20 @@ pub struct TextSvg { stroke: Option, fill: Color, alignment: TextAlignment, - handle: Option, + pub handle: Option, + fontdb: Arc, +} + +impl PartialEq for TextSvg { + fn eq(&self, other: &Self) -> bool { + self.text == other.text + && self.font == other.font + && self.shadow == other.shadow + && self.stroke == other.stroke + && self.fill == other.fill + && self.alignment == other.alignment + && self.handle == other.handle + } } impl Hash for TextSvg { @@ -43,11 +66,34 @@ pub struct Font { size: u8, } -impl From for Font { - fn from(value: iced::font::Font) -> Self { +#[derive(Clone, Debug, Default, PartialEq, Hash)] +pub struct Shadow { + pub offset_x: i16, + pub offset_y: i16, + pub spread: u16, + pub color: Color, +} + +#[derive(Clone, Debug, Default, PartialEq, Hash)] +pub struct Stroke { + size: u16, + color: Color, +} + +pub enum Message { + None, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Color(Rgb); + +impl From for Font { + fn from(value: cosmic::font::Font) -> Self { Self { name: match value.family { - iced::font::Family::Name(name) => name.to_string(), + cosmic::iced::font::Family::Name(name) => { + name.to_string() + } _ => "Quicksand Bold".into(), }, size: 20, @@ -108,9 +154,6 @@ impl Font { } } -#[derive(Clone, Debug, PartialEq)] -pub struct Color(Rgb); - impl Hash for Color { fn hash(&self, state: &mut H) { self.0.to_css_hex_string().hash(state); @@ -153,24 +196,6 @@ impl Display for Color { } } -#[derive(Clone, Debug, Default, PartialEq, Hash)] -pub struct Shadow { - pub offset_x: i16, - pub offset_y: i16, - pub spread: u16, - pub color: Color, -} - -#[derive(Clone, Debug, Default, PartialEq, Hash)] -pub struct Stroke { - size: u16, - color: Color, -} - -pub enum Message { - None, -} - impl TextSvg { pub fn new(text: impl Into) -> Self { Self { @@ -206,12 +231,33 @@ impl TextSvg { self } + pub fn fontdb(mut self, fontdb: Arc) -> Self { + self.fontdb = fontdb; + self + } + pub fn alignment(mut self, alignment: TextAlignment) -> Self { self.alignment = alignment; self } pub fn build(mut self) -> Self { + debug!("starting..."); + + let mut path = dirs::data_local_dir().unwrap(); + path.push(PathBuf::from("lumina")); + path.push(PathBuf::from("temp")); + let file_title = + &self.text.lines().next().unwrap().trim_end(); + path.push(PathBuf::from(file_title)); + path.set_extension("png"); + + if path.exists() { + debug!("cached"); + let handle = Handle::from_path(path); + self.handle = Some(handle); + return self; + } let shadow = if let Some(shadow) = &self.shadow { format!("", shadow.offset_x, @@ -229,13 +275,13 @@ impl TextSvg { } else { "".into() }; - let size = Size::new(640.0, 360.0); + let size = Size::new(1920.0, 1080.0); + let font_size = self.font.size as f32; let total_lines = self.text.lines().count(); let half_lines = (total_lines / 2) as f32; let middle_position = size.height / 2.0; let line_spacing = 10.0; - let text_and_line_spacing = - self.font.size as f32 + line_spacing; + let text_and_line_spacing = font_size + line_spacing; let starting_y_position = middle_position - (half_lines * text_and_line_spacing); @@ -259,28 +305,38 @@ impl TextSvg { size.height, shadow, self.font.name, - self.font.size, + font_size, self.fill, stroke, text); - let handle = Handle::from_memory( - Box::leak( - ::clone(&final_svg) - .into_boxed_str(), - ) - .as_bytes(), - ); + debug!("text string built..."); + let resvg_tree = Tree::from_data( + &final_svg.as_bytes(), + &resvg::usvg::Options { + fontdb: Arc::clone(&self.fontdb), + ..Default::default() + }, + ) + .expect("Woops mama"); + debug!("parsed"); + let transform = tiny_skia::Transform::default(); + let mut pixmap = + Pixmap::new(size.width as u32, size.height as u32) + .expect("opops"); + resvg::render(&resvg_tree, transform, &mut pixmap.as_mut()); + let _ = pixmap.save_png(&path); + + debug!("rendered"); + let handle = Handle::from_path(path); self.handle = Some(handle); + debug!("stored"); self } pub fn view<'a>(&self) -> Element<'a, Message> { - container( - Svg::new(self.handle.clone().unwrap()) - .width(Length::Fill) - .height(Length::Fill), - ) - .width(Length::Fill) - .height(Length::Fill) - .into() + Image::new(self.handle.clone().unwrap()) + .content_fit(ContentFit::Cover) + .width(Length::Fill) + .height(Length::Fill) + .into() } fn text_spans(&self) -> Vec { @@ -317,6 +373,26 @@ pub fn color(color: impl AsRef) -> Color { Color::from_hex_str(color) } +pub fn text_svg_generator( + slide: &mut crate::core::slide::Slide, + fontdb: Arc, +) { + if slide.text().len() > 0 { + let text_svg = TextSvg::new(slide.text()) + .alignment(slide.text_alignment()) + .fill("#fff") + .shadow(shadow(2, 2, 5, "#000000")) + .stroke(stroke(3, "#000")) + .font( + Font::from(slide.font().clone()) + .size(slide.font_size().try_into().unwrap()), + ) + .fontdb(Arc::clone(&fontdb)) + .build(); + slide.text_svg = Some(text_svg); + } +} + #[cfg(test)] mod test { use pretty_assertions::assert_eq; diff --git a/src/ui/widgets/icon/handle.rs b/src/ui/widgets/icon/handle.rs deleted file mode 100644 index efceb0a..0000000 --- a/src/ui/widgets/icon/handle.rs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2023 System76 -// SPDX-License-Identifier: MPL-2.0 - -use super::{Icon, Named}; -use iced::widget::{image, svg}; -use std::borrow::Cow; -use std::ffi::OsStr; -use std::hash::Hash; -use std::path::PathBuf; - -#[must_use] -#[derive(Clone, Debug, derive_setters::Setters)] -pub struct Handle { - pub symbolic: bool, - #[setters(skip)] - pub data: Data, -} - -impl Handle { - #[inline] - pub fn icon(self) -> Icon { - super::icon(self) - } -} - -#[must_use] -#[derive(Clone, Debug)] -pub enum Data { - Name(Named), - Image(image::Handle), - Svg(svg::Handle), -} - -/// Create an icon handle from its path. -pub fn from_path(path: PathBuf) -> Handle { - Handle { - symbolic: path - .file_stem() - .and_then(OsStr::to_str) - .is_some_and(|name| name.ends_with("-symbolic")), - data: if path - .extension() - .is_some_and(|ext| ext == OsStr::new("svg")) - { - Data::Svg(svg::Handle::from_path(path)) - } else { - Data::Image(image::Handle::from_path(path)) - }, - } -} - -/// Create an image handle from memory. -pub fn from_raster_bytes( - bytes: impl Into> - + std::convert::AsRef<[u8]> - + std::marker::Send - + std::marker::Sync - + 'static, -) -> Handle { - fn inner(bytes: Cow<'static, [u8]>) -> Handle { - Handle { - symbolic: false, - data: match bytes { - Cow::Owned(b) => { - Data::Image(image::Handle::from_bytes(b)) - } - Cow::Borrowed(b) => { - Data::Image(image::Handle::from_bytes(b)) - } - }, - } - } - - inner(bytes.into()) -} - -/// Create an image handle from RGBA data, where you must define the width and height. -pub fn from_raster_pixels( - width: u32, - height: u32, - pixels: impl Into> - + std::convert::AsRef<[u8]> - + std::marker::Send - + std::marker::Sync, -) -> Handle { - fn inner( - width: u32, - height: u32, - pixels: Cow<'static, [u8]>, - ) -> Handle { - Handle { - symbolic: false, - data: match pixels { - Cow::Owned(pixels) => Data::Image( - image::Handle::from_rgba(width, height, pixels), - ), - Cow::Borrowed(pixels) => Data::Image( - image::Handle::from_rgba(width, height, pixels), - ), - }, - } - } - - inner(width, height, pixels.into()) -} - -/// Create a SVG handle from memory. -pub fn from_svg_bytes( - bytes: impl Into>, -) -> Handle { - Handle { - symbolic: false, - data: Data::Svg(svg::Handle::from_memory(bytes)), - } -} diff --git a/src/ui/widgets/icon/mod.rs b/src/ui/widgets/icon/mod.rs deleted file mode 100644 index ac6fba3..0000000 --- a/src/ui/widgets/icon/mod.rs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2022 System76 -// SPDX-License-Identifier: MPL-2.0 - -//! Lazily-generated SVG icon widget for Iced. - -mod named; -use std::ffi::OsStr; -use std::sync::Arc; - -pub use named::{IconFallback, Named}; - -mod handle; -pub use handle::{ - from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes, - Data, Handle, -}; - -use derive_setters::Setters; -use iced::advanced::{image, svg}; -use iced::widget::{Image, Svg}; -use iced::Element; -use iced::Rotation; -use iced::{ContentFit, Length, Rectangle}; - -/// Create an [`Icon`] from a pre-existing [`Handle`] -pub fn icon(handle: Handle) -> Icon { - Icon { - content_fit: ContentFit::Fill, - handle, - height: None, - size: 16, - rotation: None, - width: None, - } -} - -/// Create an icon handle from its XDG icon name. -pub fn from_name(name: impl Into>) -> Named { - Named::new(name) -} - -/// An image which may be an SVG or PNG. -#[must_use] -#[derive(Clone, Setters)] -pub struct Icon { - #[setters(skip)] - handle: Handle, - pub(super) size: u16, - content_fit: ContentFit, - #[setters(strip_option)] - width: Option, - #[setters(strip_option)] - height: Option, - #[setters(strip_option)] - rotation: Option, -} - -impl Icon { - #[must_use] - pub fn into_svg_handle( - self, - ) -> Option { - match self.handle.data { - Data::Name(named) => { - if let Some(path) = named.path() { - if path - .extension() - .is_some_and(|ext| ext == OsStr::new("svg")) - { - return Some( - iced::advanced::svg::Handle::from_path( - path, - ), - ); - } - } - } - - Data::Image(_) => (), - Data::Svg(handle) => return Some(handle), - } - - None - } - - #[must_use] - fn view<'a, Message: 'a>(self) -> Element<'a, Message> { - let from_image = |handle| { - Image::new(handle) - .width(self.width.unwrap_or_else(|| { - Length::Fixed(f32::from(self.size)) - })) - .height(self.height.unwrap_or_else(|| { - Length::Fixed(f32::from(self.size)) - })) - .rotation(self.rotation.unwrap_or_default()) - .content_fit(self.content_fit) - .into() - }; - - let from_svg = |handle| { - Svg::::new(handle) - .width(self.width.unwrap_or_else(|| { - Length::Fixed(f32::from(self.size)) - })) - .height(self.height.unwrap_or_else(|| { - Length::Fixed(f32::from(self.size)) - })) - .rotation(self.rotation.unwrap_or_default()) - .content_fit(self.content_fit) - .into() - }; - - match self.handle.data { - Data::Name(named) => { - if let Some(path) = named.path() { - if path - .extension() - .is_some_and(|ext| ext == OsStr::new("svg")) - { - from_svg(svg::Handle::from_path(path)) - } else { - from_image(image::Handle::from_path(path)) - } - } else { - let bytes: &'static [u8] = &[]; - from_svg(svg::Handle::from_memory(bytes)) - } - } - - Data::Image(handle) => from_image(handle), - Data::Svg(handle) => from_svg(handle), - } - } -} - -impl<'a, Message: 'a> From for Element<'a, Message> { - fn from(icon: Icon) -> Self { - icon.view::() - } -} - -/// Draw an icon in the given bounds via the runtime's renderer. -pub fn draw( - renderer: &mut iced::Renderer, - handle: &Handle, - icon_bounds: Rectangle, -) { - enum IcedHandle { - Svg(svg::Handle), - Image(image::Handle), - } - - let iced_handle = match handle.clone().data { - Data::Name(named) => named.path().map(|path| { - if path - .extension() - .is_some_and(|ext| ext == OsStr::new("svg")) - { - IcedHandle::Svg(svg::Handle::from_path(path)) - } else { - IcedHandle::Image(image::Handle::from_path(path)) - } - }), - - Data::Image(handle) => Some(IcedHandle::Image(handle)), - Data::Svg(handle) => Some(IcedHandle::Svg(handle)), - }; - - match iced_handle { - Some(IcedHandle::Svg(handle)) => svg::Renderer::draw_svg( - renderer, - svg::Svg::new(handle), - icon_bounds, - ), - - Some(IcedHandle::Image(handle)) => { - image::Renderer::draw_image( - renderer, - (&handle).into(), - icon_bounds, - ); - } - - None => {} - } -} diff --git a/src/ui/widgets/icon/named.rs b/src/ui/widgets/icon/named.rs deleted file mode 100644 index 54ee390..0000000 --- a/src/ui/widgets/icon/named.rs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2023 System76 -// SPDX-License-Identifier: MPL-2.0 - -use super::{Handle, Icon}; -use std::{borrow::Cow, path::PathBuf, sync::Arc}; - -#[derive(Debug, Clone, Default, Hash)] -/// Fallback icon to use if the icon was not found. -pub enum IconFallback { - #[default] - /// Default fallback using the icon name. - Default, - /// Fallback to specific icon names. - Names(Vec>), -} - -#[must_use] -#[derive(derive_setters::Setters, Clone, Debug, Hash)] -pub struct Named { - /// Name of icon to locate in an XDG icon path. - pub(super) name: Arc, - - /// Checks for a fallback if the icon was not found. - pub fallback: Option, - - /// Restrict the lookup to a given scale. - #[setters(strip_option)] - pub scale: Option, - - /// Restrict the lookup to a given size. - #[setters(strip_option)] - pub size: Option, - - /// Whether the icon is symbolic or not. - pub symbolic: bool, - - /// Prioritizes SVG over PNG - pub prefer_svg: bool, -} - -impl Named { - pub fn new(name: impl Into>) -> Self { - let name = name.into(); - Self { - symbolic: name.ends_with("-symbolic"), - name, - fallback: Some(IconFallback::Default), - size: None, - scale: None, - prefer_svg: false, - } - } - - #[cfg(not(windows))] - #[must_use] - pub fn path(self) -> Option { - let name = &*self.name; - let fallback = &self.fallback; - let locate = |theme: &str, name| { - let mut lookup = freedesktop_icons::lookup(name) - .with_theme(theme.as_ref()) - .with_cache(); - - if let Some(scale) = self.scale { - lookup = lookup.with_scale(scale); - } - - if let Some(size) = self.size { - lookup = lookup.with_size(size); - } - - if self.prefer_svg { - lookup = lookup.force_svg(); - } - lookup.find() - }; - - let theme = "Papirus-Dark"; - let themes = if theme.as_ref() == "Cosmic" { - vec![theme.as_ref()] - } else { - vec![theme.as_ref(), "Cosmic"] - }; - - let mut result = themes.iter().find_map(|t| locate(t, name)); - - // On failure, attempt to locate fallback icon. - if result.is_none() { - if matches!(fallback, Some(IconFallback::Default)) { - for new_name in name - .rmatch_indices('-') - .map(|(pos, _)| &name[..pos]) - { - result = themes - .iter() - .find_map(|t| locate(t, new_name)); - if result.is_some() { - break; - } - } - } else if let Some(IconFallback::Names(fallbacks)) = - fallback - { - for fallback in fallbacks { - result = themes - .iter() - .find_map(|t| locate(t, fallback)); - if result.is_some() { - break; - } - } - } - } - - result - } - - #[cfg(windows)] - #[must_use] - pub fn path(self) -> Option { - //TODO: implement icon lookup for Windows - None - } - - #[inline] - pub fn handle(self) -> Handle { - Handle { - symbolic: self.symbolic, - data: super::Data::Name(self), - } - } - - #[inline] - pub fn icon(self) -> Icon { - let size = self.size; - - let icon = super::icon(self.handle()); - - match size { - Some(size) => icon.size(size), - None => icon, - } - } -} - -impl From for Handle { - #[inline] - fn from(builder: Named) -> Self { - builder.handle() - } -} - -impl From for Icon { - #[inline] - fn from(builder: Named) -> Self { - builder.icon() - } -} - -impl From for crate::Element<'_, Message> { - #[inline] - fn from(builder: Named) -> Self { - builder.icon().into() - } -} diff --git a/src/ui/widgets/mod.rs b/src/ui/widgets/mod.rs index f88ea38..d786591 100644 --- a/src/ui/widgets/mod.rs +++ b/src/ui/widgets/mod.rs @@ -1,2 +1 @@ // pub mod slide_text; -pub mod icon; diff --git a/src/ui/widgets/slide_text.rs b/src/ui/widgets/slide_text.rs index 64a202d..d393b44 100644 --- a/src/ui/widgets/slide_text.rs +++ b/src/ui/widgets/slide_text.rs @@ -1,11 +1,11 @@ +use cosmic::iced::advanced::layout::{self, Layout}; +use cosmic::iced::advanced::renderer; +use cosmic::iced::advanced::widget::{self, Widget}; +use cosmic::iced::border; +use cosmic::iced::mouse; +use cosmic::iced::{Color, Element, Length, Rectangle, Size}; use femtovg::renderer::WGPURenderer; use femtovg::{Canvas, TextContext}; -use iced::iced::advanced::layout::{self, Layout}; -use iced::iced::advanced::renderer; -use iced::iced::advanced::widget::{self, Widget}; -use iced::iced::border; -use iced::iced::mouse; -use iced::iced::{Color, Element, Length, Rectangle, Size}; pub struct SlideText { text: String, @@ -23,7 +23,7 @@ impl SlideText { }); let surface = instance.create_surface(window.clone()).unwrap(); - let adapter = iced::iced::wgpu::util::initialize_adapter_from_env_or_default(&instance, Some(&surface)) + let adapter = cosmic::iced::wgpu::util::initialize_adapter_from_env_or_default(&instance, Some(&surface)) .await .expect("Failed to find an appropriate adapter"); let (device, queue) = adapter diff --git a/test_presentation.lisp b/test_presentation.lisp index 553f254..37919e7 100644 --- a/test_presentation.lisp +++ b/test_presentation.lisp @@ -1,10 +1,10 @@ (slide :background (image :source "~/pics/frodo.jpg" :fit fill) - (text "This is frodo" :font-size 90)) + (text "This is frodo" :font-size 140)) (slide (video :source "~/vids/test/camprules2024.mp4" :fit contain)) (slide (video :source "~/vids/never give up.mkv" :fit contain)) (slide (video :source "~/vids/The promise of Rust.mkv" :fit contain)) (song :id 7 :author "North Point Worship" - :font "Quicksand Bold" :font-size 60 + :font "Quicksand" :font-size 140 :shadow "" :stroke "" :title "Death Was Arrested" :background (image :source "file:///home/chris/nc/tfc/openlp/CMG - Bright Mountains 01.jpg" :fit cover) diff --git a/test_song.lisp b/test_song.lisp index ccee693..a0705c8 100644 --- a/test_song.lisp +++ b/test_song.lisp @@ -1,5 +1,5 @@ (song :id 7 :author "North Point Worship" - :font "Quicksand Bold" :font-size 60 + :font "Quicksand" :font-size 140 :title "Death Was Arrested" :background (image :source "~/nc/tfc/openlp/CMG - Bright Mountains 01.jpg" :fit cover) :text-alignment center diff --git a/todo.org b/todo.org index 005086d..2c7c574 100644 --- a/todo.org +++ b/todo.org @@ -17,6 +17,11 @@ Actually, what if we just made the svg at load/creation time and stored it in th ** SVG performs badly Since SVG's apparently run poorly in iced, instead I'll need to see about either creating a new text element, or teaching Iced to render strokes and shadows on text. +** Fork Cryoglyph +This fork will render text 3 times. Once for the text, once for the stroke, once for the shadow. This will only be used in the slides and therefore should not be much of a performance hit since we will only be render 3 copies of the given text. This should not be bad performance since it's not a large amount of text. + +This also means in our custom widget with our custom fork, we can animate each individually perhaps. + * TODO [#C] Make the presenter more modular so things are easier to change. * TODO Build library to see all available songs, images, videos, presentations, and slides