6
* Copyright (c) 2006 Kristian Lyngstøl <kristian@beryl-project.org>
7
* Ported to Compiz and BCOP usage by Danny Baumann <maniac@beryl-project.org>
8
* Ported to Compiz 0.9 by Sam Spilsbury <smspillaz@gmail.com>
10
* This program is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU General Public License
12
* as published by the Free Software Foundation; either version 2
13
* of the License, or (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
21
* Opacify increases opacity on targeted windows and reduces it on
22
* blocking windows, making whatever window you are targeting easily
27
#include <core/core.h>
28
#include <core/serialization.h>
29
#include <composite/composite.h>
30
#include <opengl/opengl.h>
32
#include "opacify_options.h"
34
/* Size of the Window array storing passive windows. */
35
#define MAX_WINDOWS 64
38
public PluginClassHandler <OpacifyScreen, CompScreen>,
39
public PluginStateWriter <OpacifyScreen>,
40
public OpacifyOptions,
41
public ScreenInterface
44
OpacifyScreen (CompScreen *);
47
CompositeScreen *cScreen;
52
CompTimer timeoutHandle;
54
CompWindow *newActive;
57
std::vector<Window> passive;
59
unsigned short int passiveNum;
61
template <class Archive>
62
void serialize (Archive &ar, const unsigned int version)
72
handleEvent (XEvent *);
75
resetOpacity (Window id);
81
passiveWindows (CompRegion fRegion);
90
toggle (CompAction *action,
91
CompAction::State state,
92
CompOption::Vector options);
95
optionChanged (CompOption *option,
96
OpacifyOptions::Options num);
102
class OpacifyWindow :
103
public PluginClassHandler <OpacifyWindow, CompWindow>,
104
public GLWindowInterface
108
OpacifyWindow (CompWindow *);
111
CompositeWindow *cWindow;
118
glPaint (const GLWindowPaintAttrib &,
124
setOpacity (int fOpacity);
136
#define OPACIFY_SCREEN(s) \
137
OpacifyScreen *os = OpacifyScreen::get (s);
139
#define OPACIFY_WINDOW(w) \
140
OpacifyWindow *ow = OpacifyWindow::get (w);
142
class OpacifyPluginVTable :
143
public CompPlugin::VTableForScreenAndWindow <OpacifyScreen, OpacifyWindow>