Defines | |
#define | IX_EV_DEFAULT 0x00 |
default event type, automatically reset and not cumulative | |
#define | IX_EV_MANUAL 0x01 |
event has to be reset manually | |
#define | IX_EV_CUMULATIVE 0x02 |
triggering of event is counted | |
#define | IX_EV_INIT 0x04 |
new event is immediately triggred after creation | |
#define | IX_EV(id) ix_event_get((id)) |
an abrevation to get the event by id | |
#define | IX_ID(pev) ix_event_id((pev)) |
an abrevation to get the id of an event | |
Typedefs | |
typedef ix_event_s | ix_event_t |
handle of event structure | |
typedef ix_evl_s | ix_evl_t |
handle of event listener | |
typedef int(*) | IX_EVENT_HOOK_FCT (ix_event_t *pev) |
Functions | |
ix_event_t * | ix_event_new (int id, int flag, void *userdata) |
ix_event_t * | ix_event_i_new (int flags, void *userdata) |
int | ix_event_set_hook (IX_EVENT_HOOK_FCT hook) |
int | ix_event_free (ix_event_t *pe) |
ix_event_t * | ix_event_get (int id) |
int | ix_event_id (ix_event_t *pev) |
int | ix_event_set (ix_event_t *pe) |
int | ix_event_check (ix_event_t *pe) |
int | ix_event_isset (ix_event_t *pe) |
int | ix_event_reset (ix_event_t *pe) |
int | ix_event_add_evl (ix_event_t *pe, struct ix_evl_s *pevl) |
int | ix_event_del_evl (ix_event_t *pe, struct ix_evl_s *pevl) |
void * | ix_event_data (ix_event_t *pe) |
void * | ix_event_set_data (ix_event_t *pe, void *userdata) |
int | ix_event_getnewid (void) |
Events have to be created with ix_event_new(), released with ix_event_free().
During creation you can relate an event-id to the event (number between 0 and 127). You can always get the event-handle by the macro IX_EV() or vice versa with IX_ID(). With ix_event_i_new() you can create an event with automatically assigned a free id outside the range of user-supplied-event-ids.
See Set of events for more information dealing with receiving and waiting for events.
#define IX_EV_DEFAULT 0x00 |
default event type, automatically reset and not cumulative
types of events, or-ing is possible
typedef int( * ) IX_EVENT_HOOK_FCT(ix_event_t *pev) |
this is a hook function: if set it is called whenever an user event is triggered externally or internally see ix_event_set_hook()
int ix_event_check | ( | ix_event_t * | pe | ) |
checks event and reset event due to type (manual,default,...)
pe | event handle |
void* ix_event_data | ( | ix_event_t * | pe | ) |
return the userdata of an event
pe | event handle |
int ix_event_free | ( | ix_event_t * | pe | ) |
frees event, destructor
pe | event handle |
ix_event_t* ix_event_get | ( | int | id | ) |
returns event handle for some event-id
id | event-id |
int ix_event_getnewid | ( | void | ) |
get a new free event id from pool
ix_event_t* ix_event_i_new | ( | int | flags, | |
void * | userdata | |||
) |
allocates a new event of type flag, with userdata The id is supplied by the system internally (e.g. to be used in libraries for not to disturb the range of user ids)
flag | event type | |
userdata | some arbitrary user data |
int ix_event_id | ( | ix_event_t * | pev | ) |
return the event id
pe | event handle |
int ix_event_isset | ( | ix_event_t * | pe | ) |
checks if event is set
pe | event handle |
ix_event_t* ix_event_new | ( | int | id, | |
int | flag, | |||
void * | userdata | |||
) |
allocates a new event with id, of type flag, with userdata
id | ranged from 0 to 127 | |
flag | event type | |
userdata | some arbitrary user data |
int ix_event_reset | ( | ix_event_t * | pe | ) |
resets event to 0
pe | event handle |
int ix_event_set | ( | ix_event_t * | pe | ) |
triggers event
pe | event handle |
void* ix_event_set_data | ( | ix_event_t * | pe, | |
void * | userdata | |||
) |
set the userdata of an event
pe | event handle |
int ix_event_set_hook | ( | IX_EVENT_HOOK_FCT | hook | ) |
set a hook function for user events
hook | the hook function to set |