diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
commit | 9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch) | |
tree | 4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/FbTk/Timer.hh | |
parent | 1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff) | |
download | fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2 |
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/FbTk/Timer.hh')
-rw-r--r-- | src/FbTk/Timer.hh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh index 01f4860..4893fdb 100644 --- a/src/FbTk/Timer.hh +++ b/src/FbTk/Timer.hh | |||
@@ -57,7 +57,7 @@ namespace FbTk { | |||
57 | class Timer { | 57 | class Timer { |
58 | public: | 58 | public: |
59 | Timer(); | 59 | Timer(); |
60 | explicit Timer(RefCount<Command> &handler); | 60 | explicit Timer(RefCount<Command<void> > &handler); |
61 | virtual ~Timer(); | 61 | virtual ~Timer(); |
62 | 62 | ||
63 | void fireOnce(bool once) { m_once = once; } | 63 | void fireOnce(bool once) { m_once = once; } |
@@ -65,7 +65,7 @@ public: | |||
65 | void setTimeout(time_t val); | 65 | void setTimeout(time_t val); |
66 | /// set timeout | 66 | /// set timeout |
67 | void setTimeout(const timeval &val); | 67 | void setTimeout(const timeval &val); |
68 | void setCommand(RefCount<Command> &cmd); | 68 | void setCommand(RefCount<Command<void> > &cmd); |
69 | void setInterval(int val) { m_interval = val; } | 69 | void setInterval(int val) { m_interval = val; } |
70 | /// start timing | 70 | /// start timing |
71 | void start(); | 71 | void start(); |
@@ -96,7 +96,7 @@ private: | |||
96 | typedef std::list<Timer *> TimerList; | 96 | typedef std::list<Timer *> TimerList; |
97 | static TimerList m_timerlist; ///< list of all timers, sorted by next trigger time (start + timeout) | 97 | static TimerList m_timerlist; ///< list of all timers, sorted by next trigger time (start + timeout) |
98 | 98 | ||
99 | RefCount<Command> m_handler; ///< what to do on a timeout | 99 | RefCount<Command<void> > m_handler; ///< what to do on a timeout |
100 | 100 | ||
101 | bool m_timing; ///< clock running? | 101 | bool m_timing; ///< clock running? |
102 | bool m_once; ///< do timeout only once? | 102 | bool m_once; ///< do timeout only once? |
@@ -108,11 +108,11 @@ private: | |||
108 | }; | 108 | }; |
109 | 109 | ||
110 | /// executes a command after a specified timeout | 110 | /// executes a command after a specified timeout |
111 | class DelayedCmd: public Command { | 111 | class DelayedCmd: public Command<void> { |
112 | public: | 112 | public: |
113 | DelayedCmd(RefCount<Command> &cmd, unsigned int timeout = 200000); | 113 | DelayedCmd(RefCount<Command<void> > &cmd, unsigned int timeout = 200000); |
114 | void execute(); | 114 | void execute(); |
115 | static Command *parse(const std::string &command, | 115 | static Command<void> *parse(const std::string &command, |
116 | const std::string &args, bool trusted); | 116 | const std::string &args, bool trusted); |
117 | private: | 117 | private: |
118 | Timer m_timer; | 118 | Timer m_timer; |