]>
Dogcows Code - chaz/openbox/blob - otk/eventhandler.hh
1 #ifndef __eventhandler__hh
2 #define __eventhandler__hh
8 #include <X11/extensions/shape.h>
12 #include <X11/XKBlib.h>
19 class OtkEventHandler
{
21 //! Dispatches events to one of the other handlers based on their type.
22 virtual void handle(const XEvent
&e
);
24 //! Called whenever any key is pressed.
25 virtual void keyPressHandler(const XKeyEvent
&) {}
27 //! Called whenever any key is released.
28 virtual void keyReleaseHandler(const XKeyEvent
&) {}
30 //! Called whenever a button of the pointer is pressed.
31 virtual void buttonPressHandler(const XButtonEvent
&) {}
33 //! Called whenever a button of the pointer is released.
34 virtual void buttonReleaseHandler(const XButtonEvent
&) {}
36 //! Called whenever the pointer moved
37 virtual void motionHandler(const XMotionEvent
&) {}
39 //! Called whenever the pointer enters a window.
40 virtual void enterHandler(const XCrossingEvent
&) {}
42 //! Called whenever the pointer leaves a window.
43 virtual void leaveHandler(const XCrossingEvent
&) {}
45 //! Called when a window gains focus.
46 virtual void focusHandler(const XFocusChangeEvent
&) {}
48 //! Called when a window looses focus.
49 virtual void unfocusHandler(const XFocusChangeEvent
&) {}
51 //! Called when a window becomes visible to the user.
52 virtual void exposeHandler(const XExposeEvent
&) {}
54 //! Called to handle GraphicsExpose events.
55 virtual void graphicsExposeHandler(const XGraphicsExposeEvent
&) {}
57 //! Called to handle NoExpose events.
58 virtual void noExposeEventHandler(const XNoExposeEvent
&) {}
60 //! Called when the window requests a change in its z-order.
61 virtual void circulateRequestHandler(const XCirculateRequestEvent
&)
64 //! Called when a different client initiates a configure window request.
65 virtual void configureRequestHandler(const XConfigureRequestEvent
&)
68 //! Called when a different client tries to map a window.
69 virtual void mapRequestHandler(const XMapRequestEvent
&) {}
71 //! Called when another client attemps to change the size of a window.
72 virtual void resizeRequestHandler(const XResizeRequestEvent
&) {}
74 //! Called when the z-order of the window has changed.
75 virtual void circulateHandler(const XCirculateEvent
&) {}
77 //! Called when the window as been reconfigured.
78 virtual void configureHandler(const XConfigureEvent
&) {}
80 //! Called when a window is created.
81 virtual void createHandler(const XCreateWindowEvent
&) {}
83 //! Called when a window is destroyed.
84 virtual void destroyHandler(const XDestroyWindowEvent
&) {}
86 //! Called when a window is moved because of a change in the size of its
88 virtual void gravityHandler(const XGravityEvent
&) {}
90 //! Called when a window is mapped.
91 virtual void mapHandler(const XMapEvent
&) {}
93 //! Called when the server generats a MappingNotify event
94 virtual void mappingHandler(const XMappingEvent
&) {}
96 //! Called when a window is reparented
97 virtual void reparentHandler(const XReparentEvent
&) {}
99 //! Called when a window is unmapped
100 virtual void unmapHandler(const XUnmapEvent
&) {}
102 //! Called when a the visibilty of a window changes
103 virtual void visibilityHandler(const XVisibilityEvent
&) {}
105 //! Called when the colormap changes, or is installed or unistalled
106 virtual void colorMapHandler(const XColormapEvent
&) {}
108 //! Called when a property of a window changes
109 virtual void propertyHandler(const XPropertyEvent
&) {}
111 //! Called when the client loses ownership of a selection
112 virtual void selectionClearHandler(const XSelectionClearEvent
&) {}
114 //! Called when a ConvertSelection protocol request is sent
115 virtual void selectionHandler(const XSelectionEvent
&) {}
117 //! Called when a SelectionEvent occurs
118 virtual void selectionRequestHandler(const XSelectionRequestEvent
&) {}
120 //! Called when a client calls XSendEvent
122 Some types of client messages are filtered out and sent to more specific
123 event handler functions.
125 virtual void clientMessageHandler(const XClientMessageEvent
&);
127 #if defined(SHAPE) || defined(DOXYGEN_IGNORE)
128 //! Called when a shape extension event fires
129 virtual void shapeHandler(const XShapeEvent
&) {}
132 #if defined(XKB) || defined(DOXYGEN_IGNORE)
133 //! Called when an xkb extension event fires
134 virtual void xkbHandler(const XkbEvent
&) {}
137 virtual ~OtkEventHandler();
140 /*! Constructor for the OtkEventHandler class.
141 This is protected so that OtkEventHandlers can't be instantiated on their
This page took 0.044183 seconds and 4 git commands to generate.