;; smil-tags.lisp --- ;; Copyright (C) 2008 Clinton Ebadi ;; Author: Clinton Ebadi ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU Lesser General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU Lesser General Public License ;; along with this program. If not, see . (in-package :org.unknownlamer.golgonooza.smil-tags) (defmacro def-smil-tag (name &rest attributes) (let ((tag-name (string-downcase (symbol-name name))) (frobbed-attributes (mapcan (lambda (a) (list (string-downcase (symbol-name a)) a)) attributes))) `(deftag ,name (&attribute ,@attributes &body body) (emit-open-tag ,tag-name (list ,@frobbed-attributes)) (emit-body body) (emit-close-tag ,tag-name)))) (defmacro def-empty-smil-tag (name &rest attributes) (let ((tag-name (string-downcase (symbol-name name))) (frobbed-attributes (mapcan (lambda (a) (list (string-downcase (symbol-name a)) a)) attributes))) `(deftag ,name (&attribute ,@attributes) (emit-empty-tag ,tag-name (list ,@frobbed-attributes))))) (def-smil-tag smil) (def-smil-tag head) (def-smil-tag body) (def-smil-tag seq) (def-empty-smil-tag video src type) (def-empty-smil-tag audio src type)