orx  1.14
Portable Game Engine
OrxEvent

Data Structures

struct  orxEVENT
 

Macros

#define orxEVENT_GET_FLAG(ID)    ((orxU32)(1U << (orxU32)(ID)))
 
#define orxEVENT_INIT(EVENT, TYPE, ID, SENDER, RECIPIENT, PAYLOAD)
 
#define orxEVENT_KU32_FLAG_ID_NONE   0x00000000
 
#define orxEVENT_KU32_MASK_ID_ALL   0xFFFFFFFF
 
#define orxEVENT_SEND(TYPE, ID, SENDER, RECIPIENT, PAYLOAD)
 

Typedefs

typedef orxSTATUS(orxFASTCALL * orxEVENT_HANDLER) (const orxEVENT *_pstEvent)
 

Enumerations

enum  orxEVENT_TYPE {
  orxEVENT_TYPE_ANIM = 0, orxEVENT_TYPE_CLOCK, orxEVENT_TYPE_CONFIG, orxEVENT_TYPE_DISPLAY,
  orxEVENT_TYPE_FX, orxEVENT_TYPE_INPUT, orxEVENT_TYPE_LOCALE, orxEVENT_TYPE_OBJECT,
  orxEVENT_TYPE_RENDER, orxEVENT_TYPE_PHYSICS, orxEVENT_TYPE_RESOURCE, orxEVENT_TYPE_SHADER,
  orxEVENT_TYPE_SOUND, orxEVENT_TYPE_SPAWNER, orxEVENT_TYPE_SYSTEM, orxEVENT_TYPE_TEXTURE,
  orxEVENT_TYPE_TIMELINE, orxEVENT_TYPE_VIEWPORT, orxEVENT_TYPE_CORE_NUMBER, orxEVENT_TYPE_FIRST_RESERVED = orxEVENT_TYPE_CORE_NUMBER,
  orxEVENT_TYPE_LAST_RESERVED = 255, orxEVENT_TYPE_USER_DEFINED, orxEVENT_TYPE_NONE = orxENUM_NONE
}
 

Functions

orxDLLAPI orxSTATUS orxFASTCALL orxEvent_AddHandler (orxEVENT_TYPE _eEventType, orxEVENT_HANDLER _pfnEventHandler)
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_AddHandlerWithContext (orxEVENT_TYPE _eEventType, orxEVENT_HANDLER _pfnEventHandler, void *_pContext)
 
orxDLLAPI void orxFASTCALL orxEvent_Exit ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_Init ()
 
orxDLLAPI orxBOOL orxFASTCALL orxEvent_IsSending ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_RemoveHandler (orxEVENT_TYPE _eEventType, orxEVENT_HANDLER _pfnEventHandler)
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_RemoveHandlerWithContext (orxEVENT_TYPE _eEventType, orxEVENT_HANDLER _pfnEventHandler, void *_pContext)
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_Send (orxEVENT *_pstEvent)
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_SendShort (orxEVENT_TYPE _eEventType, orxENUM _eEventID)
 
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_SetHandlerIDFlags (orxEVENT_HANDLER _pfnEventHandler, orxEVENT_TYPE _eEventType, void *_pContext, orxU32 _u32AddIDFlags, orxU32 _u32RemoveIDFlags)
 
orxDLLAPI void orxFASTCALL orxEvent_Setup ()
 

Detailed Description

Event module Module that handles internal events

Macro Definition Documentation

#define orxEVENT_GET_FLAG (   ID)    ((orxU32)(1U << (orxU32)(ID)))

Definition at line 68 of file orxEvent.h.

#define orxEVENT_INIT (   EVENT,
  TYPE,
  ID,
  SENDER,
  RECIPIENT,
  PAYLOAD 
)
Value:
do \
{ \
EVENT.eType = (orxEVENT_TYPE)(TYPE); \
EVENT.eID = (orxENUM)(ID); \
EVENT.hSender = (orxHANDLE)(SENDER); \
EVENT.hRecipient = (orxHANDLE)(RECIPIENT); \
EVENT.pstPayload = (void *)(PAYLOAD); \
} while(orxFALSE)
#define orxFALSE
Definition: orxType.h:197
void * orxHANDLE
Definition: orxType.h:166
orxEVENT_TYPE
Definition: orxEvent.h:75

Helper defines

Definition at line 50 of file orxEvent.h.

#define orxEVENT_KU32_FLAG_ID_NONE   0x00000000

Definition at line 69 of file orxEvent.h.

#define orxEVENT_KU32_MASK_ID_ALL   0xFFFFFFFF

Definition at line 70 of file orxEvent.h.

#define orxEVENT_SEND (   TYPE,
  ID,
  SENDER,
  RECIPIENT,
  PAYLOAD 
)
Value:
do \
{ \
orxEVENT stEvent; \
orxEVENT_INIT(stEvent, TYPE, ID, SENDER, RECIPIENT, PAYLOAD); \
orxEvent_Send(&stEvent); \
} while(orxFALSE)
#define orxEVENT_INIT(EVENT, TYPE, ID, SENDER, RECIPIENT, PAYLOAD)
Definition: orxEvent.h:50
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_Send(orxEVENT *_pstEvent)
#define orxFALSE
Definition: orxType.h:197

Definition at line 60 of file orxEvent.h.

Typedef Documentation

typedef orxSTATUS(orxFASTCALL * orxEVENT_HANDLER) (const orxEVENT *_pstEvent)

Event handler type / return orxSTATUS_FAILURE if events processing should be stopped for the current event, orxSTATUS_FAILURE otherwise

Definition at line 125 of file orxEvent.h.

Enumeration Type Documentation

Event type enum

Enumerator
orxEVENT_TYPE_ANIM 
orxEVENT_TYPE_CLOCK 
orxEVENT_TYPE_CONFIG 
orxEVENT_TYPE_DISPLAY 
orxEVENT_TYPE_FX 
orxEVENT_TYPE_INPUT 
orxEVENT_TYPE_LOCALE 
orxEVENT_TYPE_OBJECT 
orxEVENT_TYPE_RENDER 
orxEVENT_TYPE_PHYSICS 
orxEVENT_TYPE_RESOURCE 
orxEVENT_TYPE_SHADER 
orxEVENT_TYPE_SOUND 
orxEVENT_TYPE_SPAWNER 
orxEVENT_TYPE_SYSTEM 
orxEVENT_TYPE_TEXTURE 
orxEVENT_TYPE_TIMELINE 
orxEVENT_TYPE_VIEWPORT 
orxEVENT_TYPE_CORE_NUMBER 
orxEVENT_TYPE_FIRST_RESERVED 
orxEVENT_TYPE_LAST_RESERVED 
orxEVENT_TYPE_USER_DEFINED 
orxEVENT_TYPE_NONE 

Definition at line 75 of file orxEvent.h.

Function Documentation

orxDLLAPI orxSTATUS orxFASTCALL orxEvent_AddHandler ( orxEVENT_TYPE  _eEventType,
orxEVENT_HANDLER  _pfnEventHandler 
)

Adds an event handler

Parameters
[in]_eEventTypeConcerned type of event
[in]_pfnEventHandlerEvent handler to add
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_AddHandlerWithContext ( orxEVENT_TYPE  _eEventType,
orxEVENT_HANDLER  _pfnEventHandler,
void _pContext 
)

Adds an event handler with user-defined context

Parameters
[in]_eEventTypeConcerned type of event
[in]_pfnEventHandlerEvent handler to add
[in]_pContextContext that will be stored in events sent to this handler return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxEvent_Exit ( )

Exits from the event Module

orxDLLAPI orxSTATUS orxFASTCALL orxEvent_Init ( )

Initializes the event Module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxBOOL orxFASTCALL orxEvent_IsSending ( )

Is currently sending an event?

Returns
orxTRUE / orxFALSE
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_RemoveHandler ( orxEVENT_TYPE  _eEventType,
orxEVENT_HANDLER  _pfnEventHandler 
)

Removes an event handler

Parameters
[in]_eEventTypeConcerned type of event
[in]_pfnEventHandlerEvent handler to remove return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_RemoveHandlerWithContext ( orxEVENT_TYPE  _eEventType,
orxEVENT_HANDLER  _pfnEventHandler,
void _pContext 
)

Removes an event handler which matches given context

Parameters
[in]_eEventTypeConcerned type of event
[in]_pfnEventHandlerEvent handler to remove
[in]_pContextContext of the handler to remove, orxNULL for removing all occurrences regardless of their context return orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_Send ( orxEVENT _pstEvent)

Sends an event

Parameters
[in]_pstEventEvent to send
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_SendShort ( orxEVENT_TYPE  _eEventType,
orxENUM  _eEventID 
)

Sends a simple event

Parameters
[in]_eEventTypeEvent type
[in]_eEventIDEvent ID
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxEvent_SetHandlerIDFlags ( orxEVENT_HANDLER  _pfnEventHandler,
orxEVENT_TYPE  _eEventType,
void _pContext,
orxU32  _u32AddIDFlags,
orxU32  _u32RemoveIDFlags 
)

Sets an event handler's ID flags (use orxEVENT_GET_FLAG(ID) in order to get the flag that matches an ID)

Parameters
[in]_pfnEventHandlerConcerned event handler, must have been previously added for the given type
[in]_eEventTypeConcerned type of event
[in]_pContextContext of the handler to update, orxNULL for updating all occurrences regardless of their context
[in]_u32AddIDFlagsID flags to add
[in]_u32RemoveIDFlagsID flags to remove
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxEvent_Setup ( )

Event module setup


Generated for orx by doxygen 1.8.11