src/pmc/eventhandler.pmc - a handler for events
A PMC that captures the state of the interpreter to invoke when handling an Event.
Initializes an empty
void init_pmc(PMC *data)
Initializes a new EventHandler with either a
a STRING recording the type of event to handle
the minimum threshhold of priority which the event must meet or exceed for the handler to care
Marks this PMC and any of its contents as live.
void set_string(STRING *type)
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.
SubPMC (or descendant) or a
HashPMC. With the latter, the keys should be any or all of:
Sub(or descendant) PMC containing code to invoke when handling the event
ParrotInterpreterPMC in which to invoke the code PMC
typeattribute of this event handler to the passed-in string.
typeattribute of this event handler.
ParrotInterpreteras the active interpreter in which to handle the registered events.
METHOD can_handle(PMC *event)
Report whether the event handler can handle a particular type of event.