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-05 12:12:10 +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;
|
|
|
|
|
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-05 12:12:10 +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:
|
2007-04-05 12:12:10 +00:00
|
|
|
TabBox( Workspace *ws, const char *name=0 );
|
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-05 12:12:10 +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;
|
|
|
|
|
2007-04-05 12:12:10 +00:00
|
|
|
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();
|
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-05 12:12:10 +00:00
|
|
|
void drawContents( QPainter * );
|
2004-02-05 21:58:22 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void createClientList(ClientList &list, int desktop /*-1 = all*/, Client *start, bool chain);
|
2007-04-05 12:12:10 +00:00
|
|
|
void updateOutline();
|
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
|
|
|
Client* current_client;
|
2007-03-28 20:29:45 +00:00
|
|
|
Mode m;
|
2007-04-05 12:12:10 +00:00
|
|
|
Workspace* wspace;
|
2007-03-28 20:29:45 +00:00
|
|
|
ClientList clients;
|
2003-09-16 19:28:03 +00:00
|
|
|
int desk;
|
2007-03-28 20:29:45 +00:00
|
|
|
int lineHeight;
|
|
|
|
bool showMiniIcon;
|
2007-04-05 12:12:10 +00:00
|
|
|
QTimer delayedShowTimer;
|
|
|
|
QString no_tasks;
|
2003-09-16 19:28:03 +00:00
|
|
|
bool options_traverse_all;
|
2007-04-05 12:12:10 +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
|