~townsend/compiz/fix-auto-vp-switch-0.9.10

« back to all changes in this revision

Viewing changes to plugins/expo/src/expo.h

  • Committer: MC Return
  • Date: 2013-06-29 09:36:01 UTC
  • mfrom: (3750 0.9.10)
  • mto: This revision was merged to the branch mainline in revision 3770.
  • Revision ID: mc.return@gmx.net-20130629093601-trksogeaxli98ln9
MergedĀ latestĀ lp:compiz

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    public ExpoOptions
41
41
{
42
42
    public:
 
43
 
43
44
        ExpoScreen (CompScreen *);
44
45
        ~ExpoScreen ();
45
46
 
46
47
        void handleEvent (XEvent *);
47
48
 
48
49
        void preparePaint (int);
49
 
        void paint (CompOutput::ptrList&, unsigned int);
 
50
 
 
51
        void paint (CompOutput::ptrList &,
 
52
                    unsigned int          );
 
53
 
50
54
        void donePaint ();
51
55
 
52
 
        bool glPaintOutput (const GLScreenPaintAttrib&, const GLMatrix&,
53
 
                            const CompRegion&, CompOutput *, unsigned int);
54
 
        void glPaintTransformedOutput (const GLScreenPaintAttrib&,
55
 
                                       const GLMatrix&, const CompRegion&,
56
 
                                       CompOutput *, unsigned int);
 
56
        bool glPaintOutput (const GLScreenPaintAttrib &,
 
57
                            const GLMatrix            &,
 
58
                            const CompRegion          &,
 
59
                            CompOutput                *,
 
60
                            unsigned int                );
 
61
 
 
62
        void glPaintTransformedOutput (const GLScreenPaintAttrib &,
 
63
                                       const GLMatrix            &,
 
64
                                       const CompRegion          &,
 
65
                                       CompOutput                *,
 
66
                                       unsigned int                );
57
67
 
58
68
        bool dndInit (CompAction *, CompAction::State, CompOption::Vector&);
59
69
        bool dndFini (CompAction *, CompAction::State, CompOption::Vector&);
63
73
        bool nextVp (CompAction *, CompAction::State, CompOption::Vector&);
64
74
        bool prevVp (CompAction *, CompAction::State, CompOption::Vector&);
65
75
 
66
 
        typedef enum {
 
76
        typedef enum
 
77
        {
67
78
            DnDNone,
68
79
            DnDDuring,
69
80
            DnDStart
70
81
        } DnDState;
71
82
 
72
 
        typedef enum {
 
83
        typedef enum
 
84
        {
73
85
            VPUpdateNone,
74
86
            VPUpdateMouseOver,
75
87
            VPUpdatePrevious
76
88
        } VPUpdateMode;
77
89
 
78
 
        CompositeScreen *cScreen;
79
 
        GLScreen        *gScreen;
80
 
 
81
 
        float expoCam;
82
 
        bool  expoActive;
83
 
        bool  expoMode;
84
 
 
85
 
        DnDState   dndState;
86
 
        CompWindow *dndWindow;
87
 
 
88
 
        CompPoint prevCursor;
89
 
        CompPoint newCursor;
90
 
        CompPoint prevClickPoint;
91
 
 
92
 
        CompPoint origVp;
93
 
        CompPoint selectedVp;
94
 
        CompPoint lastSelectedVp;
95
 
        CompPoint paintingVp;
96
 
 
97
 
        std::vector<float> vpActivity;
98
 
        float              vpBrightness;
99
 
        float              vpSaturation;
100
 
 
101
 
        VPUpdateMode vpUpdateMode;
102
 
 
103
 
        bool         anyClick;
104
 
        unsigned int clickTime;
105
 
        bool         doubleClick;
106
 
 
107
 
        CompRegion tmpRegion;
108
 
 
109
 
        float curveAngle;
110
 
        float curveDistance;
111
 
        float curveRadius;
112
 
 
113
 
        std::vector<GLfloat> vpNormals;
114
 
 
115
 
        CompScreen::GrabHandle grabIndex;
116
 
 
117
 
        GLTexture::List outline_texture;
118
 
        CompSize        outline_texture_size;
 
90
        CompositeScreen             *cScreen;
 
91
        GLScreen                    *gScreen;
 
92
 
 
93
        float                       expoCam;
 
94
        bool                        expoActive;
 
95
        bool                        expoMode;
 
96
 
 
97
        DnDState                    dndState;
 
98
        CompWindow                  *dndWindow;
 
99
 
 
100
        CompPoint                   prevCursor;
 
101
        CompPoint                   newCursor;
 
102
        CompPoint                   prevClickPoint;
 
103
 
 
104
        CompPoint                   origVp;
 
105
        CompPoint                   selectedVp;
 
106
        CompPoint                   lastSelectedVp;
 
107
        CompPoint                   paintingVp;
 
108
 
 
109
        std::vector<float>          vpActivity;
 
110
        float                       vpBrightness;
 
111
        float                       vpSaturation;
 
112
 
 
113
        VPUpdateMode                vpUpdateMode;
 
114
 
 
115
        bool                        anyClick;
 
116
        unsigned int                clickTime;
 
117
        bool                        doubleClick;
 
118
 
 
119
        CompRegion                  tmpRegion;
 
120
 
 
121
        float                       curveAngle;
 
122
        float                       curveDistance;
 
123
        float                       curveRadius;
 
124
 
 
125
        std::vector<GLfloat>        vpNormals;
 
126
 
 
127
        CompScreen::GrabHandle      grabIndex;
 
128
 
 
129
        GLTexture::List             outline_texture;
 
130
        CompSize                    outline_texture_size;
119
131
 
120
132
        const GlowTextureProperties *mGlowTextureProperties;
121
133
 
122
134
    private:
 
135
 
123
136
        void moveFocusViewport (int, int);
124
137
        void finishWindowMovement ();
125
138
        void updateWraps (bool);
126
139
 
127
 
        void invertTransformedVertex (const GLScreenPaintAttrib&,
128
 
                                      const GLMatrix&, CompOutput *, int[2]);
129
 
        void paintWall (const GLScreenPaintAttrib&, const GLMatrix&,
130
 
                        const CompRegion&, CompOutput *, unsigned int, bool);
 
140
        void invertTransformedVertex (const GLScreenPaintAttrib &,
 
141
                                      const GLMatrix            &,
 
142
                                      CompOutput                *,
 
143
                                      int[2]                      );
 
144
 
 
145
        void paintWall (const GLScreenPaintAttrib &,
 
146
                        const GLMatrix            &,
 
147
                        const CompRegion          &,
 
148
                        CompOutput                *,
 
149
                        unsigned int               ,
 
150
                        bool                        );
131
151
 
132
152
        KeyCode leftKey;
133
153
        KeyCode rightKey;
143
163
    public PluginClassHandler<ExpoWindow, CompWindow>
144
164
{
145
165
    public:
 
166
 
146
167
        ExpoWindow (CompWindow *);
147
168
        ~ExpoWindow ();
148
169
 
149
 
        bool damageRect (bool, const CompRect&);
150
 
 
151
 
        bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&,
152
 
                     const CompRegion&, unsigned int);
153
 
        bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,
154
 
                      const CompRegion&, unsigned int);
155
 
        void glAddGeometry (const GLTexture::MatrixList&,
156
 
                            const CompRegion&, const CompRegion&,
157
 
                            unsigned int, unsigned int);
158
 
        void glDrawTexture (GLTexture*, const GLMatrix&,
159
 
                            const GLWindowPaintAttrib&, unsigned int);
 
170
        bool damageRect (bool           ,
 
171
                         const CompRect  &);
 
172
 
 
173
        bool glDraw (const GLMatrix            &,
 
174
                     const GLWindowPaintAttrib &,
 
175
                     const CompRegion          &,
 
176
                     unsigned int                );
 
177
 
 
178
        bool glPaint (const GLWindowPaintAttrib &,
 
179
                      const GLMatrix            &,
 
180
                      const CompRegion          &,
 
181
                      unsigned int                );
 
182
 
 
183
        void glAddGeometry (const GLTexture::MatrixList &,
 
184
                            const CompRegion            &,
 
185
                            const CompRegion            &,
 
186
                            unsigned int                 ,
 
187
                            unsigned int                  );
 
188
 
 
189
        void glDrawTexture (GLTexture                 *,
 
190
                            const GLMatrix            &,
 
191
                            const GLWindowPaintAttrib &,
 
192
                            unsigned int                );
 
193
 
160
194
        void
161
195
        paintGlow (const GLMatrix            &transform,
162
 
                   const GLWindowPaintAttrib &attrib,
163
 
                   const CompRegion          &paintRegion,
164
 
                   unsigned int              mask);
 
196
                   const GLWindowPaintAttrib &attrib,
 
197
                   const CompRegion          &paintRegion,
 
198
                   unsigned int              mask);
165
199
 
166
200
        void
167
201
        computeGlowQuads (GLTexture::Matrix *matrix);
172
206
        ExpoScreen      *eScreen;
173
207
 
174
208
    private:
175
 
        GlowQuad *mGlowQuads;
176
 
        float expoOpacity;
 
209
 
 
210
        GlowQuad        *mGlowQuads;
 
211
        float           expoOpacity;
177
212
};
178
213
 
179
214
class ExpoPluginVTable :
180
215
    public CompPlugin::VTableForScreenAndWindow<ExpoScreen, ExpoWindow>
181
216
{
182
217
    public:
 
218
 
183
219
        bool init ();
184
220
};
185