used lists for the arguments and return values of those functions that did use

vectors before (if vectors were not neccessary).
This commit is contained in:
frese 2001-08-22 11:49:01 +00:00
parent d055618815
commit d4d7f0c759
7 changed files with 36 additions and 34 deletions

View File

@ -37,11 +37,11 @@
(define (query-colors colormap pixels) (define (query-colors colormap pixels)
(let ((res (%query-colors (colormap-Xcolormap colormap) (let ((res (%query-colors (colormap-Xcolormap colormap)
(vector-map! pixel-Xpixel pixels) (vector-map! pixel-Xpixel (list->vector pixels))
(display-Xdisplay (colormap-display colormap))))) (display-Xdisplay (colormap-display colormap)))))
(vector-map! (lambda (r-g-b) (vector->list (vector-map! (lambda (r-g-b)
(apply create-color r-g-b)) (apply create-color r-g-b))
res))) res))))
(import-lambda-definition %query-colors (Xcolormap Xpixels Xdisplay) (import-lambda-definition %query-colors (Xcolormap Xpixels Xdisplay)
"scx_Query_Colors") "scx_Query_Colors")

View File

@ -9,10 +9,10 @@
"scx_GContext_Font") "scx_GContext_Font")
(define (list-font-names display pattern) (define (list-font-names display pattern)
(%list-font-names (display-Xdisplay display) (vector->list (%list-font-names (display-Xdisplay display)
(if (symbol? pattern) (if (symbol? pattern)
(symbol->string pattern) (symbol->string pattern)
pattern))) pattern))))
(import-lambda-definition %list-font-names (Xdisplay pattern) (import-lambda-definition %list-font-names (Xdisplay pattern)
"scx_List_Font_Names") "scx_List_Font_Names")

View File

@ -153,7 +153,7 @@
(%set-dashlist (gcontext-Xgcontext gcontext) (%set-dashlist (gcontext-Xgcontext gcontext)
(display-Xdisplay (gcontext-display gcontext)) (display-Xdisplay (gcontext-display gcontext))
dash-offset dash-offset
dash-list)) (list->vector dash-list)))
(import-lambda-definition %set-dashlist (Xgcontext Xdisplay dashoffset dashlist) (import-lambda-definition %set-dashlist (Xgcontext Xdisplay dashoffset dashlist)
"scx_Set_Gcontext_Dashlist") "scx_Set_Gcontext_Dashlist")
@ -163,7 +163,9 @@
(define (set-gcontext-clip-rectangles! gcontext x y rectangles ordering) (define (set-gcontext-clip-rectangles! gcontext x y rectangles ordering)
(%set-gcontext-clip-rectangles! (gcontext-Xgcontext gcontext) (%set-gcontext-clip-rectangles! (gcontext-Xgcontext gcontext)
(display-Xdisplay (gcontext-display gcontext)) (display-Xdisplay (gcontext-display gcontext))
x y rectangles ordering)) x y
(list->vector rectangles)
ordering))
(import-lambda-definition %set-gcontext-clip-rectangles! (Xgcontext Xdisplay x (import-lambda-definition %set-gcontext-clip-rectangles! (Xgcontext Xdisplay x
y v ord) y v ord)

View File

@ -63,11 +63,11 @@
;; _____ ;; _____
(define (draw-points drawable gcontext vector-of-points relative?) (define (draw-points drawable gcontext points relative?)
(%draw-point (display-Xdisplay (drawable-display drawable)) (%draw-point (display-Xdisplay (drawable-display drawable))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-points (list->vector points)
relative?)) relative?))
(import-lambda-definition %draw-points (Xdisplay Xdrawable Xgcontext vec (import-lambda-definition %draw-points (Xdisplay Xdrawable Xgcontext vec
@ -90,11 +90,11 @@
;; _____ ;; _____
(define (draw-lines drawable gcontext vector-of-points relative?) (define (draw-lines drawable gcontext points relative?)
(%draw-lines (display-Xdisplay (drawable-display drawable)) (%draw-lines (display-Xdisplay (drawable-display drawable))
(drawalbe-Xobject drawable) (drawalbe-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-points (list->vector points)
relative?)) relative?))
(import-lambda-definition %draw-lines (Xdisplay Xdrawable Xgcontext vec rel) (import-lambda-definition %draw-lines (Xdisplay Xdrawable Xgcontext vec rel)
@ -102,14 +102,14 @@
;; _____ ;; _____
;; Note: vector-of-points is a vector which contains a list with 4 ;; Note: points is a list which contains lists with 4
;; integers in Form: (x1, y1, x2, y2) ;; integers in Form: (x1, y1, x2, y2)
(define (draw-segments drawalbe gcontext vector-of-points) (define (draw-segments drawalbe gcontext points)
(%draw-segments (display-Xdisplay (drawable-display drawalbe)) (%draw-segments (display-Xdisplay (drawable-display drawalbe))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-points)) (list->vector points)))
(import-lambda-definition %draw-segments (Xdisplay Xdrawable Xgcontext vec) (import-lambda-definition %draw-segments (Xdisplay Xdrawable Xgcontext vec)
"Draw_Segments") "Draw_Segments")
@ -136,22 +136,22 @@
"scx_Fill_Rectangle") "scx_Fill_Rectangle")
(define (draw-rectangles drawable gcontext vector-of-rectangles) (define (draw-rectangles drawable gcontext rectangles)
(%draw-rectangles (display-Xdisplay (drawable-display drawable)) (%draw-rectangles (display-Xdisplay (drawable-display drawable))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-rectangles)) (list->vector rectangles)))
(import-lambda-definition %draw-rectangles (Xdisplay Xdrawable Xgcontext (import-lambda-definition %draw-rectangles (Xdisplay Xdrawable Xgcontext
vec) vec)
"scx_Draw_Rectangles") "scx_Draw_Rectangles")
(define (fill-rectangles drawable gcontext vector-of-rectangles) (define (fill-rectangles drawable gcontext rectangles)
(%fill-rectangles (display-Xdisplay (drawable-display drawable)) (%fill-rectangles (display-Xdisplay (drawable-display drawable))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-rectangles)) (list->vector rectangles)))
(import-lambda-definition %fill-rectangles (Xdisplay Xdrawable Xgcontext (import-lambda-definition %fill-rectangles (Xdisplay Xdrawable Xgcontext
vec) vec)
@ -179,29 +179,29 @@
w h a1 a2) w h a1 a2)
"scx_Fill_Arc") "scx_Fill_Arc")
(define (draw-arcs drawable gcontext vector-of-data) (define (draw-arcs drawable gcontext data)
(%draw-arcs (display-Xdisplay (drawable-display drawable)) (%draw-arcs (display-Xdisplay (drawable-display drawable))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-data)) (list->vector data)))
(import-lambda-definition %draw-arcs (Xdisplay Xdrawable Xgcontext vec) (import-lambda-definition %draw-arcs (Xdisplay Xdrawable Xgcontext vec)
"scx_Draw_Arcs") "scx_Draw_Arcs")
(define (fill-arcs drawable gcontext vector-of-data) (define (fill-arcs drawable gcontext data)
(%fill-arcs (display-Xdisplay (drawable-display drawable)) (%fill-arcs (display-Xdisplay (drawable-display drawable))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-data)) (list->vector data)))
(import-lambda-definition %fill-arcs (Xdisplay Xdrawable Xgcontext vec) (import-lambda-definition %fill-arcs (Xdisplay Xdrawable Xgcontext vec)
"scx_Fill_Arcs") "scx_Fill_Arcs")
(define (fill-polygon drawable gcontext vector-of-points relative? shape) (define (fill-polygon drawable gcontext points relative? shape)
(%fill-polygon (display-Xdisplay (drawable-display drawable)) (%fill-polygon (display-Xdisplay (drawable-display drawable))
(drawable-Xobject drawable) (drawable-Xobject drawable)
(gcontext-Xgcontext gcontext) (gcontext-Xgcontext gcontext)
vector-of-points relative? shape)) (list->vector points) relative? shape))
(import-lambda-definition %fill-polygon (Xdisplay Xdrawable Xgcontext (import-lambda-definition %fill-polygon (Xdisplay Xdrawable Xgcontext
vec relative shape) vec relative shape)

View File

@ -38,9 +38,9 @@
; --- RETURN: vector of atoms ; --- RETURN: vector of atoms
(define (list-properties window) (define (list-properties window)
(let ((atom (%list-properties (display-Xdisplay (window-display window)) (let ((atoms (%list-properties (display-Xdisplay (window-display window))
(window-Xwindow window)))) (window-Xwindow window))))
(vector-map! make-atom atom))) (vector->list (vector-map! make-atom atoms))))
(import-lambda-definition %list-properties (Xdisplay Xwindow) (import-lambda-definition %list-properties (Xdisplay Xwindow)

View File

@ -50,7 +50,7 @@
(append (reverse (append (reverse
(mixed-text->pure-text (string->list e))) (mixed-text->pure-text (string->list e)))
rev-list)) rev-list))
(else (error "wrong element in list" list e))))))))) (else (error "wrong element in text list" list e)))))))))
; --- separate-fonts converts a list of mixed types (including fonts) like this: ; --- separate-fonts converts a list of mixed types (including fonts) like this:
; (13 "abc" font 'abc) -> ((13 "abc") font ('abc)) or ; (13 "abc" font 'abc) -> ((13 "abc") font ('abc)) or

View File

@ -283,9 +283,9 @@
(list (list
(make-window (vector-ref res 0) display #f) (make-window (vector-ref res 0) display #f)
(make-window (vector-ref res 1) display #f) (make-window (vector-ref res 1) display #f)
(vector-map! (lambda (Xwindow) (vector->list (vector-map! (lambda (Xwindow)
(make-window Xwindow display #f)) (make-window Xwindow display #f))
(vector-ref res 2))))) (vector-ref res 2))))))
(import-lambda-definition %query-tree (Xwindow Xdisplay) (import-lambda-definition %query-tree (Xwindow Xdisplay)
"scx_Query_Tree") "scx_Query_Tree")