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