UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_timer.h File Reference
#include "../../shared/cxx.h"

Go to the source code of this file.

Data Structures

struct  uiTimer_s
 

Typedefs

typedef void(* timerCallback_t )(uiNode_t *node, struct uiTimer_s *timer)
 
typedef struct uiTimer_s uiTimer_t
 

Functions

uiTimer_tUI_AllocTimer (uiNode_t *node, int firstDelay, timerCallback_t callback) __attribute__((warn_unused_result))
 Allocate a new time for a node. More...
 
void UI_TimerStart (uiTimer_t *timer)
 Restart a timer. More...
 
void UI_TimerStop (uiTimer_t *timer)
 Stop a timer. More...
 
void UI_TimerRelease (uiTimer_t *timer)
 Release the timer. It no more exists. More...
 
void UI_ResetTimers (void)
 
void UI_HandleTimers (void)
 Internal function to handle timers. More...
 

Typedef Documentation

typedef void(* timerCallback_t)(uiNode_t *node, struct uiTimer_s *timer)

Definition at line 31 of file ui_timer.h.

typedef struct uiTimer_s uiTimer_t
Todo:
We can use void* for the owner type, and allow to use it outside nodes

Function Documentation

uiTimer_t* UI_AllocTimer ( uiNode_t node,
int  firstDelay,
timerCallback_t  callback 
)

Allocate a new time for a node.

Parameters
[in]nodenode parent of the timer
[in]firstDelaymillisecond delay to wait the callback
[in]callbackcallback function to call every delay

Definition at line 123 of file ui_timer.cpp.

References uiTimer_s::callback, uiTimer_s::calledTime, Com_Error(), uiTimer_s::delay, ERR_FATAL, i, uiTimer_s::isRunning, uiTimer_s::next, uiTimer_s::owner, uiTimer_s::prev, timer, and UI_TIMER_SLOT_NUMBER.

Referenced by CL_BattlescapeRadarGenerateAll_f(), uiZoneNode::onMouseDown(), uiSpinnerNode::onMouseDown(), TEST_F(), UI_InitDraw(), UI_MouseDown(), and UI_VScrollbarNodeAction().

void UI_ResetTimers ( void  )

Definition at line 185 of file ui_timer.cpp.

References OBJZERO.

Referenced by UI_Shutdown().