NAME
src/pmc/eventhandler.pmc - a handler for events
DESCRIPTION
A PMC that captures the state of the interpreter to invoke when handling an Event.
Vtable Functions
void init()
Initializes an empty void init_pmc(PMC *data)
Initializes a new EventHandler with either a code
a interp
a type
a STRING recording the type of event to handle
priority
the minimum threshhold of priority which the event must meet or exceed for the handler to carevoid mark()
Marks this PMC and any of its contents as live.
void set_string(STRING *type)
Sets the STRING *get_string()
Retrieves the void set_integer_native(INTVAL priority)
Sets the minimum interesting priority for this event handler.
void set_pmc(PMC *interpreter)
Sets the passed-in PMC *get_attr_str(STRING *name)
opcode_t *invoke(void *next)
Runs the contained code,
if any; this is what handles the event.
EventHandler
.
Add attributes to it if you want it to do anything.
Sub
PMC (or descendant) or a Hash
PMC.
With the latter,
the keys should be any or all of:
Sub
(or descendant) PMC containing code to invoke when handling the event
ParrotInterpreter
PMC in which to invoke the code PMC
type
attribute of this event handler to the passed-in string.
type
attribute of this event handler.
ParrotInterpreter
as the active interpreter in which to handle the registered events.
Methods
METHOD can_handle(PMC *event)
Report whether the event handler can handle a particular type of event.