poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1#ifndef POSER_CORE_EVENT_H
2#define POSER_CORE_EVENT_H
3
8#include <poser/decl.h>
9
15typedef void (*PSC_EventHandler)(void *receiver, void *sender, void *args);
16
26C_CLASS_DECL(PSC_Event);
27
33DECLEXPORT PSC_Event *
34PSC_Event_create(void *sender)
35 ATTR_RETNONNULL;
36
44DECLEXPORT void
45PSC_Event_register(PSC_Event *self, void *receiver,
46 PSC_EventHandler handler, int id)
47 CMETHOD ATTR_NONNULL((3));
48
58DECLEXPORT void
59PSC_Event_unregister(PSC_Event *self, void *receiver,
60 PSC_EventHandler handler, int id)
61 CMETHOD ATTR_NONNULL((3));
62
71DECLEXPORT void
72PSC_Event_raise(PSC_Event *self, int id, void *args)
73 CMETHOD;
74
79DECLEXPORT void
81
82#endif
A simple event class.
void PSC_Event_destroy(PSC_Event *self)
PSC_Event destructor.
void PSC_Event_raise(PSC_Event *self, int id, void *args)
Raise an event.
void PSC_Event_register(PSC_Event *self, void *receiver, PSC_EventHandler handler, int id)
Register an event handler.
PSC_Event * PSC_Event_create(void *sender)
PSC_Event constructor.
void PSC_Event_unregister(PSC_Event *self, void *receiver, PSC_EventHandler handler, int id)
Unregister an event handler.
void(* PSC_EventHandler)(void *receiver, void *sender, void *args)
An event handler.
Definition: event.h:15