Added a primitive guess of the executable's language.
[kdbg.git] / DockWidget / dockmovemanager.h
blobdb90f33d9dce258d6bb74abc976dbfa6d2033a63
1 /*
2 Modify from KTolBoxManager
3 novaprint@mtu-net.ru
4 Judin Max
5 **********************************/
7 /*
8 This file is part of the KDE libraries
9 Copyright (C) 1998 Sven Radej (radej@kde.org)
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Library General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later version.
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Library General Public License for more details.
21 You should have received a copy of the GNU Library General Public License
22 along with this library; see the file COPYING.LIB. If not, write to
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA.
27 #ifndef DOCK_MOVE_MANAGER
28 #define DOCK_MOVE_MANAGER
30 #include <qobject.h>
31 #include <X11/X.h>
32 #include <X11/Xlib.h>
33 #include <X11/Xutil.h>
35 class QTimer;
36 class QWidget;
38 class DockMoveManager: public QObject
39 {Q_OBJECT
40 friend class DockManager;
42 private:
43 DockMoveManager(QWidget *widget);
44 ~DockMoveManager();
46 void doMove(bool in_hotspot_static=false, bool dynamic = false, bool dontmove=false);
47 void movePause(){ pauseMove = true; }
48 void moveContinue(){ pauseMove = false; }
49 void setGeometry(int x, int y, int w, int h);
51 /**
52 * Resizes the resizer. rw is width and rh is height
54 void resize(int rw, int rh) {setGeometry(xp, yp, rw, rh);};
56 /**
57 * Returns global x coordinate of a mouse.
59 int mouseX() {return rx;};
61 /**
62 * Returns global y coordinate of a mouse.
64 int mouseY() {return ry;};
66 /**
67 * Returns global x coordinate.
69 int x() {return xp;};
71 /**
72 * Returns global y coordinate.
74 int y() {return yp;};
76 /**
77 * Returns width.
79 int width() {return w;};
81 /**
82 * Returns height.
84 int height() {return h;};
85 /**
86 * Calling this slot will stop the process of moving. It is
87 * equal as if user releases the mouse button.
89 void stop ();
90 /**
91 * Internal - draws rectangle on the screen
93 void drawRectangle (int x, int y, int w, int h);
95 /**
96 * Internal - deletes last rectangle, if there is one.
98 void deleteLastRectangle ();
101 private slots:
102 void doMoveInternal();
104 private:
105 bool pauseMove;
106 int xp, yp, w, h;
107 int ox, oy, ow, oh;
108 int orig_x, orig_y, orig_w, orig_h;
109 bool noLast;
110 bool working;
112 QWidget *widget;
113 QTimer *timer;
115 int rx, ry, sx, sy;
116 int offX, offY;
118 /* X-stuff */
119 Window root;
120 GC rootgc;
121 int scr;
122 XEvent ev;
123 unsigned int active_button;
126 #endif