82
94
extern int customOptionOptionIds[AnimEventNum];
84
typedef enum _AnimDisplayOptions
86
ANIM_DISPLAY_OPTION_ABI,
87
ANIM_DISPLAY_OPTION_INDEX,
88
ANIM_DISPLAY_OPTION_NUM
91
typedef struct _AnimDisplay
93
int screenPrivateIndex;
94
HandleEventProc handleEvent;
95
HandleCompizEventProc handleCompizEvent;
97
CompMatch neverAnimateMatch;
99
CompOption opt[ANIM_DISPLAY_OPTION_NUM];
102
96
typedef struct _PluginEventInfo
105
char *activateEventName;
98
const char *pluginName;
99
const char *activateEventName;
106
100
} PluginEventInfo;
108
#define NUM_WATCHED_PLUGINS 5
113
ANIM_SCREEN_OPTION_OPEN_EFFECTS = 0,
114
ANIM_SCREEN_OPTION_OPEN_DURATIONS,
115
ANIM_SCREEN_OPTION_OPEN_MATCHES,
116
ANIM_SCREEN_OPTION_OPEN_OPTIONS,
117
ANIM_SCREEN_OPTION_OPEN_RANDOM_EFFECTS,
118
ANIM_SCREEN_OPTION_CLOSE_EFFECTS,
119
ANIM_SCREEN_OPTION_CLOSE_DURATIONS,
120
ANIM_SCREEN_OPTION_CLOSE_MATCHES,
121
ANIM_SCREEN_OPTION_CLOSE_OPTIONS,
122
ANIM_SCREEN_OPTION_CLOSE_RANDOM_EFFECTS,
123
ANIM_SCREEN_OPTION_MINIMIZE_EFFECTS,
124
ANIM_SCREEN_OPTION_MINIMIZE_DURATIONS,
125
ANIM_SCREEN_OPTION_MINIMIZE_MATCHES,
126
ANIM_SCREEN_OPTION_MINIMIZE_OPTIONS,
127
ANIM_SCREEN_OPTION_MINIMIZE_RANDOM_EFFECTS,
128
ANIM_SCREEN_OPTION_SHADE_EFFECTS,
129
ANIM_SCREEN_OPTION_SHADE_DURATIONS,
130
ANIM_SCREEN_OPTION_SHADE_MATCHES,
131
ANIM_SCREEN_OPTION_SHADE_OPTIONS,
132
ANIM_SCREEN_OPTION_SHADE_RANDOM_EFFECTS,
133
ANIM_SCREEN_OPTION_FOCUS_EFFECTS,
134
ANIM_SCREEN_OPTION_FOCUS_DURATIONS,
135
ANIM_SCREEN_OPTION_FOCUS_MATCHES,
136
ANIM_SCREEN_OPTION_FOCUS_OPTIONS,
138
ANIM_SCREEN_OPTION_ALL_RANDOM,
139
ANIM_SCREEN_OPTION_TIME_STEP,
141
ANIM_SCREEN_OPTION_CURVED_FOLD_AMP_MULT,
142
ANIM_SCREEN_OPTION_CURVED_FOLD_Z2TOM,
143
ANIM_SCREEN_OPTION_DODGE_GAP_RATIO,
144
ANIM_SCREEN_OPTION_DREAM_Z2TOM,
145
ANIM_SCREEN_OPTION_GLIDE1_AWAY_POS,
146
ANIM_SCREEN_OPTION_GLIDE1_AWAY_ANGLE,
147
ANIM_SCREEN_OPTION_GLIDE1_Z2TOM,
148
ANIM_SCREEN_OPTION_GLIDE2_AWAY_POS,
149
ANIM_SCREEN_OPTION_GLIDE2_AWAY_ANGLE,
150
ANIM_SCREEN_OPTION_GLIDE2_Z2TOM,
151
ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_AMP_MULT,
152
ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_NUM_FOLDS,
153
ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_Z2TOM,
154
ANIM_SCREEN_OPTION_MAGIC_LAMP_MOVING_END,
155
ANIM_SCREEN_OPTION_MAGIC_LAMP_GRID_RES,
156
ANIM_SCREEN_OPTION_MAGIC_LAMP_MAX_WAVES,
157
ANIM_SCREEN_OPTION_MAGIC_LAMP_WAVE_AMP_MIN,
158
ANIM_SCREEN_OPTION_MAGIC_LAMP_WAVE_AMP_MAX,
159
ANIM_SCREEN_OPTION_MAGIC_LAMP_OPEN_START_WIDTH,
160
ANIM_SCREEN_OPTION_ROLLUP_FIXED_INTERIOR,
161
ANIM_SCREEN_OPTION_SIDEKICK_NUM_ROTATIONS,
162
ANIM_SCREEN_OPTION_SIDEKICK_SPRINGINESS,
163
ANIM_SCREEN_OPTION_SIDEKICK_ZOOM_FROM_CENTER,
164
ANIM_SCREEN_OPTION_VACUUM_MOVING_END,
165
ANIM_SCREEN_OPTION_VACUUM_GRID_RES,
166
ANIM_SCREEN_OPTION_VACUUM_OPEN_START_WIDTH,
167
ANIM_SCREEN_OPTION_WAVE_WIDTH,
168
ANIM_SCREEN_OPTION_WAVE_AMP_MULT,
169
ANIM_SCREEN_OPTION_ZOOM_FROM_CENTER,
170
ANIM_SCREEN_OPTION_ZOOM_SPRINGINESS,
172
ANIM_SCREEN_OPTION_NUM
104
WatchedPluginSwitcher = 0,
107
WatchedPluginFadedesktop,
175
112
// This must have the value of the first "effect setting" above
176
// in AnimScreenOptions
177
#define NUM_NONEFFECT_OPTIONS ANIM_SCREEN_OPTION_CURVED_FOLD_AMP_MULT
180
typedef struct _AnimScreen
182
int windowPrivateIndex;
184
PreparePaintScreenProc preparePaintScreen;
185
DonePaintScreenProc donePaintScreen;
186
PaintOutputProc paintOutput;
187
PaintWindowProc paintWindow;
188
DamageWindowRectProc damageWindowRect;
189
AddWindowGeometryProc addWindowGeometry;
190
DrawWindowTextureProc drawWindowTexture;
191
InitWindowWalkerProc initWindowWalker;
193
WindowResizeNotifyProc windowResizeNotify;
194
WindowMoveNotifyProc windowMoveNotify;
195
WindowGrabNotifyProc windowGrabNotify;
196
WindowUngrabNotifyProc windowUngrabNotify;
198
CompOption opt[ANIM_SCREEN_OPTION_NUM];
200
Bool aWinWasRestackedJustNow; // a window was restacked this paint round
202
Bool pluginActive[NUM_WATCHED_PLUGINS];
204
Window *lastClientListStacking; // to store last known stacking order
205
int nLastClientListStacking;
206
int markAllWinCreatedCountdown;
207
// to mark windows as "created" if they were opened before compiz
212
int walkerAnimCount; // count of how many windows are currently involved in
213
// animations that require walker (dodge & focus fade)
215
EffectSet randomEffects[AnimEventNum];
217
OptionSets eventOptionSets[AnimEventNum];
220
ExtensionPluginInfo **extensionPlugins;
221
unsigned int nExtensionPlugins;
222
unsigned int maxExtensionPlugins;
224
// List of all possible effects for each event
225
AnimEffect *eventEffectsAllowed[AnimEventNum];
226
unsigned int nEventEffectsAllowed[AnimEventNum];
227
unsigned int maxEventEffectsAllowed[AnimEventNum];
113
// in PrivateAnimScreenOptions
114
#define NUM_NONEFFECT_OPTIONS AnimationOptions::CurvedFoldAmpMult
117
class ExtensionPluginAnimation : public ExtensionPluginInfo
120
ExtensionPluginAnimation (unsigned int nEffects,
122
CompOption::Vector *effectOptions,
123
unsigned int firstEffectOptionIndex);
124
~ExtensionPluginAnimation ();
126
// Overriden methods from ExtensionPluginInfo
127
void postPreparePaintGeneral ();
128
void prePreparePaintGeneral ();
129
void handleRestackNotify (AnimWindow *aw);
130
// Always reset stacking related info when a window is opened, closed,
131
// minimized, or unminimized.
132
void preInitiateOpenAnim (AnimWindow *aw);
133
void preInitiateCloseAnim (AnimWindow *aw);
134
void preInitiateMinimizeAnim (AnimWindow *aw);
135
void preInitiateUnminimizeAnim (AnimWindow *aw);
136
void initPersistentData (AnimWindow *aw);
137
void destroyPersistentData (AnimWindow *aw);
138
void postUpdateEventEffects (AnimEvent e,
140
void cleanUpAnimation (bool closing,
142
void postStartupCountdown ();
145
void handleSingleRestack (AnimWindow *aw);
146
void prePaintWindowsBackToFront ();
147
bool paintShouldSkipWindow (CompWindow *w);
148
CompWindowList getWindowPaintList ();
149
void resetStackingInfo ();
150
static CompWindow *getBottommostInExtendedFocusChain (CompWindow *wStartPoint);
151
static CompWindow *getBottommostInRestackChain (CompWindow *wStartPoint);
153
bool markNewCopy (CompWindow *w);
154
CompWindow * walkFirst ();
155
CompWindow * walkNext (CompWindow *w);
156
void incrementCurRestackAnimCount ();
157
void decrementCurRestackAnimCount ();
158
bool wontCreateCircularChain (CompWindow *wCur, CompWindow *wNext);
160
static void cleanUpParentChildChainItem (AnimWindow *aw);
161
static bool relevantForRestackAnim (CompWindow *w);
163
/// Is restackInfo still good?
164
static bool restackInfoStillGood (RestackInfo *restackInfo);
166
void updateLastClientList ();
168
/// A window was restacked this paint round.
169
bool mAWinWasRestackedJustNow;
172
CompWindowVector mLastClientList; ///< Last known stacking order
173
CompWindowVector mPrevClientList; ///< The stacking order before mLastClientList
174
int mRestackAnimCount; ///< Count of how many windows are currently involved in
175
///< animations that require walker (dodge & focus fade).
176
std::vector<AnimWindow *> mRestackedWindows;
179
class PrivateAnimScreen :
180
public ScreenInterface,
181
public CompositeScreenInterface,
182
public GLScreenInterface,
183
public AnimationOptions
185
friend class PrivateAnimWindow;
186
friend class AnimWindow;
190
CompositeScreen *cScreen;
194
struct timeval mLastRedrawTime;
195
bool mLastRedrawTimeFresh;
197
bool mPluginActive[WatchedPluginNum];
198
int mSwitcherPostWait;
200
Window mLastActiveWindow; ///< Last known active window
202
bool mAnimInProgress; ///< Is an animation currently being played?
203
bool mStartingNewPaintRound; ///< Is a new round of glPaints starting?
204
bool mPrePaintWindowsBackToFrontEnabled;
206
EffectSet mRandomEffects[AnimEventNum];
208
OptionSets mEventOptionSets[AnimEventNum];
210
// Effect extension plugins
211
ExtensionPluginVector mExtensionPlugins;
213
// Possible effects for each event
214
AnimEffectVector mEventEffectsAllowed[AnimEventNum];
229
216
// List of chosen effects for each event
230
EffectSet eventEffects[AnimEventNum];
235
typedef struct _AnimWindow
237
AnimWindowCommon com;
240
unsigned int newState;
242
Bool animInitialized; // whether the animation effect (not the window) is initialized
243
float remainderSteps;
253
int curAnimSelectionRow;
254
int prevAnimSelectionRow; // For the case when one event interrupts another
256
Box BB; // Bounding box for damage region calc. of CompTransform fx
257
Box lastBB; // Last bounding box
261
int magicLampWaveCount;
262
WaveParam *magicLampWaves;
265
float glideModRotAngle; // The angle of rotation modulo 360
268
float numZoomRotations;
270
// for focus fade & dodge
271
RestackInfo *restackInfo; // restack info if window was restacked this paint round
272
CompWindow *winToBePaintedBeforeThis; // Window which should be painted before this
273
CompWindow *winThisIsPaintedBefore; // the inverse relation of the above
274
CompWindow *moreToBePaintedPrev; // doubly linked list for windows underneath that
275
CompWindow *moreToBePaintedNext; // raise together with this one
277
Bool configureNotified; // was configureNotified before restack check
278
CompWindow *winPassingThrough; // win. passing through this one during focus effect
281
Bool isDodgeSubject; // TRUE if this window is the cause of dodging
282
Bool skipPostPrepareScreen;
283
CompWindow *dodgeSubjectWin;// The window being dodged
284
float dodgeMaxAmount; /* max # pixels it should dodge
285
(neg. values dodge left) */
286
int dodgeOrder; // dodge order (used temporarily)
287
Bool dodgeDirection; // 0: up, down, left, right
289
CompWindow *dodgeChainStart;// for the subject window
290
CompWindow *dodgeChainPrev; // for dodging windows
291
CompWindow *dodgeChainNext; // for dodging windows
292
Bool walkerOverNewCopy; // whether walker is on the copy at the new pos.
293
unsigned int walkerVisitCount; // how many times walker has visited this window
296
#define GET_ANIM_DISPLAY(d) \
297
((AnimDisplay *) (d)->base.privates[animDisplayPrivateIndex].ptr)
299
#define ANIM_DISPLAY(d) \
300
AnimDisplay *ad = GET_ANIM_DISPLAY (d)
302
#define GET_ANIM_SCREEN(s, ad) \
303
((AnimScreen *) (s)->base.privates[(ad)->screenPrivateIndex].ptr)
305
#define ANIM_SCREEN(s) \
306
AnimScreen *as = GET_ANIM_SCREEN (s, GET_ANIM_DISPLAY (s->display))
308
#define GET_ANIM_WINDOW(w, as) \
309
((AnimWindow *) (w)->base.privates[(as)->windowPrivateIndex].ptr)
311
#define ANIM_WINDOW(w) \
312
AnimWindow *aw = GET_ANIM_WINDOW (w, \
313
GET_ANIM_SCREEN (w->screen, \
314
GET_ANIM_DISPLAY (w->screen->display)))
316
// up, down, left, right
317
#define DODGE_AMOUNT(w, dw, dir) \
318
((dir) == 0 ? BORDER_Y(w) - (BORDER_Y(dw) + BORDER_H(dw)) : \
319
(dir) == 1 ? (BORDER_Y(w) + BORDER_H(w)) - BORDER_Y(dw) : \
320
(dir) == 2 ? BORDER_X(w) - (BORDER_X(dw) + BORDER_W(dw)) : \
321
(BORDER_X(w) + BORDER_W(w)) - BORDER_X(dw))
323
// up, down, left, right
324
#define DODGE_AMOUNT_BOX(box, dw, dir) \
325
((dir) == 0 ? (box).y - (BORDER_Y(dw) + BORDER_H(dw)) : \
326
(dir) == 1 ? ((box).y + (box).height) - BORDER_Y(dw) : \
327
(dir) == 2 ? (box).x - (BORDER_X(dw) + BORDER_W(dw)) : \
328
((box).x + (box).width) - BORDER_X(dw))
330
// ratio of perceived length of animation compared to real duration
331
// to make it appear to have the same speed with other animation effects
333
#define DREAM_PERCEIVED_T 0.6f
334
#define ROLLUP_PERCEIVED_T 0.6f
338
* Function prototypes
345
modelInitObjects (Model * model,
347
int width, int height);
350
postAnimationCleanup (CompWindow * w);
353
defaultAnimProgress (CompWindow *w);
356
sigmoidAnimProgress (CompWindow *w);
359
decelerateProgressCustom (float progress,
360
float minx, float maxx);
363
decelerateProgress (float progress);
366
applyTransformToObject (Object *obj, GLfloat *mat);
369
getActualAnimDirection (CompWindow * w,
374
defaultAnimStep (CompWindow * w,
378
defaultAnimInit (CompWindow * w);
381
defaultUpdateWindowTransform (CompWindow *w,
382
CompTransform *wTransform);
385
animZoomToIcon (CompWindow *w);
388
animDrawWindowGeometry(CompWindow * w);
391
getMousePointerXY(CompScreen * s, short *x, short *y);
394
expandBoxWithBox (Box *target, Box *source);
397
expandBoxWithPoint (Box *target, float fx, float fy);
400
updateBBWindow (CompOutput *output,
405
updateBBScreen (CompOutput *output,
410
compTransformUpdateBB (CompOutput *output,
415
prepareTransform (CompScreen *s,
417
CompTransform *resultTransform,
418
CompTransform *transform);
421
perspectiveDistortAndResetZ (CompScreen *s,
422
CompTransform *wTransform);
425
applyPerspectiveSkew (CompOutput *output,
426
CompTransform *transform,
430
applyTransform (CompTransform *wTransform,
431
CompTransform *transform);
434
getProgressAndCenter (CompWindow *w,
440
fxCurvedFoldModelStep (CompWindow *w,
444
fxFoldUpdateWindowAttrib (CompWindow * w,
445
WindowPaintAttrib * wAttrib);
448
fxCurvedFoldZoomToIcon (CompWindow *w);
453
fxDodgePostPreparePaintScreen (CompWindow *w);
456
fxDodgeUpdateWindowTransform (CompWindow *w,
457
CompTransform *wTransform);
460
fxDodgeAnimStep (CompWindow *w,
464
fxDodgeUpdateBB (CompOutput *output,
471
fxDreamAnimInit (CompWindow * w);
474
fxDreamModelStep (CompWindow * w,
478
fxDreamUpdateWindowAttrib (CompWindow * w,
479
WindowPaintAttrib * wAttrib);
482
fxDreamZoomToIcon (CompWindow *w);
487
fxFadeUpdateWindowAttrib (CompWindow * w,
488
WindowPaintAttrib *wAttrib);
494
fxFocusFadeUpdateWindowAttrib (CompWindow * w,
495
WindowPaintAttrib *wAttrib);
500
fxGlideInit (CompWindow *w);
503
fxGlideUpdateWindowAttrib (CompWindow * w,
504
WindowPaintAttrib *wAttrib);
507
fxGlideAnimStep (CompWindow *w,
511
fxGlideAnimProgress (CompWindow *w);
514
fxGlideUpdateWindowTransform (CompWindow *w,
515
CompTransform *wTransform);
518
fxGlidePrePaintWindow (CompWindow * w);
521
fxGlidePostPaintWindow (CompWindow * w);
524
fxGlideZoomToIcon (CompWindow *w);
526
/* horizontalfold.c */
529
fxHorizontalFoldsModelStep (CompWindow *w,
533
fxHorizontalFoldsInitGrid (CompWindow *w,
538
fxHorizontalFoldsZoomToIcon (CompWindow *w);
543
fxMagicLampInitGrid (CompWindow *w,
548
fxVacuumInitGrid (CompWindow *w,
553
fxMagicLampInit (CompWindow * w);
556
fxMagicLampModelStep (CompWindow * w,
562
updateOptionSets (CompScreen *s,
566
freeAllOptionSets (AnimScreen *as);
569
animGetPluginOptVal (CompWindow *w,
570
ExtensionPluginInfo *pluginInfo,
578
fxRollUpModelStep (CompWindow *w,
581
void fxRollUpInitGrid (CompWindow *w,
586
fxRollUpAnimInit (CompWindow * w);
591
fxWaveModelStep (CompWindow * w,
598
fxZoomUpdateWindowAttrib (CompWindow * w,
599
WindowPaintAttrib *wAttrib);
602
fxZoomAnimProgress (CompWindow *w,
604
float *scaleProgress,
608
fxSidekickInit (CompWindow *w);
611
fxZoomInit (CompWindow * w);
614
applyZoomTransform (CompWindow * w);
617
getZoomCenterScale (CompWindow *w,
618
Point *pCurCenter, Point *pCurScale);
217
EffectSet mEventEffects[AnimEventNum];
221
Window mActiveWindow;
222
CompMatch mNeverAnimateMatch;
225
///< To mark windows as "created" if they were opened before compiz
226
///< was started and to prevent already opened windows from doing
229
void updateEventEffects (AnimEvent e,
231
bool callPost = true);
232
void updateAllEventEffects ();
234
void updateOptionSets (AnimEvent e);
235
void updateOptionSet (OptionSet *os, const char *optNamesValuesOrig);
237
void activateEvent (bool activating);
238
bool isWinVisible (CompWindow *w);
239
AnimEvent getCorrespondingAnimEvent (AnimationOptions::Options optionId);
240
void eventMatchesChanged (CompOption *opt, AnimationOptions::Options num);
241
void eventOptionsChanged (CompOption *opt, AnimationOptions::Options num);
242
void eventEffectsChanged (CompOption *opt, AnimationOptions::Options num);
243
void eventRandomEffectsChanged (CompOption *opt, AnimationOptions::Options num);
245
CompRect getIcon (CompWindow *w, bool alwaysUseMouse);
246
void updateAnimStillInProgress ();
248
bool isAnimEffectInList (AnimEffect theEffect,
249
EffectSet &effectList);
250
bool isAnimEffectPossibleForEvent (AnimEffect theEffect,
254
PrivateAnimScreen (CompScreen *s, AnimScreen *);
255
~PrivateAnimScreen ();
258
void initiateOpenAnim (PrivateAnimWindow *aw);
259
void initiateCloseAnim (PrivateAnimWindow *aw);
260
void initiateMinimizeAnim (PrivateAnimWindow *aw);
261
void initiateUnminimizeAnim (PrivateAnimWindow *aw);
262
void initiateShadeAnim (PrivateAnimWindow *aw);
263
void initiateUnshadeAnim (PrivateAnimWindow *aw);
264
bool initiateFocusAnim (PrivateAnimWindow *aw);
266
/// Is a restacking animation currently possible?
267
bool isRestackAnimPossible ();
269
void initAnimationList ();
270
bool isAnimEffectPossible (AnimEffect theEffect);
271
CompOutput &output () { return *mOutput; }
272
AnimEffect getActualEffect (AnimEffect effect,
273
AnimEvent animEvent);
274
bool shouldIgnoreWindowForAnim (CompWindow *w, bool checkPixmap);
275
OptionSet *getOptionSetForSelectedRow (PrivateAnimWindow *aw,
277
void addExtension (ExtensionPluginInfo *extensionPluginInfo,
278
bool shouldInitPersistentData);
279
void removeExtension (ExtensionPluginInfo *extensionPluginInfo);
280
AnimEffect getMatchingAnimSelection (CompWindow *w,
283
bool otherPluginsActive ();
285
void enablePrePaintWindowsBackToFront (bool enabled);
286
void prePaintWindowsBackToFront ();
288
// CompositeScreenInterface methods
289
void preparePaint (int);
291
CompWindowList getWindowPaintList ();
293
// GLScreenInterface methods
294
bool glPaintOutput (const GLScreenPaintAttrib &,
300
// ScreenInterface methods
301
void handleCompizEvent (const char * plugin, const char *event,
302
CompOption::Vector &options);
305
class PrivateAnimWindow :
306
public WindowInterface,
307
public CompositeWindowInterface,
308
public GLWindowInterface
310
friend class PrivateAnimScreen;
311
friend class AnimWindow;
314
PrivateAnimWindow (CompWindow *, AnimWindow *aw);
315
~PrivateAnimWindow ();
317
void createFocusAnimation (AnimEffect effect, int duration);
318
inline void setShaded (bool shaded) { mNowShaded = shaded; }
319
inline Animation *curAnimation () { return mCurAnimation; }
320
inline PrivateAnimScreen *paScreen () { return mPAScreen; }
321
inline AnimWindow *aWindow () { return mAWindow; }
322
inline Box &BB () { return mBB; }
323
inline int curAnimSelectionRow () { return mCurAnimSelectionRow; }
325
void damageBoundingBox ();
326
void postAnimationCleanUp ();
333
CompositeWindow *mCWindow;
334
AnimWindow *mAWindow;
336
PrivateAnimScreen *mPAScreen;
339
unsigned int mNewState;
341
Animation *mCurAnimation;
343
bool mUnshadePending;
344
bool mEventNotOpenClose;
355
int mCurAnimSelectionRow;
356
int mPrevAnimSelectionRow; ///< For the case when one event interrupts another
358
Box mBB; ///< Bounding box for damage region calc. of GLMatrix fx
359
Box mLastBB; ///< Last bounding box
362
unsigned int getState ();
363
void updateSelectionRow (int i);
364
void postAnimationCleanUpPrev (bool closing, bool clearMatchingRow);
365
void postAnimationCleanUpCustom (bool closing,
367
bool clearMatchingRow);
368
void reverseAnimation ();
370
// WindowInterface methods
371
void resizeNotify (int dx, int dy, int dwidth, int dheight);
372
void moveNotify (int dx, int dy, bool immediate);
373
void windowNotify (CompWindowNotify n);
374
void grabNotify (int x, int y, unsigned int state, unsigned int mask);
375
void ungrabNotify ();
377
// GLWindowInterface methods
378
bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
379
const CompRegion &, unsigned int);
380
void glAddGeometry (const GLTexture::MatrixList &,
381
const CompRegion &, const CompRegion &);
382
void glDrawTexture (GLTexture *texture, GLFragment::Attrib &,
384
void glDrawGeometry ();
391
RollUpAnim (CompWindow *w,
392
WindowEvent curWindowEvent,
394
const AnimEffect info,
395
const CompRect &icon);
397
static const float kDurationFactor;
403
class MagicLampAnim :
407
MagicLampAnim (CompWindow *w,
408
WindowEvent curWindowEvent,
410
const AnimEffect info,
411
const CompRect &icon);
419
void adjustPointerIconSize ();
421
virtual bool hasMovingEnd ();
422
virtual void filterTargetX (float &targetX, float x) { }
425
class MagicLampWavyAnim :
429
MagicLampWavyAnim (CompWindow *w,
430
WindowEvent curWindowEvent,
432
const AnimEffect info,
433
const CompRect &icon);
434
~MagicLampWavyAnim ();
444
unsigned int mNumWaves;
448
void adjustPointerIconSize ();
450
bool hasMovingEnd ();
451
void filterTargetX (float &targetX, float x);
458
SidekickAnim (CompWindow *w,
459
WindowEvent curWindowEvent,
461
const AnimEffect info,
462
const CompRect &icon);
466
float getSpringiness ();
467
bool isZoomFromCenter ();
468
bool hasExtraTransform () { return true; }
469
void applyExtraTransform (float progress);
470
bool shouldAvoidParallelogramLook () { return true; }
474
public GridTransformAnim
477
WaveAnim (CompWindow *w,
478
WindowEvent curWindowEvent,
480
const AnimEffect info,
481
const CompRect &icon);
483
void adjustDuration ();
485
bool using3D () { return true; }
488
static const float kMinDuration;
495
GlideAnim (CompWindow *w,
496
WindowEvent curWindowEvent,
498
const AnimEffect info,
499
const CompRect &icon);
502
void prePaintWindow ();
503
bool postPaintWindowUsed () { return true; }
504
void postPaintWindow ();
505
void adjustDuration ();
507
void applyTransform ();
508
float getFadeProgress ();
510
float getProgress ();
511
virtual void getParams (float *finalDistFac,
515
float glideModRotAngle; ///< The angle of rotation, modulo 360.
522
Glide2Anim (CompWindow *w,
523
WindowEvent curWindowEvent,
525
const AnimEffect info,
526
const CompRect &icon);
529
void getParams (float *finalDistFac,
534
class RestackPersistentData;
537
virtual public Animation
540
RestackAnim (CompWindow *w,
541
WindowEvent curWindowEvent,
543
const AnimEffect info,
544
const CompRect &icon);
545
void cleanUp (bool closing,
547
bool initiateRestackAnim (int duration);
548
bool moveUpdate () { return false; }
549
static bool onSameRestackChain (CompWindow *wSubject, CompWindow *wOther);
551
/// Find union of restack chain (group)
552
static CompRegion unionRestackChain (CompWindow *w);
554
virtual bool paintedElsewhere () { return false; }
557
// Overridable methods
558
virtual void processCandidate (CompWindow *candidateWin,
559
CompWindow *subjectWin,
560
CompRegion &candidateAndSubjectIntersection,
561
int &numSelectedCandidates) {}
562
virtual void postInitiateRestackAnim (int numSelectedCandidates,
569
bool overNewCopy (); ///< Is glPaint on the copy at the new position?
571
RestackPersistentData *mRestackData;
574
class RestackPersistentData :
575
public PersistentData
577
friend class ExtensionPluginAnimation;
578
friend class RestackAnim;
579
friend class FocusFadeAnim;
580
friend class DodgeAnim;
583
RestackPersistentData ();
584
~RestackPersistentData ();
587
RestackInfo *restackInfo () { return mRestackInfo; }
588
void resetRestackInfo () { delete mRestackInfo; mRestackInfo = 0; }
589
void setRestackInfo (CompWindow *wRestacked,
592
CompWindow *wOldAbove,
594
void getHostedOnWin (CompWindow *wGuest, CompWindow *wHost);
596
RestackInfo *mRestackInfo; ///< restack info if window was restacked this paint round
597
CompWindow *mWinToBePaintedBeforeThis; ///< Window which should be painted before this
598
CompWindow *mWinThisIsPaintedBefore; ///< the inverse relation of mWinToBePaintedBeforeThis
599
CompWindow *mMoreToBePaintedPrev;
600
CompWindow *mMoreToBePaintedNext; ///< doubly linked list for windows underneath that
601
///< raise together with this one
602
bool mConfigureNotified; ///< was mConfigureNotified before restack check
603
CompWindow *mWinPassingThrough; ///< win. passing through this one during focus effect
604
bool mWalkerOverNewCopy; ///< whether walker is on the copy at the new pos.
605
unsigned int mVisitCount; ///< how many times walker/glPaint has visited this window
606
bool mIsSecondary; ///< whether this is one of the secondary (non-topmost) in its restack chain
609
class FocusFadeAnim :
614
FocusFadeAnim (CompWindow *w,
615
WindowEvent curWindowEvent,
617
const AnimEffect info,
618
const CompRect &icon);
619
void updateAttrib (GLWindowPaintAttrib &attrib);
620
void cleanUp (bool closing,
624
void processCandidate (CompWindow *candidateWin,
625
CompWindow *subjectWin,
626
CompRegion &candidateAndSubjectIntersection,
627
int &numSelectedCandidates);
628
GLushort computeOpacity (GLushort opacityInt);
633
DodgeDirectionUp = 0,
637
DodgeDirectionXY, // movement possibly in both X and Y (for subjects)
641
class DodgePersistentData;
648
DodgeAnim (CompWindow *w,
649
WindowEvent curWindowEvent,
651
const AnimEffect info,
652
const CompRect &icon);
653
void cleanUp (bool closing,
655
static int getDodgeAmount (CompRect &rect,
659
void updateTransform (GLMatrix &wTransform);
660
bool shouldDamageWindowOnStart ();
661
void updateBB (CompOutput &output);
662
void postPreparePaint ();
663
void calculateDodgeAmounts ();
667
void processCandidate (CompWindow *candidateWin,
668
CompWindow *subjectWin,
669
CompRegion &candidateAndSubjectIntersection,
670
int &numSelectedCandidates);
671
void postInitiateRestackAnim (int numSelectedCandidates,
676
bool paintedElsewhere ();
677
void applyDodgeTransform ();
678
float dodgeProgress ();
679
void updateDodgerDodgeAmount ();
681
DodgePersistentData *mDodgeData;
683
CompWindow *mDodgeSubjectWin;///< The window being dodged
684
float mDodgeMaxAmountX; ///< max # pixels it should dodge
685
///< (neg. value dodges leftward)
686
float mDodgeMaxAmountY; ///< max # pixels it should dodge
687
///< (neg. value dodges upward)
688
DodgeDirection mDodgeDirection;
692
class DodgePersistentData :
693
public PersistentData
695
friend class ExtensionPluginAnimation;
696
friend class DodgeAnim;
699
DodgePersistentData ();
702
int dodgeOrder; ///< dodge order (used temporarily)
704
// TODO mov the below members into DodgeAnim
705
bool isDodgeSubject; ///< true if this window is the cause of dodging
706
bool skipPostPrepareScreen;
707
CompWindow *dodgeChainStart;///< for the subject window
708
CompWindow *dodgeChainPrev; ///< for dodging windows
709
CompWindow *dodgeChainNext; ///< for dodging windows
716
DreamAnim (CompWindow *w,
717
WindowEvent curWindowEvent,
719
const AnimEffect info,
720
const CompRect &icon);
725
void adjustDuration ();
726
float getFadeProgress ();
729
static const float kDurationFactor;
736
FoldAnim (CompWindow *w,
737
WindowEvent curWindowEvent,
739
const AnimEffect info,
740
const CompRect &icon);
742
bool using3D () { return true; }
743
float getFadeProgress ();
744
void updateWindowAttrib (GLWindowPaintAttrib &attrib);
747
class CurvedFoldAnim :
751
CurvedFoldAnim (CompWindow *w,
752
WindowEvent curWindowEvent,
754
const AnimEffect info,
755
const CompRect &icon);
760
float getObjectZ (GridAnim::GridModel *mModel,
761
float forwardProgress,
763
float relDistToCenter,
767
class HorizontalFoldsAnim :
771
HorizontalFoldsAnim (CompWindow *w,
772
WindowEvent curWindowEvent,
774
const AnimEffect info,
775
const CompRect &icon);
780
float getObjectZ (GridAnim::GridModel *mModel,
781
float forwardProgress,
783
float relDistToFoldCenter,