From cf6bc394919fbd302a047a4c5a1dffb75a5d69d3 Mon Sep 17 00:00:00 2001 From: frese Date: Mon, 30 Jul 2001 14:39:14 +0000 Subject: [PATCH] updated functions to pass/receive vectors not lists from the c-routines. --- scheme/xlib/window.scm | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/scheme/xlib/window.scm b/scheme/xlib/window.scm index 4b01f64..6b97311 100644 --- a/scheme/xlib/window.scm +++ b/scheme/xlib/window.scm @@ -11,7 +11,18 @@ (receive (x y width height border-width parent change-win-attr-list) (alist-split alist '((x . 0) (y . 0) (width . #f) (height . #f) (border-width . 2) (parent . #f))) - (let* ((display (window-display parent)) + (let* ((change-win-attr-list + (map cons + (map car change-win-attr-list) + (map (lambda (obj) + (cond + ((pixel? obj) (pixel-Xpixel obj)) + ((pixmap? obj) (pixmap-Xpixmap obj)) + ((colormap? obj) (colormap-Xcolormap obj)) + ;; cursor...?? + (else obj))) + (map cdr change-win-attr-list)))) + (display (window-display parent)) (Xwindow (%create-window (display-Xdisplay display) (window-Xwindow parent) x y width height border-width @@ -269,11 +280,12 @@ (let* ((display (window-display window)) (res (%query-tree (window-Xwindow window) (display-Xdisplay display)))) - (list (make-window (first res) display #f) - (make-window (second res) display #f) - (vector-map! (lambda (Xwindow) - (make-window Xwindow display #f)) - (third res))))) + (list + (make-window (vector-ref res 0) display #f) + (make-window (vector-ref res 1) display #f) + (vector-map! (lambda (Xwindow) + (make-window Xwindow display #f)) + (vector-ref res 2))))) (import-lambda-definition %query-tree (Xwindow Xdisplay) "Query_Tree") @@ -292,9 +304,9 @@ x y (window-Xwindow dst-window)))) (if res - (list (first res) - (second res) - (make-window (third res) display #f)) + (begin + (vector-set! res 2 (make-window (vector-ref res 2) display #f)) + (vector->list res)) #f))) (import-lambda-definition %translate-coordinates (Xdisplay srcXwindow x y @@ -311,14 +323,9 @@ (let* ((display (window-display window)) (res (%query-pointer (display-Xdisplay display) (window-Xwindow window)))) - (list (first res) - (second res) - (third res) - (make-window (fourth res) display #f) - (fifth res) - (sixth res) - (make-window (seventh res) display #f) - (eighth res)))) + (vector-set! res 3 (make-window (vector-ref res 3) display #f)) + (vector-set! res 6 (make-window (vector-ref res 6) display #f)) + (vector->list res))) (import-lambda-definition %query-pointer (Xdisplay Xwindow) "Query_Pointer") \ No newline at end of file