add-event-functionEventsdescribe-event-printingdefine-event-classGoTo Top

define-event-class   event-class-name ({superclass-name}*) ({slot-specifier}*) {class-option}* => new-event-class[Macro]

Purpose
Define or redefine an event class.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

event-class-name     A non-nil, non-keyword symbol that names the event class
superclass-name     A non-nil, non-keyword symbol that specifies a direct superclass of the event class event-class-name
slot-specifiers     See below
class-options     See below
new-event-class     A new or modified event class object.

Returns
The newly defined or modified event class object.

Detailed syntax

slot-specifier ::= slot-name | (slot-name [[slot-option]])

slot-option ::= {:accessor reader-function-name}* |
{:allocation allocation-type} |
{:documentation string} |
{:initarg initarg-name}* |
{:initform form} |
{:reader reader-function-name}* |
{:type type-specifier} |
{:writer writer-function-name}*
class-option ::= (:abstract boolean) |
(:default-initargs . initarg-list) |
(:documentation string) |
(:event-metaclass event-metaclass-specifier) |
(:event-printing event-printing-specifier/code) |
(:export-accessors boolean) |
(:export-class-name boolean) |
(:export-slot-names direct-slots-specifier) |
(:generate-accessors direct-slots-specifier) |
(:generate-accessors-format {:prefix | :suffix} |
(:generate-accessors-prefix {string | symbol}) |
(:generate-accessors-suffix {string | symbol}) |
(:generate-initargs direct-slots-specifier) |
(:metaclass class-name)
event-metaclass-specifier ::= non-instance-event-class | instance-event-class |
space-instance-event-class |
nonlink-slot-event-class | link-slot-event-class
direct-slots-specifier ::= nil | t | included-slot-name* |
{t :exclude excluded-slot-name*}

Terms

class-name     A non-nil, non-keyword symbol that names a class
documentation     A documentation string
initarg-list     An initialization argument list
slot-name     A non-nil, non-keyword symbol

Description
Each superclass-name argument specifies a direct superclass of the new class. If the superclass list is empty, then the direct superclass defaults to the single class standard-event-instance.

The :metaclass class-name class option, if specified, must be a subclass of standard-event-class. The default metaclass value is the metaclass of the event superclasses of event-class-name if they all have the smae metaclass. If the event superclasses have multiple metaclasses, the metaclass of event-class-name must be provided. The following table lists the compatible event-superclass metaclasses for each event metaclass:

      Compatible Event-Superclass Metaclasses
Event      non-        space-     nonlink-    link-
Metaclassinstanceinstance instanceslotslot
non-instance-event-class X
instance-event-class XX
space-instance-event-class XXX
nonlink-slot-event-class XX X
link-slot-event-class XX X

The table in the documentation for signal-event lists the initialization arguments that are required when signaling an event. These required initialization arguments are based on the event metaclass of the event class of the event that is being signaled.

See also
    signal-event
    standard-event-class
    standard-event-instance
    with-generate-accessors-format

Example

  > (define-event-class my-event (non-instance-event)
      ((my-event-arg1 :initform nil)
       (my-event-arg2 :initform nil)))
  #<non-instance-event-class my-event>
  >


The GBBopen Project


add-event-functionEventsdescribe-event-printingdefine-event-classGoTo Top