]>
Dogcows Code - chaz/openbox/blob - otk/eventhandler.hh
1 #ifndef __eventhandler__hh
2 #define __eventhandler__hh
8 #include <X11/extensions/shape.h>
14 class OtkEventHandler
{
16 //! Dispatches events to one of the other handlers based on their type.
17 virtual void handle(const XEvent
&e
);
19 //! Called whenever any key is pressed.
20 virtual void keyPressHandler(const XKeyEvent
&) {}
22 //! Called whenever any key is released.
23 virtual void keyReleaseHandler(const XKeyEvent
&) {}
25 //! Called whenever a button of the pointer is pressed.
26 virtual void buttonPressHandler(const XButtonEvent
&) {}
28 //! Called whenever a button of the pointer is released.
29 virtual void buttonReleaseHandler(const XButtonEvent
&) {}
31 //! Called whenever the pointer moved
32 virtual void motionHandler(const XMotionEvent
&) {}
34 //! Called whenever the pointer enters a window.
35 virtual void enterHandler(const XCrossingEvent
&) {}
37 //! Called whenever the pointer leaves a window.
38 virtual void leaveHandler(const XCrossingEvent
&) {}
40 //! Called when a window gains focus.
41 virtual void focusHandler(const XFocusChangeEvent
&) {}
43 //! Called when a window looses focus.
44 virtual void unfocusHandler(const XFocusChangeEvent
&) {}
46 //! Called when a window becomes visible to the user.
47 virtual void exposeHandler(const XExposeEvent
&) {}
49 //! Called to handle GraphicsExpose events.
50 virtual void graphicsExposeHandler(const XGraphicsExposeEvent
&) {}
52 //! Called to handle NoExpose events.
53 virtual void noExposeEventHandler(const XNoExposeEvent
&) {}
55 //! Called when the window requests a change in its z-order.
56 virtual void circulateRequestHandler(const XCirculateRequestEvent
&)
59 //! Called when a different client initiates a configure window request.
60 virtual void configureRequestHandler(const XConfigureRequestEvent
&)
63 //! Called when a different client tries to map a window.
64 virtual void mapRequestHandler(const XMapRequestEvent
&) {}
66 //! Called when another client attemps to change the size of a window.
67 virtual void resizeRequestHandler(const XResizeRequestEvent
&) {}
69 //! Called when the z-order of the window has changed.
70 virtual void circulateHandler(const XCirculateEvent
&) {}
72 //! Called when the window as been reconfigured.
73 virtual void configureHandler(const XConfigureEvent
&) {}
75 //! Called when a window is created.
76 virtual void createHandler(const XCreateWindowEvent
&) {}
78 //! Called when a window is destroyed.
79 virtual void destroyHandler(const XDestroyWindowEvent
&) {}
81 //! Called when a window is moved because of a change in the size of its
83 virtual void gravityHandler(const XGravityEvent
&) {}
85 //! Called when a window is mapped.
86 virtual void mapHandler(const XMapEvent
&) {}
88 //! Called when the server generats a MappingNotify event
89 virtual void mappingHandler(const XMappingEvent
&) {}
91 //! Called when a window is reparented
92 virtual void reparentHandler(const XReparentEvent
&) {}
94 //! Called when a window is unmapped
95 virtual void unmapHandler(const XUnmapEvent
&) {}
97 //! Called when a the visibilty of a window changes
98 virtual void visibilityHandler(const XVisibilityEvent
&) {}
100 //! Called when the colormap changes, or is installed or unistalled
101 virtual void colorMapHandler(const XColormapEvent
&) {}
103 //! Called when a property of a window changes
104 virtual void propertyHandler(const XPropertyEvent
&) {}
106 //! Called when the client loses ownership of a selection
107 virtual void selectionClearHandler(const XSelectionClearEvent
&) {}
109 //! Called when a ConvertSelection protocol request is sent
110 virtual void selectionHandler(const XSelectionEvent
&) {}
112 //! Called when a SelectionEvent occurs
113 virtual void selectionRequestHandler(const XSelectionRequestEvent
&) {}
115 //! Called when a client calls XSendEvent
117 Some types of client messages are filtered out and sent to more specific
118 event handler functions.
120 virtual void clientMessageHandler(const XClientMessageEvent
&);
122 #if defined(SHAPE) || defined(DOXYGEN_IGNORE)
123 //! Called when a shape extention event fires
124 virtual void shapeHandler(const XShapeEvent
&) {}
127 virtual ~OtkEventHandler();
130 /*! Constructor for the OtkEventHandler class.
131 This is protected so that OtkEventHandlers can't be instantiated on their
This page took 0.038969 seconds and 4 git commands to generate.