aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-11 07:41:22 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-11 07:41:22 (GMT)
commit9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch)
tree4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/FbTk/Timer.cc
parent1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff)
downloadfluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip
fluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/FbTk/Timer.cc')
-rw-r--r--src/FbTk/Timer.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc
index ff568dc..f235476 100644
--- a/src/FbTk/Timer.cc
+++ b/src/FbTk/Timer.cc
@@ -24,7 +24,7 @@
24 24
25#include "Timer.hh" 25#include "Timer.hh"
26 26
27#include "ObjectRegistry.hh" 27#include "CommandParser.hh"
28#include "StringUtil.hh" 28#include "StringUtil.hh"
29 29
30//use GNU extensions 30//use GNU extensions
@@ -53,7 +53,7 @@ Timer::Timer():m_timing(false), m_once(false), m_interval(0) {
53 53
54} 54}
55 55
56Timer::Timer(RefCount<Command> &handler): 56Timer::Timer(RefCount<Command<void> > &handler):
57 m_handler(handler), 57 m_handler(handler),
58 m_timing(false), 58 m_timing(false),
59 m_once(false), 59 m_once(false),
@@ -79,7 +79,7 @@ void Timer::setTimeout(const timeval &t) {
79 m_timeout.tv_usec = t.tv_usec; 79 m_timeout.tv_usec = t.tv_usec;
80} 80}
81 81
82void Timer::setCommand(RefCount<Command> &cmd) { 82void Timer::setCommand(RefCount<Command<void> > &cmd) {
83 m_handler = cmd; 83 m_handler = cmd;
84} 84}
85 85
@@ -247,7 +247,7 @@ void Timer::addTimer(Timer *timer) {
247 247
248} 248}
249 249
250Command *DelayedCmd::parse(const std::string &command, 250Command<void> *DelayedCmd::parse(const std::string &command,
251 const std::string &args, bool trusted) { 251 const std::string &args, bool trusted) {
252 252
253 std::string cmd_str; 253 std::string cmd_str;
@@ -255,7 +255,7 @@ Command *DelayedCmd::parse(const std::string &command,
255 if (err == 0) 255 if (err == 0)
256 return 0; 256 return 0;
257 257
258 RefCount<Command> cmd(ObjectRegistry<Command>::instance().parse(cmd_str, trusted)); 258 RefCount<Command<void> > cmd(CommandParser<void>::instance().parse(cmd_str, trusted));
259 if (*cmd == 0) 259 if (*cmd == 0)
260 return 0; 260 return 0;
261 261
@@ -265,9 +265,9 @@ Command *DelayedCmd::parse(const std::string &command,
265 return new DelayedCmd(cmd, delay); 265 return new DelayedCmd(cmd, delay);
266} 266}
267 267
268REGISTER_OBJECT_PARSER(delay, DelayedCmd::parse, Command); 268REGISTER_COMMAND_PARSER(delay, DelayedCmd::parse, void);
269 269
270DelayedCmd::DelayedCmd(RefCount<Command> &cmd, unsigned int timeout) { 270DelayedCmd::DelayedCmd(RefCount<Command<void> > &cmd, unsigned int timeout) {
271 timeval to; // defaults to 200ms 271 timeval to; // defaults to 200ms
272 to.tv_sec = timeout/1000000; 272 to.tv_sec = timeout/1000000;
273 to.tv_usec = timeout % 1000000; 273 to.tv_usec = timeout % 1000000;