3
* Compiz ring switcher plugin
7
* Copyright : (C) 2007 by Danny Baumann
8
* E-mail : maniac@opencompositing.org
10
* Based on scale.c and switcher.c:
11
* Copyright : (C) 2007 David Reveman
12
* E-mail : davidr@novell.com
14
* Ported to Compiz 0.9 by:
15
* Copyright : (C) 2009 Sam Spilsbury
16
* E-mail : smspillaz@gmail.com
18
* This program is free software; you can redistribute it and/or
19
* modify it under the terms of the GNU General Public License
20
* as published by the Free Software Foundation; either version 2
21
* of the License, or (at your option) any later version.
23
* This program is distributed in the hope that it will be useful,
24
* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
* GNU General Public License for more details.
32
#include <core/atoms.h>
33
#include <core/core.h>
34
#include <composite/composite.h>
35
#include <opengl/opengl.h>
36
#include <text/text.h>
38
#include <X11/Xatom.h>
40
#include "ring_options.h"
42
extern bool textAvailable;
45
public PluginClassHandler <RingScreen, CompScreen>,
47
public ScreenInterface,
48
public CompositeScreenInterface,
49
public GLScreenInterface
53
RingScreen (CompScreen *screen);
61
RingStateSwitching = 2,
73
int x, y; /* thumb center coordinates */
74
float scale; /* size scale (fit to max thumb size) */
75
float depthScale; /* scale for depth impression */
76
float depthBrightness; /* brightness for depth impression */
87
CompositeScreen *cScreen;
92
CompScreen::GrabHandle mGrabIndex;
103
/* only used for sorting */
104
std::vector <CompWindow *> mWindows;
105
std::vector <RingDrawSlot> mDrawSlots;
109
Window mClientLeader;
111
CompWindow *mSelectedWindow;
114
CompMatch mCurrentMatch;
118
/* Functions that we hook */
121
handleEvent (XEvent *);
127
glPaintOutput (const GLScreenPaintAttrib &,
138
/* Internal Functions */
144
renderWindowTitle ();
153
addWindowToList (CompWindow *w);
162
switchToWindow (bool toNext);
168
adjustRingRotation (float chunk);
171
terminate (CompAction *action,
172
CompAction::State state,
173
CompOption::Vector options);
176
initiate (CompAction *action,
177
CompAction::State state,
178
CompOption::Vector options);
181
doSwitch (CompAction *action,
182
CompAction::State state,
183
CompOption::Vector options,
188
windowSelectAt (int x,
193
windowRemove (CompWindow *w);
196
switchActivateEvent (bool);
201
public PluginClassHandler <RingWindow, CompWindow>,
202
public GLWindowInterface,
203
public CompositeWindowInterface
207
RingWindow (CompWindow *);
211
CompositeWindow *cWindow;
214
RingScreen::RingSlot *mSlot;
218
GLfloat mScaleVelocity;
226
glPaint (const GLWindowPaintAttrib &,
232
damageRect (bool, const CompRect &);
235
is (bool removing = false);
238
compareWindows (CompWindow *w1,
242
compareRingWindowDepth (RingScreen::RingDrawSlot e1,
243
RingScreen::RingDrawSlot e2);
250
#define DIST_ROT (3600 / mWindows.size ())
251
#define DIST_ROT_w (3600 / rs->mWindows.size ())
254
#define RING_SCREEN(s) \
255
RingScreen *rs = RingScreen::get (s)
257
#define RING_WINDOW(w) \
258
RingWindow *rw = RingWindow::get (w)
260
class RingPluginVTable :
261
public CompPlugin::VTableForScreenAndWindow <RingScreen, RingWindow>