fixed typos and forgotten parameters etc. fixed display-after-function.
This commit is contained in:
parent
cf6bc39491
commit
1e1cac1d34
|
@ -37,9 +37,10 @@
|
||||||
|
|
||||||
(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 pixels)
|
||||||
|
(display-Xdisplay (colormap-display colormap)))))
|
||||||
(vector-map! (lambda (r-g-b)
|
(vector-map! (lambda (r-g-b)
|
||||||
(apply make-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)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
colormap)))))
|
colormap)))))
|
||||||
|
|
||||||
(define (free-colormap colormap)
|
(define (free-colormap colormap)
|
||||||
(let ((Xcolormap (colormap-Xcolormap)))
|
(let ((Xcolormap (colormap-Xcolormap colormap)))
|
||||||
(if (integer? Xcolormap)
|
(if (integer? Xcolormap)
|
||||||
(begin
|
(begin
|
||||||
(%free-colormap Xcolormap
|
(%free-colormap Xcolormap
|
||||||
|
|
|
@ -23,9 +23,14 @@
|
||||||
(let ((Xres (%alloc-named-color (colormap-Xcolormap colormap)
|
(let ((Xres (%alloc-named-color (colormap-Xcolormap colormap)
|
||||||
(if (symbol? color-name)
|
(if (symbol? color-name)
|
||||||
(symbol->string color-name)
|
(symbol->string color-name)
|
||||||
color-name))))
|
color-name)
|
||||||
|
(display-Xdisplay
|
||||||
|
(colormap-display colormap)))))
|
||||||
(if Xres
|
(if Xres
|
||||||
(list (make-pixel (car Xres))
|
(list (make-pixel (car Xres))
|
||||||
(apply make-color (cadr Xres))
|
(apply create-color (cadr Xres))
|
||||||
(apply make-color (caddr Xres)))
|
(apply create-color (caddr Xres)))
|
||||||
Xres)))
|
Xres)))
|
||||||
|
|
||||||
|
(import-lambda-definition %alloc-named-color (Xcolormap name Xdisplay)
|
||||||
|
"Alloc_Named_Color")
|
|
@ -3,9 +3,14 @@
|
||||||
(define-record-type display :display
|
(define-record-type display :display
|
||||||
(really-make-display after-function Xdisplay)
|
(really-make-display after-function Xdisplay)
|
||||||
display?
|
display?
|
||||||
(after-function display-after-function display-set-after-function!)
|
(after-function display-after-function real-display-set-after-function!)
|
||||||
(Xdisplay display-Xdisplay display-set-Xdisplay!))
|
(Xdisplay display-Xdisplay display-set-Xdisplay!))
|
||||||
|
|
||||||
|
(define (display-set-after-function! display proc)
|
||||||
|
(let ((old (display-after-function display)))
|
||||||
|
(real-display-set-after-function! display proc)
|
||||||
|
old))
|
||||||
|
|
||||||
(define (make-display Xdisplay finalize?)
|
(define (make-display Xdisplay finalize?)
|
||||||
(let ((maybe-display (display-list-find Xdisplay)))
|
(let ((maybe-display (display-list-find Xdisplay)))
|
||||||
(if maybe-display
|
(if maybe-display
|
||||||
|
@ -26,9 +31,10 @@
|
||||||
(let ((Xdisplay (display-Xdisplay display)))
|
(let ((Xdisplay (display-Xdisplay display)))
|
||||||
(if (integer? Xdisplay)
|
(if (integer? Xdisplay)
|
||||||
(begin
|
(begin
|
||||||
((display-after-function display) display)
|
(if (display-after-function display)
|
||||||
|
((display-after-function display) display))
|
||||||
(%close-display Xdisplay)
|
(%close-display Xdisplay)
|
||||||
(display-set-Xdisplay display 'already-closed)))))
|
(display-set-Xdisplay! display 'already-closed)))))
|
||||||
|
|
||||||
(import-lambda-definition %close-display (Xdisplay) "Close_Display")
|
(import-lambda-definition %close-display (Xdisplay) "Close_Display")
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
(define (display-default-root-window display)
|
(define (display-default-root-window display)
|
||||||
(let* ((Xdisplay (display-Xdisplay display))
|
(let* ((Xdisplay (display-Xdisplay display))
|
||||||
(Xwindow (%default-root-window Xdisplay)))
|
(Xwindow (%default-root-window Xdisplay)))
|
||||||
(make-window Xwindow (make-display Xdisplay) #f)))
|
(make-window Xwindow (make-display Xdisplay #f) #f)))
|
||||||
|
|
||||||
;; for compatibility with Elk.
|
;; for compatibility with Elk.
|
||||||
(define display-root-window display-default-root-window)
|
(define display-root-window display-default-root-window)
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
(%display-wait-output (display-Xdisplay display)
|
(%display-wait-output (display-Xdisplay display)
|
||||||
discard-events?))
|
discard-events?))
|
||||||
|
|
||||||
(import-lambda-definition %display-wait-ouput (Xdisplay discard)
|
(import-lambda-definition %display-wait-output (Xdisplay discard)
|
||||||
"Display_Wait_Output")
|
"Display_Wait_Output")
|
||||||
|
|
||||||
;; display-no-op sends a NoOperation protocol request to the X server, thereby
|
;; display-no-op sends a NoOperation protocol request to the X server, thereby
|
||||||
|
@ -254,7 +254,7 @@
|
||||||
|
|
||||||
(define (display-list-depths display screen-number)
|
(define (display-list-depths display screen-number)
|
||||||
(%display-list-depths (display-Xdisplay display)
|
(%display-list-depths (display-Xdisplay display)
|
||||||
(check-screen-number screen-number)))
|
(check-screen-number display screen-number)))
|
||||||
|
|
||||||
(import-lambda-definition %display-list-depths (Xdisplay scr)
|
(import-lambda-definition %display-list-depths (Xdisplay scr)
|
||||||
"List_Depths")
|
"List_Depths")
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
"Get_Geometry")
|
"Get_Geometry")
|
||||||
|
|
||||||
(define (get-geometry drawable)
|
(define (get-geometry drawable)
|
||||||
(let ((display (drawable-display drawable))
|
(let* ((display (drawable-display drawable))
|
||||||
(v (%get-geometry (display-Xdisplay display)
|
(v (%get-geometry (display-Xdisplay display)
|
||||||
(drawable-Xobject drawable))))
|
(drawable-Xobject drawable))))
|
||||||
;; wrap the root-window
|
;; wrap the root-window
|
||||||
(vector-set! v 0 (make-window (vector-ref v 0) display #f))
|
(vector-set! v 0 (make-window (vector-ref v 0) display #f))
|
||||||
v))
|
v))
|
||||||
|
|
|
@ -2,10 +2,15 @@
|
||||||
(really-make-font name Xfont Xfontstruct display)
|
(really-make-font name Xfont Xfontstruct display)
|
||||||
font?
|
font?
|
||||||
(name font-name font-set-name!)
|
(name font-name font-set-name!)
|
||||||
(Xfont font-Xfont font-set-Xfont!)
|
(Xfont real-font-Xfont font-set-Xfont!)
|
||||||
(Xfontstruct font-Xfontstruct font-set-Xfontstruct!)
|
(Xfontstruct font-Xfontstruct font-set-Xfontstruct!)
|
||||||
(display font-display font-set-display!))
|
(display font-display font-set-display!))
|
||||||
|
|
||||||
|
(define (font-Xfont font)
|
||||||
|
(if (none-resource? font)
|
||||||
|
0
|
||||||
|
(real-font-Xfont font)))
|
||||||
|
|
||||||
;; creates a font object. name can be #f. if Xfont is #f then it is obtained
|
;; creates a font object. name can be #f. if Xfont is #f then it is obtained
|
||||||
;; from the Xfontstruct.
|
;; from the Xfontstruct.
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@
|
||||||
((pixmap? value) (pixmap-Xpixmap value))
|
((pixmap? value) (pixmap-Xpixmap value))
|
||||||
((font? value) (font-Xfont value)) ;;??
|
((font? value) (font-Xfont value)) ;;??
|
||||||
((pixel? value) (pixel-Xpixel value))
|
((pixel? value) (pixel-Xpixel value))
|
||||||
|
;; ??...
|
||||||
(else value)))
|
(else value)))
|
||||||
(map cdr alist)))))
|
(map cdr alist)))))
|
||||||
(%change-gcontext (gcontext-Xgcontext gcontext)
|
(%change-gcontext (gcontext-Xgcontext gcontext)
|
||||||
|
@ -114,7 +115,7 @@
|
||||||
prep-alist)))
|
prep-alist)))
|
||||||
|
|
||||||
|
|
||||||
(import-lambda-definition %change-gcontext (Xgcontext Xdisplay)
|
(import-lambda-definition %change-gcontext (Xgcontext Xdisplay args)
|
||||||
"Change_Gc")
|
"Change_Gc")
|
||||||
|
|
||||||
(define (make-gcontext-setter name)
|
(define (make-gcontext-setter name)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
;; last change : 04/07/2001
|
;; last change : 04/07/2001
|
||||||
|
|
||||||
|
|
||||||
(define (clear-area window x y windth height exposures?)
|
(define (clear-area window x y width height exposures?)
|
||||||
(%clear-area (window-Xwindow window)
|
(%clear-area (window-Xwindow window)
|
||||||
(display-Xdisplay (window-display window))
|
(display-Xdisplay (window-display window))
|
||||||
x y width height exposures?))
|
x y width height exposures?))
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
|
|
||||||
(define (draw-rectangles drawable gcontext vector-of-rectangles)
|
(define (draw-rectangles drawable gcontext vector-of-rectangles)
|
||||||
(%draw-rectangles (display-Xdisplay (drawable-display drawable))
|
(%draw-rectangles (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
vector-of-rectangles))
|
vector-of-rectangles))
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
|
|
||||||
(define (fill-rectangles drawable gcontext vector-of-rectangles)
|
(define (fill-rectangles drawable gcontext vector-of-rectangles)
|
||||||
(%fill-rectangles (display-Xdisplay (drawable-display drawable))
|
(%fill-rectangles (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
vector-of-rectangles))
|
vector-of-rectangles))
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
|
|
||||||
(define (draw-arc drawable gcontext x y width height angle1 angle2)
|
(define (draw-arc drawable gcontext x y width height angle1 angle2)
|
||||||
(%draw-arc (display-Xdisplay (drawable-display drawable))
|
(%draw-arc (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
x y width height angle1 angle2))
|
x y width height angle1 angle2))
|
||||||
|
|
||||||
|
@ -169,9 +169,9 @@
|
||||||
"Draw_Arc")
|
"Draw_Arc")
|
||||||
|
|
||||||
|
|
||||||
(define (fill-arc drawable gcontext x y widht height angle1 angle2)
|
(define (fill-arc drawable gcontext x y width height angle1 angle2)
|
||||||
(%fill-arc (display-Xdisplay (drawable-display drawable))
|
(%fill-arc (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
x y width height angle1 angle2))
|
x y width height angle1 angle2))
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
|
|
||||||
(define (draw-arcs drawable gcontext vector-of-data)
|
(define (draw-arcs drawable gcontext vector-of-data)
|
||||||
(%draw-arcs (display-Xdisplay (drawable-display drawable))
|
(%draw-arcs (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
vector-of-data))
|
vector-of-data))
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
|
|
||||||
(define (fill-arcs drawable gcontext vector-of-data)
|
(define (fill-arcs drawable gcontext vector-of-data)
|
||||||
(%fill-arcs (display-Xdisplay (drawable-display drawable))
|
(%fill-arcs (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
vector-of-data))
|
vector-of-data))
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@
|
||||||
|
|
||||||
(define (fill-polygon drawable gcontext vector-of-points relative? shape)
|
(define (fill-polygon drawable gcontext vector-of-points relative? shape)
|
||||||
(%fill-polygon (display-Xdisplay (drawable-display drawable))
|
(%fill-polygon (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-object drawable)
|
(drawable-Xobject drawable)
|
||||||
(gcontext-Xgcontext gcontext)
|
(gcontext-Xgcontext gcontext)
|
||||||
vector-of-points relative? shape))
|
vector-of-points relative? shape))
|
||||||
|
|
||||||
|
|
|
@ -9,19 +9,10 @@
|
||||||
(if maybe-pixel
|
(if maybe-pixel
|
||||||
maybe-pixel
|
maybe-pixel
|
||||||
(let ((pixel (really-make-pixel #f Xpixel)))
|
(let ((pixel (really-make-pixel #f Xpixel)))
|
||||||
(add-finalizer! pixel finalize-pixel)
|
(add-finalizer! pixel pixel-list-delete!)
|
||||||
(pixel-list-set! Xpixel pixel)
|
(pixel-list-set! Xpixel pixel)
|
||||||
pixel))))
|
pixel))))
|
||||||
|
|
||||||
;; finalize-pixel is called, when the garbage collector removes the last
|
|
||||||
;; reference to the pixel from the heap. Then we can savely close the
|
|
||||||
;; pixel and remove the weak-pointer from our list.
|
|
||||||
|
|
||||||
(define (finalize-pixel pixel)
|
|
||||||
(let ((Xpixel (pixel-Xpixel pixel)))
|
|
||||||
(pixel-set-Xpixel! pixel 'already-destroyed)
|
|
||||||
(pixel-list-delete! Xpixel)))
|
|
||||||
|
|
||||||
;; All pixel records need to be saved in a weak-list, to have only one record
|
;; All pixel records need to be saved in a weak-list, to have only one record
|
||||||
;; for the same XLib pixel
|
;; for the same XLib pixel
|
||||||
|
|
||||||
|
@ -37,5 +28,6 @@
|
||||||
(let ((p (make-weak-pointer pixel)))
|
(let ((p (make-weak-pointer pixel)))
|
||||||
(table-set! *weak-pixel-list* Xpixel p)))
|
(table-set! *weak-pixel-list* Xpixel p)))
|
||||||
|
|
||||||
(define (pixel-list-delete! Xpixel)
|
(define (pixel-list-delete! pixel)
|
||||||
(table-set! *weak-pixel-list* Xpixel #f))
|
(table-set! *weak-pixel-list*
|
||||||
|
(pixel-Xpixel pixel) #f))
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
; ---
|
; ---
|
||||||
|
|
||||||
(define (create-pixmap drawable width height depth)
|
(define (create-pixmap drawable width height depth)
|
||||||
(let ((display (drawable-display drawable))
|
(let* ((display (drawable-display drawable))
|
||||||
(pixmap (%create-pixmap (display-Xdisplay display)
|
(pixmap (%create-pixmap (display-Xdisplay display)
|
||||||
(drawable-Xdrawable) widht height depth)))
|
(drawable-Xobject drawable)
|
||||||
(make-pixmap pixmap display #t)))
|
width height depth)))
|
||||||
|
(make-pixmap pixmap display #t)))
|
||||||
|
|
||||||
(import-lambda-definition %create-pixmap (Xdisplay Xdrawable w h depth)
|
(import-lambda-definition %create-pixmap (Xdisplay Xdrawable w h depth)
|
||||||
"Create_Pixmap")
|
"Create_Pixmap")
|
||||||
|
@ -16,10 +17,10 @@
|
||||||
; ---
|
; ---
|
||||||
|
|
||||||
(define (create-bitmap-from-data window data width height)
|
(define (create-bitmap-from-data window data width height)
|
||||||
(let ((display (window-display window))
|
(let* ((display (window-display window))
|
||||||
(Xpixmap (%create-bitmap-from-data (display-Xdisplay display)
|
(Xpixmap (%create-bitmap-from-data (display-Xdisplay display)
|
||||||
(window-Xwindow window)
|
(window-Xwindow window)
|
||||||
data width height)))
|
data width height)))
|
||||||
(make-pixmap Xpixmap display #t)))
|
(make-pixmap Xpixmap display #t)))
|
||||||
|
|
||||||
(import-lambda-definition %create-bitmap-from-data (Xdisplay Xdrawable data w h)
|
(import-lambda-definition %create-bitmap-from-data (Xdisplay Xdrawable data w h)
|
||||||
|
@ -29,11 +30,11 @@
|
||||||
|
|
||||||
(define (create-pixmap-from-bitmap-data win data widht height
|
(define (create-pixmap-from-bitmap-data win data widht height
|
||||||
foregrnd backgrnd depth)
|
foregrnd backgrnd depth)
|
||||||
(let ((display (window-display window))
|
(let* ((display (window-display window))
|
||||||
(pixmap (create-pixmap-from-bitmap-data (display-Xdisplay display)
|
(pixmap (create-pixmap-from-bitmap-data (display-Xdisplay display)
|
||||||
(window-Xwindow window)
|
(window-Xwindow window)
|
||||||
data widht height foregrnd
|
data widht height foregrnd
|
||||||
backgrd depth)))
|
backgrd depth)))
|
||||||
(make-pixmap pixmap display #t)))
|
(make-pixmap pixmap display #t)))
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,8 +63,8 @@
|
||||||
((null? (cdr coord))
|
((null? (cdr coord))
|
||||||
(error "zero or both coordinates must be defined"))
|
(error "zero or both coordinates must be defined"))
|
||||||
(else coord))))
|
(else coord))))
|
||||||
(%write-bitmap-file dpy filename pixmap widht height
|
(%write-bitmap-file dpy filename pixmap widht height
|
||||||
(car xy-hot) (cadr xy-hot))))
|
(car xy-hot) (cadr xy-hot))))
|
||||||
|
|
||||||
|
|
||||||
(import-lambda-definition %write-bitmap-file (Xdisplay file Xpixmap w h x y)
|
(import-lambda-definition %write-bitmap-file (Xdisplay file Xpixmap w h x y)
|
||||||
|
|
|
@ -110,10 +110,9 @@
|
||||||
"Set_Selection_Owner")
|
"Set_Selection_Owner")
|
||||||
|
|
||||||
|
|
||||||
; --- (get-selection-owner instead of selection-owner)
|
|
||||||
; --- RETURN -> Window (s48 record)
|
; --- RETURN -> Window (s48 record)
|
||||||
|
|
||||||
(define (get-selection-owner display selection)
|
(define (selection-owner display selection)
|
||||||
(make-window (%get-selection-owner (display-Xdisplay display)
|
(make-window (%get-selection-owner (display-Xdisplay display)
|
||||||
(atom-Xatom selection))
|
(atom-Xatom selection))
|
||||||
display
|
display
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
(define (change-format format)
|
(define (change-format format)
|
||||||
(cond ((symbol? format)
|
(cond ((symbol? format)
|
||||||
(cond ((eq? '1-byte) 1)
|
(cond ((eq? format '1-byte) 1)
|
||||||
((eq? '2-byte) 2)
|
((eq? format '2-byte) 2)
|
||||||
(else (error "Wrong format-type" change-format))))
|
(else (error "Wrong format-type" change-format))))
|
||||||
((number? format)
|
((number? format)
|
||||||
(if (or (= 1 format) (= 2 format))
|
(if (or (= 1 format) (= 2 format))
|
||||||
|
@ -105,11 +105,11 @@
|
||||||
|
|
||||||
(define (draw-poly-text drawable gcontext x y text format)
|
(define (draw-poly-text drawable gcontext x y text format)
|
||||||
(let ((vec-text (transform-text text))
|
(let ((vec-text (transform-text text))
|
||||||
(int-format (change-format format))
|
(int-format (change-format format)))
|
||||||
(if (check-format? vec-text int-format)
|
(if (check-format? vec-text int-format)
|
||||||
(%draw-poly-text (display-Xdisplay (drawable-display drawable))
|
(%draw-poly-text (display-Xdisplay (drawable-display drawable))
|
||||||
(drawable-Xobject drawable) (gcontext-Xgcontext gcontext)
|
(drawable-Xobject drawable) (gcontext-Xgcontext gcontext)
|
||||||
x y vec-text (change-format! format)))
|
x y vec-text (change-format! format)))))
|
||||||
|
|
||||||
(import-lambda-definition %draw-poly-text (Xdisplay Xdrawable Xgcontext
|
(import-lambda-definition %draw-poly-text (Xdisplay Xdrawable Xgcontext
|
||||||
x y text format)
|
x y text format)
|
||||||
|
|
Loading…
Reference in New Issue