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-03-08 04:44:06 +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;
|
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
namespace KWinInternal
|
|
|
|
{
|
2001-02-20 01:20:38 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
class Workspace;
|
|
|
|
class Client;
|
|
|
|
|
2007-03-08 04:44:06 +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-03-08 04:44:06 +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-03-08 16:49:44 +00:00
|
|
|
ClientList currentClientList();
|
2003-09-16 19:28:03 +00:00
|
|
|
int currentDesktop();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2001-06-10 04:10:42 +00:00
|
|
|
// DesktopMode and WindowsMode are based on the order in which the desktop
|
|
|
|
// or window were viewed.
|
|
|
|
// DesktopListMode lists them in the order created.
|
2003-09-16 19:28:03 +00:00
|
|
|
enum Mode { DesktopMode, DesktopListMode, WindowsMode };
|
|
|
|
void setMode( Mode mode );
|
|
|
|
Mode mode() const;
|
|
|
|
|
2007-03-08 16:48:48 +00:00
|
|
|
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-03-08 16:49:44 +00:00
|
|
|
void refTabBox();
|
|
|
|
void unrefTabBox();
|
|
|
|
|
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-03-08 04:44:06 +00:00
|
|
|
void updateKeyMapping();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2007-03-08 16:49:44 +00:00
|
|
|
public slots:
|
|
|
|
void show();
|
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
protected:
|
|
|
|
void showEvent( QShowEvent* );
|
|
|
|
void hideEvent( QHideEvent* );
|
2007-03-08 04:44:06 +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);
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
private:
|
2007-03-08 04:44:06 +00:00
|
|
|
Client* client;
|
2003-09-16 19:28:03 +00:00
|
|
|
Mode m;
|
|
|
|
Workspace* wspace;
|
2007-03-08 16:49:44 +00:00
|
|
|
ClientList clients, displayed_clients;
|
2003-09-16 19:28:03 +00:00
|
|
|
int desk;
|
2004-02-05 21:58:22 +00:00
|
|
|
int lineHeight;
|
|
|
|
bool showMiniIcon;
|
2003-09-16 19:28:03 +00:00
|
|
|
QTimer delayedShowTimer;
|
|
|
|
QString no_tasks;
|
|
|
|
bool options_traverse_all;
|
2007-03-08 16:49:44 +00:00
|
|
|
int display_refcount;
|
2003-09-16 19:28:03 +00:00
|
|
|
};
|
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
|
|
|
|
|
|
|
/*!
|
2001-06-10 04:10:42 +00:00
|
|
|
Returns the current mode, either DesktopListMode or WindowsMode
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
\sa setMode()
|
|
|
|
*/
|
|
|
|
inline TabBox::Mode 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-03-08 16:49:44 +00:00
|
|
|
/*!
|
|
|
|
Increase the reference count, preventing the default tabbox from showing.
|
|
|
|
*/
|
|
|
|
inline void TabBox::refTabBox()
|
|
|
|
{
|
|
|
|
++display_refcount;
|
|
|
|
}
|
|
|
|
|
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
|