diff options
author | Daniel Kochmański <daniel@turtleware.eu> | 2023-10-17 10:00:02 +0200 |
---|---|---|
committer | Daniel Kochmański <daniel@turtleware.eu> | 2024-09-17 07:54:42 +0200 |
commit | 0981a5b38d09f63230d9dcda1a422c6b4920c544 (patch) | |
tree | 5e6a6e7ea60c464b2a879b7a0e310d3394517bf7 | |
parent | e3c2e4112a98fb7027753416353ee76e9d013676 (diff) |
core: move lambda-event and with-synchronization to events
-rw-r--r-- | Core/windowing/events.lisp | 14 | ||||
-rw-r--r-- | Core/windowing/input.lisp | 13 |
2 files changed, 13 insertions, 14 deletions
diff --git a/Core/windowing/events.lisp b/Core/windowing/events.lisp index 427fa6a5..2241ed43 100644 --- a/Core/windowing/events.lisp +++ b/Core/windowing/events.lisp @@ -95,6 +95,19 @@ (define-event-class lambda-event (standard-event) ((thunk :initarg :thunk :reader lambda-event-thunk))) +(defmethod handle-event ((client sheet) (event lambda-event)) + (declare (ignore client)) + (funcall (lambda-event-thunk event))) + +(defmacro with-synchronization (sheet test &body body) + `(if ,test + (progn ,@body) + ,(once-only (sheet) + `(dispatch-event ,sheet + (make-instance 'lambda-event + :sheet ,sheet + :thunk (lambda () ,@body)))))) + ;;; We have three pairs of the pointer event coordinates in different ;;; coordinate systems: ;;; @@ -258,7 +271,6 @@ (defun delete-pulse (event) (setf (pulse-event-delay event) nil)) - ;;; Constants dealing with events (defconstant +pointer-no-button+ #x00) diff --git a/Core/windowing/input.lisp b/Core/windowing/input.lisp index 3c1ce302..111d565a 100644 --- a/Core/windowing/input.lisp +++ b/Core/windowing/input.lisp @@ -437,19 +437,6 @@ use condition-variables nor locks.")) (with-lock-held ((event-queue-schedule-lock queue)) (call-next-method))) -(defmethod handle-event ((client sheet) (event lambda-event)) - (declare (ignore client)) - (funcall (lambda-event-thunk event))) - -(defmacro with-synchronization (sheet test &body body) - `(if ,test - (progn ,@body) - ,(once-only (sheet) - `(dispatch-event ,sheet - (make-instance 'lambda-event - :sheet ,sheet - :thunk (lambda () ,@body)))))) - ;;; STANDARD-SHEET-INPUT-MIXIN |