2
* Copyright © 2007 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
#ifndef _COMPIZ_CUBE_H
27
#define _COMPIZ_CUBE_H
29
#include <core/core.h>
30
#include <core/pluginclasshandler.h>
32
#include <composite/composite.h>
33
#include <opengl/opengl.h>
34
#include <opengl/vector.h>
35
#include <opengl/texture.h>
37
#define COMPIZ_CUBE_ABI 1
45
class PrivateCubeScreen;
47
class CubeScreenInterface :
48
public WrapableInterface<CubeScreen, CubeScreenInterface>
51
virtual void cubeGetRotation (float &x, float &v, float &progress);
52
virtual void cubeClearTargetOutput (float xRotate, float vRotate);
53
virtual void cubePaintTop (const GLScreenPaintAttrib &sAttrib,
54
const GLMatrix &transform,
57
virtual void cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
58
const GLMatrix &transform,
61
virtual void cubePaintInside (const GLScreenPaintAttrib &sAttrib,
62
const GLMatrix &transform,
65
virtual bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib,
66
const GLMatrix &transform,
68
std::vector<GLVector> &points);
69
virtual void cubePaintViewport (const GLScreenPaintAttrib &sAttrib,
70
const GLMatrix &transform,
71
const CompRegion ®ion,
74
virtual bool cubeShouldPaintViewport (const GLScreenPaintAttrib &sAttrib,
75
const GLMatrix &transform,
82
public WrapableHandler<CubeScreenInterface, 8>,
83
public PluginClassHandler<CubeScreen, CompScreen, COMPIZ_CUBE_ABI>,
84
public CompOption::Class
94
CubeScreen (CompScreen *s);
97
CompOption::Vector & getOptions ();
98
bool setOption (const CompString &name, CompOption::Value &value);
100
WRAPABLE_HND (0, CubeScreenInterface, void, cubeGetRotation,
101
float &, float&, float&);
102
WRAPABLE_HND (1, CubeScreenInterface, void, cubeClearTargetOutput,
104
WRAPABLE_HND (2, CubeScreenInterface, void, cubePaintTop,
105
const GLScreenPaintAttrib &, const GLMatrix &,
107
WRAPABLE_HND (3, CubeScreenInterface, void, cubePaintBottom,
108
const GLScreenPaintAttrib &, const GLMatrix &,
110
WRAPABLE_HND (4, CubeScreenInterface, void, cubePaintInside,
111
const GLScreenPaintAttrib &, const GLMatrix &,
113
WRAPABLE_HND (5, CubeScreenInterface, bool, cubeCheckOrientation,
114
const GLScreenPaintAttrib &, const GLMatrix &,
115
CompOutput *, std::vector<GLVector> &);
116
WRAPABLE_HND (6, CubeScreenInterface, void, cubePaintViewport,
117
const GLScreenPaintAttrib &, const GLMatrix &,
118
const CompRegion &, CompOutput *, unsigned int);
119
WRAPABLE_HND (7, CubeScreenInterface, bool, cubeShouldPaintViewport,
120
const GLScreenPaintAttrib &, const GLMatrix &,
121
CompOutput *, PaintOrder);
125
bool unfolded () const;
127
RotationState rotationState () const;
128
void rotationState (RotationState state);
130
friend class PrivateCubeWindow;
131
friend class PrivateCubeScreen;
134
PrivateCubeScreen *priv;
137
#define CUBE_SCREEN(s) \
138
CubeScreen *cs = CubeScreen::get (s)