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_ITimerTask.h
30 * Declaration of GHOST_ITimerTask interface class.
33 #ifndef _GHOST_ITIMER_TASK_H_
34 #define _GHOST_ITIMER_TASK_H_
36 #include "GHOST_Types.h"
40 * Interface for a timer task.
41 * Timer tasks are created by the system and can be installed by the system.
42 * After installation, the timer callback-procedure or "timerProc" will be called
43 * periodically. You should not need to inherit this class. It is passed to the
44 * application in the timer-callback.<br>
46 * Note that GHOST processes timers in the UI thread. You should ask GHOST
47 * process messages in order for the timer-callbacks to be called.
48 * @see GHOST_ISystem#installTimer
49 * @see GHOST_TimerProcPtr
50 * @author Maarten Gribnau
53 class GHOST_ITimerTask
59 virtual ~GHOST_ITimerTask()
64 * Returns the timer callback.
65 * @return The timer callback.
67 virtual GHOST_TimerProcPtr getTimerProc() const = 0;
70 * Changes the timer callback.
71 * @param timerProc The timer callback.
73 virtual void setTimerProc(const GHOST_TimerProcPtr timerProc) = 0;
76 * Returns the timer user data.
77 * @return The timer user data.
79 virtual GHOST_TUserDataPtr getUserData() const = 0;
82 * Changes the time user data.
83 * @param data The timer user data.
85 virtual void setUserData(const GHOST_TUserDataPtr userData) = 0;
87 #ifdef WITH_CXX_GUARDEDALLOC
89 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_ITimerTask"); }
90 void operator delete( void *mem ) { MEM_freeN(mem); }
94 #endif // _GHOST_ITIMER_TASK_H_