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
|
|
|
|
2005-07-28 14:59:42 +00:00
|
|
|
#include <Q3Frame>
|
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;
|
|
|
|
|
2005-07-28 14:59:42 +00:00
|
|
|
class TabBox : public Q3Frame
|
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:
|
|
|
|
TabBox( Workspace *ws, const char *name=0 );
|
|
|
|
~TabBox();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
Client* currentClient();
|
2006-08-13 22:45:44 +00:00
|
|
|
void setCurrentClient( Client* c );
|
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;
|
|
|
|
|
|
|
|
void reset();
|
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
|
|
|
|
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();
|
2005-06-22 15:44:24 +00:00
|
|
|
void updateKeyMapping();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
protected:
|
|
|
|
void showEvent( QShowEvent* );
|
|
|
|
void hideEvent( QHideEvent* );
|
2004-02-05 21:58:22 +00:00
|
|
|
void drawContents( QPainter * );
|
|
|
|
|
|
|
|
private:
|
|
|
|
void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
|
2006-08-13 22:45:44 +00:00
|
|
|
void updateOutline();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
private:
|
2006-08-13 22:45:44 +00:00
|
|
|
Client* current_client;
|
2003-09-16 19:28:03 +00:00
|
|
|
Mode m;
|
|
|
|
Workspace* wspace;
|
|
|
|
ClientList clients;
|
|
|
|
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;
|
2006-08-13 22:45:44 +00:00
|
|
|
Window outline_left, outline_right, outline_top, outline_bottom;
|
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
|
|
|
|
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
|