From: Carlos Garnacho Date: Fri, 4 Jan 2008 20:27:26 +0000 (+0000) Subject: Implement "cover" effect. X-Git-Tag: EVINCE_2_21_90~63 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=d66c86c82bbacd93faa4cb1a73572e7860c07308;p=evince.git Implement "cover" effect. 2008-01-04 Carlos Garnacho * shell/ev-transition-animation.c (ev_transition_animation_cover) (ev_transition_animation_paint): Implement "cover" effect. svn path=/trunk/; revision=2807 --- diff --git a/ChangeLog b/ChangeLog index 59c765bf..1a229dfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-04 Carlos Garnacho + + * shell/ev-transition-animation.c (ev_transition_animation_cover) + (ev_transition_animation_paint): Implement "cover" effect. + 2008-01-04 Carlos Garnacho * shell/ev-transition-animation.c (ev_transition_animation_push) diff --git a/shell/ev-transition-animation.c b/shell/ev-transition-animation.c index a99a47f1..2e39ee6e 100644 --- a/shell/ev-transition-animation.c +++ b/shell/ev-transition-animation.c @@ -469,6 +469,36 @@ ev_transition_animation_push (cairo_t *cr, } } +static void +ev_transition_animation_cover (cairo_t *cr, + EvTransitionAnimation *animation, + EvTransitionEffect *effect, + gdouble progress, + GdkRectangle page_area) +{ + EvTransitionAnimationPriv *priv; + gint width, height; + gint angle; + + priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation); + width = page_area.width; + height = page_area.height; + + g_object_get (effect, + "angle", &angle, + NULL); + + paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area); + + if (angle == 0) { + /* left to right */ + paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 0, page_area); + } else { + /* top to bottom */ + paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 0, page_area); + } +} + void ev_transition_animation_paint (EvTransitionAnimation *animation, cairo_t *cr, @@ -513,6 +543,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation, case EV_TRANSITION_EFFECT_PUSH: ev_transition_animation_push (cr, animation, priv->effect, progress, page_area); break; + case EV_TRANSITION_EFFECT_COVER: + ev_transition_animation_cover (cr, animation, priv->effect, progress, page_area); + break; default: { GEnumValue *enum_value;