diff options
Diffstat (limited to 'src/FbTk/SignalHandler.hh')
-rw-r--r-- | src/FbTk/SignalHandler.hh | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/FbTk/SignalHandler.hh b/src/FbTk/SignalHandler.hh index e05fb3a..aa3a275 100644 --- a/src/FbTk/SignalHandler.hh +++ b/src/FbTk/SignalHandler.hh | |||
@@ -1,4 +1,4 @@ | |||
1 | // SignalHandler.hh for Fluxbox Window Manager | 1 | // SignalHandler.hh for FbTk |
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | 2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
@@ -19,19 +19,19 @@ | |||
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.hh,v 1.1 2002/11/26 16:01:27 fluxgen Exp $ | 22 | // $Id: SignalHandler.hh,v 1.2 2002/11/27 21:47:33 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_SIGNALHANDLER_HH | 24 | #ifndef FBTK_SIGNALHANDLER_HH |
25 | #define FBTK_SIGNALHANDLER_HH | 25 | #define FBTK_SIGNALHANDLER_HH |
26 | 26 | ||
27 | #include "EventHandler.hh" | ||
28 | |||
29 | #include <signal.h> | 27 | #include <signal.h> |
30 | 28 | ||
31 | namespace FbTk { | 29 | namespace FbTk { |
32 | 30 | ||
33 | struct SignalEvent { | 31 | |
34 | int signum; | 32 | class SignalEventHandler { |
33 | public: | ||
34 | virtual void handleSignal(int signum) = 0; | ||
35 | }; | 35 | }; |
36 | 36 | ||
37 | /** | 37 | /** |
@@ -42,7 +42,6 @@ struct SignalEvent { | |||
42 | */ | 42 | */ |
43 | class SignalHandler { | 43 | class SignalHandler { |
44 | public: | 44 | public: |
45 | |||
46 | /// get singleton object | 45 | /// get singleton object |
47 | static SignalHandler *instance(); | 46 | static SignalHandler *instance(); |
48 | /** | 47 | /** |
@@ -52,7 +51,7 @@ public: | |||
52 | @param eh event handler | 51 | @param eh event handler |
53 | @param oldhandler_ret return handler to old sighandler | 52 | @param oldhandler_ret return handler to old sighandler |
54 | */ | 53 | */ |
55 | bool registerHandler(int signum, EventHandler<SignalEvent> *eh, EventHandler<SignalEvent> **oldhandler_ret = 0); | 54 | bool registerHandler(int signum, SignalEventHandler *eh, SignalEventHandler **oldhandler_ret = 0); |
56 | /** | 55 | /** |
57 | removes the signum handler | 56 | removes the signum handler |
58 | @param signum signal number | 57 | @param signum signal number |
@@ -63,7 +62,7 @@ private: | |||
63 | 62 | ||
64 | static void handleSignal(int signum); | 63 | static void handleSignal(int signum); |
65 | 64 | ||
66 | static EventHandler<SignalEvent> *s_signal_handler[NSIG]; ///< NSIG defined in signal.h | 65 | static SignalEventHandler *s_signal_handler[NSIG]; ///< NSIG defined in signal.h |
67 | }; | 66 | }; |
68 | 67 | ||
69 | }; // end namespace FbTk | 68 | }; // end namespace FbTk |