changelog shortlog graph tags branches files raw help

Mercurial > demo / changeset: refactoring, ui stuff (goin with slint for DSL power)

changeset 16: af615d1895cb
parent 15: e8eb5754d201
child 17: e4c9ec452eb6
author: ellis <ellis@rwest.io>
date: Fri, 26 May 2023 21:59:40 -0400
files: Cargo.toml makefile scripts/build.ros scripts/check.ros scripts/db.ros scripts/demo.ros scripts/pack.ros scripts/test.ros tools/scripts/check.ros tools/scripts/db.ros tools/scripts/demo.ros tools/scripts/pack.ros tools/scripts/test.ros ui/Cargo.toml ui/src/lib.rs ui/src/main.rs
description: refactoring, ui stuff (goin with slint for DSL power)
     1.1--- a/Cargo.toml	Thu May 25 21:47:14 2023 -0400
     1.2+++ b/Cargo.toml	Fri May 26 21:59:40 2023 -0400
     1.3@@ -4,9 +4,9 @@
     1.4 build = "build.rs"
     1.5 [lib]
     1.6 path = "lib.rs"
     1.7-crate-type = ["lib","cdylib","staticlib"]
     1.8+crate-type = ["rlib","cdylib"]
     1.9 [workspace]
    1.10-members = ["obj","fig"]
    1.11+members = ["obj","fig","ui"]
    1.12 [dependencies]
    1.13 libc = "0.2"
    1.14 obj = {version = "0.1.0",path = "obj"}
     2.1--- a/makefile	Thu May 25 21:47:14 2023 -0400
     2.2+++ b/makefile	Fri May 26 21:59:40 2023 -0400
     2.3@@ -8,7 +8,7 @@
     2.4 build:$(RS) $(CL);cargo build --$(M);$L install.lisp
     2.5 ffi:build;cp target/$(M)/libdemo.dylib ffi;cd ffi;$(P) ffi/build.py
     2.6 docs:$(RS);cargo doc
     2.7-test:$(RS);cargo test
     2.8+test:$(RS) $(CL);cargo test;$L tests.lisp
     2.9 #pack:;scripts/pack.ros
    2.10 #check:;scripts/check.ros
    2.11 ci:clean fmt build ffi docs test;
     3.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2+++ b/scripts/build.ros	Fri May 26 21:59:40 2023 -0400
     3.3@@ -0,0 +1,25 @@
     3.4+#!/bin/sh
     3.5+#|-*- mode:lisp -*-|#
     3.6+#|
     3.7+exec ros -Q -- $0 "$@"
     3.8+|#
     3.9+(progn ;;init forms
    3.10+  (ros:ensure-asdf)
    3.11+  #+quicklisp(ql:quickload '() :silent t)
    3.12+  )
    3.13+
    3.14+(defpackage :ros.script.build.3891893519
    3.15+  (:use :cl))
    3.16+(in-package :ros.script.build.3891893519)
    3.17+
    3.18+(defun main (&rest argv)
    3.19+  (declare (ignorable argv))
    3.20+  (write-line "> cargo build --release")
    3.21+  (uiop:run-program "cargo build --release")
    3.22+  (wrie-line "  built rust libs and bindings")
    3.23+  (asdf:load-asd "cl-demo.asd")
    3.24+  (asdf:load-system "demo")
    3.25+  (asdf:make :demo)
    3.26+
    3.27+  )
    3.28+;;; vim: set ft=lisp lisp:
     4.1--- a/scripts/check.ros	Thu May 25 21:47:14 2023 -0400
     4.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3@@ -1,17 +0,0 @@
     4.4-#!/bin/sh
     4.5-#|-*- mode:lisp -*-|#
     4.6-#|
     4.7-exec ros -Q -- $0 "$@"
     4.8-|#
     4.9-(progn ;;init forms
    4.10-  (ros:ensure-asdf)
    4.11-  #+quicklisp(ql:quickload '() :silent t)
    4.12-  )
    4.13-
    4.14-(defpackage :ros.script.scriptscheck.3892329806
    4.15-  (:use :cl))
    4.16-(in-package :ros.script.scriptscheck.3892329806)
    4.17-
    4.18-(defun main (&rest argv)
    4.19-  (declare (ignorable argv)))
    4.20-;;; vim: set ft=lisp lisp:
     5.1--- a/scripts/db.ros	Thu May 25 21:47:14 2023 -0400
     5.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3@@ -1,12 +0,0 @@
     5.4-#!/bin/sh
     5.5-#|-*- mode:lisp -*-|#
     5.6-#|
     5.7-exec ros -Q -- $0 "$@"
     5.8-|#
     5.9-(progn ;;init forms
    5.10-  (ros:ensure-asdf)
    5.11-  #+quicklisp(ql:quickload '() :silent t))
    5.12-
    5.13-(defun main (&rest argv)
    5.14-  (declare (ignorable argv))
    5.15-  (format t "hello world"))
     6.1--- a/scripts/demo.ros	Thu May 25 21:47:14 2023 -0400
     6.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3@@ -1,12 +0,0 @@
     6.4-#!/bin/sh
     6.5-#|-*- mode:lisp -*-|#
     6.6-#|
     6.7-exec ros -Q -- $0 "$@"
     6.8-|#
     6.9-(progn ;;init forms
    6.10-  (ros:ensure-asdf)
    6.11-  #+quicklisp(ql:quickload '(demo) :silent t))
    6.12-
    6.13-(defun main (&rest argv)
    6.14-  (declare (ignorable argv))
    6.15-  (demo:main))
     7.1--- a/scripts/pack.ros	Thu May 25 21:47:14 2023 -0400
     7.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3@@ -1,17 +0,0 @@
     7.4-#!/bin/sh
     7.5-#|-*- mode:lisp -*-|#
     7.6-#|
     7.7-exec ros -Q -- $0 "$@"
     7.8-|#
     7.9-(progn ;;init forms
    7.10-  (ros:ensure-asdf)
    7.11-  #+quicklisp(ql:quickload '() :silent t)
    7.12-  )
    7.13-
    7.14-(defpackage :ros.script.pack.3891893796
    7.15-  (:use :cl))
    7.16-(in-package :ros.script.pack.3891893796)
    7.17-
    7.18-(defun main (&rest argv)
    7.19-  (declare (ignorable argv)))
    7.20-;;; vim: set ft=lisp lisp:
     8.1--- a/scripts/test.ros	Thu May 25 21:47:14 2023 -0400
     8.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3@@ -1,14 +0,0 @@
     8.4-#!/bin/sh
     8.5-#|-*- mode:lisp -*-|#
     8.6-#|
     8.7-exec ros -Q -- $0 "$@"
     8.8-|#
     8.9-(progn ;;init forms
    8.10-  (ros:ensure-asdf)
    8.11-  #+quicklisp(ql:quickload '() :silent t))
    8.12-
    8.13-(defun main (&rest argv)
    8.14-  (declare (ignorable argv))
    8.15-  (write-line "> cargo test")
    8.16-  (uiop:run-program "cargo test")
    8.17-  (write-line "  tested rust crates"))
     9.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2+++ b/tools/scripts/check.ros	Fri May 26 21:59:40 2023 -0400
     9.3@@ -0,0 +1,17 @@
     9.4+#!/bin/sh
     9.5+#|-*- mode:lisp -*-|#
     9.6+#|
     9.7+exec ros -Q -- $0 "$@"
     9.8+|#
     9.9+(progn ;;init forms
    9.10+  (ros:ensure-asdf)
    9.11+  #+quicklisp(ql:quickload '() :silent t)
    9.12+  )
    9.13+
    9.14+(defpackage :ros.script.scriptscheck.3892329806
    9.15+  (:use :cl))
    9.16+(in-package :ros.script.scriptscheck.3892329806)
    9.17+
    9.18+(defun main (&rest argv)
    9.19+  (declare (ignorable argv)))
    9.20+;;; vim: set ft=lisp lisp:
    10.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2+++ b/tools/scripts/db.ros	Fri May 26 21:59:40 2023 -0400
    10.3@@ -0,0 +1,12 @@
    10.4+#!/bin/sh
    10.5+#|-*- mode:lisp -*-|#
    10.6+#|
    10.7+exec ros -Q -- $0 "$@"
    10.8+|#
    10.9+(progn ;;init forms
   10.10+  (ros:ensure-asdf)
   10.11+  #+quicklisp(ql:quickload '() :silent t))
   10.12+
   10.13+(defun main (&rest argv)
   10.14+  (declare (ignorable argv))
   10.15+  (format t "hello world"))
    11.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2+++ b/tools/scripts/demo.ros	Fri May 26 21:59:40 2023 -0400
    11.3@@ -0,0 +1,12 @@
    11.4+#!/bin/sh
    11.5+#|-*- mode:lisp -*-|#
    11.6+#|
    11.7+exec ros -Q -- $0 "$@"
    11.8+|#
    11.9+(progn ;;init forms
   11.10+  (ros:ensure-asdf)
   11.11+  #+quicklisp(ql:quickload '(demo) :silent t))
   11.12+
   11.13+(defun main (&rest argv)
   11.14+  (declare (ignorable argv))
   11.15+  (demo:main))
    12.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2+++ b/tools/scripts/pack.ros	Fri May 26 21:59:40 2023 -0400
    12.3@@ -0,0 +1,17 @@
    12.4+#!/bin/sh
    12.5+#|-*- mode:lisp -*-|#
    12.6+#|
    12.7+exec ros -Q -- $0 "$@"
    12.8+|#
    12.9+(progn ;;init forms
   12.10+  (ros:ensure-asdf)
   12.11+  #+quicklisp(ql:quickload '() :silent t)
   12.12+  )
   12.13+
   12.14+(defpackage :ros.script.pack.3891893796
   12.15+  (:use :cl))
   12.16+(in-package :ros.script.pack.3891893796)
   12.17+
   12.18+(defun main (&rest argv)
   12.19+  (declare (ignorable argv)))
   12.20+;;; vim: set ft=lisp lisp:
    13.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2+++ b/tools/scripts/test.ros	Fri May 26 21:59:40 2023 -0400
    13.3@@ -0,0 +1,14 @@
    13.4+#!/bin/sh
    13.5+#|-*- mode:lisp -*-|#
    13.6+#|
    13.7+exec ros -Q -- $0 "$@"
    13.8+|#
    13.9+(progn ;;init forms
   13.10+  (ros:ensure-asdf)
   13.11+  #+quicklisp(ql:quickload '() :silent t))
   13.12+
   13.13+(defun main (&rest argv)
   13.14+  (declare (ignorable argv))
   13.15+  (write-line "> cargo test")
   13.16+  (uiop:run-program "cargo test")
   13.17+  (write-line "  tested rust crates"))
    14.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2+++ b/ui/Cargo.toml	Fri May 26 21:59:40 2023 -0400
    14.3@@ -0,0 +1,29 @@
    14.4+[package]
    14.5+name = "ui"
    14.6+version = "0.1.0"
    14.7+edition = "2021"
    14.8+[lib]
    14.9+path = "src/lib.rs"
   14.10+crate-type = ["rlib","cdylib"]
   14.11+[[bin]]
   14.12+name = "demo-ui"
   14.13+path = "src/main.rs"
   14.14+[dependencies]
   14.15+wgpu = "0.16.1"
   14.16+winit = "0.28.6"
   14.17+obj = {version = "0.1.0",path = "../obj"}
   14.18+fig = {version = "0.1.0",path = "../fig"}
   14.19+env_logger = "0.10.0"
   14.20+log = "0.4.17"
   14.21+cfg-if = "1.0.0"
   14.22+[target.'cfg(target_arch = "wasm32")'.dependencies]
   14.23+console_error_panic_hook = "0.1.6"
   14.24+console_log = "0.2.0"
   14.25+wgpu = { version = "0.15", features = ["webgl"]}
   14.26+wasm-bindgen = "0.2"
   14.27+wasm-bindgen-futures = "0.4.30"
   14.28+web-sys = { version = "0.3", features = [
   14.29+    "Document",
   14.30+    "Window",
   14.31+    "Element",
   14.32+]}
    15.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2+++ b/ui/src/lib.rs	Fri May 26 21:59:40 2023 -0400
    15.3@@ -0,0 +1,59 @@
    15.4+#[cfg(target_arch="wasm32")]
    15.5+use wasm_bindgen::prelude::*;
    15.6+use winit::{
    15.7+    event::*,
    15.8+    event_loop::{ControlFlow, EventLoop},
    15.9+    window::WindowBuilder,
   15.10+};
   15.11+
   15.12+#[cfg_attr(target_arch="wasm32", wasm_bindgen(start))]
   15.13+pub fn run() {
   15.14+  cfg_if::cfg_if! {
   15.15+    if #[cfg(target_arch = "wasm32")] {
   15.16+      std::panic::set_hook(Box::new(console_error_panic_hook::hook));
   15.17+      console_log::init_with_level(log::Level::Warn).expect("Couldn't initialize logger");
   15.18+    } else {
   15.19+      env_logger::init();
   15.20+    }
   15.21+  }
   15.22+  let event_loop = EventLoop::new();
   15.23+  let window = WindowBuilder::new().build(&event_loop).unwrap();
   15.24+
   15.25+  #[cfg(target_arch = "wasm32")]
   15.26+{
   15.27+    // Winit prevents sizing with CSS, so we have to set
   15.28+    // the size manually when on web.
   15.29+    use winit::dpi::PhysicalSize;
   15.30+    window.set_inner_size(PhysicalSize::new(450, 400));
   15.31+    
   15.32+    use winit::platform::web::WindowExtWebSys;
   15.33+    web_sys::window()
   15.34+        .and_then(|win| win.document())
   15.35+        .and_then(|doc| {
   15.36+            let dst = doc.get_element_by_id("wasm-example")?;
   15.37+            let canvas = web_sys::Element::from(window.canvas());
   15.38+            dst.append_child(&canvas).ok()?;
   15.39+            Some(())
   15.40+        })
   15.41+        .expect("Couldn't append canvas to document body.");
   15.42+}
   15.43+    event_loop.run(move |event, _, control_flow| match event {
   15.44+        Event::WindowEvent {
   15.45+            ref event,
   15.46+            window_id,
   15.47+        } if window_id == window.id() => match event {
   15.48+            WindowEvent::CloseRequested
   15.49+            | WindowEvent::KeyboardInput {
   15.50+                input:
   15.51+                    KeyboardInput {
   15.52+                        state: ElementState::Pressed,
   15.53+                        virtual_keycode: Some(VirtualKeyCode::Escape),
   15.54+                        ..
   15.55+                    },
   15.56+                ..
   15.57+            } => *control_flow = ControlFlow::Exit,
   15.58+            _ => {}
   15.59+        },
   15.60+        _ => {}
   15.61+    });
   15.62+}
    16.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2+++ b/ui/src/main.rs	Fri May 26 21:59:40 2023 -0400
    16.3@@ -0,0 +1,4 @@
    16.4+use ui::run;
    16.5+pub fn main() {
    16.6+    run();
    16.7+}