diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2006-02-03 07:06:27 +0000 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2006-02-03 07:06:27 +0000 |
commit | b3d40238f85676bc0a3947f2a6f7145dd9bf555f (patch) | |
tree | 7f60e3607a6e799947a60039308c84eb4afc044c /src/Manager.h |
Initial checkin.
MPGWM++ is the C++ of MPGWM. MPGWM was an extension of SWM and became slightly
unmaintainable with added features. The C++ version should get around this
problem. This is not yet a full version of MPGWM, some additional features need
to be implemented and tested.
Diffstat (limited to 'src/Manager.h')
-rw-r--r-- | src/Manager.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/Manager.h b/src/Manager.h new file mode 100644 index 0000000..645f908 --- /dev/null +++ b/src/Manager.h @@ -0,0 +1,66 @@ +/*-- + --*/ + +#ifndef __MANAGER_H__ +#define __MANAGER_H__ +#include<X11/Xlib.h> +#include<X11/Xutil.h> +#include<X11/extensions/XInput.h> +#include<vector> +#include<map> +#include<stdio.h> +#include "logger.h" +#include "Config.h" +#include "WMWindow.h" +#include "PointerDevice.h" +#include "DeviceError.h" +#include "XError.h" +#include "mpgxlib.h" + +using namespace std; + +class Manager +{ + private: + Config* config; + Display* dpy; + Window root; + int screen; + vector<WMWindow*> windows; + vector<PointerDevice*> pointers; + + bool stop; + + public: + Manager(); ~Manager(); + void init(char* display); + void loop(); + void takedown(); + + private: + void initX11(char* display); + void initXi(); + void initMPGXlib(); + void addNewClient(); + void queryInitial(); + vector<WMWindow*> queryWindows(); + bool isWMWindow(Window win); + bool isCursorWindow(Window win); + void raiseCursors(); + void hideCursor(); + WMWindow* windowToWMWindow(Window w); + + /* event processing routines */ + void handleCreateNotify(XCreateWindowEvent* ev); + void handleMapRequest(XMapEvent* ev); + void handleMapNotify(XMapEvent* ev); + void handleConfigureRequest(XConfigureRequestEvent* ev); + void handleReparentNotify(XReparentEvent* ev); + void handleDestroyNotify(XDestroyWindowEvent* ev); + void handleUnmapNotify(XUnmapEvent* ev); + void handleOtherEvents(XEvent *ev); + + PointerDevice* idToPointerDevice(int id); +}; + +#endif |