3
* Compiz application switcher plugin
7
* Copyright : (C) 2008 by Danny Baumann
8
* E-mail : maniac@compiz-fusion.org
10
* Based on switcher.c:
11
* Copyright : (C) 2007 David Reveman
12
* E-mail : davidr@novell.com
14
* This program is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU General Public License
16
* as published by the Free Software Foundation; either version 2
17
* of the License, or (at your option) any later version.
19
* This program is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
30
#include <sys/types.h>
32
#include <X11/Xatom.h>
34
#include <compiztoolbox/compiztoolbox.h>
36
#include <core/pluginclasshandler.h>
38
#include "staticswitcher_options.h"
40
class StaticSwitchScreen :
41
public BaseSwitchScreen,
42
public ScreenInterface,
43
public CompositeScreenInterface,
44
public GLScreenInterface,
45
public PluginClassHandler<StaticSwitchScreen,CompScreen>,
46
public StaticswitcherOptions
49
StaticSwitchScreen (CompScreen *screen);
50
~StaticSwitchScreen ();
52
void preparePaint (int);
55
bool glPaintOutput (const GLScreenPaintAttrib &,
56
const GLMatrix &, const CompRegion &,
57
CompOutput *, unsigned int);
59
void updatePopupWindow ();
60
void updateWindowList ();
61
void createWindowList ();
62
bool getPaintRectangle (CompWindow *w,
65
void doWindowDamage (CompWindow *w);
66
void handleSelectionChange (bool toNext, int nextIdx);
69
Cursor getCursor (bool mouseSelectOn);
70
void initiate (SwitchWindowSelection selection,
71
bool shouldShowPopup);
72
void windowRemove (CompWindow *w);
73
int getRowXOffset (int y);
74
void getWindowPosition (unsigned int index,
77
CompWindow *findWindowAt (int x,
79
void handleEvent (XEvent *event);
80
bool adjustVelocity ();
81
void paintRect (CompRect &box,
83
unsigned short *color,
85
void paintSelectionRect (int x,
89
unsigned int opacity);
90
void getMinimizedAndMatch (bool &minimizedOption,
94
Window lastActiveWindow;
96
CompTimer popupDelayTimer;
115
class StaticSwitchWindow :
116
public BaseSwitchWindow,
117
public CompositeWindowInterface,
118
public GLWindowInterface,
119
public PluginClassHandler<StaticSwitchWindow,CompWindow>
122
StaticSwitchWindow (CompWindow *window);
124
bool isSwitchWin (bool removing = false);
125
bool damageRect (bool initial, const CompRect &rect);
127
bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
128
const CompRegion &, unsigned int);
130
void paintThumb (const GLWindowPaintAttrib &, const GLMatrix &,
131
unsigned int, int, int);
132
void updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
138
void updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
146
void updateIconPos (int &wx,
153
IconMode getIconMode ();
155
StaticSwitchScreen *sScreen;
158
#define MAX_ICON_SIZE 256
160
#define PREVIEWSIZE 150
163
#define SWITCH_SCREEN(s) \
164
StaticSwitchScreen *ss = StaticSwitchScreen::get (s)
166
#define SWITCH_WINDOW(w) \
167
StaticSwitchWindow *sw = StaticSwitchWindow::get (w)
169
class StaticSwitchPluginVTable :
170
public CompPlugin::VTableForScreenAndWindow<StaticSwitchScreen, StaticSwitchWindow>