diff options
author | fluxgen <fluxgen> | 2002-08-17 22:15:31 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-08-17 22:15:31 (GMT) |
commit | 7b6b2661c0a97684543e22f67603e4821a8d5bf1 (patch) | |
tree | acc357771297408a10af2ca5a3c49b85dd65e47f /src/SignalHandler.cc | |
parent | 0515215ca7414628d71363911050866193102f40 (diff) | |
download | fluxbox-7b6b2661c0a97684543e22f67603e4821a8d5bf1.zip fluxbox-7b6b2661c0a97684543e22f67603e4821a8d5bf1.tar.bz2 |
changed to FbTk EventHandler with SignalEvent
Diffstat (limited to 'src/SignalHandler.cc')
-rw-r--r-- | src/SignalHandler.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/SignalHandler.cc b/src/SignalHandler.cc index 67f83fa..2ef2cd6 100644 --- a/src/SignalHandler.cc +++ b/src/SignalHandler.cc | |||
@@ -19,13 +19,13 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: SignalHandler.cc,v 1.1 2002/08/13 23:57:04 fluxgen Exp $ | 22 | // $Id: SignalHandler.cc,v 1.2 2002/08/17 22:15:31 fluxgen Exp $ |
23 | 23 | ||
24 | #include "SignalHandler.hh" | 24 | #include "SignalHandler.hh" |
25 | 25 | ||
26 | namespace FbTk { | 26 | namespace FbTk { |
27 | 27 | ||
28 | SignalHandler::EventHandler *SignalHandler::s_signal_handler[NSIG]; | 28 | EventHandler<SignalEvent> *SignalHandler::s_signal_handler[NSIG]; |
29 | 29 | ||
30 | SignalHandler::SignalHandler() { | 30 | SignalHandler::SignalHandler() { |
31 | // clear signal list | 31 | // clear signal list |
@@ -38,7 +38,8 @@ SignalHandler *SignalHandler::instance() { | |||
38 | return &singleton; | 38 | return &singleton; |
39 | } | 39 | } |
40 | 40 | ||
41 | bool SignalHandler::registerHandler(int signum, EventHandler *eh, EventHandler **oldhandler_ret) { | 41 | bool SignalHandler::registerHandler(int signum, EventHandler<SignalEvent> *eh, |
42 | EventHandler<SignalEvent> **oldhandler_ret) { | ||
42 | // must be less than NSIG | 43 | // must be less than NSIG |
43 | if (signum >= NSIG) | 44 | if (signum >= NSIG) |
44 | return false; | 45 | return false; |
@@ -68,8 +69,11 @@ void SignalHandler::removeHandler(int signum) { | |||
68 | 69 | ||
69 | void SignalHandler::handleSignal(int signum) { | 70 | void SignalHandler::handleSignal(int signum) { |
70 | // make sure we got a handler for this signal | 71 | // make sure we got a handler for this signal |
71 | if (s_signal_handler[signum] != 0) | 72 | if (s_signal_handler[signum] != 0) { |
72 | s_signal_handler[signum]->handleSignal(signum); | 73 | SignalEvent sigev; |
74 | sigev.signum = signum; | ||
75 | s_signal_handler[signum]->handleEvent(&sigev); | ||
76 | } | ||
73 | } | 77 | } |
74 | 78 | ||
75 | }; | 79 | }; |