2001-07-16 09:53:08 -04:00
|
|
|
;; author -> Norbert Freudemann
|
|
|
|
;; creation date : 16/07/2001
|
|
|
|
;; last change : 16/07/2001
|
|
|
|
|
|
|
|
; ---
|
|
|
|
|
|
|
|
(define (create-pixmap drawable width height depth)
|
2001-07-30 10:43:22 -04:00
|
|
|
(let* ((display (drawable-display drawable))
|
|
|
|
(pixmap (%create-pixmap (display-Xdisplay display)
|
|
|
|
(drawable-Xobject drawable)
|
|
|
|
width height depth)))
|
|
|
|
(make-pixmap pixmap display #t)))
|
2001-07-16 09:53:08 -04:00
|
|
|
|
|
|
|
(import-lambda-definition %create-pixmap (Xdisplay Xdrawable w h depth)
|
|
|
|
"Create_Pixmap")
|
|
|
|
|
|
|
|
; ---
|
|
|
|
|
|
|
|
(define (create-bitmap-from-data window data width height)
|
2001-07-30 10:43:22 -04:00
|
|
|
(let* ((display (window-display window))
|
|
|
|
(Xpixmap (%create-bitmap-from-data (display-Xdisplay display)
|
|
|
|
(window-Xwindow window)
|
|
|
|
data width height)))
|
2001-07-19 11:19:07 -04:00
|
|
|
(make-pixmap Xpixmap display #t)))
|
2001-07-16 09:53:08 -04:00
|
|
|
|
2001-07-18 11:45:54 -04:00
|
|
|
(import-lambda-definition %create-bitmap-from-data (Xdisplay Xdrawable data w h)
|
2001-07-16 09:53:08 -04:00
|
|
|
"Create_Bitmap_From_Data")
|
|
|
|
|
|
|
|
; ---
|
|
|
|
|
|
|
|
(define (create-pixmap-from-bitmap-data win data widht height
|
|
|
|
foregrnd backgrnd depth)
|
2001-07-30 10:43:22 -04:00
|
|
|
(let* ((display (window-display window))
|
|
|
|
(pixmap (create-pixmap-from-bitmap-data (display-Xdisplay display)
|
|
|
|
(window-Xwindow window)
|
|
|
|
data widht height foregrnd
|
|
|
|
backgrd depth)))
|
2001-07-19 11:19:07 -04:00
|
|
|
(make-pixmap pixmap display #t)))
|
2001-07-16 09:53:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
(import-lambda-definition %create-pixmap-from-bitmap-data
|
|
|
|
(Xdisplay Xdrawabel data w h f b depth)
|
|
|
|
"Create_Pixmap_From_Bitmap_Data")
|
|
|
|
|
|
|
|
; Returns a list of five elements: (pixmap widht heigth x y)
|
|
|
|
|
|
|
|
(define (read-bitmap-file drawable filename)
|
|
|
|
(let ((res (%read-bitmap-file (display-Xdisplay (drawable-display drawable))
|
|
|
|
(drawable-Xobject drawable)
|
|
|
|
filename)))
|
2001-07-19 11:19:07 -04:00
|
|
|
(set-car! res (make-pixmap (drawable-display drawable) (car res) #t))))
|
2001-07-16 09:53:08 -04:00
|
|
|
|
|
|
|
(import-lambda-definition %read-bitmap-file (Xdisplay Xdrawable file)
|
|
|
|
"Read_Bitmap_File")
|
|
|
|
|
|
|
|
|
|
|
|
; --- coord is optional. It should be the empty list or (x-hot y-hot)
|
|
|
|
|
|
|
|
(define (write-bitmap-file filename pixmap width height . coord)
|
|
|
|
(let ((dpy (display-Xdisplay (pixmap-display pixmap)))
|
|
|
|
(xy-hot (cond
|
|
|
|
((null? coord) (list -1 -1))
|
|
|
|
((null? (cdr coord))
|
|
|
|
(error "zero or both coordinates must be defined"))
|
|
|
|
(else coord))))
|
2001-07-30 10:43:22 -04:00
|
|
|
(%write-bitmap-file dpy filename pixmap widht height
|
|
|
|
(car xy-hot) (cadr xy-hot))))
|
2001-07-16 09:53:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
(import-lambda-definition %write-bitmap-file (Xdisplay file Xpixmap w h x y)
|
|
|
|
"Write_Bitmap_File")
|