2003-08-19 15:19:38 -04:00
|
|
|
;;; -*-Scheme-*-
|
|
|
|
;;;
|
|
|
|
;;; The Scheme part of the X11 widget interface.
|
|
|
|
|
|
|
|
(require 'xt)
|
|
|
|
|
|
|
|
(define widget-subdirectory 'xaw)
|
|
|
|
|
|
|
|
(define load-always '())
|
|
|
|
|
|
|
|
(define widget-aliases #f)
|
|
|
|
|
|
|
|
(define (widget-loaded? w)
|
2003-08-19 15:25:03 -04:00
|
|
|
(feature? (string->symbol (format #f "~a:~a.so" widget-subdirectory w))))
|
2003-08-19 15:19:38 -04:00
|
|
|
|
|
|
|
(define-macro (load-widgets . w)
|
|
|
|
(let ((wl '()) (l '()))
|
|
|
|
(if (null? w)
|
|
|
|
(error 'load-widgets "no arguments"))
|
|
|
|
(for-each
|
|
|
|
(lambda (w)
|
|
|
|
(if (not (symbol? w))
|
|
|
|
(error 'load-widgets "argument not a symbol"))
|
|
|
|
(if (not (widget-loaded? w))
|
|
|
|
(set! l (cons w l))))
|
|
|
|
w)
|
|
|
|
(for-each
|
|
|
|
(lambda (w)
|
|
|
|
(if (not (widget-loaded? w))
|
|
|
|
(set! l (cons w l))))
|
|
|
|
load-always)
|
|
|
|
(if (not (null? l))
|
|
|
|
(begin
|
|
|
|
(if (not widget-aliases)
|
|
|
|
(load (format #f "~a/ALIASES" widget-subdirectory)))
|
2003-08-19 15:25:03 -04:00
|
|
|
(if autoload-notify? (format #t "[Loading "))
|
2003-08-19 15:19:38 -04:00
|
|
|
(do ((f l (cdr f))) ((null? f))
|
|
|
|
(let* ((file (car f))
|
|
|
|
(alias (assq (car f) widget-aliases)))
|
|
|
|
(if alias (set! file (cdr alias)))
|
2003-08-19 15:25:03 -04:00
|
|
|
(if autoload-notify?
|
|
|
|
(format #t "~a~a" file (if (null? (cdr f)) "" " ")))
|
|
|
|
(set! wl (cons (format #f "~a/~a.so" widget-subdirectory file)
|
2003-08-19 15:19:38 -04:00
|
|
|
wl))))
|
2003-08-19 15:25:03 -04:00
|
|
|
(if autoload-notify? (format #t "]~%"))
|
2003-08-19 15:19:38 -04:00
|
|
|
`(fluid-let ((load-libraries
|
|
|
|
(if (feature? 'motif)
|
|
|
|
(string-append site-lib-xmotif " " load-libraries)
|
|
|
|
(string-append site-lib-xaw " " load-libraries))))
|
|
|
|
(load ',wl)))
|
|
|
|
#f)))
|
|
|
|
|
|
|
|
(define load-widget load-widgets)
|
|
|
|
|
|
|
|
(provide 'xwidgets)
|