]> www.fi.muni.cz Git - evince.git/commitdiff
Implement "blinds" effect.
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 4 Jan 2008 20:26:43 +0000 (20:26 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Fri, 4 Jan 2008 20:26:43 +0000 (20:26 +0000)
2008-01-04  Carlos Garnacho  <carlosg@gnome.org>

        * shell/ev-transition-animation.c (ev_transition_animation_blinds)
        (ev_transition_animation_paint): Implement "blinds" effect.

svn path=/trunk/; revision=2802

ChangeLog
shell/ev-transition-animation.c

index 0fd0c80ffc66701086f7abcd6d8e103eb9160db8..c3f7b09b522557f1d692de2d4d0c27a40a7e0ac8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
+
+       * shell/ev-transition-animation.c (ev_transition_animation_blinds)
+       (ev_transition_animation_paint): Implement "blinds" effect.
+
 2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
 
        * shell/ev-transition-animation.c (ev_transition_animation_split)
index e2bc323444849a6430fe9f8cccee81540367fcd1..aa0177e052aa83a7759708ce719e1b6a5f7aace0 100644 (file)
@@ -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;