changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/gui/ext.lisp

changeset 261: 2a4f11c0e8c8
parent: e243efeae91d
author: Richard Westhaver <ellis@rwest.io>
date: Wed, 03 Apr 2024 22:40:01 -0400
permissions: -rw-r--r--
description: slint integrated
1 (in-package :gui/ext)
2 
3 (defparameter *gui-backend-list* '(:gtk :tk :mcclim))
4 
5 (defparameter *gui-backend* nil)
6 
7 (defun register-gui-backend (name &optional lib)
8  "Register a new GUI backend named NAME. if LIB is provided it is
9 assumed to be a path to a shared library.")
10 
11 (defun load-gui-backend (backend)
12  (case backend
13  (:gtk (nyi!))
14  (:tk (nyi!))
15  (:mcclim (nyi!))
16  (:slint (nyi!))))
17 
18 (defmacro with-gui-handlers (&body body)
19  `(progn
20  ,@body))
21 
22 (defmacro def-gui (ret &body body)
23  "Define a CLI main function in the current package which returns RET.
24 
25 Note that this macro does not export the defined function and requires
26 GUI-MAIN to be an external symbol."
27  `(progn
28  (declaim (type stream output))
29  (defun gui-main (&key (output *standard-output*))
30  "Run the top-level function and print to OUTPUT."
31  (let ((*standard-output* output))
32  (with-gui-handlers
33  (progn ,@body ,ret))))))