diff options
author | fluxgen <fluxgen> | 2002-11-27 21:41:38 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-11-27 21:41:38 (GMT) |
commit | e3785fc3c3039fd9e56866c467e3f7f287514770 (patch) | |
tree | 42933a4a48fab3441f715bac9f9b121d2c222973 /src/FbTk/EventHandler.hh | |
parent | 7d6df5692c5c13c804f562be98a84c66dc8a540f (diff) | |
download | fluxbox-e3785fc3c3039fd9e56866c467e3f7f287514770.zip fluxbox-e3785fc3c3039fd9e56866c467e3f7f287514770.tar.bz2 |
removed templated and fixed XEvent functions
Diffstat (limited to 'src/FbTk/EventHandler.hh')
-rw-r--r-- | src/FbTk/EventHandler.hh | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/FbTk/EventHandler.hh b/src/FbTk/EventHandler.hh index 1fc73c4..10d9757 100644 --- a/src/FbTk/EventHandler.hh +++ b/src/FbTk/EventHandler.hh | |||
@@ -1,5 +1,5 @@ | |||
1 | // fluxbox.cc for Fluxbox Window Manager | 1 | // EventHandler.cc for Fluxbox Window Manager |
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | 2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen at 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 |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -19,23 +19,34 @@ | |||
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: EventHandler.hh,v 1.1 2002/11/26 16:01:27 fluxgen Exp $ | 22 | // $Id: EventHandler.hh,v 1.2 2002/11/27 21:41:38 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_EVENTHANDLER_HH | 24 | #ifndef FBTK_EVENTHANDLER_HH |
25 | #define FBTK_EVENTHANDLER_HH | 25 | #define FBTK_EVENTHANDLER_HH |
26 | 26 | ||
27 | #include <X11/Xlib.h> | ||
28 | |||
27 | namespace FbTk { | 29 | namespace FbTk { |
28 | 30 | ||
29 | /** | 31 | /** |
30 | template eventhandler | 32 | interface for X events |
31 | Both return value and argument is generic. | ||
32 | */ | 33 | */ |
33 | template <typename Event_T, typename Event_ret_T = void> | ||
34 | class EventHandler { | 34 | class EventHandler { |
35 | public: | 35 | public: |
36 | virtual ~EventHandler() { } | 36 | virtual ~EventHandler() { } |
37 | 37 | ||
38 | virtual Event_ret_T handleEvent(Event_T * const) = 0; | 38 | /** |
39 | Events that don't have an specific event function | ||
40 | */ | ||
41 | virtual void handleEvent(XEvent &ev) { } | ||
42 | virtual void buttonPressEvent(XButtonEvent &ev) { } | ||
43 | virtual void buttonReleaseEvent(XButtonEvent &ev) { } | ||
44 | virtual void exposeEvent(XExposeEvent &ev) { } | ||
45 | virtual void motionNotifyEvent(XMotionEvent &ev) { } | ||
46 | virtual void keyPressEvent(XKeyEvent &ev) { } | ||
47 | virtual void keyReleaseEvent(XKeyEvent &ev) { } | ||
48 | virtual void leaveNotifyEvent(XCrossingEvent &ev) { } | ||
49 | virtual void enterNotifyEvent(XCrossingEvent &ev) { } | ||
39 | }; | 50 | }; |
40 | 51 | ||
41 | }; | 52 | }; |