1.1--- a/lisp/lib/gui/pkg.lisp Sun Dec 17 02:27:22 2023 -0500
1.2+++ b/lisp/lib/gui/pkg.lisp Sun Dec 17 04:06:19 2023 -0500
1.3@@ -1,6 +1,18 @@
1.4-(uiop:define-package :gui
1.5- (:nicknames :gui)
1.6+(defpackage :gui/core
1.7 (:use :cl :std :log)
1.8+ (:export
1.9+ :gui-error))
1.10+
1.11+(defpackage :gui/wm
1.12+ (:use :cl :std :log :gui/core :wayflan-client)
1.13+ (:export))
1.14+
1.15+(defpackage :gui/proto/keyboard
1.16+ (:use :cl :std :gui/core :gui/wm)
1.17+ (:export))
1.18+
1.19+(defpackage :gui/ext
1.20+ (:use :cl :std :log :gui/core)
1.21 (:export
1.22 :*gui-backend-list*
1.23 :*gui-backend*
1.24@@ -9,36 +21,3 @@
1.25 :with-gui-handlers
1.26 :gui-main
1.27 :def-gui))
1.28-
1.29-(in-package :gui)
1.30-
1.31-(defparameter *gui-backend-list* '(:gtk :tk :mcclim))
1.32-
1.33-(defparameter *gui-backend* nil)
1.34-
1.35-(defun register-gui-backend (name &optional lib)
1.36- "Register a new GUI backend named NAME. if LIB is provided it is
1.37-assumed to be a path to a shared library.")
1.38-
1.39-(defun load-gui-backend (backend)
1.40- (case backend
1.41- (:gtk (nyi!))
1.42- (:tk (nyi!))
1.43- (:mcclim (nyi!))))
1.44-
1.45-(defmacro with-gui-handlers (&body body)
1.46- `(progn
1.47- ,@body))
1.48-
1.49-(defmacro def-gui (ret &body body)
1.50- "Define a CLI main function in the current package which returns RET.
1.51-
1.52-Note that this macro does not export the defined function and requires
1.53-`gui:main' to be an external symbol."
1.54- `(progn
1.55- (declaim (type stream output))
1.56- (defun gui-main (&key (output *standard-output*))
1.57- "Run the top-level function and print to OUTPUT."
1.58- (let ((*standard-output* output))
1.59- (with-gui-handlers
1.60- (progn ,@body ,ret))))))