]> icculus.org git repositories - mikachu/openbox.git/blob - src/xeventhandler.hh
position the client inside the frame correctly.
[mikachu/openbox.git] / src / xeventhandler.hh
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
2 #ifndef   __xeventhandler_hh
3 #define   __xeventhandler_hh
4
5 /*! @file xeventhandler.hh
6   @brief The class which handles raw XEvents, turning them into high-level
7          user interaction sequences, or processing them as appropriate
8 */
9
10 extern "C" {
11 #include <X11/Xlib.h>
12 }
13
14 namespace ob {
15
16 // XXX: TEMPORARY!!
17 class OBClient;
18
19
20 //! Handles X events
21 /*!
22   There are 2 type of X events:<br>
23     a) User Actions<br>
24     b) Background Events<br>
25   <p>
26   User Actions are events like mouse drags and presses, key presses.
27   Background Events are everything else. Stuff that can't be bound to user
28     input.
29   <p>
30   When an XEvent comes to the application, it is sent to this class. This class
31   will determine what the event means, such as "A Left-Mouse-Button Drag on
32   this window", or "Double click with right mouse button on root window" or
33   "space bar pressed", or Background Event.
34   <p>
35   If the XEvent or combination of XEvents form a User Action, then the action
36   is dispatched to the OBBindingMapper.
37   <p>
38   If the XEvent is a Background Event, it is simply dealt with as appropriate.
39 */
40 class OBXEventHandler
41 {
42 private:
43   //! The time at which the last XEvent with a time was received
44   Time _lasttime;
45
46   //! Handles mouse button press events
47   /*!
48     @param e The XEvent to handle
49   */
50   void buttonPress(const XButtonEvent &e);
51   //! Handles mouse button release events
52   /*!
53     @param e The XEvent to handle
54   */
55   void buttonRelease(const XButtonEvent &e);
56   //! Handles keyboard key press events
57   /*!
58     @param e The XEvent to handle
59   */
60   void keyPress(const XKeyEvent &e); 
61   //! Handles mouse motion events
62   /*!
63     @param e The XEvent to handle
64   */
65   void motion(const XMotionEvent &e);
66   //! Handles mouse-enter events
67   /*!
68     @param e The XEvent to handle
69   */
70   void enterNotify(const XCrossingEvent &e);
71   //! Handles mouse-leave events
72   /*!
73     @param e The XEvent to handle
74   */
75   void leaveNotify(const XCrossingEvent &e);
76   //! Handles configure request events
77   /*!
78     @param e The XEvent to handle
79   */
80   void configureRequest(const XConfigureRequestEvent &e);
81   //! Handles window map request events
82   /*!
83     @param e The XEvent to handle
84   */
85   void mapRequest(const XMapRequestEvent &e);
86   //! Handles window unmap events
87   /*!
88     @param e The XEvent to handle
89   */
90   void unmapNotify(const XUnmapEvent &e);
91   //! Handles window destroy events
92   /*!
93     @param e The XEvent to handle
94   */
95   void destroyNotify(const XDestroyWindowEvent &e);
96   //! Handles window reparent events
97   /*!
98     @param e The XEvent to handle
99   */
100   void reparentNotify(const XReparentEvent &e);
101   //! Handles window property change events
102   /*!
103     @param e The XEvent to handle
104   */
105   void propertyNotify(const XPropertyEvent &e);
106   //! Handles window expose events
107   /*!
108     @param e The XEvent to handle
109   */
110   void expose(const XExposeEvent &e);
111   //! Handles colormap events
112   /*!
113     @param e The XEvent to handle
114   */
115   void colormapNotify(const XColormapEvent &e);
116   //! Handles focus-in events
117   /*!
118     @param e The XEvent to handle
119   */
120   void focusIn(const XFocusChangeEvent &e);
121   //! Handles focus-out events
122   /*!
123     @param e The XEvent to handle
124   */
125   void focusOut(const XFocusChangeEvent &e);
126 #if defined(SHAPE) || defined(DOXYGEN_IGNORE)
127   //! Handles Shape extension events
128   /*!
129     @param e The XEvent to handle
130   */
131   void shapeEvent(const XShapeEvent &e);
132 #endif // SHAPE 
133   //! Handles client message events
134   /*!
135     @param e The XEvent to handle
136   */
137   void clientMessage(const XClientMessageEvent &e);
138  
139   
140 public:
141   //! Constructs an OBXEventHandler object
142   OBXEventHandler();
143   
144   //! Handle an XEvent
145   /*!
146     @param e The XEvent to handle
147   */
148   void handle(const XEvent &e);
149
150
151   // XXX: TEMPORARY MOVE TO A SCREEN CLASS OR SOMETHING
152   void manageWindow(int, Window);
153   void unmanageWindow(OBClient*);
154 };
155
156 }
157
158 #endif // __xeventhandler_hh