| parrotcode: a handler for events | |
| Contents | PMCs |

src/pmc/eventhandler.pmc - a handler for events

A PMC that captures the state of the interpreter to invoke when handling an Event.

void init()EventHandler.
Add attributes to it if you want it to do anything.void init_pmc(PMC *data)Sub PMC (or descendant) or a Hash PMC.
With the latter,
the keys should be any or all of:codeSub (or descendant) PMC containing code to invoke when handling the eventinterpParrotInterpreter PMC in which to invoke the code PMCtypepriorityvoid mark()void destroy() void destroy() {
Parrot_EventHandler *e = PMC_data_typed(SELF, Parrot_EventHandler *);
if (e) {
mem_sys_free(e);
PMC_data(SELF) = NULL;
}
}
void set_string(STRING *type)type attribute of this event handler to the passed-in string.STRING *get_string()type attribute of this event handler.void set_integer_native(INTVAL priority)void set_pmc(PMC *interpreter)ParrotInterpreter as the active interpreter in which to handle the registered events.PMC *get_attr_str(STRING *name)opcode_t *invoke(void *next)
PCCMETHOD can_handle(PMC *event)
|
|
|