diff options
author | Samuel Fadel <samuel@nihil.ws> | 2022-12-02 16:14:26 +0100 |
---|---|---|
committer | Samuel Fadel <samuel@nihil.ws> | 2022-12-02 16:14:26 +0100 |
commit | 21ebd4dda267d09c60d8b646782aed28138c5690 (patch) | |
tree | a07d2103c745e382160a344263790235e3ec0c68 /wm.scm | |
parent | 7aa66702b2b9396add0cc20849ec89a48495c7ff (diff) |
Proof-of-concept event handling. See NOTE.
Diffstat (limited to 'wm.scm')
-rw-r--r-- | wm.scm | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -1,6 +1,8 @@ (define-module (wm) #:use-module (system foreign) - #:export (wm-init wm-quit)) + #:export (wm-init + wm-set-configure-notify-handler! + wm-quit)) (define libschewm (dynamic-link "libschewm")) @@ -13,12 +15,22 @@ (dynamic-func name libschewm) args)) +(define c/wm-init + (schewm-func int "wm_init" '())) + (define (wm-init) - (let ((c/wm-init - (schewm-func int "wm_init" '()))) - (int-as-bool (c/wm-init)))) - -(define (wm-quit s) - (let ((c/wm-quit - (schewm-func void "wm_quit" (list '*)))) - (c/wm-quit (string->pointer s)))) + (int-as-bool (c/wm-init))) + +(define wm-quit + (schewm-func void "wm_quit" '())) + +(define c/wm-set-configure-notify-handler + (schewm-func void + "wm_set_configure_notify_handler" + (list '*))) + +(define (wm-set-configure-notify-handler! handler) + (c/wm-set-configure-notify-handler + (procedure->pointer void + handler + (list int16 int16 uint32 uint32)))) |