screen-thirds based shortcuts, xinerama aware strut overide, auto unmaximize
[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              int southstrut__=0, int strutscreen__=-2);
22
23     virtual void move(int __xslot, int __yslot);
24     virtual void resize(int __xsize, int __ysize);
25     virtual void moveResize(int __xslot, int __yslot,
26                             int __xsize, int __ysize);
27     virtual void moveRelative(int __xdiff, int __ydiff);
28     virtual void resizeRelative(int __xdiff, int __ydiff);
29     virtual void toDesk(int __desk);
30
31     virtual void quit();
32
33     virtual int activeWindow();
34
35 public slots:
36     void move_TL();
37     void move_TR();
38     void move_BL();
39     void move_BR();
40
41     void resize_Q();
42     void resize_H();
43     void resize_V();
44     void resize_F();
45
46     void move_00();
47     void move_10();
48     void move_20();
49     void move_01();
50     void move_11();
51     void move_21();
52
53     void resize_00();
54     void resize_10();
55     void resize_20();
56     void resize_01();
57     void resize_11();
58     void resize_21();
59
60     void move_L();
61     void move_R();
62     void move_U();
63     void move_D();
64
65     void resize_IH();
66     void resize_DH();
67     void resize_IV();
68     void resize_DV();
69
70 public slots:
71     void activeWindowChanged(WId id);
72
73 private:
74     void initGeometry(int __forceScreens=-1);
75     void updateGeometry(QRect& __new);
76     void applyGeometry();
77     QRect doMoveResize(int __xslot, int __yslot,
78                        int __xsize, int __ysize);
79     void moveSlot(int nx, int ny, int posx, int posy);
80     void resizeSlot(int nx, int ny, int szx, int szy);
81
82     void updateTimestamp(void);
83
84     int split_;
85     int ignorestruts_;
86     int reserveNorth_;
87     int reserveSouth_;
88     int reserveEast_;
89     int reserveWest_;
90
91     int activeWindow_;
92     QRect inner_;
93     QRect outer_;
94     QRect orig_;
95     QRect region_;
96     XSizeHints hints_;
97     int screen_;
98     int numScreens_;
99
100     int hsize_;
101     int vsize_;
102
103     int hgap_;
104     int vgap_;
105     int hsplit_;
106     int vsplit_;
107
108     int southstrut_;
109     int strutscreen_;
110
111     QDateTime timestamp_;
112 };
113
114 #endif