3
* Compiz thumbnail plugin
7
* Copyright : (C) 2007 by Dennis Kasprzyk
8
* E-mail : onestone@beryl-project.org
10
* Ported to Compiz 0.9
11
* Copyright : (C) 2009 by Sam Spilsbury
12
* E-mail : smspillaz@gmail.com
14
* Based on thumbnail.c:
15
* Copyright : (C) 2007 Stjepan Glavina
16
* E-mail : stjepang@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
* - Make Thumbnail it's own class with methods
33
* - Make a Thumbnail container class - this is where the window /
35
* - Set KDE Thumbnail property
36
* - Set Compiz Thumbnail property (for plugins like peek)
41
#include <core/core.h>
42
#include <core/atoms.h>
43
#include <composite/composite.h>
44
#include <opengl/opengl.h>
45
#include <text/text.h>
46
#include <mousepoll/mousepoll.h>
48
#include "thumbnail_options.h"
50
#define THUMB_SCREEN(s) \
51
ThumbScreen *ts = ThumbScreen::get (s)
53
#define THUMB_WINDOW(w) \
54
ThumbWindow *tw = ThumbWindow::get (w)
56
#define WIN_X(w) ((w)->x () - (w)->border ().left)
57
#define WIN_Y(w) ((w)->y () - (w)->border ().top)
58
#define WIN_W(w) ((w)->width () + (w)->border ().left + (w)->border ().right)
59
#define WIN_H(w) ((w)->height () + (w)->border ().top + (w)->border ().bottom)
61
#define TEXT_DISTANCE 10
63
bool textPluginLoaded;
65
typedef struct _Thumbnail
83
public PluginClassHandler <ThumbScreen, CompScreen>,
84
public ScreenInterface,
85
public GLScreenInterface,
86
public CompositeScreenInterface,
87
public ThumbnailOptions
91
ThumbScreen (CompScreen *sceen);
94
void handleEvent (XEvent *);
96
void preparePaint (int);
99
glPaintOutput (const GLScreenPaintAttrib &,
109
glPaintTransformedOutput (const GLScreenPaintAttrib &,
116
freeThumbText (Thumbnail *t);
119
renderThumbText (Thumbnail *t,
123
damageThumbRegion (Thumbnail *t);
126
thumbUpdateThumbnail ();
129
thumbShowThumbnail ();
132
checkPosition (CompWindow *w);
135
positionUpdate (const CompPoint &pos);
138
paintTexture (int wx,
145
thumbPaintThumb (Thumbnail *t,
146
const GLMatrix *transform);
150
CompositeScreen *cScreen;
153
CompWindow *pointedWin;
160
CompTimer displayTimeout;
162
GLTexture::List glowTexture;
163
GLTexture::List windowTexture;
172
public PluginClassHandler <ThumbWindow, CompWindow>,
173
public WindowInterface,
174
public CompositeWindowInterface,
175
public GLWindowInterface
179
ThumbWindow (CompWindow *window);
183
CompositeWindow *cWindow;
187
glPaint (const GLWindowPaintAttrib &attrib,
188
const GLMatrix &transform,
193
resizeNotify (int dx,
199
damageRect (bool initial,
200
const CompRect &rect);
203
class ThumbPluginVTable :
204
public CompPlugin::VTableForScreenAndWindow <ThumbScreen, ThumbWindow>