-(defun htmlformat-list-start-value-func (x nitems)
- (values (hyperobject-class-title x) nitems (class-name-of x)))
-
-(defclass htmlformat (textformat)
- ()
- (:default-initargs :file-start-str "<html><body>~%"
- :file-end-str "</body><html>~%"
- :list-start-indent t
- :list-start-fmtstr "<p><b>~a~p:</b></p><div class=\"~A\"><ul>~%"
- :list-start-value-func #'htmlformat-list-start-value-func
- :list-end-fmtstr "</ul></div>~%"
- :list-end-indent t
- :list-end-value-func #'identity
- :obj-start-indent t
- :obj-start-fmtstr "<li>"
- :obj-start-value-func #'identity
- :obj-end-indent t
- :obj-end-fmtstr "</li>~%"
- :obj-end-value-func #'identity
- :obj-data-indent t
- :obj-data-fmtstr #'hyperobject-class-fmtstr-html-labels
- :obj-data-fmtstr-labels #'hyperobject-class-fmtstr-html-labels
- :obj-data-value-func #'hyperobject-class-value-func))
-
-(defclass xhtmlformat (textformat)
- ()
- (:default-initargs :file-start-str "<html><body>~%"
- :file-end-str "</body><html>~%"
- :list-start-indent t
- :list-start-fmtstr "<p><b>~a~p:</b></p><div class=\"~A\"><ul>~%"
- :list-start-value-func #'htmlformat-list-start-value-func
- :list-end-fmtstr "</ul></div>~%"
- :list-end-indent t
- :list-end-value-func #'identity
- :obj-start-indent t
- :obj-start-fmtstr "<li>"
- :obj-start-value-func #'identity
- :obj-end-indent t
- :obj-end-fmtstr "</li>~%"
- :obj-end-value-func #'identity
- :obj-data-indent t
- :obj-data-fmtstr #'hyperobject-class-fmtstr-html-labels
- :obj-data-fmtstr-labels #'hyperobject-class-fmtstr-html-labels
- :obj-data-value-func #'hyperobject-class-xmlvalue-func))
-
-
-(defun xmlformat-list-end-value-func (x)
- (format nil "~alist" (class-name-of x)))
-
-(defun xmlformat-list-start-value-func (x nitems)
- (values (format nil "~alist" (class-name-of x)) (hyperobject-class-title x) nitems))
-
-(defclass xmlformat (textformat)
- ()
- (:default-initargs :file-start-str "" ; (std-xml-header)
- :list-start-indent t
- :list-start-fmtstr "<~a><title>~a~p:</title> ~%"
- :list-start-value-func #'xmlformat-list-start-value-func
- :list-end-indent t
- :list-end-fmtstr "</~a>~%"
- :list-end-value-func #'xmlformat-list-end-value-func
- :obj-start-fmtstr "<~a>"
- :obj-start-value-func #'class-name-of
- :obj-start-indent t
- :obj-end-fmtstr "</~a>~%"
- :obj-end-value-func #'class-name-of
- :obj-end-indent nil
- :obj-data-indent nil
- :obj-data-fmtstr #'hyperobject-class-fmtstr-xml
- :obj-data-fmtstr-labels #'hyperobject-class-fmtstr-xml-labels
- :obj-data-value-func #'hyperobject-class-xmlvalue-func))
-
-(defclass link-ref ()
- ((fmtstr :type function :initarg :fmtstr :accessor fmtstr)
- (fmtstr-labels :type function :initarg :fmtstr-labels :accessor fmtstr-labels)
- (page-name :type string :initarg :page-name :accessor page-name)
- (href-head :type string :initarg :href-head :accessor href-head)
- (href-end :type string :initarg :href-end :accessor href-end)
- (ampersand :type string :initarg :ampersand :accessor ampersand))
- (:default-initargs :fmtstr nil
- :fmtstr-labels nil
- :page-name "disp-func1"
- :href-head nil :href-end nil :ampersand nil)
- (:documentation "Formatting for a linked hyperlink"))
-
-(defclass html-link-ref (link-ref)
- ()
- (:default-initargs :fmtstr #'hyperobject-class-fmtstr-html-ref
- :fmtstr-labels #'hyperobject-class-fmtstr-html-ref-labels
- :href-head "a href="
- :href-end "a"
- :ampersand "&"))
-
-(defclass xhtml-link-ref (link-ref)
- ()
- (:default-initargs :fmtstr #'hyperobject-class-fmtstr-html-ref
- :fmtstr-labels #'hyperobject-class-fmtstr-html-ref-labels
- :href-head "a href="
- :href-end "a"
- :ampersand "&"))
-
-(defclass xml-link-ref (link-ref)
- ()
- (:default-initargs :fmtstr #'hyperobject-class-fmtstr-xml-ref
- :fmtstr-labels #'hyperobject-class-fmtstr-xml-ref-labels
- :href-head "xmllink xlink:type=\"simple\" xlink:href="
- :href-end "xmllink"
- :ampersand "&")
- (:documentation "Mozilla's and W3's idea of a link with XML"))
-
-(defclass ie-xml-link-ref (xml-link-ref)
- ()
- (:default-initargs :href-head "html:a href="
- :href-end "html:a" )
- (:documentation "Internet Explorer's idea of a link with XML"))
-
-
-(defclass htmlrefformat (htmlformat)
- ()
- (:default-initargs :link-ref (make-instance 'html-link-ref)))
-
-(defclass xhtmlrefformat (xhtmlformat)
- ()
- (:default-initargs :link-ref (make-instance 'xhtml-link-ref)))
-
-(defclass xmlrefformat (xmlformat)
- ()
- (:default-initargs :link-ref (make-instance 'xml-link-ref)))
-
-(defclass ie-xmlrefformat (xmlformat)
- ()
- (:default-initargs :link-ref (make-instance 'ie-xml-link-ref)))
+(defvar +newline-string+ (format nil "~%"))
+
+(defun initialize-text-view (view)
+ (setf (list-start-str-or-func view)
+ (compile nil
+ #'(lambda (obj nitems strm)
+ (format strm "~a~P:~%"
+ (hyperobject-class-user-name obj) nitems))))
+ (setf (list-start-indent view) t)
+ (setf (obj-data-indent view) t)
+ (setf (obj-data-end-str view) +newline-string+))
+
+(defun html-list-start-func (obj nitems strm)
+ (format strm "<p><b>~a~p:</b></p><div class=\""
+ (hyperobject-class-user-name obj) nitems)
+ (write-string (class-name-of obj))
+ (write-string "\"><ul>~%" strm))
+
+(defun initialize-html-view (view)
+ (initialize-text-view view)
+ (setf (file-start-str view) (format nil "<html><body>~%"))
+ (setf (file-end-str view) (format nil "</body><html>~%"))
+ (setf (list-start-indent view) t)
+ (setf (list-start-str-or-func view) #'html-list-start-func)
+ (setf (list-end-str-or-func view) (format nil "</ul></div>~%"))
+ (setf (list-end-indent view) t)
+ (setf (obj-start-indent view) t)
+ (setf (obj-start-str-or-func view) "<li>")
+ (setf (obj-end-indent view) t)
+ (setf (obj-end-str-or-func view) (format nil "</li>~%"))
+ (setf (obj-data-indent view) t))
+
+(defun initialize-xhtml-view (view)
+ (initialize-text-view view)
+ (setf (file-start-str view) (format nil "<html><body>~%"))
+ (setf (file-end-str view) (format nil "</body><html>~%"))
+ (setf (list-start-indent view) t)
+ (setf (list-start-str-or-func view) #'html-list-start-func)
+ (setf (list-end-str-or-func view) (format nil "</ul></div>~%"))
+ (setf (list-end-indent view) t)
+ (setf (obj-start-indent view) t)
+ (setf (obj-start-str-or-func view) "<li>")
+ (setf (obj-end-indent view) t)
+ (setf (obj-end-str-or-func view) (format nil "</li>~%"))
+ (setf (obj-data-indent view) t))
+
+(defun xmlformat-list-end-func (x strm)
+ (write-string "</" strm)
+ (write-string (class-name-of x) strm)
+ (write-string "list" strm)
+ (write-string ">" strm)
+ (write-char #\newline strm))
+
+(defun xmlformat-list-start-func (x nitems strm)
+ (write-char #\< strm)
+ (write-string (class-name-of x) strm)
+ (write-string "list><title>" strm)
+ (format strm "~A~P:</title> ~%"
+ (hyperobject-class-user-name x) nitems))
+
+(defun initialize-xml-view (view)
+ (initialize-text-view view)
+ (setf (file-start-str view) "") ; (std-xml-header)
+ (setf (list-start-indent view) t)
+ (setf (list-start-str-or-func view) #'xmlformat-list-start-func)
+ (setf (list-end-indent view) t)
+ (setf (list-end-str-or-func view) #'xmlformat-list-end-func)
+ (setf (obj-start-str-or-func view) (format nil "<~(~a~)>" (object-class-name view)))
+ (setf (obj-start-indent view) t)
+ (setf (obj-end-str-or-func view) (format nil "</~(~a~)>~%" (object-class-name view)))
+ (setf (obj-end-indent view) nil)
+ (setf (obj-data-indent view) nil))