]> icculus.org git repositories - mikachu/openbox.git/blob - otk/timerqueuemanager.hh
add setup_fallback_focus() to handle focus when nothing is left focused
[mikachu/openbox.git] / otk / timerqueuemanager.hh
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
2 #ifndef __timerqueuemanager_hh
3 #define __timerqueuemanager_hh
4
5 #include "timerqueue.hh"
6
7 namespace otk {
8
9 //! Manages a queue of OBTimer objects
10 /*!
11   All OBTimer objects add themself to an OBTimerQueueManager. The manager is
12   what fires the timers when their time has elapsed. This is done by having the
13   application call the OBTimerQueueManager::fire class in its main event loop.
14 */
15 class OBTimerQueueManager {
16 private:
17   //! A priority queue of all timers being managed by this class.
18   TimerQueue timerList;
19 public:
20   //! Constructs a new OBTimerQueueManager
21   OBTimerQueueManager() {}
22   //! Destroys the OBTimerQueueManager
23   virtual ~OBTimerQueueManager() {}
24
25   //! Fire the next timer in the queue.
26   /*!
27     @param wait If true, this function will wait for the next timer, breaking
28                 on any events from the X server.
29   */
30   virtual void fire(bool wait = true);
31
32   //! Adds a new timer to the queue
33   /*!
34     @param timer An OBTimer to add to the queue
35   */
36   virtual void addTimer(OBTimer* timer);
37   //! Removes a timer from the queue
38   /*!
39     @param timer An OBTimer already in the queue to remove
40   */
41   virtual void removeTimer(OBTimer* timer);
42 };
43
44 }
45
46 #endif // __timerqueuemanager_hh