comic/add-events [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 add-events

File

 comic.lsp

Description

 Adds events to a comic. If an id is supplied, the events will
 be added to the event with that id. Otherwise the events will
 be added directly to the events-slot of the comic.

 When called with a comic, the method will also assign ids to 
 the new events.

Parameter

 comic: the comic to modify
 events: the events to add (Can be a list of events or a single
 event.)
 id: If supplied, the id of the event to add the events to.

Return Value

 boolean (t if events were added, else nil)

Synopsis

(defmethod add-events ((comic comic) events &optional id)

Example

(add-events my-comic (make-event)) --> t
(add-events my-comic (make-event) 10) 
--> t if event with id 10 was found, else nil

comic/check-comic [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 check-comic

File

 comic.lisp

Description

 Checks the state of a comic-object:
 -> Do all events have an ID?
 -> Are the start-time and duration values consistent?

Arguments

 comic: the comic-object

Optional Arguments

 print (default t): Print detailed information to stream

Return Value

 boolean: If the comic object passes all test T, else NIL

Synopsis

(defun check-comic (comic &optional (print t))

Example

(check-comic +test-comic+) --> NIL, because it holds added events
                                    without IDs.
(progn 
  (cc-prepare +test-comic)
  (check-comic +test-comic+)) --> T

comic/comicp [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 comicp

File

 comic.lisp

Description

 returns t if the specified object is a comic

Arguments

 obj: any object

Return Value

 boolean

Example

;;; (comicp my-comic) --> t

comic/delete-event [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 delete-event

File

 comic.lsp

Description

 Deletes event with given ID from comic, including all subevents.

Arguments

 comic: the comic
 id: the id of the event to delete

Optional Arguments

 print: print to std-out when event is deleted

Return Value

 boolean: t if event deleted, else nil

Synopsis

(defmethod delete-event ((comic comic) id &optional (print t))

comic/get-event-by-id [ Methods ]

[ Top ] [ comic ] [ Methods ]

Name

 get-event-by-id

File

 comic.lsp

Description

 Returns the event with the given ID from a comic (or event).

Parameter

 comic: the comic
 id: the id

Return Value

 event

Synopsis

(defmethod get-event-by-id ((comic event) id)

comic/get-event-by-name [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 get-event-by-name

File

 comic.lsp

Description

 Returns all events with a given name from a comic (or event).

Arguments

 comic: the comic. Can also be an event.
 a name (symbol)

Return Value

 event or list (if multiple results)

Synopsis

(defun get-event-by-name (comic name)

comic/get-events-by-time [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 get-events-by-time

File

 comic.lsp

Description

 Returns all events active at a given point of time.
 Be carefull to (prepare comic) first, as the function 
 only looks at the values of a single event.

Arguments

 comic: The comic. Can also be an event, but should idealy
        be a prepared comic. 
 time: The point in time. Value defaults to seconds.

Return Value

 event

Synopsis

(defun get-events-by-time (comic time)

comic/make-comic [ Functions ]

[ Top ] [ comic ] [ Functions ]

Name

 make-comic

File

 comic.lisp

Description

 Creates a comic and checks if given values are of approprate
 types. If a name is supplied, the comic will be bound to that
 symbol and be available as a global variable.

 The function also checks the start-time and duration-slots
 of all given events and subevents (and so on) for consistency:
 E.g. if the comic has a duration of 1 minute, but a given event
 starts at minute 2, an error will be signaled.

 A comic is an event and inherits all slots from the event class.
 Additional slots of the comic class, like title, subtitle, author
 and date have no special purpose per se, but may be accessed by
 render-modes, e.g. to write meta-data to a file, a header to a
 document, etc.

Arguments

 name (symbol)

Optional Arguments

 title (string or symbol, default: "untitlted")
 subtitle (string or symbol)
 author (string or symbol)
 date (string or symbol, default: todays date)
 ... as well as all slots of the event class.

Return Value

 comic

Synopsis

(defun make-comic
    (name ; if a name is supplied, it will be a global variable
     &rest
       args
     &key
       (title "untitled")
       subtitle
       author
       (date (todays-date))
       events
       protagonists
       &allow-other-keys)

Example

;;; (make-comic '+my-comic+ :events (...))

event/comic [ Classes ]

[ Top ] [ event ] [ Classes ]

Name

 comic

File

 comic.lisp

Description

 Definition of comic-class.

Slots

 Direct slots: title, subtitle, author, date
 ...as well as all slots of the event and named-object classes

Synopsis

(defclass comic (event)
  ((title :accessor title
          :initarg :title
          :initform "untitled")
   (subtitle :accessor subtitle
             :initarg :subtitle
             :initform nil)
   (author :accessor author
             :initarg :author
             :initform nil)
   (date :accessor date
         :initarg :date
         :initform (todays-date))
   (protagonists :initarg :protagonists
                 :initform nil)))