~compiz-team/compiz-expo-plugin/oneiric

« back to all changes in this revision

Viewing changes to src/expo.h

  • Committer: Sam Spilsbury
  • Date: 2011-09-15 11:22:08 UTC
  • Revision ID: sam.spilsbury@canonical.com-20110915112208-54w58lv48z6554mn
Added expo plugin polish

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include <core/core.h>
27
27
#include <core/pluginclasshandler.h>
 
28
#include <cairo.h>
 
29
#include <cairo-xlib-xrender.h>
28
30
 
29
31
#include <composite/composite.h>
30
32
#include <opengl/opengl.h>
31
33
 
32
34
#include "expo_options.h"
 
35
#include "glow.h"
 
36
 
 
37
#define WIN_REAL_X(w) (w->x () - w->border ().left)
 
38
#define WIN_REAL_Y(w) (w->y () - w->border ().top)
 
39
#define WIN_REAL_WIDTH(w) (w->width () + 2 * w->geometry ().border () + \
 
40
                           w->border ().left + w->border ().right)
 
41
#define WIN_REAL_HEIGHT(w) (w->height () + 2 * w->geometry ().border () + \
 
42
                            w->border ().top + w->border ().bottom)
33
43
 
34
44
class ExpoScreen :
35
45
    public ScreenInterface,
40
50
{
41
51
    public:
42
52
        ExpoScreen (CompScreen *);
 
53
        ~ExpoScreen ();
43
54
 
44
55
        void handleEvent (XEvent *);
45
56
 
53
64
                                       const GLMatrix&, const CompRegion&,
54
65
                                       CompOutput *, unsigned int);
55
66
 
 
67
        const CompWindowList & getWindowPaintList ();
 
68
 
56
69
        bool dndInit (CompAction *, CompAction::State, CompOption::Vector&);
57
70
        bool dndFini (CompAction *, CompAction::State, CompOption::Vector&);
58
71
        bool doExpo (CompAction *, CompAction::State, CompOption::Vector&);
61
74
        bool nextVp (CompAction *, CompAction::State, CompOption::Vector&);
62
75
        bool prevVp (CompAction *, CompAction::State, CompOption::Vector&);
63
76
 
 
77
        CompPoint currentViewport ();
 
78
 
64
79
        typedef enum {
65
80
            DnDNone,
66
81
            DnDDuring,
81
96
        bool  expoMode;
82
97
 
83
98
        DnDState   dndState;
84
 
        CompWindow *dndWindow;
 
99
        CompWindowList dndWindows;
85
100
 
86
101
        CompPoint prevCursor;
87
102
        CompPoint newCursor;
111
126
 
112
127
        CompScreen::GrabHandle grabIndex;
113
128
 
 
129
        GLTexture::List polkadots_texture;
 
130
        CompSize        polkadots_texture_size;
 
131
        CompSize        viewport_size;
 
132
 
 
133
        GLTexture::List outline_texture;
 
134
        CompSize        outline_texture_size;
 
135
 
 
136
        bool paintingDndWindow;
 
137
 
 
138
        const GlowTextureProperties *mGlowTextureProperties;
 
139
 
114
140
    private:
115
141
        void moveFocusViewport (int, int);
116
142
        void finishWindowMovement ();
121
147
        void paintWall (const GLScreenPaintAttrib&, const GLMatrix&,
122
148
                        const CompRegion&, CompOutput *, unsigned int, bool);
123
149
 
 
150
        void paintViewport (const GLScreenPaintAttrib& attrib,
 
151
                            const GLMatrix&            transform,
 
152
                            const CompRegion&          region,
 
153
                            CompOutput                 *output,
 
154
                            unsigned int               mask,
 
155
                            CompPoint                  vpPos,
 
156
                            GLVector                   &vpCamPos,
 
157
                            bool                       reflection);
 
158
 
 
159
        bool windowsOnVp (CompPoint &p);
 
160
 
124
161
        KeyCode leftKey;
125
162
        KeyCode rightKey;
126
163
        KeyCode upKey;
127
164
        KeyCode downKey;
 
165
 
 
166
        Cursor  mMoveCursor;
128
167
};
129
168
 
130
169
class ExpoWindow :
131
170
    public CompositeWindowInterface,
132
171
    public GLWindowInterface,
 
172
    public WindowInterface,
133
173
    public PluginClassHandler<ExpoWindow, CompWindow>
134
174
{
135
175
    public:
136
176
        ExpoWindow (CompWindow *);
 
177
        ~ExpoWindow ();
137
178
 
138
179
        bool damageRect (bool, const CompRect&);
139
180
 
 
181
        void resizeNotify (int dx, int dy, int dw, int dh);
 
182
 
140
183
        bool glDraw (const GLMatrix&, GLFragment::Attrib&,
141
184
                     const CompRegion&, unsigned int);
142
185
        bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,
147
190
        void glDrawTexture (GLTexture *, GLFragment::Attrib& attrib,
148
191
                            unsigned int);
149
192
 
 
193
        void
 
194
        paintGlow (GLFragment::Attrib        &attrib,
 
195
                   const CompRegion          &paintRegion,
 
196
                   unsigned int              mask);
 
197
 
 
198
        void
 
199
        computeGlowQuads (GLTexture::Matrix *matrix);
 
200
 
150
201
        CompWindow      *window;
151
202
        CompositeWindow *cWindow;
152
203
        GLWindow        *gWindow;
153
204
        ExpoScreen      *eScreen;
 
205
 
 
206
        float           dndOpacity;
 
207
 
 
208
        GlowQuad *mGlowQuads;
154
209
};
155
210
 
156
211
class ExpoPluginVTable :