]> Dogcows Code - chaz/openbox/blob - otk/eventhandler.hh
rm consts that wont compile on some libfreetype's
[chaz/openbox] / otk / eventhandler.hh
1 #ifndef __eventhandler__hh
2 #define __eventhandler__hh
3
4 extern "C" {
5 #include <X11/Xlib.h>
6
7 #ifdef SHAPE
8 #include <X11/extensions/shape.h>
9 #endif // SHAPE
10 }
11
12 namespace otk {
13
14 class OtkEventHandler {
15 public:
16 //! Dispatches events to one of the other handlers based on their type.
17 virtual void handle(const XEvent &e);
18
19 //! Called whenever any key is pressed.
20 virtual void keyPressHandler(const XKeyEvent &) {}
21
22 //! Called whenever any key is released.
23 virtual void keyReleaseHandler(const XKeyEvent &) {}
24
25 //! Called whenever a button of the pointer is pressed.
26 virtual void buttonPressHandler(const XButtonEvent &) {}
27
28 //! Called whenever a button of the pointer is released.
29 virtual void buttonReleaseHandler(const XButtonEvent &) {}
30
31 //! Called whenever the pointer moved
32 virtual void motionHandler(const XMotionEvent &) {}
33
34 //! Called whenever the pointer enters a window.
35 virtual void enterHandler(const XCrossingEvent &) {}
36
37 //! Called whenever the pointer leaves a window.
38 virtual void leaveHandler(const XCrossingEvent &) {}
39
40 //! Called when a window gains focus.
41 virtual void focusHandler(const XFocusChangeEvent &) {}
42
43 //! Called when a window looses focus.
44 virtual void unfocusHandler(const XFocusChangeEvent &) {}
45
46 //! Called when a window becomes visible to the user.
47 virtual void exposeHandler(const XExposeEvent &) {}
48
49 //! Called to handle GraphicsExpose events.
50 virtual void graphicsExposeHandler(const XGraphicsExposeEvent &) {}
51
52 //! Called to handle NoExpose events.
53 virtual void noExposeEventHandler(const XNoExposeEvent &) {}
54
55 //! Called when the window requests a change in its z-order.
56 virtual void circulateRequestHandler(const XCirculateRequestEvent &)
57 {}
58
59 //! Called when a different client initiates a configure window request.
60 virtual void configureRequestHandler(const XConfigureRequestEvent &)
61 {}
62
63 //! Called when a different client tries to map a window.
64 virtual void mapRequestHandler(const XMapRequestEvent &) {}
65
66 //! Called when another client attemps to change the size of a window.
67 virtual void resizeRequestHandler(const XResizeRequestEvent &) {}
68
69 //! Called when the z-order of the window has changed.
70 virtual void circulateHandler(const XCirculateEvent &) {}
71
72 //! Called when the window as been reconfigured.
73 virtual void configureHandler(const XConfigureEvent &) {}
74
75 //! Called when a window is created.
76 virtual void createHandler(const XCreateWindowEvent &) {}
77
78 //! Called when a window is destroyed.
79 virtual void destroyHandler(const XDestroyWindowEvent &) {}
80
81 //! Called when a window is moved because of a change in the size of its
82 //! parent.
83 virtual void gravityHandler(const XGravityEvent &) {}
84
85 //! Called when a window is mapped.
86 virtual void mapHandler(const XMapEvent &) {}
87
88 //! Called when the server generats a MappingNotify event
89 virtual void mappingHandler(const XMappingEvent &) {}
90
91 //! Called when a window is reparented
92 virtual void reparentHandler(const XReparentEvent &) {}
93
94 //! Called when a window is unmapped
95 virtual void unmapHandler(const XUnmapEvent &) {}
96
97 //! Called when a the visibilty of a window changes
98 virtual void visibilityHandler(const XVisibilityEvent &) {}
99
100 //! Called when the colormap changes, or is installed or unistalled
101 virtual void colorMapHandler(const XColormapEvent &) {}
102
103 //! Called when a property of a window changes
104 virtual void propertyHandler(const XPropertyEvent &) {}
105
106 //! Called when the client loses ownership of a selection
107 virtual void selectionClearHandler(const XSelectionClearEvent &) {}
108
109 //! Called when a ConvertSelection protocol request is sent
110 virtual void selectionHandler(const XSelectionEvent &) {}
111
112 //! Called when a SelectionEvent occurs
113 virtual void selectionRequestHandler(const XSelectionRequestEvent &) {}
114
115 //! Called when a client calls XSendEvent
116 /*!
117 Some types of client messages are filtered out and sent to more specific
118 event handler functions.
119 */
120 virtual void clientMessageHandler(const XClientMessageEvent &);
121
122 #if defined(SHAPE) || defined(DOXYGEN_IGNORE)
123 //! Called when a shape extention event fires
124 virtual void shapeHandler(const XShapeEvent &) {}
125 #endif // SHAPE
126
127 virtual ~OtkEventHandler();
128
129 protected:
130 /*! Constructor for the OtkEventHandler class.
131 This is protected so that OtkEventHandlers can't be instantiated on their
132 own.
133 */
134 OtkEventHandler();
135
136 private:
137 };
138
139 }
140
141 #endif
This page took 0.038297 seconds and 4 git commands to generate.