aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShav Kinderlehrer <shav@trinket.icu>2026-05-08 17:45:15 -0400
committerShav Kinderlehrer <shav@trinket.icu>2026-05-08 17:45:15 -0400
commit91e1dbfd946f8396709d83701a6651b5c2ca7bdc (patch)
treec136edbd8480180a02b067450531aae611761ca0
parente85467ec272826bed113c29042ea4db355b851a3 (diff)
downloadextant-91e1dbfd946f8396709d83701a6651b5c2ca7bdc.tar.gz
extant-91e1dbfd946f8396709d83701a6651b5c2ca7bdc.zip
Embed guile for custom handlers and update UI
Adds support for writing custom handlers and sets the ui to be properly centered and not move around while messages are added. Also auto scrolls when the messages window gets too long.
-rw-r--r--data/styles.xml6
-rw-r--r--scm/extant-input.scm15
-rw-r--r--scm/guile.xml6
3 files changed, 27 insertions, 0 deletions
diff --git a/data/styles.xml b/data/styles.xml
new file mode 100644
index 0000000..741e6dc
--- /dev/null
+++ b/data/styles.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/ski/frog/extant/styles">
+ <file>window.css</file>
+ </gresource>
+</gresources>
diff --git a/scm/extant-input.scm b/scm/extant-input.scm
new file mode 100644
index 0000000..d50a7fe
--- /dev/null
+++ b/scm/extant-input.scm
@@ -0,0 +1,15 @@
+(define-module (extant input)
+ #:export (register-handler!))
+
+(define *handlers* '())
+
+(define (register-handler! proc)
+ (set! *handlers* (cons proc *handlers*)))
+
+(define (dispatch-input text)
+ (let loop ((handlers *handlers*))
+ (if (null? handlers)
+ `((text . "No handlers found!")
+ (style . "error"))
+ (let ((result ((car handlers) text)))
+ (or result (loop (cdr handlers)))))))
diff --git a/scm/guile.xml b/scm/guile.xml
new file mode 100644
index 0000000..8a5368d
--- /dev/null
+++ b/scm/guile.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/ski/frog/extant/guile">
+ <file>extant-input.scm</file>
+ </gresource>
+</gresources>