r3049: *** empty log message ***
[kmrcl.git] / ml-class.lisp
index c42d2ae25884f46754add3288040090ce98ca71b..c3d20406c47b2c816bee4473e7e0db5d601170c1 100644 (file)
@@ -11,7 +11,7 @@
 ;;;; in Text, HTML, and XML formats. This includes hyperlinking
 ;;;; capability and sub-objects.
 ;;;;
-;;;; $Id: ml-class.lisp,v 1.11 2002/10/14 19:26:36 kevin Exp $
+;;;; $Id: ml-class.lisp,v 1.13 2002/10/16 05:57:12 kevin Exp $
 ;;;;
 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
   #+sbcl (sb-pcl:class-of obj)
   #+cmu (pcl:class-of obj))
 
+(defun ml-class-name (obj)
+  #-(or cmu sbcl) (class-name obj)
+  #+sbcl (sb-pcl:class-name obj)
+  #+cmu (pcl:class-name obj))
+
 (defclass ml-class (#-(or cmu sbcl) standard-class
                      #+cmu pcl::standard-class
                      #+sbcl sb-pcl::standard-class)
@@ -154,7 +159,7 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
          (value-func '())
          (xmlvalue-func '())
          (classname (class-name cl))
-         (package (symbol-package (class-name cl)))
+         (package (symbol-package (ml-class-name cl)))
          (ref-fields (slot-value cl 'ref-fields)))
       (declare (ignore classname))
       (dolist (f (slot-value cl 'fields))
@@ -310,7 +315,7 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
   (string-downcase (subseq name 1)))
   
 (defmethod ml-class-stdname ((cl standard-object))
-  (string-downcase (subseq (class-name (ml-class-of cl)) 1)))
+  (string-downcase (subseq (ml-class-name (ml-class-of cl)) 1)))
   
 ;;;; Generic Print functions
 
@@ -319,6 +324,7 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
 (defparameter *default-htmlrefformat* nil)
 (defparameter *default-xmlformat* nil)
 (defparameter *default-xmlrefformat* nil)
+(defparameter *default-ie-xmlrefformat* nil)
 (defparameter *default-nullformat* nil)
 (defparameter *default-init-format?* nil)
 
@@ -329,6 +335,7 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
     (setq *default-htmlrefformat* (make-instance 'htmlrefformat))
     (setq *default-xmlformat* (make-instance 'xmlformat))
     (setq *default-xmlrefformat* (make-instance 'xmlrefformat))
+    (setq *default-ie-xmlrefformat* (make-instance 'ie-xmlrefformat))
     (setq *default-nullformat* (make-instance 'nullformat))
     (setq *default-init-format?* t))
   
@@ -337,7 +344,9 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
       (:html *default-htmlformat*)
       (:htmlref *default-htmlrefformat*)
       (:xml  *default-xmlformat*)
+      (:xml  *default-xmlformat*)
       (:xmlref *default-xmlrefformat*)
+      (:ie-xmlref *default-ie-xmlrefformat*)
       (:null *default-nullformat*)
       (otherwise *default-textformat*)))
     
@@ -415,13 +424,13 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
 
 
 (defun class-name-of (obj)
-  (string-downcase (class-name (ml-class-of obj))))
+  (string-downcase (ml-class-name (ml-class-of obj))))
 
 (defun xmlformat-list-end-value-func (x)
-  (format nil "~alist" (string-downcase (class-name (ml-class-of x)))))
+  (format nil "~alist" (string-downcase (ml-class-name (ml-class-of x)))))
 
 (defun xmlformat-list-start-value-func (x nitems) 
-  (values (format nil "~alist" (string-downcase (class-name (ml-class-of x)))) (ml-class-title x) nitems))
+  (values (format nil "~alist" (string-downcase (ml-class-name (ml-class-of x)))) (ml-class-title x) nitems))
 
 (defclass xmlformat (textformat) 
   ()
@@ -467,10 +476,17 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
 (defclass xml-link-ref (link-ref)
   ()
   (:default-initargs :fmtstr #'ml-class-fmtstr-xml-ref 
-    :fmtstr-labels #'ml-class-fmtstr-xml-ref-labels
-    :href-head "xmllink xlink:type=\"simple\" xlink:href=" 
-    :href-end "xmllink" 
-    :ampersand "&"))
+                    :fmtstr-labels #'ml-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)
@@ -481,6 +497,10 @@ Format is ((field-name field-lookup-func other-link-params) ...)")
   ()
   (:default-initargs :link-ref (make-instance 'xml-link-ref)))
 
+(defclass ie-xmlrefformat (xmlformat)
+  ()
+  (:default-initargs :link-ref (make-instance 'ie-xml-link-ref)))
+
 
 ;;; File Start and Ends