;;;; ;;;; w w w - b r o w s e r . s t k l o s -- A simple WEB browser ;;;; ;;;; Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; Permission to use, copy, and/or distribute this software and its ;;;; documentation for any purpose and without fee is hereby granted, provided ;;;; that both the above copyright notice and this permission notice appear in ;;;; all copies and derived works. Fees for distribution or use of this ;;;; software or derived works may only be charged with express written ;;;; permission of the copyright holder. ;;;; This software is provided ``as is'' without express or implied warranty. ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 21-Oct-1996 14:02 ;;;; Last file update: 16-Apr-1998 11:45 ;;;; (require "Tk-classes") (require "www") (import WWW) (define WWW:browser (let ((browser #f)) ;; Id of browser (#f if no browser exists) (lambda args ;; URL history management ;; (define new-url (let ((history '()) (current -1)) (lambda (txt url) (case url ((previous) (when (> (length history) 1) (set! current (modulo (- current 1) (length history))) (www:view-url (Id txt) (list-ref history current)))) ((next) (when (> (length history) 1) (set! current (modulo (+ current 1) (length history))) (www:view-url (Id txt) (list-ref history current)))) ((reload) (www:view-url (Id txt) (list-ref history current))) (ELSE (if (null? history) (begin (set! history (list url)) (set! current 0)) (unless (string=? (list-ref history current) url) (set! history (append history (list url))) (set! current (- (length history) 1))))))))) ;;; Make interface ;;; (define (make-buttons parent txt) (let* ((f (make :parent parent)) (back (make