new implementations.

This commit is contained in:
frese 2001-08-29 14:44:15 +00:00
parent c72bd59c42
commit fd66d0396b
2 changed files with 54 additions and 0 deletions

37
scheme/xlib/error.scm Normal file
View File

@ -0,0 +1,37 @@
(define *x-error-handler* #f)
(define *x-fatal-error-handler* #f)
(define internal-x-error-handler
(lambda (infos)
(if *x-error-handler*
(let ((display (make-display (vector-ref infos 0) #f))
(ser-num (vector-ref infos 1))
(error-code (vector-ref infos 2))
(major-opcode (vector-ref infos 3))
(minor-opcode (vector-ref infos 4))
(res-id (vector-ref infos 5))
(error-string (vector-ref infos 6)))
(*x-error-handler* display ser-num error-code major-opcode
minor-opcode res-id error-string))
#f)))
(define-exported-binding "internal-x-error-handler" internal-x-error-handler)
(define (x-error-handler . args)
(if (null? args)
*x-error-handler*
(set! *x-error-handler* (car args))))
(define internal-x-fatal-error-handler
(lambda (Xdisplay)
(if *x-fatal-error-handler*
(*x-fatal-error-handler* (make-display Xdisplay #f))
#f)))
(define-exported-binding "internal-x-fatal-error-handler"
internal-x-fatal-error-handler)
(define (x-fatal-error-handler . args)
(if (null? args)
*x-fatal-error-handler*
(set! *x-fatal-error-handler* (car args))))

17
scheme/xlib/extension.scm Normal file
View File

@ -0,0 +1,17 @@
(define (list-extensions display)
(vector->list (%list-extensions (display-Xdisplay display))))
(import-lambda-definition %list-extensions (Xdisplay)
"scx_List_Extensions")
(define (query-extension display name)
(let ((res (%query-extension (display-Xdisplay display)
(if (symbol? name)
(string->symbol name)
name))))
(if res
(vector->list res)
res)))
(import-lambda-definition %query-extension (Xdisplay name)
"scx_Query_Extension")