3 * ***** BEGIN GPL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20 * All rights reserved.
22 * The Original Code is: all of this file.
24 * Contributor(s): none yet.
26 * ***** END GPL LICENSE BLOCK *****
29 /** \file ghost/GHOST_ITimerTask.h
31 * Declaration of GHOST_ITimerTask interface class.
34 #ifndef _GHOST_ITIMER_TASK_H_
35 #define _GHOST_ITIMER_TASK_H_
37 #include "GHOST_Types.h"
41 * Interface for a timer task.
42 * Timer tasks are created by the system and can be installed by the system.
43 * After installation, the timer callback-procedure or "timerProc" will be called
44 * periodically. You should not need to inherit this class. It is passed to the
45 * application in the timer-callback.<br>
47 * Note that GHOST processes timers in the UI thread. You should ask GHOST
48 * process messages in order for the timer-callbacks to be called.
49 * @see GHOST_ISystem#installTimer
50 * @see GHOST_TimerProcPtr
51 * @author Maarten Gribnau
54 class GHOST_ITimerTask
60 virtual ~GHOST_ITimerTask()
65 * Returns the timer callback.
66 * @return The timer callback.
68 virtual GHOST_TimerProcPtr getTimerProc() const = 0;
71 * Changes the timer callback.
72 * @param timerProc The timer callback.
74 virtual void setTimerProc(const GHOST_TimerProcPtr timerProc) = 0;
77 * Returns the timer user data.
78 * @return The timer user data.
80 virtual GHOST_TUserDataPtr getUserData() const = 0;
83 * Changes the time user data.
84 * @param data The timer user data.
86 virtual void setUserData(const GHOST_TUserDataPtr userData) = 0;
88 #ifdef WITH_CXX_GUARDEDALLOC
90 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_ITimerTask"); }
91 void operator delete( void *mem ) { MEM_freeN(mem); }
95 #endif // _GHOST_ITIMER_TASK_H_