2000-03-24 22:23:02 +00:00
|
|
|
/*****************************************************************
|
2003-09-16 19:28:03 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
2003-09-16 19:28:03 +00:00
|
|
|
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
2000-03-24 22:23:02 +00:00
|
|
|
******************************************************************/
|
2003-09-16 19:28:03 +00:00
|
|
|
|
2002-07-26 20:30:36 +00:00
|
|
|
#ifndef KWIN_TABBOX_H
|
|
|
|
#define KWIN_TABBOX_H
|
2003-09-16 19:28:03 +00:00
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
#include <QFrame>
|
2006-05-11 08:04:23 +00:00
|
|
|
#include <QTimer>
|
2003-09-16 19:28:03 +00:00
|
|
|
#include "utils.h"
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2001-02-20 01:20:38 +00:00
|
|
|
class QLabel;
|
|
|
|
|
2007-04-05 12:07:35 +00:00
|
|
|
namespace KWin
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
2001-02-20 01:20:38 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
class Workspace;
|
|
|
|
class Client;
|
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
class TabBox : public QFrame
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
1999-08-19 23:26:42 +00:00
|
|
|
Q_OBJECT
|
2003-09-16 19:28:03 +00:00
|
|
|
public:
|
2007-04-12 14:12:34 +00:00
|
|
|
TabBox( Workspace *ws );
|
2003-09-16 19:28:03 +00:00
|
|
|
~TabBox();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
Client* currentClient();
|
2007-04-12 14:12:34 +00:00
|
|
|
ClientList currentClientList();
|
2003-09-16 19:28:03 +00:00
|
|
|
int currentDesktop();
|
2007-04-12 14:12:34 +00:00
|
|
|
QList< int > currentDesktopList();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
void setCurrentClient( Client* newClient );
|
|
|
|
void setCurrentDesktop( int newDesktop );
|
2003-09-16 19:28:03 +00:00
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
enum SortOrder { StaticOrder, MostRecentlyUsedOrder };
|
|
|
|
void setMode( TabBoxMode mode );
|
|
|
|
TabBoxMode mode() const;
|
|
|
|
|
|
|
|
void reset( bool partial_reset = false );
|
2006-02-19 01:33:48 +00:00
|
|
|
void nextPrev( bool next = true);
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
void delayedShow();
|
|
|
|
void hide();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
void refDisplay();
|
|
|
|
void unrefDisplay();
|
|
|
|
bool isDisplayed() const;
|
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
void handleMouseEvent( XEvent* );
|
2000-05-14 01:58:13 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
Workspace* workspace() const;
|
2001-06-10 04:10:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
void reconfigure();
|
2007-04-12 14:12:34 +00:00
|
|
|
void updateKeyMapping();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void show();
|
2007-03-08 16:49:44 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
protected:
|
|
|
|
void showEvent( QShowEvent* );
|
|
|
|
void hideEvent( QHideEvent* );
|
2007-04-12 14:12:34 +00:00
|
|
|
void paintEvent( QPaintEvent* );
|
2004-02-05 21:58:22 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
|
2007-04-12 14:12:34 +00:00
|
|
|
void createDesktopList(QList< int > &list, int start, SortOrder order);
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
private:
|
2007-04-05 12:12:10 +00:00
|
|
|
Workspace* wspace;
|
2007-04-12 14:12:34 +00:00
|
|
|
TabBoxMode m;
|
2007-03-28 20:29:45 +00:00
|
|
|
ClientList clients;
|
2007-04-12 14:12:34 +00:00
|
|
|
Client* client;
|
|
|
|
QList< int > desktops;
|
2003-09-16 19:28:03 +00:00
|
|
|
int desk;
|
2007-04-12 14:12:34 +00:00
|
|
|
|
2007-04-05 12:12:10 +00:00
|
|
|
QTimer delayedShowTimer;
|
2007-04-12 14:12:34 +00:00
|
|
|
int display_refcount;
|
2007-04-05 12:12:10 +00:00
|
|
|
QString no_tasks;
|
2007-04-12 14:12:34 +00:00
|
|
|
int lineHeight;
|
|
|
|
bool showMiniIcon;
|
2003-09-16 19:28:03 +00:00
|
|
|
bool options_traverse_all;
|
|
|
|
};
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns the tab box' workspace
|
|
|
|
*/
|
|
|
|
inline Workspace* TabBox::workspace() const
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
1999-08-19 23:26:42 +00:00
|
|
|
return wspace;
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
/*!
|
2007-04-12 14:12:34 +00:00
|
|
|
Returns the current mode, either TabBoxDesktopListMode or TabBoxWindowsMode
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
\sa setMode()
|
|
|
|
*/
|
2007-04-12 14:12:34 +00:00
|
|
|
inline TabBoxMode TabBox::mode() const
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
1999-08-19 23:26:42 +00:00
|
|
|
return m;
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
/*!
|
|
|
|
Increase the reference count, preventing the default tabbox from showing.
|
|
|
|
|
|
|
|
\sa unrefDisplay(), isDisplayed()
|
|
|
|
*/
|
|
|
|
inline void TabBox::refDisplay()
|
|
|
|
{
|
|
|
|
++display_refcount;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns whether the tab box is being displayed, either natively or by an
|
|
|
|
effect.
|
|
|
|
|
|
|
|
\sa refDisplay(), unrefDisplay()
|
|
|
|
*/
|
|
|
|
inline bool TabBox::isDisplayed() const
|
|
|
|
{
|
|
|
|
return display_refcount > 0;
|
|
|
|
}
|
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
} // namespace
|
2001-02-20 01:20:38 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
#endif
|