Added suffix "scx_" to all imported C functions.

This commit is contained in:
frese 2001-07-31 14:54:53 +00:00
parent 158a0d2c5e
commit 024abcc745
21 changed files with 111 additions and 112 deletions

View File

@ -31,7 +31,7 @@
(make-atom Xatom))) (make-atom Xatom)))
(import-lambda-definition %intern-atom (Xdisplay name) (import-lambda-definition %intern-atom (Xdisplay name)
"Intern_Atom") "scx_Intern_Atom")
;; finalize-atom is called, when the garbage collector removes the last ;; finalize-atom is called, when the garbage collector removes the last
;; reference to the atom from the heap. Then we can savely close the ;; reference to the atom from the heap. Then we can savely close the

View File

@ -23,14 +23,14 @@
(internal-make-color (%create-color r g b))))) (internal-make-color (%create-color r g b)))))
(import-lambda-definition %create-color (r g b) (import-lambda-definition %create-color (r g b)
"Create_Color") "scx_Create_Color")
;; returns a list of r,g,b as integers ;; returns a list of r,g,b as integers
(define (extract-rgb-values color) (define (extract-rgb-values color)
(%extract-rgb-values (color-Xcolor color))) (%extract-rgb-values (color-Xcolor color)))
(import-lambda-definition %extract-rgb-values (XColor) (import-lambda-definition %extract-rgb-values (XColor)
"Extract_RGB_Values") "scx_Extract_RGB_Values")
;; All color records need to be saved in a weak-list, to have only one record ;; All color records need to be saved in a weak-list, to have only one record
;; for the same r,g,b value in the heap. ;; for the same r,g,b value in the heap.

View File

@ -30,7 +30,7 @@
(display-Xdisplay (colormap-display colormap))))) (display-Xdisplay (colormap-display colormap)))))
(import-lambda-definition %query-color (Xcolormap Xpixel Xdisplay) (import-lambda-definition %query-color (Xcolormap Xpixel Xdisplay)
"Query_Color") "scx_Query_Color")
;; query-colors does the same as query-color but on vectors of pixels and ;; query-colors does the same as query-color but on vectors of pixels and
;; colors. See XQueryColors. ;; colors. See XQueryColors.
@ -44,7 +44,7 @@
res))) res)))
(import-lambda-definition %query-colors (Xcolormap Xpixels Xdisplay) (import-lambda-definition %query-colors (Xcolormap Xpixels Xdisplay)
"Query_Colors") "scx_Query_Colors")
;; lookup-color takes the name of a color (a string or symbol) looks it up in ;; lookup-color takes the name of a color (a string or symbol) looks it up in
;; the colormap and returns a pair of colors: the exact color and the closest ;; the colormap and returns a pair of colors: the exact color and the closest
@ -63,4 +63,4 @@
(error "no such color:" color-name)))) (error "no such color:" color-name))))
(import-lambda-definition %lookup-color (Xcolormap Xdisplay name) (import-lambda-definition %lookup-color (Xcolormap Xdisplay name)
"Lookup_Color") "scx_Lookup_Color")

View File

@ -34,7 +34,7 @@
(colormap-set-Xcolormap! colormap 'already-freed))))) (colormap-set-Xcolormap! colormap 'already-freed)))))
(import-lambda-definition %free-colormap (Xcolormap Xdisplay) (import-lambda-definition %free-colormap (Xcolormap Xdisplay)
"Free_Colormap") "scx_Free_Colormap")
;; All colormap records need to be saved in a weak-list, to have only one record ;; All colormap records need to be saved in a weak-list, to have only one record
;; for the same XLib colormap ;; for the same XLib colormap

View File

@ -12,7 +12,7 @@
Xpixel))) Xpixel)))
(import-lambda-definition %alloc-color (Xcolormap Xcolor Xdisplay) (import-lambda-definition %alloc-color (Xcolormap Xcolor Xdisplay)
"Alloc_Color") "scx_Alloc_Color")
;; alloc-named-color looks up the named color with respect to the screen that ;; alloc-named-color looks up the named color with respect to the screen that
;; is associated with the specified colormap. It returns both the exact database ;; is associated with the specified colormap. It returns both the exact database
@ -33,4 +33,4 @@
Xres))) Xres)))
(import-lambda-definition %alloc-named-color (Xcolormap name Xdisplay) (import-lambda-definition %alloc-named-color (Xcolormap name Xdisplay)
"Alloc_Named_Color") "scx_Alloc_Named_Color")

View File

@ -34,7 +34,7 @@
(cursor-set-Xcursor! cursor 'already-destroyed))))) (cursor-set-Xcursor! cursor 'already-destroyed)))))
(import-lambda-definition %free-cursor (Xdisplay Xcursor) (import-lambda-definition %free-cursor (Xdisplay Xcursor)
"Free_Cursor") "scx_Free_Cursor")
;; All cursor records need to be saved in a weak-list, to have only one record ;; All cursor records need to be saved in a weak-list, to have only one record
;; for the same Xlib cursor-structure in the heap. ;; for the same Xlib cursor-structure in the heap.

View File

@ -71,4 +71,4 @@
p))) p)))
(import-lambda-definition %display-message-fd (Xdisplay) (import-lambda-definition %display-message-fd (Xdisplay)
"Display_Message_fd") "scx_Display_Message_fd")

View File

@ -17,7 +17,8 @@
(error "cannot open display" display-name) (error "cannot open display" display-name)
(make-display Xdisplay #t))))) (make-display Xdisplay #t)))))
(import-lambda-definition %open-display (name) "Open_Display") (import-lambda-definition %open-display (name)
"scx_Open_Display")
;; for compatibility with elk: is that correct?? see error.c ;; for compatibility with elk: is that correct?? see error.c
(define set-after-function! display-set-after-function!) (define set-after-function! display-set-after-function!)
@ -35,7 +36,7 @@
(define display-root-window display-default-root-window) (define display-root-window display-default-root-window)
(import-lambda-definition %default-root-window (Xdisplay) (import-lambda-definition %default-root-window (Xdisplay)
"Display_Default_Root_Window") "scx_Display_Default_Root_Window")
;; display-default-colormap return the default colormap for allocation on the ;; display-default-colormap return the default colormap for allocation on the
;; default screen of the specified display. See DefaultColormap. ;; default screen of the specified display. See DefaultColormap.
@ -49,7 +50,7 @@
(define display-colormap display-default-colormap) (define display-colormap display-default-colormap)
(import-lambda-definition %default-colormap (Xdisplay) (import-lambda-definition %default-colormap (Xdisplay)
"Display_Default_Colormap") "scx_Display_Default_Colormap")
;; display-default-gcontext return the default graphics context for the root ;; display-default-gcontext return the default graphics context for the root
;; window of the default screen of the specified display. See DefaultGC. ;; window of the default screen of the specified display. See DefaultGC.
@ -60,7 +61,7 @@
(make-gcontext Xgcontext display #f))) (make-gcontext Xgcontext display #f)))
(import-lambda-definition %default-gcontext (Xdisplay) (import-lambda-definition %default-gcontext (Xdisplay)
"Display_Default_Gcontext") "scx_Display_Default_Gcontext")
;; display-default-depth returns the depth (number of planes) of the default ;; display-default-depth returns the depth (number of planes) of the default
;; root window of the default screen of the specified display. See DefaultDepth. ;; root window of the default screen of the specified display. See DefaultDepth.
@ -70,7 +71,7 @@
(%default-depth Xdisplay))) (%default-depth Xdisplay)))
(import-lambda-definition %default-depth (Xdisplay) (import-lambda-definition %default-depth (Xdisplay)
"Display_Default_Depth") "scx_Display_Default_Depth")
;; display-default-screen-number returns the default screen number of the given ;; display-default-screen-number returns the default screen number of the given
;; display. See DefaultScreen. ;; display. See DefaultScreen.
@ -80,7 +81,7 @@
(%default-screen-number Xdisplay))) (%default-screen-number Xdisplay)))
(import-lambda-definition %default-screen-number (Xdisplay) (import-lambda-definition %default-screen-number (Xdisplay)
"Display_Default_Screen_Number") "scx_Display_Default_Screen_Number")
;; internal function ;; internal function
(define (check-screen-number display screen-number) (define (check-screen-number display screen-number)
@ -96,7 +97,7 @@
(%display-cells (display-Xdisplay display) screen-number)) (%display-cells (display-Xdisplay display) screen-number))
(import-lambda-definition %display-cells (Xdisplay screen-number) (import-lambda-definition %display-cells (Xdisplay screen-number)
"Display_Cells") "scx_Display_Cells")
;; display-planes returns the depth of the root window of the specified screen. ;; display-planes returns the depth of the root window of the specified screen.
;; See DisplayPlanes. ;; See DisplayPlanes.
@ -106,7 +107,7 @@
(%display-planes (display-Xdisplay display) screen-number)) (%display-planes (display-Xdisplay display) screen-number))
(import-lambda-definition %display-planes (Xdisplay screen-number) (import-lambda-definition %display-planes (Xdisplay screen-number)
"Display_Planes") "scx_Display_Planes")
;; display-string returns the name of the display as a string - the same that ;; display-string returns the name of the display as a string - the same that
;; was specified with open-display. See DisplayString. ;; was specified with open-display. See DisplayString.
@ -115,7 +116,7 @@
(%display-string (display-Xdisplay display))) (%display-string (display-Xdisplay display)))
(import-lambda-definition %display-string (Xdisplay) (import-lambda-definition %display-string (Xdisplay)
"Display_String") "scx_Display_String")
;; Display-Vendor returns a pair, whose car is the vendor identification and ;; Display-Vendor returns a pair, whose car is the vendor identification and
;; whose cdr is the release number. See DisplayVendor. ;; whose cdr is the release number. See DisplayVendor.
@ -124,7 +125,7 @@
(%display-vendor (display-Xdisplay display))) (%display-vendor (display-Xdisplay display)))
(import-lambda-definition %display-vendor (Xdisplay) (import-lambda-definition %display-vendor (Xdisplay)
"Display_Vendor") "scx_Display_Vendor")
;; Display-protocol-version return a pair of major and minor version numbers of ;; Display-protocol-version return a pair of major and minor version numbers of
;; the X protocol. ;; the X protocol.
@ -133,7 +134,7 @@
(%display-protocol-version (display-Xdisplay display))) (%display-protocol-version (display-Xdisplay display)))
(import-lambda-definition %display-protocol-version (Xdisplay) (import-lambda-definition %display-protocol-version (Xdisplay)
"Display_Protocol_Version") "scx_Display_Protocol_Version")
;; display-screen-count returns the number of available screen on this display. ;; display-screen-count returns the number of available screen on this display.
;; See ScreenCount. ;; See ScreenCount.
@ -142,7 +143,7 @@
(%display-screen-count (display-Xdisplay display))) (%display-screen-count (display-Xdisplay display)))
(import-lambda-definition %display-screen-count (Xdisplay) (import-lambda-definition %display-screen-count (Xdisplay)
"Display_Screen_Count") "scx_Display_Screen_Count")
;; display-image-byte-order returns one of the symbols 'lsb-first and ;; display-image-byte-order returns one of the symbols 'lsb-first and
;; 'msb-first. ;; 'msb-first.
@ -151,7 +152,7 @@
(%display-image-byte-order (display-Xdisplay display))) (%display-image-byte-order (display-Xdisplay display)))
(import-lambda-definition %display-image-byte-order (Xdisplay) (import-lambda-definition %display-image-byte-order (Xdisplay)
"Display_Image_Byte_Order") "scx_Display_Image_Byte_Order")
;; display-bitmap-unit returns the size of a bitmap's scanline unit in bits. ;; display-bitmap-unit returns the size of a bitmap's scanline unit in bits.
;; See BitmapUnit. ;; See BitmapUnit.
@ -160,7 +161,7 @@
(%display-bitmap-unit (display-Xdisplay display))) (%display-bitmap-unit (display-Xdisplay display)))
(import-lambda-definition %display-bitmap-unit (Xdisplay) (import-lambda-definition %display-bitmap-unit (Xdisplay)
"Display_Bitmap_Unit") "scx_Display_Bitmap_Unit")
;; display-bitmap-bit-order return one the symbols 'lbs-first and 'msb-first. ;; display-bitmap-bit-order return one the symbols 'lbs-first and 'msb-first.
;; See BitmapBitOrder. ;; See BitmapBitOrder.
@ -169,7 +170,7 @@
(%display-bitmap-bit-order (display-Xdisplay display))) (%display-bitmap-bit-order (display-Xdisplay display)))
(import-lambda-definition %display-bitmap-bit-order (Xdisplay) (import-lambda-definition %display-bitmap-bit-order (Xdisplay)
"Display_Bitmap_Bit_Order") "scx_Display_Bitmap_Bit_Order")
;; display-bitmap-pad returns the number of bits that each scanline must be ;; display-bitmap-pad returns the number of bits that each scanline must be
;; padded. See BitmapPad. ;; padded. See BitmapPad.
@ -178,7 +179,7 @@
(%display-bitmap-pad (display-Xdisplay display))) (%display-bitmap-pad (display-Xdisplay display)))
(import-lambda-definition %display-bitmap-pad (Xdisplay) (import-lambda-definition %display-bitmap-pad (Xdisplay)
"Display_Bitmap_Pad") "scx_Display_Bitmap_Pad")
;; display-width (-height) returns the width (height) of the screen in pixels. ;; display-width (-height) returns the width (height) of the screen in pixels.
;; See DisplayWidth (DisplayHeight). ;; See DisplayWidth (DisplayHeight).
@ -187,13 +188,13 @@
(%display-width (display-Xdisplay display))) (%display-width (display-Xdisplay display)))
(import-lambda-definition %display-width (Xdisplay) (import-lambda-definition %display-width (Xdisplay)
"Display_Width") "scx_Display_Width")
(define (display-height display) (define (display-height display)
(%display-height (display-Xdisplay display))) (%display-height (display-Xdisplay display)))
(import-lambda-definition %display-height (Xdisplay) (import-lambda-definition %display-height (Xdisplay)
"Display_Height") "scx_Display_Height")
;; display-width-mm (-height-mm) returns the width (height) of the screen in ;; display-width-mm (-height-mm) returns the width (height) of the screen in
;; millimeters. See DisplayWidthMM (DisplayHeightMM). ;; millimeters. See DisplayWidthMM (DisplayHeightMM).
@ -202,13 +203,13 @@
(%display-width-mm (display-Xdisplay display))) (%display-width-mm (display-Xdisplay display)))
(import-lambda-definition %display-width-mm (Xdisplay) (import-lambda-definition %display-width-mm (Xdisplay)
"Display_Width_Mm") "scx_Display_Width_Mm")
(define (display-height-mm display) (define (display-height-mm display)
(%display-height-mm (display-Xdisplay display))) (%display-height-mm (display-Xdisplay display)))
(import-lambda-definition %display-height-mm (Xdisplay) (import-lambda-definition %display-height-mm (Xdisplay)
"Display_Height_Mm") "scx_Display_Height_Mm")
;; See XDisplayMotionBufferSize. ;; See XDisplayMotionBufferSize.
@ -216,7 +217,7 @@
(%display-motion-buffer-size (display-Xdisplay display))) (%display-motion-buffer-size (display-Xdisplay display)))
(import-lambda-definition %display-motion-buffer-size (Xdisplay) (import-lambda-definition %display-motion-buffer-size (Xdisplay)
"Display_Motion_Buffer_Size") "scx_Display_Motion_Buffer_Size")
;; The display-flush-output flushes the output buffer. See XFlush. ;; The display-flush-output flushes the output buffer. See XFlush.
@ -224,7 +225,7 @@
(%display-flush-output (display-Xdisplay display))) (%display-flush-output (display-Xdisplay display)))
(import-lambda-definition %display-flush-output (Xdisplay) (import-lambda-definition %display-flush-output (Xdisplay)
"Display_Flush_Output") "scx_Display_Flush_Output")
;; display-wait-output flushes the output buffer and then waits until all ;; display-wait-output flushes the output buffer and then waits until all
;; requests have been received and processed by the X server. discard-events? ;; requests have been received and processed by the X server. discard-events?
@ -235,7 +236,7 @@
discard-events?)) discard-events?))
(import-lambda-definition %display-wait-output (Xdisplay discard) (import-lambda-definition %display-wait-output (Xdisplay discard)
"Display_Wait_Output") "scx_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
;; exercising the connection. See XNoOp. ;; exercising the connection. See XNoOp.
@ -244,7 +245,7 @@
(%no-op (display-Xdisplay display))) (%no-op (display-Xdisplay display)))
(import-lambda-definition %no-op (Xdisplay) (import-lambda-definition %no-op (Xdisplay)
"No_Op") "scx_No_Op")
;; for compatibility with Elk. ;; for compatibility with Elk.
(define no-op display-no-op) (define no-op display-no-op)
@ -257,7 +258,7 @@
(check-screen-number display 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") "scx_List_Depths")
;; for compatibility with Elk. ;; for compatibility with Elk.
(define list-depths display-list-depths) (define list-depths display-list-depths)
@ -271,7 +272,7 @@
(define list-pixmap-formats display-list-pixmap-formats) ;; compat./Elk (define list-pixmap-formats display-list-pixmap-formats) ;; compat./Elk
(import-lambda-definition %display-list-pixmap-formats (Xdisplay) (import-lambda-definition %display-list-pixmap-formats (Xdisplay)
"List_Pixmap_Formats") "scx_List_Pixmap_Formats")
;; synchronize just sets the after-function of the display to ;; synchronize just sets the after-function of the display to
;; display-wait-output (with #f for discard-events?). ;; display-wait-output (with #f for discard-events?).

View File

@ -1,6 +1,6 @@
;; defined in window.c ;; defined in window.c
(import-lambda-definition %get-geometry (Xdisplay Xdrawable) (import-lambda-definition %get-geometry (Xdisplay Xdrawable)
"Get_Geometry") "scx_Get_Geometry")
(define (get-geometry drawable) (define (get-geometry drawable)
(let* ((display (drawable-display drawable)) (let* ((display (drawable-display drawable))

View File

@ -3,6 +3,3 @@
event? event?
(type event-type event-set-type!) ;a symbol (type event-type event-set-type!) ;a symbol
(args event-args event-set-args!)) ;a vector (args event-args event-set-args!)) ;a vector

View File

@ -70,7 +70,7 @@
(cdr r))))) (cdr r)))))
(import-lambda-definition %peek-event (Xdisplay) (import-lambda-definition %peek-event (Xdisplay)
"Peek_Event") "scx_Peek_Event")
(define (events-pending display) (define (events-pending display)
(%events-pending (display-Xdisplay display))) (%events-pending (display-Xdisplay display)))
@ -79,7 +79,7 @@
; 0)) ; 0))
(import-lambda-definition %events-pending (Xdisplay) (import-lambda-definition %events-pending (Xdisplay)
"Events_Pending") "scx_Events_Pending")
(define (get-motion-events window from-time to-time) (define (get-motion-events window from-time to-time)
(%get-motion-events (display-Xdisplay (window-display window)) (%get-motion-events (display-Xdisplay (window-display window))
@ -87,4 +87,4 @@
from-time to-time)) from-time to-time))
(import-lambda-definition %get-motion-events (Xdisplay Xwindow from to) (import-lambda-definition %get-motion-events (Xdisplay Xwindow from to)
"Get_Motion_Events") "scx_Get_Motion_Events")

View File

@ -28,7 +28,7 @@
font)))) font))))
(import-lambda-definition %Get_Xfont (Xfontstruct) (import-lambda-definition %Get_Xfont (Xfontstruct)
"Get_Xfont") "scx_Get_Xfont")
;; load-font loads a font by its name. See XLoadQueryFont. ;; load-font loads a font by its name. See XLoadQueryFont.
@ -40,7 +40,7 @@
(make-font font-name #f Xfontstruct display #t))) (make-font font-name #f Xfontstruct display #t)))
(import-lambda-definition %load-font (Xdisplay font_name) (import-lambda-definition %load-font (Xdisplay font_name)
"Load_Font") "scx_Load_Font")
;; for compatibility with Elk: ;; for compatibility with Elk:
@ -66,7 +66,7 @@
;; Elk uses only XUnloadFont, but then the XFontStruct is not freed ?? ;; Elk uses only XUnloadFont, but then the XFontStruct is not freed ??
(import-lambda-definition %free-font (Xdisplay Xfontstruct) (import-lambda-definition %free-font (Xdisplay Xfontstruct)
"Free_Font") "scx_Free_Font")
;; All font records need to be saved in a weak-list, to have only one record ;; All font records need to be saved in a weak-list, to have only one record
;; for the same font in the heap. ;; for the same font in the heap.

View File

@ -35,7 +35,7 @@
(gcontext-set-Xgcontext! gcontext 'already-freed))))) (gcontext-set-Xgcontext! gcontext 'already-freed)))))
(import-lambda-definition %free-gcontext (Xgcontext Xdisplay) (import-lambda-definition %free-gcontext (Xgcontext Xdisplay)
"Free_Gc") "scx_Free_Gc")
;; All gcontext records need to be saved in a weak-list, to have only one record ;; All gcontext records need to be saved in a weak-list, to have only one record
;; for the same XLib gcontext ;; for the same XLib gcontext

View File

@ -19,7 +19,7 @@
(make-gcontext Xgcontext display #t)))))) (make-gcontext Xgcontext display #t))))))
(import-lambda-definition %create-gcontext (Xdisplay Xdrawable alist) (import-lambda-definition %create-gcontext (Xdisplay Xdrawable alist)
"Create_Gc") "scx_Create_Gc")
;; ... ;; ...
@ -32,7 +32,7 @@
new-gcontext)) new-gcontext))
(import-lambda-definition %copy-gcontext (Xdisplay Xsource Xdest) (import-lambda-definition %copy-gcontext (Xdisplay Xsource Xdest)
"Copy_Gc") "scx_Copy_Gc")
;; ... ;; ...
@ -63,7 +63,7 @@
alist))))) alist)))))
(import-lambda-definition %get-gcontext-values (Xgcontext Xdisplay) (import-lambda-definition %get-gcontext-values (Xgcontext Xdisplay)
"Get_Gc_Values") "scx_Get_Gc_Values")
;;... ;;...
@ -116,7 +116,7 @@
(import-lambda-definition %change-gcontext (Xgcontext Xdisplay args) (import-lambda-definition %change-gcontext (Xgcontext Xdisplay args)
"Change_Gc") "scx_Change_Gc")
(define (make-gcontext-setter name) (define (make-gcontext-setter name)
(lambda (gcontext value) (lambda (gcontext value)
@ -156,7 +156,7 @@
dash-list)) dash-list))
(import-lambda-definition %set-dashlist (Xgcontext Xdisplay dashoffset dashlist) (import-lambda-definition %set-dashlist (Xgcontext Xdisplay dashoffset dashlist)
"Set_Gcontext_Dashlist") "scx_Set_Gcontext_Dashlist")
;; ... ;; ...
@ -167,7 +167,7 @@
(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)
"Set_Gcontext_Clip_Rectangles") "scx_Set_Gcontext_Clip_Rectangles")
;; ... ;; ...
@ -176,7 +176,7 @@
width height shape)) width height shape))
(import-lambda-definition %query-best-size (Xdisplay width height shape) (import-lambda-definition %query-best-size (Xdisplay width height shape)
"Query_Best_Size") "scx_Query_Best_Size")
(define (query-best-cursor display width height) (define (query-best-cursor display width height)
(query-best-size display width height 'cursor)) (query-best-size display width height 'cursor))

View File

@ -4,10 +4,10 @@
(make-pixel (%black-pixel (display-Xdisplay display)))) (make-pixel (%black-pixel (display-Xdisplay display))))
(import-lambda-definition %black-pixel (Xdisplay) (import-lambda-definition %black-pixel (Xdisplay)
"Black_Pixel") "scx_Black_Pixel")
(define (white-pixel display) (define (white-pixel display)
(make-pixel (%white-pixel (display-Xdisplay display)))) (make-pixel (%white-pixel (display-Xdisplay display))))
(import-lambda-definition %white-pixel (Xdisplay) (import-lambda-definition %white-pixel (Xdisplay)
"White_Pixel") "scx_White_Pixel")

View File

@ -36,7 +36,7 @@
(pixmap-set-Xpixmap! pixmap 'already-destroyed))))) (pixmap-set-Xpixmap! pixmap 'already-destroyed)))))
(import-lambda-definition %free-pixmap (Xdisplay Xpixmap) (import-lambda-definition %free-pixmap (Xdisplay Xpixmap)
"Free_Pixmap") "scx_Free_Pixmap")
;; All pixmap records need to be saved in a weak-list, to have only one record ;; All pixmap records need to be saved in a weak-list, to have only one record
;; for the same Xlib pixmap-structure in the heap. ;; for the same Xlib pixmap-structure in the heap.

View File

@ -12,7 +12,7 @@
(make-pixmap pixmap display #t))) (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") "scx_Create_Pixmap")
; --- ; ---
@ -24,7 +24,7 @@
(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)
"Create_Bitmap_From_Data") "scx_Create_Bitmap_From_Data")
; --- ; ---
@ -40,7 +40,7 @@
(import-lambda-definition %create-pixmap-from-bitmap-data (import-lambda-definition %create-pixmap-from-bitmap-data
(Xdisplay Xdrawabel data w h f b depth) (Xdisplay Xdrawabel data w h f b depth)
"Create_Pixmap_From_Bitmap_Data") "scx_Create_Pixmap_From_Bitmap_Data")
; Returns a list of five elements: (pixmap widht heigth x y) ; Returns a list of five elements: (pixmap widht heigth x y)
@ -51,7 +51,7 @@
(set-car! res (make-pixmap (drawable-display drawable) (car res) #t)))) (set-car! res (make-pixmap (drawable-display drawable) (car res) #t))))
(import-lambda-definition %read-bitmap-file (Xdisplay Xdrawable file) (import-lambda-definition %read-bitmap-file (Xdisplay Xdrawable file)
"Read_Bitmap_File") "scx_Read_Bitmap_File")
; --- coord is optional. It should be the empty list or (x-hot y-hot) ; --- coord is optional. It should be the empty list or (x-hot y-hot)
@ -68,4 +68,4 @@
(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)
"Write_Bitmap_File") "scx_Write_Bitmap_File")

View File

@ -11,8 +11,8 @@
(symbol->string name) (symbol->string name)
name)))) name))))
(import-labmda-definition %intern-atom (Xdisplay name) (import-lambda-definition %intern-atom (Xdisplay name)
"Intern_Atom") "scx_Intern_Atom")
; --- RETURN: atom or symbol: none ; --- RETURN: atom or symbol: none
@ -24,7 +24,7 @@
name))) name)))
(import-lambda-definition %find-atom (Xdisplay name) (import-lambda-definition %find-atom (Xdisplay name)
"Find_Atom") "scx_Find_Atom")
; --- RETURN: string ; --- RETURN: string
@ -33,7 +33,7 @@
(atom-Xatom atom))) (atom-Xatom atom)))
(import-lambda-definition %atom-name (Xdisplay atom) (import-lambda-definition %atom-name (Xdisplay atom)
"Atom_Name") "scx_Atom_Name")
; --- RETURN: vector of atoms ; --- RETURN: vector of atoms
@ -44,7 +44,7 @@
(import-lambda-definition %list-properties (Xdisplay Xwindow) (import-lambda-definition %list-properties (Xdisplay Xwindow)
"List_Properties") "scx_List_Properties")
; --- Return: list consisting: '(atom integer data integer) ; --- Return: list consisting: '(atom integer data integer)
@ -58,7 +58,7 @@
(import-lambda-definition %get-property (Xwindow Xdisplay Xatom_prop Xatom_type (import-lambda-definition %get-property (Xwindow Xdisplay Xatom_prop Xatom_type
start len deletep) start len deletep)
"Get_Property") "scx_Get_Property")
; --- RETURN -> "void" ; --- RETURN -> "void"
@ -72,7 +72,7 @@
(import-lambda-definition %change-property (Xdisplay Xwindow Xatom_prop (import-lambda-definition %change-property (Xdisplay Xwindow Xatom_prop
Xatom_type format mode data) Xatom_type format mode data)
"Change_Property") "scx_Change_Property")
; --- RETURN -> "void" ; --- RETURN -> "void"
@ -82,7 +82,7 @@
(atom-Xatom property))) (atom-Xatom property)))
(import-lambda-definition %delete-property (Xdisplay Xwindow Xatom_prop) (import-lambda-definition %delete-property (Xdisplay Xwindow Xatom_prop)
"Delete_Property") "scx_Delete_Property")
; --- RETURN -> "void" ; --- RETURN -> "void"
@ -95,7 +95,7 @@
(import-lambda-definition %rotate-properties (Xdisplay Xwindow Xatom_vec delta) (import-lambda-definition %rotate-properties (Xdisplay Xwindow Xatom_vec delta)
"Rotate_Properties") "scx_Rotate_Properties")
; --- RETURN -> "void" ; --- RETURN -> "void"
@ -107,7 +107,7 @@
(import-lambda-definition %set-selection-owner! (Xdisplay Xatom_s Xwindow_owner (import-lambda-definition %set-selection-owner! (Xdisplay Xatom_s Xwindow_owner
time) time)
"Set_Selection_Owner") "scx_Set_Selection_Owner")
; --- RETURN -> Window (s48 record) ; --- RETURN -> Window (s48 record)
@ -120,7 +120,7 @@
(import-lambda-definition %get-selection-owner (Xdisplay Xatom_s) (import-lambda-definition %get-selection-owner (Xdisplay Xatom_s)
"Get_Selection_Owner") "scx_Get_Selection_Owner")
; --- RETURN -> "void" ; --- RETURN -> "void"
@ -136,7 +136,7 @@
(import-lambda-definition %convert-selection (Xdisplay Xatom_s Xatom_t (import-lambda-definition %convert-selection (Xdisplay Xatom_s Xatom_t
Xwindow time) Xwindow time)
"Convert_Selection") "scx_Convert_Selection")

View File

@ -50,7 +50,7 @@
(error "Wrong format for text")))) (error "Wrong format for text"))))
(import-lambda-definition %text-width (Xfontstruct text format) (import-lambda-definition %text-width (Xfontstruct text format)
"Text_Width") "scx_Text_Width")
; --- Each extents-...-functions returns an number. ; --- Each extents-...-functions returns an number.
@ -62,7 +62,7 @@
(extents-intern font text format 1)) (extents-intern font text format 1))
(define (extends-width font text format) (define (extents-width font text format)
(extents-intern font text format 2)) (extents-intern font text format 2))
@ -82,7 +82,7 @@
(error "Wrong format for text!")))) (error "Wrong format for text!"))))
(import-lambda-definition %extents-text (Xfontstruct text format which) (import-lambda-definition %extents-text (Xfontstruct text format which)
"Extents_Text") "scx_Extents_Text")
; --- draw-image-text get's a mixed vector (text) with integer and ; --- draw-image-text get's a mixed vector (text) with integer and
; font-type inside. ; font-type inside.
@ -99,23 +99,31 @@
(import-lambda-definition %draw-image-text (Xdisplay Xdrawable Xgcontext (import-lambda-definition %draw-image-text (Xdisplay Xdrawable Xgcontext
x y text format) x y text format)
"Draw_Image_Text") "scx_Draw_Image_Text")
; --- text is a Vector of font-object and chars. ; --- text is a Vector of font-object and chars.
(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 int-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)
"Draw_Poly_Text") "scx_Draw_Poly_Text")
(define (check-format (trans-text int-format))
(call-with-current-continuation
(lambda (return)
(for-each (lambda (obj)
(if (and (vector? obj)
(not (vec-format? obj int-format)))
(return #f)))
(vector->list trans-text))
#t)))
; --- Extracts the Xfont from the scheme48-font-record and makes vectors ; --- Extracts the Xfont from the scheme48-font-record and makes vectors
@ -152,7 +160,6 @@
; The format is '1-byte. ; The format is '1-byte.
(define (translate-text string) (define (translate-text string)
(if (string? string)
(let* ((len (string-length string)) (let* ((len (string-length string))
(res-vec (make-vector len))) (res-vec (make-vector len)))
(let loop ((i 0)) (let loop ((i 0))
@ -160,10 +167,4 @@
res-vec res-vec
(begin (begin
(vector-set! res-vec i (char->integer (string-ref string i))) (vector-set! res-vec i (char->integer (string-ref string i)))
(loop (+ i 1)))))) (loop (+ i 1)))))))
(error "the parameter istn't a string" translate-string)))

View File

@ -38,7 +38,7 @@
(window-set-Xwindow! window 'already-destroyed))))) (window-set-Xwindow! window 'already-destroyed)))))
(import-lambda-definition %destroy-window (Xdisplay Xwindow) (import-lambda-definition %destroy-window (Xdisplay Xwindow)
"Destroy_Window") "scx_Destroy_Window")
;; All window records need to be saved in a weak-list, to have only one record ;; All window records need to be saved in a weak-list, to have only one record
;; for the same Xlib window-structure in the heap. ;; for the same Xlib window-structure in the heap.

View File

@ -33,7 +33,7 @@
(import-lambda-definition %create-window (Xdisplay Xparent x y width height (import-lambda-definition %create-window (Xdisplay Xparent x y width height
border-width attrAlist) border-width attrAlist)
"Create_Window") "scx_Create_Window")
;; change-window-attributes takes an alist of names and values... ;; change-window-attributes takes an alist of names and values...
;; names can be: background-pixmap, background-pixel, border-pixmap, ;; names can be: background-pixmap, background-pixel, border-pixmap,
@ -60,7 +60,7 @@
prep-alist))) prep-alist)))
(import-lambda-definition %change-window-attributes (Xwindow Xdisplay alist) (import-lambda-definition %change-window-attributes (Xwindow Xdisplay alist)
"Change_Window_Attributes") "scx_Change_Window_Attributes")
;; simple functions that use change-window-attributes ;; simple functions that use change-window-attributes
;; TODO: a caching system for multiple calls to these functions ;; TODO: a caching system for multiple calls to these functions
@ -121,7 +121,7 @@
alist))))) alist)))))
(import-lambda-definition %get-window-attributes (Xdisplay Xwindow) (import-lambda-definition %get-window-attributes (Xdisplay Xwindow)
"Get_Window_Attributes") "scx_Get_Window_Attributes")
(define (make-win-attr-getter name) (define (make-win-attr-getter name)
(lambda (window) (lambda (window)
@ -166,7 +166,7 @@
prep-alist))) prep-alist)))
(import-lambda-definition %configure-window (Xwindow Xdisplay alist) (import-lambda-definition %configure-window (Xwindow Xdisplay alist)
"Configure_Window") "scx_Configure_Window")
;; the following mutators are based on configure-window ;; the following mutators are based on configure-window
@ -190,7 +190,7 @@
(display-Xdisplay (window-display window)))) (display-Xdisplay (window-display window))))
(import-lambda-definition %map-window (Xwindow Xdisplay) (import-lambda-definition %map-window (Xwindow Xdisplay)
"Map_Window") "scx_Map_Window")
;; The unmap-window function unmaps the specified window and causes the ;; The unmap-window function unmaps the specified window and causes the
;; X server to generate an unmap-notify event. See XUnmapWindow. ;; X server to generate an unmap-notify event. See XUnmapWindow.
@ -200,7 +200,7 @@
(display-Xdisplay (window-display window)))) (display-Xdisplay (window-display window))))
(import-lambda-definition %unmap-window (Xwindow Xdisplay) (import-lambda-definition %unmap-window (Xwindow Xdisplay)
"Unmap_Window") "scx_Unmap_Window")
;; The destroy-subwindows function destroys all inferior windows of the ;; The destroy-subwindows function destroys all inferior windows of the
;; specified window, in bottom-to-top stacking order. See XDestroySubWindows. ;; specified window, in bottom-to-top stacking order. See XDestroySubWindows.
@ -210,7 +210,7 @@
(display-Xdisplay (window-display window)))) (display-Xdisplay (window-display window))))
(import-lambda-definition %destroy-subwindows (Xwindow Xdisplay) (import-lambda-definition %destroy-subwindows (Xwindow Xdisplay)
"Destroy_Subwindows") "scx_Destroy_Subwindows")
;; The map-subwindows function maps all subwindows for a specified window in ;; The map-subwindows function maps all subwindows for a specified window in
;; top-to-bottom stacking order. See XMapSubwindows ;; top-to-bottom stacking order. See XMapSubwindows
@ -220,7 +220,7 @@
(display-Xdisplay (window-display window)))) (display-Xdisplay (window-display window))))
(import-lambda-definition %map-subwindows (Xwindow Xdisplay) (import-lambda-definition %map-subwindows (Xwindow Xdisplay)
"Map_Subwindows") "scx_Map_Subwindows")
;; The unmap-subwindows function unmaps all subwindows for each subwindow ;; The unmap-subwindows function unmaps all subwindows for each subwindow
;; and expose events on formerly obscured windows. See XUnmapSubwindow. ;; and expose events on formerly obscured windows. See XUnmapSubwindow.
@ -230,7 +230,7 @@
(display-Xdisplay (window-display window)))) (display-Xdisplay (window-display window))))
(import-lambda-definition %unmap-subwindows (Xwindow Xdisplay) (import-lambda-definition %unmap-subwindows (Xwindow Xdisplay)
"Unmap_Subwindows") "scx_Unmap_Subwindows")
;; See XCirculateSubwindows. ;; See XCirculateSubwindows.
@ -241,7 +241,7 @@
; other is: 'raise-lower / exception?? ; other is: 'raise-lower / exception??
(import-lambda-definition %circulate-subwindows (Xwindow Xdisplay dir) (import-lambda-definition %circulate-subwindows (Xwindow Xdisplay dir)
"Circulate_Subwindows") "scx_Circulate_Subwindows")
;; The clear-window function clears the entire area in the specified window. ;; The clear-window function clears the entire area in the specified window.
;; See XClearWindow. ;; See XClearWindow.
@ -288,7 +288,7 @@
(vector-ref res 2))))) (vector-ref res 2)))))
(import-lambda-definition %query-tree (Xwindow Xdisplay) (import-lambda-definition %query-tree (Xwindow Xdisplay)
"Query_Tree") "scx_Query_Tree")
;; translate-coordinates takes the x and y coordinates relative to the source ;; translate-coordinates takes the x and y coordinates relative to the source
;; window's origin and returns a list of three elements: the x and y coordinates ;; window's origin and returns a list of three elements: the x and y coordinates
@ -311,7 +311,7 @@
(import-lambda-definition %translate-coordinates (Xdisplay srcXwindow x y (import-lambda-definition %translate-coordinates (Xdisplay srcXwindow x y
srcXwindow) srcXwindow)
"Translate_Coordinates") "scx_Translate_Coordinates")
;; query-pointer returns a list of eight elements: x and y coordinates, a ;; query-pointer returns a list of eight elements: x and y coordinates, a
@ -328,4 +328,4 @@
(vector->list res))) (vector->list res)))
(import-lambda-definition %query-pointer (Xdisplay Xwindow) (import-lambda-definition %query-pointer (Xdisplay Xwindow)
"Query_Pointer") "scx_Query_Pointer")