diff --git a/.dir-locals.el b/.dir-locals.el index f9937e3..a95f219 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,4 +1,4 @@ ;;; Directory Local Variables -*- no-byte-compile: t -*- ;;; For more information see (info "(emacs) Directory Variables") -((nil . ((dape-command . (lldb-dap :program "target/debug/lumina" :args ["-i" "test_presentation.lisp"]))))) +((nil . ((dape-command . (gdb :program "target/debug/lumina" :args ["-i" "test_presentation.lisp"] :compile "just b"))))) diff --git a/Cargo.lock b/Cargo.lock index 3ae7be1..f1f8b2f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1276,7 +1276,7 @@ dependencies = [ "log", "rangemap", "rustc-hash 1.1.0", - "rustybuzz", + "rustybuzz 0.14.1", "self_cell", "smol_str", "swash", @@ -2943,7 +2943,7 @@ dependencies = [ "iced_graphics", "kurbo 0.10.4", "log", - "resvg", + "resvg 0.42.0", "rustc-hash 2.1.1", "softbuffer", "tiny-skia", @@ -2984,7 +2984,7 @@ dependencies = [ "lyon", "once_cell", "raw-window-handle", - "resvg", + "resvg 0.42.0", "rustc-hash 2.1.1", "rustix 0.38.44", "thiserror 1.0.69", @@ -3166,12 +3166,28 @@ dependencies = [ "zune-jpeg", ] +[[package]] +name = "image-webp" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6970fe7a5300b4b42e62c52efa0187540a5bef546c60edaf554ef595d2e6f0b" +dependencies = [ + "byteorder-lite", + "quick-error", +] + [[package]] name = "imagesize" 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 = "immutable-chunkmap" version = "2.0.6" @@ -3643,6 +3659,7 @@ dependencies = [ "miette", "pretty_assertions", "rayon", + "resvg 0.45.1", "rodio", "ron 0.8.1", "serde", @@ -4927,6 +4944,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" version = "0.37.5" @@ -5200,7 +5223,24 @@ 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]] @@ -5376,8 +5416,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.1", + "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", ] @@ -6729,12 +6787,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" @@ -6826,12 +6896,39 @@ 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", + "svgtypes", + "tiny-skia-path", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "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", diff --git a/Cargo.toml b/Cargo.toml index 27051a0..5c6d4d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ gstreamer-app = "0.23" url = "2" colors-transform = "0.2.11" rayon = "1.11.0" +resvg = "0.45.1" # femtovg = { version = "0.16.0", features = ["wgpu"] } # wgpu = "26.0.1" # mupdf = "0.5.0" @@ -51,4 +52,4 @@ opt-level = 3 debug = true [lints.rust] -mismatched_lifetime_syntaxes = "allow" \ No newline at end of file +mismatched_lifetime_syntaxes = "allow" diff --git a/src/core/service_items.rs b/src/core/service_items.rs index b0b9da5..a3c5eeb 100644 --- a/src/core/service_items.rs +++ b/src/core/service_items.rs @@ -47,13 +47,12 @@ impl TryFrom<(Vec, String)> for ServiceItem { fn try_from( value: (Vec, String), ) -> std::result::Result { - let sto = value.0.to_owned(); - let song = Song { - title: "Death Was Arrested".to_string(), - ..Default::default() - }; debug!(?value); - Ok(Self::from(&song)) + let val = Value::from( + String::from_utf8(value.0) + .expect("Value couldn't be made"), + ); + Ok(Self::from(&val)) } } diff --git a/src/core/slide.rs b/src/core/slide.rs index b394bdb..a6cb45a 100644 --- a/src/core/slide.rs +++ b/src/core/slide.rs @@ -321,6 +321,10 @@ impl Slide { self.id = index; } + pub(crate) fn text_to_image(&self) { + todo!() + } + // pub fn slides_from_item(item: &ServiceItem) -> Result> { // todo!() // } diff --git a/src/main.rs b/src/main.rs index 7ed2c2d..27efc06 100644 --- a/src/main.rs +++ b/src/main.rs @@ -312,6 +312,21 @@ impl cosmic::Application for App { } else { cosmic::Action::None } + }).on_drop(|index, idk| { + debug!(index, idk); + cosmic::Action::None + }).on_data_received( move |mime, data| { + debug!(?data, mime); + let Ok(item) = ServiceItem::try_from((data.clone(), mime.clone())) else { + return cosmic::Action::None; + }; + cosmic::Action::App(Message::AddServiceItem(index, item)) + }).on_finish(move |mime, data, action, x, y| { + debug!(mime, ?data, ?action, x, y); + let Ok(item) = ServiceItem::try_from((data.clone(), mime.clone())) else { + return cosmic::Action::None; + }; + cosmic::Action::App(Message::AddServiceItem(index, item)) }) .into() }); diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index 766d77e..cd9b2d9 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -333,10 +333,10 @@ impl Presenter { } } Message::VideoFrame => { - // if let Some(video) = &self.video { - // self.video_position = - // video.position().as_secs_f32(); - // } + if let Some(video) = &self.video { + self.video_position = + video.position().as_secs_f32(); + } } Message::MissingPlugin(element) => { if let Some(video) = &mut self.video {