ui_timer.c File Reference

#include "../client.h"
#include "ui_nodes.h"
#include "ui_timer.h"
Include dependency graph for ui_timer.c:

Go to the source code of this file.

Defines

#define UI_TIMER_SLOT_NUMBER   10
 Number max of timer slot.

Functions

static void UI_RemoveTimerFromActiveList (uiTimer_t *timer)
 Remove a timer from the active linked list.
static void UI_InsertTimerInActiveList (uiTimer_t *first, uiTimer_t *newTimer)
 Insert a timer in a sorted linked list of timers. List are ordered from smaller to bigger nextTime value.
void UI_HandleTimers (void)
 Internal function to handle timers.
uiTimer_tUI_AllocTimer (uiNode_t *node, int firstDelay, timerCallback_t callback)
 Allocate a new time for a node.
void UI_TimerStart (uiTimer_t *timer)
 Restart a timer.
void UI_TimerStop (uiTimer_t *timer)
 Stop a timer.
void UI_TimerRelease (uiTimer_t *timer)
 Release the timer. It no more exists.

Variables

static uiTimer_t mn_timerSlots [UI_TIMER_SLOT_NUMBER]
 Timer slot. Only one.
static uiTimer_tmn_firstTimer
 First timer from the timer list. This list is ordered from smaller to bigger nextTime value.

Detailed Description

Definition in file ui_timer.c.


Define Documentation

#define UI_TIMER_SLOT_NUMBER   10

Number max of timer slot.

Definition at line 32 of file ui_timer.c.

Referenced by UI_AllocTimer(), and UI_RemoveTimerFromActiveList().


Function Documentation

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

Allocate a new time for a node.

Parameters:
[in] node node parent of the timer
[in] firstDelay millisecond delay to wait the callback
[in] callback callback function to call every delay

Definition at line 123 of file ui_timer.c.

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, qfalse, and UI_TIMER_SLOT_NUMBER.

Referenced by testTimerDataStructure(), UI_GenAllRadarMap_f(), UI_InitDraw(), UI_SpinnerNodeDown(), UI_VScrollbarNodeAction(), and UI_ZoneNodeDown().

void UI_HandleTimers ( void   ) 
static void UI_InsertTimerInActiveList ( uiTimer_t first,
uiTimer_t newTimer 
) [static]

Insert a timer in a sorted linked list of timers. List are ordered from smaller to bigger nextTime value.

Definition at line 66 of file ui_timer.c.

References uiTimer_s::next, uiTimer_s::nextTime, uiTimer_s::prev, and cvar_s::prev.

Referenced by UI_HandleTimers(), and UI_TimerStart().

static void UI_RemoveTimerFromActiveList ( uiTimer_t timer  )  [inline, static]

Remove a timer from the active linked list.

Note:
The function doesn't set to null next and previous attributes of the timer

Definition at line 49 of file ui_timer.c.

References uiTimer_s::next, uiTimer_s::prev, and UI_TIMER_SLOT_NUMBER.

Referenced by UI_HandleTimers(), UI_TimerRelease(), and UI_TimerStop().

void UI_TimerRelease ( uiTimer_t timer  ) 
void UI_TimerStart ( uiTimer_t timer  ) 
void UI_TimerStop ( uiTimer_t timer  ) 

Variable Documentation

First timer from the timer list. This list is ordered from smaller to bigger nextTime value.

Definition at line 43 of file ui_timer.c.

uiTimer_t mn_timerSlots[UI_TIMER_SLOT_NUMBER] [static]

Timer slot. Only one.

Definition at line 37 of file ui_timer.c.


Generated by  doxygen 1.6.2