157 lines
5.0 KiB
Scheme
157 lines
5.0 KiB
Scheme
; 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 invalide-time)
|
|
;; See XGrabPointer.
|
|
|
|
(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. See XUngrabPointer.
|
|
|
|
(define (ungrab-pointer display time)
|
|
(%ungrab-pointer (display-Xdisplay display)
|
|
time))
|
|
|
|
(import-lambda-definition %ungrab-pointer (Xdisplay time)
|
|
"scx_Ungrab_Pointer")
|
|
|
|
|
|
;; grab-button performs a grab-pointer depending on a corresponding
|
|
;; button press event. See XGrabButton.
|
|
|
|
(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-definition %grab-button (Xdisplay Xwindow button
|
|
mods ownerp events
|
|
ptr-sync? kbd-sync?
|
|
Xconfine-to Xcursor)
|
|
"scx_Grab_Button")
|
|
|
|
;; ungrab-button releases the passive grab, performed by
|
|
;; grab-button. See XUngrabButton.
|
|
|
|
(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")
|
|
|
|
;; change-active-pointer-grab changes the specified dynamic parameters
|
|
;; if the pointer is actively grabbed by the client (by grab-pointer,
|
|
;; not by grab-button). See XChangeActivePointerGrab.
|
|
|
|
(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")
|
|
|
|
;; grab-keyboard actively grabs control of the keyboard and generates
|
|
;; FocusIn and FocusOut events. Further key events are reported only
|
|
;; to the grabbing client.
|
|
;; ungrab-keyboard releases the keyboard and any queued events if this
|
|
;; client has it actively grabbed from either grab-keyboard or
|
|
;; grab-Key. See XGrabKeyboard and XUngrabKeyboard.
|
|
|
|
(define (grab-keyboard window owner? ptr-sync? kbd-sync? time)
|
|
(%grab-keyboard (display-Xdisplay (window-display window))
|
|
(window-Xwindow window)
|
|
owner? ptr-sync? kbd-sync? time))
|
|
|
|
(import-lambda-definition %grab-keyboard (Xdisplay Xwindow
|
|
owner? ptr-sync? kbd-sync?
|
|
time)
|
|
"scx_Grab_Keyboard")
|
|
|
|
(define (ungrab-keyboard display time)
|
|
(%ungrab-keyboard (display-Xdisplay display)
|
|
time))
|
|
|
|
|
|
(import-lambda-definition %ungrab-keyboard (Xdisplay time)
|
|
"scx_Ungrab_Keyboard")
|
|
|
|
;; The grab-key function establishes a passive grab on the
|
|
;; keyboard. In the future, the keyboard is actively
|
|
;; grabbed.
|
|
;; ungrab-key releases this passive grab. See XGrabKey and XUngrabKey.
|
|
|
|
(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")
|
|
|
|
;; allow-events function releases some queued events if the client has
|
|
;; caused a device to freeze. See XAllowEvents.
|
|
|
|
(define (allow-events display mode time)
|
|
(%allow-events (display-Xdisplay display)
|
|
mode time))
|
|
|
|
(import-lambda-definition %allow-events (Xdisplay mode time)
|
|
"scx_Allow_Events")
|
|
|
|
;; grab-server disables processing of requests and close downs on all
|
|
;; other connections than the one this request arrived on. You should
|
|
;; not grab the X server any more than is absolutely necessary. See
|
|
;; XGrabServer.
|
|
|
|
(define (grab-server display)
|
|
(%grab-server (display-Xdisplay display)))
|
|
|
|
(import-lambda-definition %grab-server (Xdisplay)
|
|
"scx_Grab_Server")
|
|
|
|
;; ungrab-server restarts processing of requests and close downs on
|
|
;; other connections. You should avoid grabbing the X server as much
|
|
;; as possible. See XUngrabServer.
|
|
|
|
(define (ungrab-server display)
|
|
(%ungrab-server (display-Xdisplay display)))
|
|
|
|
(import-lambda-definition %ungrab-server (Xdisplay)
|
|
"scx_Ungrab_Server")
|
|
|
|
|
|
;; with-server-grabbed not implemented (yet).
|
|
|
|
;;(define-syntax (with-server-grabbed display . body-forms))
|