Rearrange the entire kifu directory tree

This commit is contained in:
Savanni D'Gerinel 2023-05-13 14:02:24 -04:00
parent 68cec8bc12
commit 297e7f70c4
41 changed files with 18 additions and 16 deletions

View File

@ -45,18 +45,20 @@ kifu-core/test-oneshot:
cd kifu/kifu-core && make test-oneshot cd kifu/kifu-core && make test-oneshot
kifu-gtk: kifu-gtk:
cd kifu/kifu-gtk && make release cd kifu/gtk && make release
kifu-gtk/dev: kifu-gtk/dev:
cd kifu/kifu-gtk && make dev cd kifu/gtk && make dev
kifu-pwa: kifu-pwa:
cd kifu/kifu-pwa && make release pushd kifu/ffi/wasm && make && popd
pushd kifu/core-types && make && popd
cd kifu/pwa && make release
kifu-pwa/dev: kifu-pwa/dev:
pushd kifu/ffi/wasm && make && popd pushd kifu/ffi/wasm && make && popd
pushd kifu/core-types && make && popd pushd kifu/core-types && make && popd
pushd kifu/kifu-pwa && make dev pushd kifu/pwa && make dev
kifu-pwa/test-server: kifu-pwa/test-server:
pushd kifu/kifu-pwa && make test-server pushd kifu/pwa && make test-server

View File

@ -1,6 +1,6 @@
SOURCES = $(shell find ../kifu-core -name "*.rs") SOURCES = $(shell find ../core -name "*.rs")
dist/core.d.ts: $(SOURCES) dist/core.d.ts: $(SOURCES)
mkdir -p dist mkdir -p dist
typeshare ../kifu-core --lang=typescript --output-file=dist/core.d.ts typeshare ../core --lang=typescript --output-file=dist/core.d.ts

View File

@ -9,7 +9,7 @@ edition = "2021"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]
kifu-core = { path = "../../kifu-core" } kifu-core = { path = "../../core" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.5.0" serde-wasm-bindgen = "0.5.0"
wasm-bindgen = "0.2" wasm-bindgen = "0.2"

View File

@ -14,7 +14,7 @@ gio = { version = "0.17" }
glib = { version = "0.17" } glib = { version = "0.17" }
gtk = { version = "0.6", package = "gtk4" } gtk = { version = "0.6", package = "gtk4" }
image = { version = "0.24" } image = { version = "0.24" }
kifu-core = { path = "../kifu-core" } kifu-core = { path = "../core" }
tokio = { version = "1.26", features = [ "full" ] } tokio = { version = "1.26", features = [ "full" ] }
screenplay = { path = "../../screenplay" } screenplay = { path = "../../screenplay" }

View File

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 350 KiB

View File

@ -1,17 +1,17 @@
pub mod ui; pub mod ui;
use kifu_core::{CoreApp, Request, Response}; use kifu_core::{CoreApp, CoreRequest, CoreResponse};
use std::sync::Arc; use std::sync::Arc;
use tokio::runtime::Runtime; use tokio::runtime::Runtime;
#[derive(Clone)] #[derive(Clone)]
pub struct CoreApi { pub struct CoreApi {
pub gtk_tx: gtk::glib::Sender<Response>, pub gtk_tx: gtk::glib::Sender<CoreResponse>,
pub rt: Arc<Runtime>, pub rt: Arc<Runtime>,
pub core: CoreApp, pub core: CoreApp,
} }
impl CoreApi { impl CoreApi {
pub fn dispatch(&self, request: Request) { pub fn dispatch(&self, request: CoreRequest) {
self.rt.spawn({ self.rt.spawn({
let gtk_tx = self.gtk_tx.clone(); let gtk_tx = self.gtk_tx.clone();
let core = self.core.clone(); let core = self.core.clone();

View File

@ -1,5 +1,5 @@
use gtk::prelude::*; use gtk::prelude::*;
use kifu_core::{CoreApp, Request, Response}; use kifu_core::{CoreApp, CoreRequest, CoreResponse};
use kifu_gtk::{ui::PlayingField, CoreApi}; use kifu_gtk::{ui::PlayingField, CoreApi};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
@ -31,7 +31,7 @@ fn main() {
let runtime = runtime.clone(); let runtime = runtime.clone();
move |app| { move |app| {
let (gtk_tx, gtk_rx) = let (gtk_tx, gtk_rx) =
gtk::glib::MainContext::channel::<Response>(gtk::glib::PRIORITY_DEFAULT); gtk::glib::MainContext::channel::<CoreResponse>(gtk::glib::PRIORITY_DEFAULT);
let api = CoreApi { let api = CoreApi {
gtk_tx, gtk_tx,
@ -47,7 +47,7 @@ fn main() {
let playing_field = Arc::new(RwLock::new(None)); let playing_field = Arc::new(RwLock::new(None));
move |message| { move |message| {
match message { match message {
Response::PlayingFieldView(view) => { CoreResponse::PlayingFieldView(view) => {
let api = api.clone(); let api = api.clone();
let start = std::time::Instant::now(); let start = std::time::Instant::now();
@ -67,7 +67,7 @@ fn main() {
} }
}); });
api.dispatch(Request::PlayingField); api.dispatch(CoreRequest::PlayingField);
} }
}); });

View File

Before

Width:  |  Height:  |  Size: 479 KiB

After

Width:  |  Height:  |  Size: 479 KiB