2001-08-28 10:45:09 -04:00
|
|
|
; The C-procedures for (xlib-release-X-or-later?) are in the
|
|
|
|
; file init.c
|
|
|
|
|
|
|
|
(import-lambda-definition xlib-release-4-or-later? ()
|
|
|
|
"scx_Xlib_Release_4_Or_Later")
|
|
|
|
|
|
|
|
(import-lambda-definition xlib-release-5-or-later? ()
|
|
|
|
"scx_Xlib_Release_5_Or_Later")
|
|
|
|
|
|
|
|
(import-lambda-definition xlib-release-6-or-later? ()
|
|
|
|
"scx_Xlib_Release_6_Or_Later")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; get-default returns the user default values of a specified program
|
|
|
|
;; from the X-resource database. program and option should be
|
|
|
|
;; strings. On success a string is returned, otherwise #f. See
|
|
|
|
;; XGetDefault.
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function get-default (display program option)
|
2001-08-29 10:43:49 -04:00
|
|
|
"scx_Get_Default")
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; resource-manager-string returns the RESOURCE_MANAGER property from
|
|
|
|
;; the server's root window of screen 0, or #f if no such property
|
|
|
|
;; exists. See XResourceManagerString.
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function resource-manager-string (display)
|
2001-08-28 10:45:09 -04:00
|
|
|
"scx_Resource_Manager_String")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; parse-geometry parses a string for the standard X format for x, y,
|
|
|
|
;; width and height arguments. Definition:
|
|
|
|
;; [=][<width>{xX}<height>][{+-}<xoffset>{+-}<yoffset>]. The return
|
|
|
|
;; value is a list (x-negative? y-negative? x y width height), where
|
|
|
|
;; x, y, width, height can be #f if they were not specified in the
|
|
|
|
;; string. See XParseGeometry.
|
2001-08-28 10:45:09 -04:00
|
|
|
|
|
|
|
(define (parse-geometry string)
|
2002-02-08 12:09:43 -05:00
|
|
|
(vector->list (%parse-geometry string)))
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2001-08-29 10:43:49 -04:00
|
|
|
(import-lambda-definition %parse-geometry (string)
|
2001-08-28 10:45:09 -04:00
|
|
|
"scx_Parse_Geometry")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; these are some functions for clipboard handling.
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
(define store-buffer #f)
|
|
|
|
(define store-bytes #f)
|
|
|
|
(define fetch-buffer #f)
|
|
|
|
(define fetch-bytes #f)
|
|
|
|
(define rotate-buffers #f)
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(let ((xa-string 31) ;; from Xatom.h
|
|
|
|
(xa-cut-buffers '(9 10 11 12 13 14 15 16)))
|
2001-08-28 10:45:09 -04:00
|
|
|
;(9...16 are XA_CUT_BUFFER0...XA_CUT_BUFFER7)
|
2003-03-10 21:47:38 -05:00
|
|
|
(set! store-buffer
|
|
|
|
(lambda (dpy bytes buf)
|
|
|
|
(if (<= 0 buf 7)
|
|
|
|
(change-property dpy (default-root-window dpy)
|
|
|
|
(list-ref xa-cut-buffers buf)
|
|
|
|
(change-property-mode replace)
|
|
|
|
(make-property xa-string
|
|
|
|
8
|
|
|
|
bytes)))))
|
2001-08-28 10:45:09 -04:00
|
|
|
|
|
|
|
(set! store-bytes (lambda (dpy bytes)
|
|
|
|
(store-buffer dpy bytes 0)))
|
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(set! fetch-buffer
|
|
|
|
(lambda (dpy buf)
|
|
|
|
(if (<= 0 buf 7)
|
|
|
|
(let ((p (get-full-window-property
|
|
|
|
dpy (default-root-window dpy)
|
|
|
|
(list-ref xa-cut-buffers buf)
|
|
|
|
#f xa-string)))
|
|
|
|
(if (and p (eq? (property:type p) xa-string)
|
|
|
|
(string? (property:data p)))
|
|
|
|
(property:data p)
|
|
|
|
"")))))
|
2001-08-28 10:45:09 -04:00
|
|
|
|
2001-08-29 10:43:49 -04:00
|
|
|
(set! fetch-bytes (lambda (dpy)
|
2001-08-28 10:45:09 -04:00
|
|
|
(fetch-buffer dpy 0)))
|
|
|
|
|
|
|
|
(set! rotate-buffers (lambda (dpy delta)
|
2003-03-10 21:47:38 -05:00
|
|
|
(rotate-window-properties dpy
|
|
|
|
(default-root-window dpy)
|
|
|
|
xa-cut-buffers delta))))
|
2001-08-28 10:45:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|