#include "../client.h"
#include "ui_nodes.h"
#include "ui_timer.h"
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_t * | UI_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_t * | mn_firstTimer |
First timer from the timer list. This list is ordered from smaller to bigger nextTime value. |
Definition in file ui_timer.c.
#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().
uiTimer_t* UI_AllocTimer | ( | uiNode_t * | node, | |
int | firstDelay, | |||
timerCallback_t | callback | |||
) |
Allocate a new time for a node.
[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 | ) |
Internal function to handle timers.
Definition at line 98 of file ui_timer.c.
References uiTimer_s::callback, uiTimer_s::calledTime, CL_Milliseconds(), uiTimer_s::delay, uiTimer_s::isRunning, uiTimer_s::next, uiTimer_s::nextTime, uiTimer_s::owner, UI_InsertTimerInActiveList(), and UI_RemoveTimerFromActiveList().
Referenced by UI_Draw().
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.
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 | ) |
Release the timer. It no more exists.
Definition at line 177 of file ui_timer.c.
References uiTimer_s::callback, uiTimer_s::next, uiTimer_s::owner, uiTimer_s::prev, and UI_RemoveTimerFromActiveList().
Referenced by testTimerDataStructure(), UI_GenAllRadarMapRelease_f(), UI_SpinnerNodeCapturedMouseLost(), UI_VScrollbarNodeCapturedMouseLost(), and UI_ZoneNodeCapturedMouseLost().
void UI_TimerStart | ( | uiTimer_t * | timer | ) |
Restart a timer.
Definition at line 151 of file ui_timer.c.
References CL_Milliseconds(), uiTimer_s::delay, uiTimer_s::isRunning, uiTimer_s::next, uiTimer_s::nextTime, uiTimer_s::prev, qtrue, and UI_InsertTimerInActiveList().
Referenced by testTimerDataStructure(), UI_Draw(), UI_GenAllRadarMap_f(), UI_SpinnerNodeDown(), UI_VScrollbarNodeAction(), and UI_ZoneNodeDown().
void UI_TimerStop | ( | uiTimer_t * | timer | ) |
Stop a timer.
Definition at line 164 of file ui_timer.c.
References uiTimer_s::isRunning, uiTimer_s::next, uiTimer_s::prev, qfalse, and UI_RemoveTimerFromActiveList().
Referenced by testTimerDataStructure(), UI_CheckTooltipDelay(), and UI_Draw().
uiTimer_t* mn_firstTimer [static] |
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.