Exemple #1
0
void
fxFoldUpdateWindowAttrib(AnimScreen        *as,
                         CompWindow        *w,
                         WindowPaintAttrib *wAttrib)
{
    ANIM_WINDOW(w);

    if (aw->curWindowEvent == WindowEventOpen ||
            aw->curWindowEvent == WindowEventClose ||
            ((aw->curWindowEvent == WindowEventMinimize ||
              aw->curWindowEvent == WindowEventUnminimize) &&
             ((aw->curAnimEffect == AnimEffectCurvedFold &&
               !animGetB(as, aw, ANIM_SCREEN_OPTION_CURVED_FOLD_Z2TOM)) ||
              (aw->curAnimEffect == AnimEffectHorizontalFolds &&
               !animGetB(as, aw, ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_Z2TOM)))))
    {
        float forwardProgress = defaultAnimProgress(aw);

        wAttrib->opacity =
            (GLushort)(aw->storedOpacity * (1 - forwardProgress));
    }
    else if ((aw->curWindowEvent == WindowEventMinimize ||
              aw->curWindowEvent == WindowEventUnminimize) &&
             ((aw->curAnimEffect == AnimEffectCurvedFold &&
               animGetB(as, aw, ANIM_SCREEN_OPTION_CURVED_FOLD_Z2TOM)) ||
              (aw->curAnimEffect == AnimEffectHorizontalFolds &&
               animGetB(as, aw, ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_Z2TOM))))
    {
        fxZoomUpdateWindowAttrib(as, w, wAttrib);
    }
    // if shade/unshade don't do anything
}
Exemple #2
0
static inline Bool
fxGlideZoomToTaskBar(AnimScreen *as, AnimWindow *aw)
{
   return
     (aw->curWindowEvent == WindowEventMinimize ||
      aw->curWindowEvent == WindowEventUnminimize) &&
     ((aw->curAnimEffect == AnimEffectGlide3D1 &&
       animGetB(as, aw, ANIM_SCREEN_OPTION_GLIDE1_Z2TOM)) ||
      (aw->curAnimEffect == AnimEffectGlide3D2 &&
          animGetB(as, aw, ANIM_SCREEN_OPTION_GLIDE2_Z2TOM)));
}
Exemple #3
0
Bool
fxDreamModelStep(CompScreen *s, CompWindow *w, float time)
{
   if (!defaultAnimStep(s, w, time))
     return FALSE;

   ANIM_SCREEN(s);
   ANIM_WINDOW(w);

   Model *model = aw->model;

   float forwardProgress;
   if ((aw->curWindowEvent == WindowEventMinimize ||
        aw->curWindowEvent == WindowEventUnminimize) &&
       animGetB(as, aw, ANIM_SCREEN_OPTION_DREAM_Z2TOM))
     {
        float dummy;
        fxZoomAnimProgress(as, aw, &forwardProgress, &dummy, TRUE);
     }
   else
     forwardProgress = defaultAnimProgress(aw);

   int i;
   for (i = 0; i < model->numObjects; i++)
     fxDreamModelStepObject(w,
                            model,
                            &model->objects[i], forwardProgress);

   return TRUE;
}
Bool fxHorizontalFoldsZoomToIcon(CompWindow * w)
{
	ANIM_WINDOW(w);
	return ((aw->com.curWindowEvent == WindowEventMinimize ||
		 aw->com.curWindowEvent == WindowEventUnminimize) &&
		animGetB(w, ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_Z2TOM));
}
void
fxFlyinUpdateWindowAttrib (CompWindow * w,
			   WindowPaintAttrib * wAttrib)
{
    ANIMSIM_WINDOW(w);

    float forwardProgress = fxFlyinAnimProgress (w);

    if (animGetB (w, ANIMSIM_SCREEN_OPTION_FLYIN_FADE))
	wAttrib->opacity = aw->com->storedOpacity * (1 - forwardProgress);
}
Exemple #6
0
void fxRollUpModelStep(CompWindow * w, float time)
{
	defaultAnimStep(w, time);

	ANIM_WINDOW(w);

	Model *model = aw->com.model;

	float forwardProgress = sigmoidAnimProgress(w);
	Bool fixedInterior =
	    animGetB(w, ANIM_SCREEN_OPTION_ROLLUP_FIXED_INTERIOR);

	Object *object = model->objects;
	int i;
	for (i = 0; i < model->numObjects; i++, object++)
		fxRollUpModelStepObject
		    (w, model, object, forwardProgress, fixedInterior);
}
Exemple #7
0
void
fxDreamUpdateWindowAttrib(AnimScreen        *as,
                          CompWindow        *w,
                          WindowPaintAttrib *wAttrib)
{
   ANIM_WINDOW(w);

   if ((aw->curWindowEvent == WindowEventMinimize ||
        aw->curWindowEvent == WindowEventUnminimize) &&
       animGetB(as, aw, ANIM_SCREEN_OPTION_DREAM_Z2TOM))
     {
        fxZoomUpdateWindowAttrib(as, w, wAttrib);
        return;
     }

   float forwardProgress = defaultAnimProgress(aw);

   wAttrib->opacity = (GLushort)(aw->storedOpacity * (1 - forwardProgress));
}
Exemple #8
0
Bool
fxCurvedFoldModelStep(CompScreen *s, CompWindow *w, float time)
{
    if (!defaultAnimStep(s, w, time))
        return FALSE;

    ANIM_SCREEN(s);
    ANIM_WINDOW(w);

    Model *model = aw->model;

    float forwardProgress;
    if ((aw->curWindowEvent == WindowEventMinimize ||
            aw->curWindowEvent == WindowEventUnminimize) &&
            animGetB(as, aw, ANIM_SCREEN_OPTION_CURVED_FOLD_Z2TOM))
    {
        float dummy;
        fxZoomAnimProgress(as, aw, &forwardProgress, &dummy, TRUE);
    }
    else
        forwardProgress = defaultAnimProgress(aw);

    float curveMaxAmp =
        animGetF(as, aw, ANIM_SCREEN_OPTION_CURVED_FOLD_AMP) * WIN_W(w) *
        pow(WIN_H(w) / (s->height * 1.2f), 0.7);
    int i;
    for (i = 0; i < model->numObjects; i++)
        fxCurvedFoldModelStepObject
        (w,
         model,
         &model->objects[i],
         forwardProgress,
         curveMaxAmp);

    return TRUE;
}
void
fxAirplaneLinearAnimStepPolygon (CompWindow *w,
				   PolygonObject *p,
				   float forwardProgress)
{
    ANIMADDON_WINDOW (w);

    float airplanePathLength =
	animGetF (w, ANIMADDON_SCREEN_OPTION_AIRPLANE_PATHLENGTH);
    Bool airplaneFly2TaskBar =
	animGetB (w, ANIMADDON_SCREEN_OPTION_AIRPLANE_FLY2TOM);

    AirplaneEffectParameters *aep = p->effectParameters;
    if (!aep)
	return;

    /*  Phase1: folding: flaps, folding center, folding wings.
     *  Phase2: rotate and fly.
     */

    if (forwardProgress > p->moveStartTime &&
	forwardProgress < aep->moveStartTime4)
	// Phase1: folding: flaps, center, wings.
    {
	float moveProgress1 = forwardProgress - p->moveStartTime;
	if (p->moveDuration > 0)
	    moveProgress1 /= p->moveDuration;
	else
	    moveProgress1 = 0;
	if (moveProgress1 < 0)
	    moveProgress1 = 0;
	else if (moveProgress1 > 1)
	    moveProgress1 = 1;

	float moveProgress2 = forwardProgress - aep->moveStartTime2;
	if (aep->moveDuration2 > 0)
	    moveProgress2 /= aep->moveDuration2;
	else
	    moveProgress2 = 0;
	if (moveProgress2 < 0)
	    moveProgress2 = 0;
	else if (moveProgress2 > 1)
	    moveProgress2 = 1;

	float moveProgress3 = forwardProgress - aep->moveStartTime3;
	if (aep->moveDuration3 > 0)
	    moveProgress3 /= aep->moveDuration3;
	else
	    moveProgress3 = 0;
	if (moveProgress3 < 0)
	    moveProgress3 = 0;
	else if (moveProgress3 > 1)
	    moveProgress3 = 1;

	p->centerPos.x = p->centerPosStart.x;
	p->centerPos.y = p->centerPosStart.y;
	p->centerPos.z = p->centerPosStart.z;

	p->rotAngle = moveProgress1 * p->finalRotAng;
	aep->rotAngleA = moveProgress2 * aep->finalRotAngA;
	aep->rotAngleB = moveProgress3 * aep->finalRotAngB;

	aep->flyRotation.x = 0;
	aep->flyRotation.y = 0;
	aep->flyRotation.z = 0;
	aep->flyScale = 0;
    }
    else if (forwardProgress >= aep->moveStartTime4)
	// Phase2: rotate and fly 
    {
	float moveProgress4 = forwardProgress - aep->moveStartTime4;
	if (aep->moveDuration4 > 0)
	    moveProgress4 /= aep->moveDuration4;
	if (moveProgress4 < 0)
	    moveProgress4 = 0;
	else if (moveProgress4 > 1)
	    moveProgress4 = 1;

	float moveProgress5 = forwardProgress - (aep->moveStartTime4 + .01);
	if (aep->moveDuration5 > 0)
	    moveProgress5 /= aep->moveDuration5;
	if (moveProgress5 < 0)
	    moveProgress5 = 0;
	else if (moveProgress5 > 1)
	    moveProgress5 = 1;


	p->rotAngle = p->finalRotAng;
	aep->rotAngleA = aep->finalRotAngA;
	aep->rotAngleB = aep->finalRotAngB;

	aep->flyRotation.x = moveProgress4 * aep->flyFinalRotation.x;
	aep->flyRotation.y = moveProgress4 * aep->flyFinalRotation.y;

	// flying path

	float icondiffx = 0;
	aep->flyTheta = moveProgress5 * -M_PI_2 * airplanePathLength;
	aep->centerPosFly.x = w->screen->width * .4 * sin (2 * aep->flyTheta);

	if (((aw->com->curWindowEvent == WindowEventMinimize ||
	      aw->com->curWindowEvent == WindowEventUnminimize) &&
	     airplaneFly2TaskBar) ||
	    aw->com->curWindowEvent == WindowEventOpen ||
	    aw->com->curWindowEvent == WindowEventClose)
	{
	    // flying path ends at icon/pointer

	    int sign = 1;
	    if (aw->com->curWindowEvent == WindowEventUnminimize ||
		aw->com->curWindowEvent == WindowEventOpen)
		sign = -1;

	    icondiffx =
		(((aw->com->icon.x + aw->com->icon.width / 2)
		  - (p->centerPosStart.x +
		     sign * w->screen->width * .4 *
		     sin (2 * -M_PI_2 * airplanePathLength))) *
		 moveProgress5);
	    aep->centerPosFly.y =
		((aw->com->icon.y + aw->com->icon.height / 2) -
		 p->centerPosStart.y) *
		-sin (aep->flyTheta / airplanePathLength);
	}
	else
	{
	    if (p->centerPosStart.y < w->screen->height * .33 ||
		p->centerPosStart.y > w->screen->height * .66)
		aep->centerPosFly.y =
		    w->screen->height * .6 * sin (aep->flyTheta / 3.4);
	    else
		aep->centerPosFly.y =
		    w->screen->height * .4 * sin (aep->flyTheta / 3.4);
	    if (p->centerPosStart.y < w->screen->height * .33)
		aep->centerPosFly.y *= -1;
	}

	aep->flyFinalRotation.z =
	    ((atan (2.0) + M_PI_2) * sin (aep->flyTheta) - M_PI_2) * 180 / M_PI;
	aep->flyFinalRotation.z += 90;


	if (aw->com->curWindowEvent == WindowEventMinimize ||
	    aw->com->curWindowEvent == WindowEventClose)
	{
	    aep->flyFinalRotation.z *= -1;
	}
	else if (aw->com->curWindowEvent == WindowEventUnminimize ||
		 aw->com->curWindowEvent == WindowEventOpen)
	{
	    aep->centerPosFly.x *= -1;
	}

	aep->flyRotation.z = aep->flyFinalRotation.z;

	p->centerPos.x = p->centerPosStart.x + aep->centerPosFly.x + icondiffx;
	p->centerPos.y = p->centerPosStart.y + aep->centerPosFly.y;
	p->centerPos.z = p->centerPosStart.z + aep->centerPosFly.z;

	aep->flyScale = moveProgress5 * aep->flyFinalScale;
    }
}