~vanvugt/compiz-animation-plugin/fix-915236

« back to all changes in this revision

Viewing changes to src/fade.cpp

  • Committer: Erkin Bahceci
  • Date: 2009-07-15 16:05:10 UTC
  • Revision ID: git-v1:6eeaa209932c6039edd4c362c352f242468a118a
Initial C++ port. Dodge and magic lamp changes.

- New dodge mode: all windows moving (made the default).
- Fixed dodge artifacts/weirdness showing up in certain situations.
- Magic Lamp renamed to Magic Lamp Wavy.
- Vacuum renamed to Magic Lamp, allowed for minimize (made the default).
- Separated restack stuff (dodge and focus-fade) from animation core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
35
35
 */
36
36
 
37
 
#include "animation-internal.h"
 
37
#include "private.h"
38
38
 
39
39
// =====================  Effect: Fade  =========================
40
40
 
41
 
void
42
 
fxFadeUpdateWindowAttrib(CompWindow * w,
43
 
                         WindowPaintAttrib * wAttrib)
44
 
{
45
 
    ANIM_WINDOW(w);
46
 
 
47
 
    float forwardProgress = defaultAnimProgress (w);
48
 
 
49
 
    wAttrib->opacity = (GLushort) (aw->com.storedOpacity * (1 - forwardProgress));
50
 
}
51
 
 
 
41
FadeAnim::FadeAnim (CompWindow *w,
 
42
                    WindowEvent curWindowEvent,
 
43
                    float duration,
 
44
                    const AnimEffect info,
 
45
                    const CompRect &icon) :
 
46
    Animation::Animation (w, curWindowEvent, duration, info, icon)
 
47
{
 
48
}
 
49
 
 
50
void
 
51
FadeAnim::updateAttrib (GLWindowPaintAttrib &attrib)
 
52
{
 
53
    attrib.opacity = (GLushort) (mStoredOpacity * (1 - getFadeProgress ()));
 
54
}
 
55
 
 
56
void
 
57
FadeAnim::updateBB (CompOutput &output)
 
58
{
 
59
    mAWindow->expandBBWithWindow ();
 
60
}
52
61