ui_timer.h

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 2002-2010 UFO: Alien Invasion.
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017 See the GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 */
00024 
00025 #ifndef CLIENT_UI_UI_TIMER_H
00026 #define CLIENT_UI_UI_TIMER_H
00027 
00028 struct uiNode_s;
00029 struct uiTimer_s;
00030 
00031 typedef void (*timerCallback_t)(struct uiNode_s *node, struct uiTimer_s *timer);
00032 
00036 typedef struct uiTimer_s {
00037     struct uiTimer_s *next; 
00038     struct uiTimer_s *prev; 
00039     int nextTime;               
00041     struct uiNode_s *owner; 
00042     timerCallback_t callback;   
00043     int calledTime;             
00045     int delay;                  
00046     void *userData;             
00047     qboolean isRunning;         
00048 } uiTimer_t;
00049 
00050 uiTimer_t* UI_AllocTimer(struct uiNode_s *node, int firstDelay, timerCallback_t callback) __attribute__ ((warn_unused_result));
00051 void UI_TimerStart(uiTimer_t *timer);
00052 void UI_TimerStop(uiTimer_t *timer);
00053 void UI_TimerRelease(uiTimer_t *timer);
00054 
00055 void UI_HandleTimers(void);
00056 
00057 #ifdef COMPILE_UNITTESTS
00058 uiTimer_t *UI_GetFirstTimer(void);
00059 void UI_PrivateInsertTimerInActiveList(uiTimer_t* first, uiTimer_t* newTimer);
00060 #endif
00061 
00062 #endif

Generated by  doxygen 1.6.2