~kzmd-deactivatedaccount/ubuntu/natty/compiz-plugins-main/popup-delay-fix-772177

« back to all changes in this revision

Viewing changes to animation/include/animation/zoom.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-02-24 17:34:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110224173418-b81hfllshqpciq6n
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ANIMATION_ZOOM_H
 
2
#define ANIMATION_ZOOM_H
 
3
#include "animation.h"
 
4
 
 
5
class ZoomAnim :
 
6
    public FadeAnim,
 
7
    virtual public TransformAnim
 
8
{
 
9
public:
 
10
     ZoomAnim (CompWindow *w,
 
11
               WindowEvent curWindowEvent,
 
12
               float duration,
 
13
               const AnimEffect info,
 
14
               const CompRect &icon);
 
15
 
 
16
public:
 
17
     void step () { TransformAnim::step (); }
 
18
     void adjustDuration ();
 
19
     float getFadeProgress ();
 
20
     bool updateBBUsed () { return true; }
 
21
     void updateBB (CompOutput &output) { TransformAnim::updateBB (output); }
 
22
     void applyTransform ();
 
23
protected:
 
24
     float getActualProgress ();
 
25
     Point getCenter ();
 
26
     virtual float getSpringiness ();
 
27
     virtual bool isZoomFromCenter ();
 
28
     virtual bool zoomToIcon () { return true; }
 
29
     virtual bool hasExtraTransform () { return false; }
 
30
     virtual void applyExtraTransform (float progress) {}
 
31
     virtual bool shouldAvoidParallelogramLook () { return false; }
 
32
     virtual bool scaleAroundIcon ();
 
33
     virtual bool neverSpringy () { return false; }
 
34
     void getZoomProgress (float *moveProgress,
 
35
                           float *scaleProgress,
 
36
                           bool neverSpringy);
 
37
 
 
38
     static const float kDurationFactor;
 
39
     static const float kSpringyDurationFactor;
 
40
     static const float kNonspringyDurationFactor;
 
41
 
 
42
private:
 
43
     void getCenterScaleFull (Point *pCurCenter, Point *pCurScale,
 
44
                              Point *pWinCenter, Point *pIconCenter,
 
45
                              float *pMoveProgress);
 
46
     void getCenterScale (Point *pCurCenter, Point *pCurScale);
 
47
};
 
48
 
 
49
class GridZoomAnim :
 
50
    public GridTransformAnim,
 
51
    public ZoomAnim
 
52
{
 
53
public:
 
54
    GridZoomAnim (CompWindow *w,
 
55
                  WindowEvent curWindowEvent,
 
56
                  float duration,
 
57
                  const AnimEffect info,
 
58
                  const CompRect &icon);
 
59
    void init () { GridTransformAnim::init (); }
 
60
    void step () { ZoomAnim::step (); }
 
61
    void updateTransform (GLMatrix &wTransform)
 
62
    { GridTransformAnim::updateTransform (wTransform); }
 
63
    void updateBB (CompOutput &output) { GridTransformAnim::updateBB (output); }
 
64
    bool updateBBUsed () { return true; }
 
65
    bool neverSpringy () { return true; }
 
66
    float getSpringiness () { return 0; }
 
67
    bool scaleAroundIcon () { return false; }
 
68
    void adjustDuration ();
 
69
};
 
70
#endif