Implement reserve-north/south/west/east
[kwingrid.git] / kwingrid.h
1 // -*- c++ -*-
2
3 #ifndef __kwingrid_h
4 #define __kwingrid_h 1
5
6 #include <Xlib.h>
7 #include <Xutil.h>
8
9 #include <QtCore/QObject>
10 #include <QtCore/QDateTime>
11 #include <QtCore/QRect>
12
13 class KWinGrid : public QObject
14 {
15     Q_OBJECT
16
17 public:
18     KWinGrid(int hgap__, int vgap__, int hsplit__, int vsplit__, int split__=0,
19              int ignorestruts__=-1,
20              int reserveNorth__=0, int reserveSouth__=0, int reserveWest__=0, int reserveEast__=0);
21
22     virtual void move(int __xslot, int __yslot);
23     virtual void resize(int __xsize, int __ysize);
24     virtual void moveResize(int __xslot, int __yslot,
25                             int __xsize, int __ysize);
26     virtual void moveRelative(int __xdiff, int __ydiff);
27     virtual void resizeRelative(int __xdiff, int __ydiff);
28     virtual void toDesk(int __desk);
29
30     virtual void quit();
31
32     virtual int activeWindow();
33
34 public slots:
35     void move_TL();
36     void move_TR();
37     void move_BL();
38     void move_BR();
39
40     void resize_Q();
41     void resize_H();
42     void resize_V();
43     void resize_F();
44
45     void move_L();
46     void move_R();
47     void move_U();
48     void move_D();
49
50     void resize_IH();
51     void resize_DH();
52     void resize_IV();
53     void resize_DV();
54
55 public slots:
56     void activeWindowChanged(WId id);
57
58 private:
59     void initGeometry(int __forceScreens=-1);
60     void updateGeometry(QRect& __new);
61     void applyGeometry();
62     QRect doMoveResize(int __xslot, int __yslot,
63                        int __xsize, int __ysize);
64
65     void updateTimestamp(void);
66
67     int split_;
68     int ignorestruts_;
69     int reserveNorth_;
70     int reserveSouth_;
71     int reserveEast_;
72     int reserveWest_;
73
74     int activeWindow_;
75     QRect inner_;
76     QRect outer_;
77     QRect orig_;
78     QRect region_;
79     XSizeHints hints_;
80     int screen_;
81     int numScreens_;
82
83     int hsize_;
84     int vsize_;
85
86     int hgap_;
87     int vgap_;
88     int hsplit_;
89     int vsplit_;
90
91     QDateTime timestamp_;
92 };
93
94 #endif