2001-10-09 11:32:54 -04:00
|
|
|
;; iconfiy-window send a WM_CHANGE_STATE message (in an appropiate
|
|
|
|
;; format), to the root window of the specified screen. See
|
|
|
|
;; XIconifyWindow.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (iconify-window window screen-number)
|
|
|
|
(check-screen-number (window-display window) screen-number)
|
|
|
|
(if (not (%iconify-window (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
screen-number))
|
|
|
|
(error "cannot iconify window"
|
|
|
|
window)))
|
|
|
|
|
|
|
|
(import-lambda-definition %iconify-window (Xdisplay Xwindow scr-num)
|
|
|
|
"scx_Iconify_Window")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; withdraw-window unmaps the specified window and sends a synthetic
|
|
|
|
;; UnmapNotify event to the root window of the specified screen. See
|
|
|
|
;; XWithdrawWindow.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (withdraw-window window screen-number)
|
|
|
|
(check-screen-number screen-number)
|
|
|
|
(if (not (%withdraw-window (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
screen-number))
|
|
|
|
(error "cannot withdraw window"
|
|
|
|
window)))
|
|
|
|
|
|
|
|
(import-lambda-definition %withdraw-window (Xdisplay Xwindow scr-num)
|
|
|
|
"scx_Withdraw_Window")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; reconfigure-wm-window change attributes of the specified window
|
|
|
|
;; similar to configure-window, or sends a ConfigureRequestEvent to
|
|
|
|
;; the root window if that fails. See XReconfigureWMWindow. See
|
|
|
|
;; configure-window.
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (reconfigure-wm-window window screen-number window-change-alist)
|
2001-08-21 10:45:32 -04:00
|
|
|
(check-screen-number screen-number)
|
|
|
|
(if (not (%reconfigure-wm-window (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
screen-number
|
2002-02-08 12:09:43 -05:00
|
|
|
(window-change-alist->integer+vector
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
window-change-alist)))
|
2001-08-21 10:45:32 -04:00
|
|
|
(error "cannot reconfigure window"
|
|
|
|
window)))
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(import-lambda-definition %reconfigure-wm-window
|
|
|
|
(Xdisplay Xwindow scrnum changes)
|
2001-08-21 10:45:32 -04:00
|
|
|
"scx_Reconfigure_Wm_Window")
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; get-wm-command reads the WM_COMMAND property from the specified
|
|
|
|
;; window and returns is as a list of strings. See XGetCommand.
|
2001-10-09 11:32:54 -04:00
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-command window)
|
2001-08-21 10:45:32 -04:00
|
|
|
(vector->list (%wm-command (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window))))
|
|
|
|
|
|
|
|
(import-lambda-definition %wm-command (Xdisplay Xwindow)
|
|
|
|
"scx_Wm_Command")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-wm-command! sets the WM_COMMAND property (the command and
|
|
|
|
;; arguments used to invoke the application). The command has to be
|
|
|
|
;; specified as a list of string or symbols. See XSetCommand.
|
|
|
|
|
|
|
|
(define (set-wm-command! window command)
|
|
|
|
(%set-wm-command! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
(list->vector (map (lambda (x)
|
|
|
|
(if (symbol? x)
|
|
|
|
(symbol->string x)
|
|
|
|
x))
|
|
|
|
command))))
|
|
|
|
|
2001-10-30 09:31:36 -05:00
|
|
|
(import-lambda-definition %set-wm-command! (Xdisplay Xwindow command)
|
2001-10-09 11:32:54 -04:00
|
|
|
"scx_Set_Wm_Command")
|
|
|
|
|
|
|
|
;; get-text-property returns the property specified by atom of the
|
|
|
|
;; specified window as a list of strings. See XGetTextProperty.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (get-text-property window atom)
|
|
|
|
(let ((res (%get-text-property (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
(atom-Xatom atom))))
|
|
|
|
(cond
|
|
|
|
((eq? res #t) #f)
|
|
|
|
((eq? res #f) (error "cannot create string list from text property"))
|
|
|
|
(else (vector->list res)))))
|
|
|
|
|
|
|
|
(import-lambda-definition %get-text-property (Xdisplay Xwindow Xatom)
|
|
|
|
"scx_Get_Text_Property")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-text-property! sets the property specified by atom of the
|
|
|
|
;; specified window to value - a list of strings or symbols.
|
|
|
|
|
2002-02-08 12:09:43 -05:00
|
|
|
(define (s->s s)
|
|
|
|
(if (symbol? s)
|
|
|
|
(symbol->string s)
|
|
|
|
s))
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (set-text-property! window value atom)
|
|
|
|
(let ((res (%set-text-property! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
2002-02-08 12:09:43 -05:00
|
|
|
(list->vector (map s->s value))
|
2001-08-21 10:45:32 -04:00
|
|
|
(atom-Xatom atom))))
|
|
|
|
(if res
|
|
|
|
res
|
|
|
|
(error "cannot create text property from string list" value))))
|
|
|
|
|
|
|
|
(import-lambda-definition %set-text-property! (Xdisplay Xwindow value XAtom)
|
|
|
|
"scx_Set_Text_Property")
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; get-wm-protocols function returns the list of atoms stored in the
|
2001-10-09 11:32:54 -04:00
|
|
|
;; WM_PROTOCOLS property on the specified window. These atoms describe
|
|
|
|
;; window manager protocols in which the owner of this window is
|
|
|
|
;; willing to participate. See XGetWMProtocols.
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-protocols window)
|
2001-08-21 10:45:32 -04:00
|
|
|
(let ((res (%wm-protocols (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window))))
|
|
|
|
(if res
|
|
|
|
(map make-atom
|
|
|
|
(vector->list res))
|
|
|
|
(error "cannot get WM protocols"))))
|
|
|
|
|
|
|
|
(import-lambda-definition %wm-protocols (Xdisplay Xwindow)
|
|
|
|
"scx_Wm_Protocols")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-wm-protocols! sets the WM_PROTOCOLS property of the specified
|
|
|
|
;; window. protocols has to be a list of atoms. See XSetWMProtocols.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (set-wm-protocols! window protocols)
|
|
|
|
(let ((res (%set-wm-protocols! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
(list->vector (map atom-Xatom protocols)))))
|
|
|
|
(if res
|
|
|
|
res
|
|
|
|
(error "cannot set WM protocols" protocols))))
|
|
|
|
|
|
|
|
(import-lambda-definition %set-wm-protocols! (Xdisplay Xwindow protocols)
|
|
|
|
"scx_Set_Wm_Protocols")
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; get-wm-class returns the class hint for the specified window. See
|
2001-10-09 11:32:54 -04:00
|
|
|
;; XGetClassHint.
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-class window)
|
2001-08-21 10:45:32 -04:00
|
|
|
(let ((res (%wm-class (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window))))
|
|
|
|
(if res
|
|
|
|
res
|
|
|
|
(error "cannot get WM class hint"))))
|
|
|
|
|
|
|
|
(import-lambda-definition %wm-class (Xdisplay Xwindow)
|
|
|
|
"scx_Wm_Class")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-wm-class! sets the class hint for the specified window. See
|
|
|
|
;; XSetClassHint.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (set-wm-class! window name class)
|
|
|
|
(%set-wm-class! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
(if (symbol? name)
|
|
|
|
(symbol->string name)
|
|
|
|
name)
|
|
|
|
(if (symbol? class)
|
|
|
|
(symbol->string class)
|
|
|
|
class)))
|
|
|
|
|
|
|
|
(import-lambda-definition %set-wm-class! (Xdisplay Xwindow name class)
|
|
|
|
"scx_Set_Wm_Class")
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; enumerated type for the XWMHints type. used by set-wm-hints! and
|
|
|
|
;; get-wm-hints.
|
|
|
|
|
2002-02-08 12:09:43 -05:00
|
|
|
(define-enumerated-type initial-state :initial-state
|
|
|
|
initial-state? initial-states initial-state-name initial-state-index
|
|
|
|
(withdrawn normal initial-state-2 iconic initial-state-4))
|
|
|
|
|
|
|
|
(define (initial-state->integer v)
|
|
|
|
(initial-state-index v))
|
|
|
|
|
|
|
|
(define (integer->initial-state i)
|
|
|
|
(vector-ref initial-states i))
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define-enumerated-type wm-hint :wm-hint
|
|
|
|
wm-hint?
|
|
|
|
wm-hints
|
|
|
|
wm-hint-name
|
|
|
|
wm-hint-index
|
|
|
|
(input? initial-state icon-pixmap icon-window icon-position icon-mask
|
|
|
|
window-group urgency))
|
|
|
|
|
2002-02-06 08:54:56 -05:00
|
|
|
(define-syntax make-wm-hint-alist
|
|
|
|
(syntax-rules
|
|
|
|
()
|
|
|
|
((make-wm-hint-alist (attr arg) rest ...)
|
|
|
|
(cons (cons (wm-hint attr) arg)
|
|
|
|
(make-wm-hint-alist rest ...)))
|
|
|
|
((make-wm-hint-alist)
|
|
|
|
'())))
|
|
|
|
|
2002-02-08 12:09:43 -05:00
|
|
|
(define wm-hint-alist->integer+vector
|
|
|
|
(make-enum-alist->integer+vector
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
wm-hints wm-hint-index
|
2002-02-08 12:09:43 -05:00
|
|
|
(lambda (v)
|
|
|
|
(cond
|
|
|
|
((or (eq? v (wm-hint input?))
|
|
|
|
(eq? v (wm-hint urgency)))
|
|
|
|
(lambda (x) x))
|
|
|
|
((eq? v (wm-hint initial-state))
|
|
|
|
initial-state->integer)
|
|
|
|
((or (eq? v (wm-hint icon-pixmap))
|
|
|
|
(eq? v (wm-hint icon-mask)))
|
|
|
|
pixmap-Xpixmap)
|
|
|
|
((or (eq? v (wm-hint icon-window))
|
|
|
|
(eq? v (wm-hint window-group)))
|
|
|
|
window-Xwindow)
|
|
|
|
((eq? v (wm-hint icon-position))
|
|
|
|
(lambda (x) x))))))
|
|
|
|
|
|
|
|
(define (integer+vector->wm-hint-alist display)
|
|
|
|
(make-integer+vector->enum-alist
|
|
|
|
wm-hints wm-hint-index
|
|
|
|
(lambda (v)
|
|
|
|
(cond
|
|
|
|
((or (eq? v (wm-hint input?))
|
|
|
|
(eq? v (wm-hint urgency)))
|
|
|
|
(lambda (x) x))
|
|
|
|
((eq? v (wm-hint initial-state))
|
|
|
|
integer->initial-state)
|
|
|
|
((or (eq? v (wm-hint icon-pixmap))
|
|
|
|
(eq? v (wm-hint icon-mask)))
|
|
|
|
(lambda (Xpixmap)
|
|
|
|
(make-pixmap Xpixmap display #f)))
|
|
|
|
((or (eq? v (wm-hint icon-window))
|
|
|
|
(eq? v (wm-hint window-group)))
|
|
|
|
(lambda (Xwindow)
|
|
|
|
(make-window Xwindow display #f)))
|
|
|
|
((eq? v (wm-hint icon-position))
|
|
|
|
(lambda (x) x))))))
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
|
|
|
|
;; get-wm-hints reads the window manager hints and returns them as an
|
|
|
|
;; alist mapping wm-hint types to specific values. If a hints is not
|
|
|
|
;; defined, it is not included in the alist. See wm-hint. See
|
|
|
|
;; XGetWMHints for a description.
|
|
|
|
|
|
|
|
(define (get-wm-hints window)
|
2001-08-21 10:45:32 -04:00
|
|
|
(let ((res (%wm-hints (display-Xdisplay (window-display window))
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(window-Xwindow window))))
|
|
|
|
(filter (lambda (x) (not (null? (cdr x))))
|
2002-02-08 12:09:43 -05:00
|
|
|
((integer+vector->wm-hint-alist (window-display window)) res))))
|
2001-08-21 10:45:32 -04:00
|
|
|
|
|
|
|
(import-lambda-definition %wm-hints (Xdisplay Xwindow)
|
|
|
|
"scx_Wm_Hints")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-wm-hints! sets the specified window manager hints. The hints
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; must be specified as an alist of wm-hint values (see above) mapping
|
|
|
|
;; to the appropiate values. See XSetWMHints.
|
2001-10-09 11:32:54 -04:00
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (set-wm-hints! window wm-hint-alist)
|
2001-08-21 10:45:32 -04:00
|
|
|
(%set-wm-hints! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
2002-02-08 12:09:43 -05:00
|
|
|
(wm-hint-alist->integer+vector wm-hint-alist)))
|
2001-08-21 10:45:32 -04:00
|
|
|
|
|
|
|
(import-lambda-definition %set-wm-hints! (Xdisplay Xwindow args)
|
|
|
|
"scx_Set_Wm_Hints")
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; get-transient-for returns the WM_TRANSIENT_FOR property for the
|
2001-10-09 11:32:54 -04:00
|
|
|
;; specified window. The value of that property is a window. See
|
|
|
|
;; XGetTransientForHint.
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-transient-for window)
|
2001-10-30 09:31:36 -05:00
|
|
|
(make-window (%transient-for (display-Xdisplay (window-display window))
|
2001-08-21 10:45:32 -04:00
|
|
|
(window-Xwindow window))
|
|
|
|
(window-display window)
|
|
|
|
#f))
|
|
|
|
|
|
|
|
(import-lambda-definition %transient-for (Xdisplay Xwindow)
|
|
|
|
"scx_Transient_For")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-transient-for! sets the WM_TRANSIENT_FOR property of the
|
|
|
|
;; specified window to the specified property-window. See
|
|
|
|
;; XSetTransientForHint.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (set-transient-for! window property-window)
|
2001-10-30 09:31:36 -05:00
|
|
|
(%set-transient-for! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
(window-Xwindow property-window)))
|
2001-08-21 10:45:32 -04:00
|
|
|
|
|
|
|
(import-lambda-definition %set-transient-for! (Xdisplay Xwindow
|
|
|
|
Xpropertywindow)
|
|
|
|
"scx_Set_Transient_For")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; The following function a wrappers for the get/set-text-property
|
|
|
|
;; function.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define xa-wm-name (make-atom 39))
|
|
|
|
(define xa-wm-icon-name (make-atom 37))
|
|
|
|
(define xa-wm-client-machine (make-atom 36))
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-name w)
|
2001-08-21 10:45:32 -04:00
|
|
|
(get-text-property w xa-wm-name))
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-icon-name w)
|
2001-08-21 10:45:32 -04:00
|
|
|
(get-text-property w xa-wm-icon-name))
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-client-machine w)
|
2001-08-21 10:45:32 -04:00
|
|
|
(get-text-property w xa-wm-client-machine))
|
|
|
|
|
|
|
|
(define (set-wm-name! w s)
|
|
|
|
(set-text-property! w s xa-wm-name))
|
|
|
|
|
|
|
|
(define (set-wm-icon-name! w s)
|
|
|
|
(set-text-property! w s xa-wm-icon-name))
|
|
|
|
|
|
|
|
(define (set-wm-client-machine! w s)
|
|
|
|
(set-text-property! w s xa-wm-client-machine))
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; an enumerated type for XSizeHints used by get-wm-normal-hints and
|
|
|
|
;; set-wm-normal-hints!
|
|
|
|
|
|
|
|
(define-enumerated-type size-hint :size-hint
|
|
|
|
size-hint?
|
|
|
|
size-hints
|
|
|
|
size-hint-name
|
|
|
|
size-hint-index
|
|
|
|
;; aspect should have the form ((min-x . min-y) . (max-x . max-y))
|
|
|
|
;; for win-gravity see gravity in create-window.
|
|
|
|
;; the other hints must be pairs of integers - (x . y) or (width . height)
|
|
|
|
;; us-position, us-size .....!!??
|
|
|
|
(us-position us-size position size min-size max-size resize-inc aspect
|
|
|
|
base-size win-gravity))
|
|
|
|
|
2002-02-06 08:54:56 -05:00
|
|
|
(define-syntax make-size-hint-alist
|
|
|
|
(syntax-rules
|
|
|
|
()
|
|
|
|
((make-size-hint-alist (attr arg) rest ...)
|
|
|
|
(cons (cons (size-hint attr) arg)
|
|
|
|
(make-size-hint-alist rest ...)))
|
|
|
|
((make-size-hint-alist)
|
|
|
|
'())))
|
|
|
|
|
2002-02-08 12:09:43 -05:00
|
|
|
(define size-hint-alist->integer+vector
|
|
|
|
(make-enum-alist->integer+vector
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
size-hints size-hint-index
|
2002-02-08 12:09:43 -05:00
|
|
|
(lambda (v)
|
|
|
|
(cond
|
|
|
|
((eq? v (size-hint win-gravity))
|
|
|
|
gravity->integer)
|
|
|
|
(else (lambda (x) x))))))
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
|
2002-02-08 12:09:43 -05:00
|
|
|
(define integer+vector->size-hint-alist
|
2002-02-25 08:10:11 -05:00
|
|
|
(make-integer+vector->enum-alist
|
|
|
|
size-hints size-hint-index
|
2002-02-08 12:09:43 -05:00
|
|
|
(lambda (v)
|
|
|
|
(cond
|
|
|
|
((eq? v (size-hint win-gravity))
|
|
|
|
integer->gravity)
|
|
|
|
(else (lambda (x) x))))))
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
|
|
|
|
;; get-wm-normal-hints/set-wm-normal-hints! get or set the size hints
|
2001-10-09 11:32:54 -04:00
|
|
|
;; stored in the WM_NORMAL_HINTS property on the specified window. The
|
|
|
|
;; hints are '(x y width height us-position us-size min-width
|
|
|
|
;; min-height max-width max-height width-inc height-inc min-aspect-x
|
|
|
|
;; min-aspect-y max-aspect-x max-aspect-y base-width base-height
|
|
|
|
;; gravity). See XGetWMNormalHints, XSetWMNormalHints.
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-wm-normal-hints window)
|
2001-08-29 10:43:49 -04:00
|
|
|
(let* ((v (%wm-normal-hints (display-Xdisplay (window-display window))
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(window-Xwindow window))))
|
2002-02-25 08:10:11 -05:00
|
|
|
(integer+vector->size-hint-alist v)))
|
2001-08-29 10:43:49 -04:00
|
|
|
|
|
|
|
(import-lambda-definition %wm-normal-hints (Xdisplay Xwindow)
|
|
|
|
"scx_Wm_Normal_Hints")
|
2001-08-21 10:45:32 -04:00
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (set-wm-normal-hints! window size-hint-alist)
|
2002-02-25 08:10:11 -05:00
|
|
|
(%set-wm-normal-hints! (display-Xdisplay (window-display window))
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(window-Xwindow window)
|
2002-02-08 12:09:43 -05:00
|
|
|
(size-hint-alist->integer+vector size-hint-alist)))
|
2001-08-21 10:45:32 -04:00
|
|
|
|
2001-10-30 09:31:36 -05:00
|
|
|
(import-lambda-definition %set-wm-normal-hints! (Xdisplay Xwindow alist)
|
2001-08-29 10:43:49 -04:00
|
|
|
"scx_Set_Wm_Normal_Hints")
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
;; get-icon-sizes returns the icon sizes specified by a window manager as
|
2001-10-09 11:32:54 -04:00
|
|
|
;; a list. If no icon sizes are specified the list is empty. An icon
|
|
|
|
;; size itself is a list consisting of integers meaning '(min-width
|
|
|
|
;; min-height max-width max-height width-inc height-inc). See
|
|
|
|
;; XGetIconSizes.
|
|
|
|
|
- changed variable arguments and return values in set-wm-hints!,
get-wm-hints, set-wm-normal-hints!, get-wm-normal-hints,
create-gcontext, change-gcontext, get-visual-info,
change-window-attributes, get-window-attributes, configure-window,
create-window to use an enumerated type instead of symbols.
- renamed functions in xlib-client (e.g. wm-hints to get-wm-hints).
2002-01-06 11:53:13 -05:00
|
|
|
(define (get-icon-sizes window)
|
2001-08-21 10:45:32 -04:00
|
|
|
(let ((r (%icon-sizes (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window))))
|
|
|
|
(map vector->list
|
|
|
|
(vector->list r))))
|
|
|
|
|
|
|
|
(import-lambda-definition %icon-sizes (Xdisplay Xwindow)
|
|
|
|
"scx_Icon_Sizes")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; set-icon-sizes! is used only by window managers to set the
|
|
|
|
;; supported icon sizes. See icon-sizes, XSetIconSizes.
|
|
|
|
|
2001-08-21 10:45:32 -04:00
|
|
|
(define (set-icon-sizes! window icon-sizes)
|
|
|
|
(%set-icon-sizes! (display-Xdisplay (window-display window))
|
|
|
|
(window-Xwindow window)
|
|
|
|
(list->vector (map list->vector icon-sizes))))
|
|
|
|
|
|
|
|
(import-lambda-definition %set-icon-sizes! (Xdisplay Xwindow sizes)
|
|
|
|
"scx_Set_Icon_Sizes")
|