;;; -*- mode: Lisp; Syntax: Common-Lisp; -*- ;;; ;;; Copyright (c) 2009 by the authors. ;;; ;;; See LICENCE for details. (in-package :hu.dwim.presentation) ;;;;;; ;;; book/alternator/inspector (def (icon e) book) (def (component e) book/alternator/inspector (text/alternator/inspector exportable/component) ()) (def subtype-mapper *inspector-type-mapping* (or null book) book/alternator/inspector) (def layered-method make-alternatives ((component book/alternator/inspector) (class standard-class) (prototype book) (value book)) (list* (make-instance 'book/text/inspector :component-value value) (make-instance 'book/toc/inspector :component-value value) (call-next-layered-method))) (def layered-method export-file-name (format (component book/alternator/inspector) (value book)) (title-of value)) (def (function e) make-book-menu-item (name) (menu-item/widget () (replace-target-place/widget () (icon/widget book :label (title-of (find-book name))) (make-value-viewer (find-book name))))) ;;;;;; ;;; t/reference/inspector (def layered-method make-reference-content ((component t/reference/inspector) (class standard-class) (prototype book) (value book)) (title-of value)) ;;;;;; ;;; book/text/inspector (def (component e) book/text/inspector (t/text/inspector collapsible-contents/component title/mixin exportable/component) ((toc :type component))) (def refresh-component book/text/inspector (bind (((:slots toc component-value) -self-)) (setf toc (make-instance 'book/toc/inspector :component-value component-value)))) (def render-xhtml book/text/inspector (with-render-style/component (-self-) (render-collapse-or-expand-command-for -self-) (render-title-for -self-) (foreach #'render-author (authors-of (component-value-of -self-))) (when (expanded-component? -self-)