2
* Copyright © 2005 Novell, Inc.
4
* Permission to use, copy, modify, distribute, and sell this software
5
* and its documentation for any purpose is hereby granted without
6
* fee, provided that the above copyright notice appear in all copies
7
* and that both that copyright notice and this permission notice
8
* appear in supporting documentation, and that the name of
9
* Novell, Inc. not be used in advertising or publicity pertaining to
10
* distribution of the software without specific, written prior permission.
11
* Novell, Inc. makes no representations about the suitability of this
12
* software for any purpose. It is provided "as is" without express or
15
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17
* NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
* Author: David Reveman <davidr@novell.com>
26
#include <core/core.h>
27
#include <core/privatehandler.h>
28
#include <composite/composite.h>
29
#include <opengl/opengl.h>
31
#define FADE_OPTION_FADE_MODE 0
32
#define FADE_OPTION_FADE_SPEED 1
33
#define FADE_OPTION_FADE_TIME 2
34
#define FADE_OPTION_WINDOW_MATCH 3
35
#define FADE_OPTION_VISUAL_BELL 4
36
#define FADE_OPTION_FULLSCREEN_VISUAL_BELL 5
37
#define FADE_OPTION_DIM_UNRESPONSIVE 6
38
#define FADE_OPTION_UNRESPONSIVE_BRIGHTNESS 7
39
#define FADE_OPTION_UNRESPONSIVE_SATURATION 8
40
#define FADE_OPTION_NUM 9
42
#define FADE_MODE_CONSTANTSPEED 0
43
#define FADE_MODE_CONSTANTTIME 1
44
#define FADE_MODE_MAX FADE_MODE_CONSTANTTIME
47
public ScreenInterface,
48
public CompositeScreenInterface,
49
public PrivateHandler<FadeScreen, CompScreen>
52
FadeScreen (CompScreen *s);
54
CompOption::Vector & getOptions ();
55
bool setOption (const char *, CompOption::Value &);
57
void handleEvent (XEvent *);
58
void preparePaint (int);
63
CompOption::Vector opt;
65
CompositeScreen *cScreen;
69
public WindowInterface,
70
public GLWindowInterface,
71
public PrivateHandler<FadeWindow, CompWindow>
74
FadeWindow (CompWindow *w);
77
void windowNotify (CompWindowNotify);
78
void paintStep (unsigned int, int, int);
80
bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,
81
const CompRegion&, unsigned int);
83
void addDisplayModal ();
84
void removeDisplayModal ();
91
CompositeWindow *cWindow;
98
GLushort targetOpacity;
99
GLushort targetBrightness;
100
GLushort targetSaturation;
112
class FadePluginVTable :
113
public CompPlugin::VTableForScreenAndWindow<FadeScreen, FadeWindow>
118
PLUGIN_OPTION_HELPER (FadeScreen);