~ubuntu-branches/ubuntu/trusty/compiz/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-08-22 06:58:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3352.
  • Revision ID: package-import@ubuntu.com-20130822065807-17nlzez0d30y09so
Tags: upstream-0.9.10+13.10.20130822
ImportĀ upstreamĀ versionĀ 0.9.10+13.10.20130822

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
#include "shift_options.h"
50
50
 
51
 
typedef enum {
 
51
typedef enum
 
52
{
52
53
    ShiftStateNone = 0,
53
54
    ShiftStateOut,
54
55
    ShiftStateSwitching,
56
57
    ShiftStateIn
57
58
} ShiftState;
58
59
 
59
 
typedef enum {
 
60
typedef enum
 
61
{
60
62
    ShiftTypeNormal = 0,
61
63
    ShiftTypeGroup,
62
64
    ShiftTypeAll
63
65
} ShiftType;
64
66
 
65
 
typedef struct _ShiftSlot {
66
 
    int   x, y;            /* thumb center coordinates */
67
 
    float z;
68
 
    float scale;           /* size scale (fit to maximal thumb size */
69
 
    float opacity;
70
 
    float rotation;
 
67
typedef struct _ShiftSlot
 
68
{
 
69
    int     x, y;            /* thumb center coordinates */
 
70
    float   z;
 
71
    float   scale;           /* size scale (fits to maximal thumb size) */
 
72
    float   opacity;
 
73
    float   rotation;
71
74
 
72
75
    GLfloat tx;
73
76
    GLfloat ty;
76
79
 
77
80
} ShiftSlot;
78
81
 
79
 
typedef struct _ShiftDrawSlot {
 
82
typedef struct _ShiftDrawSlot
 
83
{
80
84
    CompWindow *w;
81
85
    ShiftSlot  *slot;
82
86
    float      distance;
97
101
        CompositeScreen *cScreen;
98
102
        GLScreen        *gScreen;
99
103
        CompText        text;
100
 
    
 
104
 
101
105
    public:
102
106
 
103
107
        void
108
112
        
109
113
        void
110
114
        paint (CompOutput::ptrList &,
111
 
               unsigned int);
 
115
               unsigned int          );
112
116
        
113
117
        bool glPaintOutput (const GLScreenPaintAttrib &,
114
 
                            const GLMatrix &, const CompRegion &,
115
 
                            CompOutput *, unsigned int);
 
118
                            const GLMatrix            &,
 
119
                            const CompRegion          &,
 
120
                            CompOutput                *,
 
121
                            unsigned int                );
116
122
        
117
123
        void
118
124
        donePaint ();
123
129
        KeyCode mRightKey;
124
130
        KeyCode mUpKey;
125
131
        KeyCode mDownKey;
126
 
    
 
132
 
127
133
        CompScreen::GrabHandle mGrabIndex;
128
134
        
129
 
        ShiftState      mState;
130
 
        ShiftType       mType;
131
 
        
132
 
        bool            mMoreAdjust;
133
 
        bool            mMoveAdjust;
134
 
        
135
 
        float           mMvTarget;
136
 
        float           mMvAdjust;
137
 
        float           mMvVelocity;
138
 
        bool            mInvert;
139
 
        
140
 
        Cursor          mCursor;
 
135
        ShiftState      mState;
 
136
        ShiftType       mType;
 
137
        
 
138
        bool            mMoreAdjust;
 
139
        bool            mMoveAdjust;
 
140
        
 
141
        float           mMvTarget;
 
142
        float           mMvAdjust;
 
143
        float           mMvVelocity;
 
144
        bool            mInvert;
 
145
        
 
146
        Cursor          mCursor;
141
147
        
142
148
        /* only used for sorting */
143
 
        CompWindow      **mWindows;
144
 
        int             mNWindows;
145
 
        int             mWindowsSize;
 
149
        CompWindow      **mWindows;
 
150
        int             mNWindows;
 
151
        int             mWindowsSize;
146
152
 
147
153
        
148
 
        ShiftDrawSlot   *mDrawSlots;
149
 
        int             mNSlots;
150
 
        int             mSlotsSize;
151
 
        ShiftDrawSlot   *mActiveSlot;
152
 
        
153
 
        Window          mClientLeader;
154
 
        Window          mSelectedWindow;
155
 
        
156
 
        CompMatch       mMatch;
157
 
        CompMatch       *mCurrentMatch;
158
 
        
159
 
        CompOutput      *mOutput;
160
 
        int             mUsedOutput;
161
 
        
162
 
        float           mReflectBrightness;
163
 
        bool            mReflectActive;
164
 
        
165
 
        float           mAnim;
166
 
        float           mAnimVelocity;
167
 
        
168
 
        int             mButtonPressTime;
169
 
        bool            mButtonPressed;
170
 
        int             mStartX;
171
 
        int             mStartY;
172
 
        float           mStartTarget;
173
 
        float           mLastTitle;
174
 
        
175
 
        bool            mPaintingAbove;
176
 
        
177
 
        bool            mCancelled;
 
154
        ShiftDrawSlot   *mDrawSlots;
 
155
        int             mNSlots;
 
156
        int             mSlotsSize;
 
157
        ShiftDrawSlot   *mActiveSlot;
 
158
        
 
159
        Window          mClientLeader;
 
160
        Window          mSelectedWindow;
 
161
        
 
162
        CompMatch       mMatch;
 
163
        CompMatch       *mCurrentMatch;
 
164
        
 
165
        CompOutput      *mOutput;
 
166
        int             mUsedOutput;
 
167
        
 
168
        float           mReflectBrightness;
 
169
        bool            mReflectActive;
 
170
        
 
171
        float           mAnim;
 
172
        float           mAnimVelocity;
 
173
        
 
174
        int             mButtonPressTime;
 
175
        bool            mButtonPressed;
 
176
        int             mStartX;
 
177
        int             mStartY;
 
178
        float           mStartTarget;
 
179
        float           mLastTitle;
 
180
        
 
181
        bool            mPaintingAbove;
 
182
        
 
183
        bool            mCancelled;
178
184
 
179
185
    public:
180
186
 
224
230
        term (bool cancel);
225
231
 
226
232
        bool
227
 
        terminate (CompAction         *action,
 
233
        terminate (CompAction          *action,
228
234
                    CompAction::State  aState,
229
235
                    CompOption::Vector &options);
230
236
 
234
240
                        CompOption::Vector &options);
235
241
 
236
242
        bool
237
 
        doSwitch (CompAction         *action,
 
243
        doSwitch (CompAction           *action,
238
244
                    CompAction::State  aState,
239
245
                    CompOption::Vector &options,
240
 
                    bool            nextWindow,
241
 
                    ShiftType       type);
 
246
                    bool               nextWindow,
 
247
                    ShiftType          type);
242
248
 
243
249
        bool
244
250
        initiate (CompAction         *action,
245
 
                  CompAction::State    state,
 
251
                  CompAction::State  state,
246
252
                  CompOption::Vector &options);
247
253
 
248
254
        bool
249
 
        initiateAll (CompAction         *action,
 
255
        initiateAll (CompAction            *action,
250
256
                        CompAction::State  aState,
251
257
                        CompOption::Vector &options);
252
258
 
253
259
        void
254
260
        windowRemove (Window id);
255
 
 
256
261
};
257
262
 
258
263
class ShiftWindow :
266
271
        ShiftWindow (CompWindow *);
267
272
        ~ShiftWindow ();
268
273
        
269
 
        CompWindow *window;
 
274
        CompWindow      *window;
270
275
        CompositeWindow *cWindow;
271
 
        GLWindow        *gWindow;
 
276
        GLWindow        *gWindow;
272
277
 
273
278
    public:
274
279
 
279
284
                 unsigned int                );
280
285
                 
281
286
        bool
282
 
        damageRect (bool        initial,
 
287
        damageRect (bool           initial,
283
288
                    const CompRect &rect);
284
289
 
285
290
    public:
286
291
        
287
 
        ShiftSlot       mSlots[2];
288
 
        float           mOpacity;
289
 
        float           mBrightness;
290
 
        float           mOpacityVelocity;
291
 
        float           mBrightnessVelocity;
292
 
        
293
 
        bool            mActive;
294
 
    
 
292
        ShiftSlot       mSlots[2];
 
293
        float           mOpacity;
 
294
        float           mBrightness;
 
295
        float           mOpacityVelocity;
 
296
        float           mBrightnessVelocity;
 
297
 
 
298
        bool            mActive;
 
299
 
295
300
    public:
296
301
 
297
302
        bool
298
 
        adjustShiftAttribs (float chunk);
 
303
        adjustShiftAttribs (float chunk);
299
304
 
300
305
        bool
301
306
        canStackRelativeTo ();
313
318
#define SHIFT_SCREEN(s)                                                       \
314
319
    ShiftScreen *ss = ShiftScreen::get (s)
315
320
 
316
 
 
317
321
class ShiftPluginVTable :
318
322
    public CompPlugin::VTableForScreenAndWindow <ShiftScreen, ShiftWindow>
319
323
{