1 #ifndef __eventhandler__hh
2 #define __eventhandler__hh
10 class OtkEventHandler{
12 //! Dispatches events to one of the other handlers based on their type.
13 virtual int handle(const XEvent &e);
15 //! Called whenever any key is pressed.
16 virtual int keyPressHandler(const XKeyEvent &) {return 1;}
18 //! Called whenever any key is released.
19 virtual int keyReleaseHandler(const XKeyEvent &) {return 1;}
21 //! Called whenever a button of the pointer is pressed.
22 virtual int buttonPressHandler(const XButtonEvent &) {return 1;}
24 //! Called whenever a button of the pointer is released.
25 virtual int buttonReleaseHandler(const XButtonEvent &) {return 1;}
27 //! Called whenever the pointer enters a window.
28 virtual int enterHandler(const XCrossingEvent &) {return 1;}
30 //! Called whenever the pointer leaves a window.
31 virtual int leaveHandler(const XCrossingEvent &) {return 1;}
33 //! Called when a window gains focus.
34 virtual int focusHandler(const XFocusChangeEvent &) {return 1;}
36 //! Called when a window looses focus.
37 virtual int unfocusHandler(const XFocusChangeEvent &) {return 1;}
39 //! Called when a window becomes visible to the user.
40 virtual int exposeHandler(const XExposeEvent &) {return 1;}
42 //! Called to handle GraphicsExpose events.
43 virtual int graphicsExposeHandler(const XGraphicsExposeEvent &) {return 1;}
45 //! Called to handle NoExpose events.
46 virtual int noExposeEventHandler(const XNoExposeEvent &) {return 1;}
48 //! Called when the window requests a change in its z-order.
49 virtual int circulateRequestHandler(const XCirculateRequestEvent &)
52 //! Called when a different client initiates a configure window request.
53 virtual int configureRequestHandler(const XConfigureRequestEvent &)
56 //! Called when a different client tries to map a window.
57 virtual int mapRequestHandler(const XMapRequestEvent &) {return 1;}
59 //! Called when another client attemps to change the size of a window.
60 virtual int resizeRequestHandler(const XResizeRequestEvent &) {return 1;}
62 //! Called when the z-order of the window has changed.
63 virtual int circulateHandler(const XCirculateEvent &) {return 1;}
65 //! Called when the window as been reconfigured.
66 virtual int configureHandler(const XConfigureEvent &) {return 1;}
68 //! Called when a window is created.
69 virtual int createHandler(const XCreateWindowEvent &) {return 1;}
71 //! Called when a window is destroyed.
72 virtual int destroyHandler(const XDestroyWindowEvent &) {return 1;}
74 //! Called when a window is moved because of a change in the size of its
76 virtual int gravityHandler(const XGravityEvent &) {return 1;}
78 //! Called when a window is mapped.
79 virtual int mapHandler(const XMapEvent &) {return 1;}
81 //! Called when the server generats a MappingNotify event
82 virtual int mappingHandler(const XMappingEvent &) {return 1;}
84 //! Called when a window is reparented
85 virtual int reparentHandler(const XReparentEvent &) {return 1;}
87 //! Called when a window is unmapped
88 virtual int unmapHandler(const XUnmapEvent &) {return 1;}
90 //! Called when a the visibilty of a window changes
91 virtual int visibilityHandler(const XVisibilityEvent &) {return 1;}
93 //! Called when the colormap changes, or is installed or unistalled
94 virtual int colorMapHandler(const XColormapEvent &) {return 1;}
96 //! Called when a client calls XSendEvent
97 virtual int clientMessageHandler(const XClientMessageEvent &) {return 1;}
99 //! Called when a property of a window changes
100 virtual int propertyHandler(const XPropertyEvent &) {return 1;}
102 //! Called when the client loses ownership of a selection
103 virtual int selectionClearHandler(const XSelectionClearEvent &) {return 1;}
105 //! Called when a ConvertSelection protocol request is sent
106 virtual int selectionHandler(const XSelectionEvent &) {return 1;}
108 //! Called when a SelectionEvent occurs
109 virtual int selectionRequestHandler(const XSelectionRequestEvent &)
112 virtual ~OtkEventHandler();
115 /*! Constructor for the XEventHandler class.
116 This is protected so that XEventHandlers can't be instantiated on their