aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-08-17 22:15:31 (GMT)
committerfluxgen <fluxgen>2002-08-17 22:15:31 (GMT)
commit7b6b2661c0a97684543e22f67603e4821a8d5bf1 (patch)
treeacc357771297408a10af2ca5a3c49b85dd65e47f /src
parent0515215ca7414628d71363911050866193102f40 (diff)
downloadfluxbox_pavel-7b6b2661c0a97684543e22f67603e4821a8d5bf1.zip
fluxbox_pavel-7b6b2661c0a97684543e22f67603e4821a8d5bf1.tar.bz2
changed to FbTk EventHandler with SignalEvent
Diffstat (limited to 'src')
-rw-r--r--src/SignalHandler.cc14
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
26namespace FbTk { 26namespace FbTk {
27 27
28SignalHandler::EventHandler *SignalHandler::s_signal_handler[NSIG]; 28EventHandler<SignalEvent> *SignalHandler::s_signal_handler[NSIG];
29 29
30SignalHandler::SignalHandler() { 30SignalHandler::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
41bool SignalHandler::registerHandler(int signum, EventHandler *eh, EventHandler **oldhandler_ret) { 41bool 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
69void SignalHandler::handleSignal(int signum) { 70void 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};