diff --git a/Cargo.toml b/Cargo.toml index 5286ac2..72f45b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,9 @@ license = "GPL-3.0" edition = "2021" build = "build.rs" +[build-dependencies] +gtk4 = "0.4" + [dependencies] gtk4 = "0.4" libadwaita = "0.1" @@ -17,7 +20,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" dirs = "4.0.0" -tokio = { version = "1.19.2", features = ["rt", "rt-multi-thread", "macros"] } +tokio = { version = "1.20", features = ["rt", "rt-multi-thread", "macros"] } wait_not_await = "0.2.1" regex = "1.6.0" lazy_static = "1.4.0" diff --git a/anime-game-core b/anime-game-core index f4ad771..ccb2f20 160000 --- a/anime-game-core +++ b/anime-game-core @@ -1 +1 @@ -Subproject commit f4ad7711ac156c4c69bc8a14c896f07ad54a101c +Subproject commit ccb2f2082ad278cce946ebd960e4a065368babaf diff --git a/assets/resources.xml b/assets/resources.xml new file mode 100644 index 0000000..4a66f5a --- /dev/null +++ b/assets/resources.xml @@ -0,0 +1,6 @@ + + + + images/icon.png + + diff --git a/assets/ui/main.blp b/assets/ui/main.blp index f02784a..10e3a99 100644 --- a/assets/ui/main.blp +++ b/assets/ui/main.blp @@ -34,7 +34,8 @@ Adw.ApplicationWindow window { Adw.PreferencesGroup { Gtk.Image { - file: "assets/images/icon.png"; + resource: "/org/app/assets/images/icon.png"; + vexpand: true; margin-top: 48; } diff --git a/blueprint-compiler b/blueprint-compiler index 08da6f7..30f0dee 160000 --- a/blueprint-compiler +++ b/blueprint-compiler @@ -1 +1 @@ -Subproject commit 08da6f79c7a4fee9212ef82d8c6c8095fc7644ce +Subproject commit 30f0deea34851aa6fbb4f8a5dcd9216f5ac714f9 diff --git a/build.rs b/build.rs index 1f8aabe..e509c18 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,5 @@ use std::process::{Command, Stdio}; -use std::fs::{self, read_dir, create_dir_all}; +use std::fs::{self, read_dir, create_dir_all, read_to_string}; use std::path::Path; fn compile_blueprint(path: T) -> Result { @@ -27,11 +27,21 @@ fn compile_blueprint(path: T) -> Result { } fn main() { + if let Ok(_) = read_to_string("assets/resources.xml") { + gtk4::gio::compile_resources( + "assets", + "assets/resources.xml", + ".assets.gresource", + ); + } + if let Ok(entries) = read_dir("assets/ui") { if let Err(_) = read_dir("assets/ui/.dist") { create_dir_all("assets/ui/.dist").expect("UI dist dir couldn't be created"); } + println!("cargo:rerun-if-changed=assets/ui/*.blp"); + for entry in entries { if let Ok(entry) = entry { if let Ok(metadata) = entry.metadata() { diff --git a/external/hpatchz/LICENSE b/external/hpatchz/LICENSE new file mode 100644 index 0000000..a289e34 --- /dev/null +++ b/external/hpatchz/LICENSE @@ -0,0 +1,48 @@ +MIT License + +HDiffPatch +Copyright (c) 2012-2021 housisong + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +---------------------------------------------------------------------------------- + +libdivsufsort +Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/external/hpatchz/hpatchz b/external/hpatchz/hpatchz new file mode 100755 index 0000000..40fa549 Binary files /dev/null and b/external/hpatchz/hpatchz differ diff --git a/src/main.rs b/src/main.rs index 0bf2c3a..67f6e51 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,10 @@ async fn main() { gtk::init().expect("GTK initialization failed"); adw::init(); + // Register and include resources + gtk::gio::resources_register_include!(".assets.gresource") + .expect("Failed to register resources"); + // Create app let application = gtk::Application::new( Some("com.gitlab.an-anime-team.an-anime-game-launcher-gtk"),