00001
00002
00003
00004
00005 #ifndef HANDLER_H
00006 #define HANDLER_H
00007
00008 #include <qobject.h>
00009 #include <qrect.h>
00010 #include <qstring.h>
00011 #include "rwm.h"
00012
00013 class Manager;
00014 class Frame;
00015
00016 struct border
00017 {
00018 int top;
00019 int left;
00020 int right;
00021 int bottom;
00022 int grip;
00023 };
00024
00025
00026 #define APPLY_GRAVITY 1
00027 #define REMOVE_GRAVITY -1
00028
00029 class Handler : public QObject
00030 {
00031 Q_OBJECT
00032
00033 Window clientId;
00034 Manager* Parent;
00035 Display* dpy;
00036 border clientBorder;
00037 QRect handlerGeometry, desktopRect, oldClientGeometry;
00038 QString title;
00039 QString clientName;
00040 Frame* frame;
00041
00042 int titleBarHeight;
00043
00044 bool hasNetName;
00045 bool hasTitle;
00046
00047 int ignoreUnmap;
00048
00049 Window transFor;
00050
00051 XSizeHints* size;
00052 Colormap cmap;
00053
00054 enum states { sEmpty = 0,
00055 sModal = 1,
00056 sSticky = 1 << 1,
00057 smaxVert = 1 << 2,
00058 smaxHorz = 1 << 3,
00059 sShaded = 1 << 4,
00060 sSkipTaskbar = 1 << 5,
00061 sSkipPager = 1 << 6
00062 };
00063 int winState;
00064
00065 void setupClient();
00066 void createFrame();
00067 void getXClientName();
00068 void initPosition();
00069 void fixupPositionBasedOnStruts( Strut* );
00070 bool getExtendedWMHintString( Atom, char** );
00071 void getExtendedNetWMStates();
00072 void* getExtendedNetPropertyData( Window, Atom, Atom, int* );
00073 void setWMState( int state );
00074 long getWMState();
00075 void setExtendedWMState();
00076 void gravitate( int );
00077 void reparent();
00078 int titleHeight();
00079 void unhide();
00080
00081 public:
00082 Handler( Window w = 0, Manager* parent = 0, const char* name = 0 );
00083 ~Handler();
00084
00085 void handleConfigureRequest( XConfigureRequestEvent* );
00086 void handleMapRequest( XMapRequestEvent* );
00087 void handlePropertyChange( XPropertyEvent* );
00088 QRect clientGeometry;
00089 };
00090
00091 #endif // HANDLER_H