From: Carlos Garnacho Date: Fri, 4 Jan 2008 20:26:43 +0000 (+0000) Subject: Implement "blinds" effect. X-Git-Tag: EVINCE_2_21_90~68 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=4859886aa78453b5a948f5ca17083bae536c4625;p=evince.git Implement "blinds" effect. 2008-01-04 Carlos Garnacho * shell/ev-transition-animation.c (ev_transition_animation_blinds) (ev_transition_animation_paint): Implement "blinds" effect. svn path=/trunk/; revision=2802 --- diff --git a/ChangeLog b/ChangeLog index 0fd0c80f..c3f7b09b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-04 Carlos Garnacho + + * shell/ev-transition-animation.c (ev_transition_animation_blinds) + (ev_transition_animation_paint): Implement "blinds" effect. + 2008-01-04 Carlos Garnacho * shell/ev-transition-animation.c (ev_transition_animation_split) diff --git a/shell/ev-transition-animation.c b/shell/ev-transition-animation.c index e2bc3234..aa0177e0 100644 --- a/shell/ev-transition-animation.c +++ b/shell/ev-transition-animation.c @@ -282,6 +282,50 @@ ev_transition_animation_split (cairo_t *cr, } } +static void +ev_transition_animation_blinds (cairo_t *cr, + EvTransitionAnimation *animation, + EvTransitionEffect *effect, + gdouble progress, + GdkRectangle page_area) +{ + EvTransitionAnimationPriv *priv; + EvTransitionEffectAlignment alignment; + gint width, height, i; + + priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation); + width = page_area.width; + height = page_area.height; + + g_object_get (effect, + "alignment", &alignment, + NULL); + + paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area); + + for (i = 0; i < N_BLINDS; i++) { + cairo_save (cr); + + if (alignment == EV_TRANSITION_ALIGNMENT_HORIZONTAL) { + cairo_rectangle (cr, + 0, + height / N_BLINDS * i, + width, + height / N_BLINDS * progress); + } else { + cairo_rectangle (cr, + width / N_BLINDS * i, + 0, + width / N_BLINDS * progress, + height); + } + + cairo_clip (cr); + paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area); + cairo_restore (cr); + } +} + void ev_transition_animation_paint (EvTransitionAnimation *animation, cairo_t *cr, @@ -311,6 +355,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation, case EV_TRANSITION_EFFECT_SPLIT: ev_transition_animation_split (cr, animation, priv->effect, progress, page_area); break; + case EV_TRANSITION_EFFECT_BLINDS: + ev_transition_animation_blinds (cr, animation, priv->effect, progress, page_area); + break; default: { GEnumValue *enum_value;