X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=ml-class.lisp;h=39878fa91bae69131b19285e8ccac934628d015d;hb=65fa5f1c69413c92a654784135d59ebdbf89966d;hp=b720de00351cd7d5dcb936a8c10d47c8529a00a8;hpb=4a7372ef4000eaaa86a987bc9668ccecf7d0489f;p=kmrcl.git diff --git a/ml-class.lisp b/ml-class.lisp index b720de0..39878fa 100644 --- a/ml-class.lisp +++ b/ml-class.lisp @@ -11,7 +11,7 @@ ;;;; in Text, HTML, and XML formats. This includes hyperlinking ;;;; capability and sub-objects. ;;;; -;;;; $Id: ml-class.lisp,v 1.17 2002/10/16 21:58:49 kevin Exp $ +;;;; $Id: ml-class.lisp,v 1.20 2002/10/17 00:25:05 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -25,17 +25,17 @@ (declaim (optimize (speed 3) (safety 1))) (defun ml-class-of (obj) - #-(or cmu sbcl) (class-of obj) + #-(or cmu sbcl scl) (class-of obj) #+sbcl (sb-pcl:class-of obj) - #+cmu (pcl:class-of obj)) + #+(or cmu scl) (pcl:class-of obj)) (defun ml-class-name (obj) - #-(or cmu sbcl) (class-name obj) + #-(or cmu sbcl scl) (class-name obj) #+sbcl (sb-pcl:class-name obj) - #+cmu (pcl:class-name obj)) + #+(or cmu scl) (pcl:class-name obj)) (defclass ml-class (#-(or cmu sbcl) standard-class - #+cmu pcl::standard-class + #+(or cmu scl) pcl::standard-class #+sbcl sb-pcl::standard-class) ((title :initarg :title :type string :reader ml-std-title :documentation @@ -72,7 +72,7 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (:default-initargs :title nil :fields nil :subobjects-lists nil :ref-fields nil) (:documentation "Metaclass for Markup Language classes.")) -#+cmu +#+(or cmu scl) (defmethod pcl:finalize-inheritance :after ((cl ml-class)) (init-ml-class cl)) @@ -82,7 +82,7 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (init-ml-class cl)) -#+cmu +#+(or cmu slc) (defmethod pcl:validate-superclass ((class ml-class) (superclass pcl::standard-class)) t) @@ -98,16 +98,6 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (defmethod clos:finalize-inheritance :after ((cl ml-class)) (init-ml-class cl)) -;;#+cmu -;;(defmethod pcl::class-finalized-p ((cl ml-class)) -;; (and (not (null (slot-value cl 'pcl::wrapper))) -;; (not (null (slot-value cl 'fmtstr-text))))) - -;;#+sbcl -;;(defmethod sb-pcl::class-finalized-p ((cl ml-class)) -;; (and (not (null (slot-value cl 'sb-pcl::wrapper))) -;; (not (null (slot-value cl 'fmtstr-text))))) - #+lispworks (defmethod clos:process-a-class-option ((class ml-class) (name (eql :title)) @@ -322,6 +312,8 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (defparameter *default-textformat* nil) (defparameter *default-htmlformat* nil) (defparameter *default-htmlrefformat* nil) +(defparameter *default-xhtmlformat* nil) +(defparameter *default-xhtmlrefformat* nil) (defparameter *default-xmlformat* nil) (defparameter *default-xmlrefformat* nil) (defparameter *default-ie-xmlrefformat* nil) @@ -333,6 +325,8 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (setq *default-textformat* (make-instance 'textformat)) (setq *default-htmlformat* (make-instance 'htmlformat)) (setq *default-htmlrefformat* (make-instance 'htmlrefformat)) + (setq *default-xhtmlformat* (make-instance 'xhtmlformat)) + (setq *default-xhtmlrefformat* (make-instance 'xhtmlrefformat)) (setq *default-xmlformat* (make-instance 'xmlformat)) (setq *default-xmlrefformat* (make-instance 'xmlrefformat)) (setq *default-ie-xmlrefformat* (make-instance 'ie-xmlrefformat)) @@ -343,7 +337,8 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (:text *default-textformat*) (:html *default-htmlformat*) (:htmlref *default-htmlrefformat*) - (:xml *default-xmlformat*) + (:xhtml *default-xhtmlformat*) + (:xhtmlref *default-xhtmlrefformat*) (:xml *default-xmlformat*) (:xmlref *default-xmlrefformat*) (:ie-xmlref *default-ie-xmlrefformat*) @@ -409,6 +404,27 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (values (ml-class-title x) nitems (class-name-of x))) (defclass htmlformat (textformat) + () + (:default-initargs :file-start-str "~%" + :file-end-str "~%" + :list-start-indent t + :list-start-fmtstr "

~a~p:

~%" + :list-end-indent t + :list-end-value-func #'identity + :obj-start-indent t + :obj-start-fmtstr "
  • " + :obj-start-value-func #'identity + :obj-end-indent t + :obj-end-fmtstr "
  • ~%" + :obj-end-value-func #'identity + :obj-data-indent t + :obj-data-fmtstr #'ml-class-fmtstr-html-labels + :obj-data-fmtstr-labels #'ml-class-fmtstr-html-labels + :obj-data-value-func #'ml-class-value-func)) + +(defclass xhtmlformat (textformat) () (:default-initargs :file-start-str "~%" :file-end-str "~%" @@ -470,6 +486,14 @@ Format is ((field-name field-lookup-func other-link-params) ...)") (:documentation "Formatting for a linked reference")) (defclass html-link-ref (link-ref) + () + (:default-initargs :fmtstr #'ml-class-fmtstr-html-ref + :fmtstr-labels #'ml-class-fmtstr-html-ref-labels + :href-head "a href=" + :href-end "a" + :ampersand "&")) + +(defclass xhtml-link-ref (link-ref) () (:default-initargs :fmtstr #'ml-class-fmtstr-html-ref :fmtstr-labels #'ml-class-fmtstr-html-ref-labels @@ -497,6 +521,10 @@ Format is ((field-name field-lookup-func other-link-params) ...)") () (: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)))