1999-08-19 23:26:42 +00:00
|
|
|
#ifndef WORKSPACE_H
|
|
|
|
#define WORKSPACE_H
|
|
|
|
|
|
|
|
#include <qwidget.h>
|
|
|
|
#include <qapplication.h>
|
|
|
|
#include <qpopupmenu.h>
|
|
|
|
#include <qvaluelist.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
|
|
|
class Client;
|
|
|
|
class TabBox;
|
1999-11-07 08:46:36 +00:00
|
|
|
|
|
|
|
class KGlobalAccel;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
typedef QValueList<Client*> ClientList;
|
|
|
|
|
|
|
|
class Workspace : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
Workspace();
|
|
|
|
Workspace( WId rootwin );
|
|
|
|
virtual ~Workspace();
|
|
|
|
|
|
|
|
virtual bool workspaceEvent( XEvent * );
|
|
|
|
|
1999-11-07 08:46:36 +00:00
|
|
|
bool hasClient(Client *);
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
Client* findClient( WId w ) const;
|
|
|
|
|
|
|
|
QRect geometry() const;
|
|
|
|
|
|
|
|
bool destroyClient( Client* );
|
|
|
|
|
|
|
|
WId rootWin() const;
|
|
|
|
|
|
|
|
Client* activeClient() const;
|
|
|
|
void setActiveClient( Client* );
|
|
|
|
void activateClient( Client* );
|
|
|
|
void requestFocus( Client* c);
|
|
|
|
|
|
|
|
void doPlacement( Client* c );
|
|
|
|
void raiseClient( Client* c );
|
|
|
|
|
|
|
|
void clientHidden( Client* );
|
|
|
|
|
|
|
|
int currentDesktop() const;
|
1999-11-07 01:43:06 +00:00
|
|
|
void setCurrentDesktop( int new_desktop );
|
1999-08-19 23:26:42 +00:00
|
|
|
int numberOfDesktops() const;
|
1999-11-07 01:43:06 +00:00
|
|
|
void setNumberOfDesktops( int n );
|
|
|
|
|
1999-09-27 16:02:44 +00:00
|
|
|
QWidget* desktopWidget();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
void grabKey(KeySym keysym, unsigned int mod);
|
|
|
|
|
|
|
|
Client* nextClient(Client*) const;
|
|
|
|
Client* previousClient(Client*) const;
|
|
|
|
Client* nextStaticClient(Client*) const;
|
|
|
|
Client* previousStaticClient(Client*) const;
|
|
|
|
|
|
|
|
//#### TODO right layers as default
|
|
|
|
Client* topClientOnDesktop( int fromLayer = 0, int toLayer = 0) const;
|
|
|
|
|
|
|
|
|
|
|
|
void showPopup( const QPoint&, Client* );
|
|
|
|
|
|
|
|
void setDesktopClient( Client* );
|
|
|
|
|
|
|
|
void makeFullScreen( Client* );
|
|
|
|
|
1999-11-07 08:46:36 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
protected:
|
|
|
|
bool keyPress( XKeyEvent key );
|
|
|
|
bool keyRelease( XKeyEvent key );
|
1999-11-07 01:43:06 +00:00
|
|
|
bool clientMessage( XClientMessageEvent msg );
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
private:
|
1999-11-07 08:46:36 +00:00
|
|
|
KGlobalAccel *keys;
|
1999-08-19 23:26:42 +00:00
|
|
|
void init();
|
|
|
|
WId root;
|
|
|
|
ClientList clients;
|
|
|
|
ClientList stacking_order;
|
|
|
|
ClientList focus_chain;
|
|
|
|
Client* active_client;
|
|
|
|
bool control_grab;
|
|
|
|
bool tab_grab;
|
|
|
|
TabBox* tab_box;
|
|
|
|
void freeKeyboard(bool pass);
|
|
|
|
QPopupMenu *popup;
|
|
|
|
Client* should_get_focus;
|
|
|
|
|
|
|
|
void raiseTransientsOf( ClientList& safeset, Client* c );
|
|
|
|
void randomPlacement(Client* c);
|
|
|
|
|
|
|
|
void focusToNull();
|
|
|
|
Client* desktop_client;
|
|
|
|
int current_desktop;
|
1999-11-07 01:43:06 +00:00
|
|
|
int number_of_desktops;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
Client* popup_client;
|
1999-09-27 16:02:44 +00:00
|
|
|
QWidget* desktop_widget;
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
//experimental
|
|
|
|
void setDecoration( int deco );
|
1999-11-07 20:29:26 +00:00
|
|
|
|
1999-11-07 01:43:06 +00:00
|
|
|
void propagateClients( bool onlyStacking = FALSE);
|
1999-08-19 23:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inline WId Workspace::rootWin() const
|
|
|
|
{
|
|
|
|
return root;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns the active client, i.e. the client that has the focus (or None if no
|
|
|
|
client has the focus)
|
|
|
|
*/
|
|
|
|
inline Client* Workspace::activeClient() const
|
|
|
|
{
|
|
|
|
return active_client;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns the current virtual desktop of this workspace
|
|
|
|
*/
|
|
|
|
inline int Workspace::currentDesktop() const
|
|
|
|
{
|
|
|
|
return current_desktop;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns the number of virtual desktops of this workspace
|
|
|
|
*/
|
|
|
|
inline int Workspace::numberOfDesktops() const
|
|
|
|
{
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|