aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--wheelwork.lisp14
1 files changed, 14 insertions, 0 deletions
diff --git a/wheelwork.lisp b/wheelwork.lisp
index 6de9d6b..059db18 100644
--- a/wheelwork.lisp
+++ b/wheelwork.lisp
@@ -561,6 +561,10 @@ disk."
:path (uiop:merge-pathnames* asset-id (asset-root app)))))))
(defmacro defhandler (name handler)
+ "Defines a handler - binds (FDEFINITION NAME) to HANDLER, which
+should be an expression that evaluates to an instance of
+EVENT-HANDLER, which is funcallable. It is define such that handlers
+can be redefined using this form to support interactive development."
(let ((handler-var (gensym)))
`(let ((,handler-var ,handler))
(if-let (extant (and (fboundp ',name)
@@ -571,6 +575,7 @@ disk."
(defmacro on-perframe
((&optional (target 'target) (time 'time)) &body body)
+ "Creates a handler for 'PERFRAME events"
`(make-instance
'event-handler
:event-type 'wheelwork::perframe
@@ -629,6 +634,7 @@ disk."
(win-x 'win-x) (win-y 'win-y)
(win-xrel 'win-xrel) (win-yrel 'win-yrel))
&body body)
+ "Creates a handler for MOUSEMOTION events"
`(make-instance
'event-handler
:event-type 'wheelwork::mousemotion
@@ -660,6 +666,7 @@ disk."
(clicks 'clicks) (button 'button)
(win-x 'win-x) (win-y 'win-y))
&body body)
+ "Creates a handler for MOUSEDOWN events"
`(make-instance
'event-handler
:event-type 'wheelwork::mousedown
@@ -687,6 +694,7 @@ disk."
(clicks 'clicks) (button 'button)
(win-x 'win-x) (win-y 'win-y))
&body body)
+ "Creates a handler for MOUSEUP events"
`(make-instance
'event-handler
:event-type 'wheelwork::mouseup
@@ -710,6 +718,7 @@ disk."
(defmacro on-mousewheel
((&optional (target 'target) (x 'x) (y 'y) (dir 'dir)) &body body)
+ "Creates a handler for MOUSEWHEEL events"
`(make-instance
'event-handler
:event-type 'wheelwork::mousewheel
@@ -727,6 +736,8 @@ disk."
(defmacro on-blur
((&optional (target 'target)) &body body)
+ "Creates a handler for BLUR events. BLUR is a psuedo event that
+fires whenever an object loses focus."
`(make-instance
'event-handler
:event-type 'wheelwork::blur
@@ -738,6 +749,9 @@ disk."
(defmacro on-focus
((&optional (target 'target)) &body body)
+ "Creates a handler for a FOCUS event. FOCUS is a pusedo event that
+fires when the FOCUS slot of the current APPLICATION instance is changed.
+"
`(make-instance
'event-handler
:event-type 'wheelwork::focus