aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.hh
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-09 22:10:48 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-09-14 17:39:10 (GMT)
commitcfcc4d44aa07c0e33ee299e38c94e3f7f6c0458e (patch)
treeff9e21f8863c1e9fccf5429ad09d358a5068ca4e /src/FbTk/Timer.hh
parentd338e6c003cca84733c7900be256a991790f7018 (diff)
downloadfluxbox-cfcc4d44aa07c0e33ee299e38c94e3f7f6c0458e.zip
fluxbox-cfcc4d44aa07c0e33ee299e38c94e3f7f6c0458e.tar.bz2
FbTk::Timer accepts Slots instead of Commands as the former are more general
Diffstat (limited to 'src/FbTk/Timer.hh')
-rw-r--r--src/FbTk/Timer.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh
index e61d77f..4b5a10e 100644
--- a/src/FbTk/Timer.hh
+++ b/src/FbTk/Timer.hh
@@ -56,7 +56,7 @@ namespace FbTk {
56class Timer { 56class Timer {
57public: 57public:
58 Timer(); 58 Timer();
59 explicit Timer(RefCount<Command<void> > &handler); 59 explicit Timer(const RefCount<Slot<void> > &handler);
60 virtual ~Timer(); 60 virtual ~Timer();
61 61
62 void fireOnce(bool once) { m_once = once; } 62 void fireOnce(bool once) { m_once = once; }
@@ -65,7 +65,7 @@ public:
65 /// set timeout 65 /// set timeout
66 void setTimeout(const timeval &val); 66 void setTimeout(const timeval &val);
67 void setTimeout(unsigned int secs, unsigned int usecs); 67 void setTimeout(unsigned int secs, unsigned int usecs);
68 void setCommand(RefCount<Command<void> > &cmd); 68 void setCommand(const RefCount<Slot<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<void> > m_handler; ///< what to do on a timeout 99 RefCount<Slot<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?
@@ -110,7 +110,7 @@ private:
110/// executes a command after a specified timeout 110/// executes a command after a specified timeout
111class DelayedCmd: public Command<void> { 111class DelayedCmd: public Command<void> {
112public: 112public:
113 DelayedCmd(RefCount<Command<void> > &cmd, unsigned int timeout = 200000); 113 DelayedCmd(const RefCount<Slot<void> > &cmd, unsigned int timeout = 200000);
114 void execute(); 114 void execute();
115 static Command<void> *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);