From 814296eb3d662a70987422f781e5af49332f132a Mon Sep 17 00:00:00 2001 From: nofreude Date: Wed, 22 Aug 2001 12:06:41 +0000 Subject: [PATCH] First implementation --- scheme/xlib/grab.scm | 153 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 scheme/xlib/grab.scm diff --git a/scheme/xlib/grab.scm b/scheme/xlib/grab.scm new file mode 100644 index 0000000..5c26050 --- /dev/null +++ b/scheme/xlib/grab.scm @@ -0,0 +1,153 @@ +; Norbert Freudemann + +; grab-pointer grabs control of a pointer for your client only. +; It returns on of the symbols: +; (success not-viewable already-grabbed frozen invlalide-time) + +(define (grab-pointer window owner? events ptr-sync? kbd-sync? + confine-to cursor time) + (%grab-pointer (display-Xdisplay (window-display window)) + (window-Xwindow window) + owner? events + ptr-sync? kbd-sync? + (window-Xwindow confine-to) + (cursor-Xcursor cursor) + time)) + + +(import-lambda-definition %grab-pointer (Xdisplay Xwindow owner? events + ptr-sync? kbd-sync? + Xconfine-to Xcursor time) + "scx_Grab_Pointer") + + +; ungrab-pointer releases the pointer. + +(define (ungrab-pointer display time) + (%ungrab-pointer (display-Xdisplay display) + time)) + +(import-lambda-definition %ungrab-pointer (Xdisplay time) + "scx_Ungrab_Pointer") + + +; --- + +(define (grab-button window button mod owner? events ptr-sync? kbd-sync? + confine-to cursor) + (%grab-button (display-Xdisplay (window-display window)) + (window-Xwindow window) + button mod owner? events ptr-sync? kbd-sync? + (window-Xwindow confine-to) + (cursor-Xcursor cursor))) + +(import-lambda-definfition %grab-button (Xdisplay Xwindow button + mods ownerp events + ptr-sync? kbd-sync? + Xconfine-to Xcursor) + "scx_Grab_Button") + + +; --- + + +(define (ungrab-button window button modifiers) + (%ungrab-button (display-Xdisplay (window-display window)) + (window-Xwindow window) + button modifiers)) + +(import-lambda-definition %ungrab-button (Xdisplay Xwindow + button modifiers) + "scx_Ungrab_Button") + + +; --- + +(define (change-active-pointer-grab display events cursor time) + (%change-active-p-g (display-Xdisplay display) + events cursor time)) + +(import-lambda-definition %change-active-p-g (Xdislay events + cursor time) + "scx_Change_Active_Pointer_Grab") + + +; --- + +(define (grab-keybord window owner? ptr-sync? kbd-sync? time) + (%grab-keybord (display-Xdisplay (window-display window)) + (window-Xwindow window) + owner? ptr-sync? kbd-sync? time)) + +(import-lambda-definition %grab-keybord (Xdisplay Xwindow + owner? ptr-sync? kbd-sync? + time) + "scx_Grab_Keybord") + + +; --- + + +(define (ungrab-keybord display time) + (%ungrab-keybord (display-Xdisplay display) + time)) + + +(import-lambda-definition %ungrab-keybord (Xdisplay time) + "scx_Ungrab_Keybord") + + +; --- + +(define (grab-key window key mod owner? ptr-sync? kbd-sync?) + (%grab-key (display-Xdisplay (window-display window)) + (window-Xwindow window) + key mod owner? ptr-sync? kbd-sync? (symbol? key))) + +(import-lambda-definition %grab-key (Xdisplay xwindow key mod + owner ptr-sync? kbd-sync? flag) + "scx_Grab_Key") + +; --- + + +(define (ungrab-key window key mod) + (%ungrab-key (display-Xdisplay (window-display window)) + (window-Xwindow window) + key mod (symbol? key))) + +(import-lambda-definition %ungrag-key (Xdisplay Xwindow key mod + flag) + "scx_Ungrab_Key") + +; --- + + +(define (allow-events display mode time) + (%allow-events (display-Xdisplay display) + mode time)) + +(import-lambda-definition %allow-events (Xdisplay mode time) + "scx_Allow_Events") + +; --- + +(define (grab-server display) + (%grab-server (display-Xdisplay display))) + +(import-lambda-definition %grab-server (Xdisplay) + "scx_Grab_Server") + +; --- + +(define (ungrab-server display) + (%ungrab-server (display-Xdisplay display))) + +(import-lambda-definition %ungrab-server (Xdisplay) + "scx_Ungrab_Server") + + +; Implementation of with-server-grabbed follows... + +;(define (with-server-grabbed display . body-forms) +;) \ No newline at end of file