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