(defmacro create-keybindings (&rest keybindings) "Example: (create-keybindings ((#\\C :mod-4 :shift) (lambda () (create-test-window *wm*))) ((#\\Return :mod-4 :shift) (lambda (window) (close-test-window *wm* window))))" `(quote ,(loop :for (keycomb action) :in keybindings :collect (make-instance 'keybinding :key (car keycomb) :modifiers (cdr keycomb) :action action)))) (defclass window-manager () ((display :accessor display :initarg :display :type x:display) (screen :accessor screen :initarg :screen :type x:screen) (windows :accessor windows :initarg :windows :type (or null (cons x:window))) (cursor :accessor cursor :initarg :cursor :type (or null x:cursor)) (keybindings :accessor keybindings :initarg :keybindings :initform (create-keybindings ((#\C :mod-4 :shift) (lambda () (create-test-window *wm*))) ((#\Return :mod-4 :shift) (lambda (window) (close-test-window *wm* window)))))))