From 21ebd4dda267d09c60d8b646782aed28138c5690 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Fri, 2 Dec 2022 16:14:26 +0100 Subject: Proof-of-concept event handling. See NOTE. --- wm.scm | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'wm.scm') diff --git a/wm.scm b/wm.scm index 8304dca..3d46652 100644 --- a/wm.scm +++ b/wm.scm @@ -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)))) -- cgit v1.2.3