2
* Animation plugin for compiz/beryl
6
* Copyright : (C) 2006 Erkin Bahceci
7
* E-mail : erkinbah@gmail.com
9
* Based on Wobbly and Minimize plugins by
11
* E-mail : davidr@novell.com>
13
* Particle system added by : (C) 2006 Dennis Kasprzyk
14
* E-mail : onestone@beryl-project.org
16
* Beam-Up added by : Florencio Guimaraes
17
* E-mail : florencio@nexcorp.com.br
19
* Hexagon tessellator added by : Mike Slegeir
20
* E-mail : mikeslegeir@mail.utexas.edu>
22
* This program is free software; you can redistribute it and/or
23
* modify it under the terms of the GNU General Public License
24
* as published by the Free Software Foundation; either version 2
25
* of the License, or (at your option) any later version.
27
* This program is distributed in the hope that it will be useful,
28
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
* GNU General Public License for more details.
32
* You should have received a copy of the GNU General Public License
33
* along with this program; if not, write to the Free Software
34
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
37
#include "animation-internal.h"
40
fxDreamAnimInit (CompWindow * w)
44
if (fxDreamZoomToIcon (w))
46
aw->com.animTotalTime /= ZOOM_PERCEIVED_T;
47
aw->com.usingTransform = TRUE;
50
aw->com.animTotalTime /= DREAM_PERCEIVED_T;
52
aw->com.animRemainingTime = aw->com.animTotalTime;
54
return defaultAnimInit (w);
58
fxDreamModelStepObject (CompWindow * w,
61
float forwardProgress,
64
float waveWidth = 10.0f;
65
float waveSpeed = 7.0f;
67
float origx = w->attrib.x + (WIN_W(w) * object->gridPosition.x -
68
w->output.left) * model->scale.x;
69
float origy = w->attrib.y + (WIN_H(w) * object->gridPosition.y -
70
w->output.top) * model->scale.y;
74
forwardProgress * waveAmpMax * model->scale.x *
75
sin(object->gridPosition.y * M_PI * waveWidth +
76
waveSpeed * forwardProgress);
77
object->position.y = origy;
81
fxDreamModelStep (CompWindow *w, float time)
83
defaultAnimStep (w, time);
87
Model *model = aw->com.model;
89
float forwardProgress = getProgressAndCenter (w, NULL);
91
float waveAmpMax = MIN(WIN_H(w), WIN_W(w)) * 0.125f;
93
Object *object = model->objects;
95
for (i = 0; i < model->numObjects; i++, object++)
96
fxDreamModelStepObject(w,
104
fxDreamUpdateWindowAttrib (CompWindow * w,
105
WindowPaintAttrib * wAttrib)
109
if (fxDreamZoomToIcon (w))
111
fxZoomUpdateWindowAttrib (w, wAttrib);
115
float forwardProgress = defaultAnimProgress (w);
117
wAttrib->opacity = (GLushort) (aw->com.storedOpacity * (1 - forwardProgress));
121
fxDreamZoomToIcon (CompWindow *w)
124
return ((aw->com.curWindowEvent == WindowEventMinimize ||
125
aw->com.curWindowEvent == WindowEventUnminimize) &&
126
animGetB (w, ANIM_SCREEN_OPTION_DREAM_Z2TOM));