diff options
author | Daniel Kochmański <daniel@turtleware.eu> | 2024-09-03 12:54:26 +0200 |
---|---|---|
committer | Daniel Kochmański <daniel@turtleware.eu> | 2024-09-03 12:54:26 +0200 |
commit | 43807ba80dca8f05d5d45b1b2c93dd66fbb8e1f1 (patch) | |
tree | ee2f2fb05daf2e25bdc5d6515bcbac0e14298a63 | |
parent | b245efd7591495b9460117c42653d6c1201ca023 (diff) |
cleanup: rename *-track-pointer to *-wait-handler
These functions are not meant to only track the pointer - for example the
modifier may change etc.
-rw-r--r-- | Core/clim-core/frames/frames.lisp | 20 | ||||
-rw-r--r-- | Core/clim-core/presentations/translators.lisp | 7 | ||||
-rw-r--r-- | Core/clim-core/presentations/typed-input.lisp | 6 | ||||
-rw-r--r-- | Core/clim-core/system/declarations.lisp | 4 | ||||
-rw-r--r-- | Documentation/Notes/extended-stream-input.org | 2 |
5 files changed, 21 insertions, 18 deletions
diff --git a/Core/clim-core/frames/frames.lisp b/Core/clim-core/frames/frames.lisp index 2b618c01..31b18d22 100644 --- a/Core/clim-core/frames/frames.lisp +++ b/Core/clim-core/frames/frames.lisp @@ -835,13 +835,14 @@ frames and will not have focus. (declare (ignore stream button-press-event)) nil) -(defmethod frame-input-context-track-pointer - ((frame standard-application-frame) input-context stream event) - (declare (ignore input-context stream event)) +(defmethod frame-input-context-wait-handler + ((frame standard-application-frame) stream event) + (declare (ignore frame stream event)) nil) -(defun frame-highlight-at-position (frame input-context stream event) - (let* ((modifier (event-modifier-state event)) +(defun frame-highlight-at-position (frame stream event) + (let* ((input-context *input-context*) + (modifier (event-modifier-state event)) (x (device-event-x event)) (y (device-event-y event)) (presentation (find-innermost-applicable-presentation @@ -851,10 +852,11 @@ frames and will not have focus. (set-highlighted-presentation stream presentation) (update-pointer-documentation frame input-context stream event))) -(defmethod frame-input-context-track-pointer - ((frame standard-application-frame) input-context - (stream output-recording-stream) event) - (frame-highlight-at-position frame input-context stream event)) +(defmethod frame-input-context-wait-handler + ((frame standard-application-frame) + (stream output-recording-stream) + event) + (frame-highlight-at-position frame stream event)) (defun simple-event-loop (&optional (frame *application-frame*)) "An simple event loop for applications that want all events to be handled by diff --git a/Core/clim-core/presentations/translators.lisp b/Core/clim-core/presentations/translators.lisp index bc044292..bd25564f 100644 --- a/Core/clim-core/presentations/translators.lisp +++ b/Core/clim-core/presentations/translators.lisp @@ -768,15 +768,16 @@ a presentation" :unhighlight)))) nil) -(defun highlight-current-presentation (frame input-context) +(defun highlight-current-presentation (frame) (when-let* ((port (port frame)) (port-pointer (port-pointer port)) (event (synthesize-pointer-motion-event port port-pointer)) (sheet (event-sheet event))) - (frame-input-context-track-pointer frame input-context sheet event))) + (frame-input-context-wait-handler frame sheet event))) (defun highlight-applicable-presentation (frame stream input-context &optional (prefer-pointer-window t)) (when (or prefer-pointer-window (eq stream (pointer-sheet (port-pointer (port frame))))) - (highlight-current-presentation frame input-context))) + (let ((*input-context* input-context)) + (highlight-current-presentation frame input-context)))) diff --git a/Core/clim-core/presentations/typed-input.lisp b/Core/clim-core/presentations/typed-input.lisp index ca455d24..721cb186 100644 --- a/Core/clim-core/presentations/typed-input.lisp +++ b/Core/clim-core/presentations/typed-input.lisp @@ -41,9 +41,9 @@ (when (eventp gesture) (output-recording-stream-p (event-sheet gesture))))) -(defun input-context-event-handler (stream) +(defun input-context-wait-handler (stream) (declare (ignore stream)) - (highlight-current-presentation *application-frame* *input-context*)) + (highlight-current-presentation *application-frame*)) (defun input-context-button-press-handler (stream button-event) (declare (ignore stream)) @@ -57,7 +57,7 @@ (if override nil *input-context*))) (*pointer-button-press-handler* #'input-context-button-press-handler) (*input-wait-test* #'input-context-wait-test) - (*input-wait-handler* #'input-context-event-handler)) + (*input-wait-handler* #'input-context-wait-handler)) (funcall form-cont))) (defmacro with-input-context diff --git a/Core/clim-core/system/declarations.lisp b/Core/clim-core/system/declarations.lisp index 4ab93dea..3bb2de28 100644 --- a/Core/clim-core/system/declarations.lisp +++ b/Core/clim-core/system/declarations.lisp @@ -254,8 +254,8 @@ panes.")) (frame input-context stream x y &key event)) (defgeneric frame-input-context-button-press-handler (frame stream button-press-event)) -(defgeneric frame-input-context-track-pointer - (frame input-context stream event)) +(defgeneric frame-input-context-wait-handler + (frame stream event)) (defgeneric frame-document-highlighted-presentation (frame presentation input-context window-context x y stream)) (defgeneric frame-drag-and-drop-feedback diff --git a/Documentation/Notes/extended-stream-input.org b/Documentation/Notes/extended-stream-input.org index 01e88430..01960213 100644 --- a/Documentation/Notes/extended-stream-input.org +++ b/Documentation/Notes/extended-stream-input.org @@ -240,7 +240,7 @@ no pointer events remain wait test, the input wait handler and the pointer button press handler: - input-context-wait-test :: (and event-p pointer/keyboard-p) - - input-context-event-handler :: highlight-applicable-presentation + - input-context-wait-handler :: highlight-applicable-presentation - input-context-button-press-handler :: throw-highlighted-presentation /it is not clear whether the event is consumed or not, neither whether |