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

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

svn path=/trunk/; revision=2803

ChangeLog
shell/ev-transition-animation.c

index c3f7b09b522557f1d692de2d4d0c27a40a7e0ac8..f54aa8e06f984f17f9abe49159b52372ea847d81 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_box)
+       (ev_transition_animation_paint): Implement "box" effect.
+
 2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
 
        * shell/ev-transition-animation.c (ev_transition_animation_blinds)
index aa0177e052aa83a7759708ce719e1b6a5f7aace0..6a4006b27df5170ae5eae7db03b32235dab288ce 100644 (file)
@@ -326,6 +326,50 @@ ev_transition_animation_blinds (cairo_t               *cr,
        }
 }
 
+static void
+ev_transition_animation_box (cairo_t               *cr,
+                            EvTransitionAnimation *animation,
+                            EvTransitionEffect    *effect,
+                            gdouble                progress,
+                            GdkRectangle           page_area)
+{
+       EvTransitionAnimationPriv *priv;
+       EvTransitionEffectDirection direction;
+       gint width, height;
+
+       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       width = page_area.width;
+       height = page_area.height;
+
+       g_object_get (effect,
+                     "direction", &direction,
+                     NULL);
+
+       if (direction == EV_TRANSITION_DIRECTION_INWARD) {
+               paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+
+               cairo_rectangle (cr,
+                                width * progress / 2,
+                                height * progress / 2,
+                                width * (1 - progress),
+                                height * (1 - progress));
+               cairo_clip (cr);
+
+               paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+       } else {
+               paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+
+               cairo_rectangle (cr,
+                                (width / 2) - (width * progress / 2),
+                                (height / 2) - (height * progress / 2),
+                                width * progress,
+                                height * progress);
+               cairo_clip (cr);
+
+               paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+       }
+}
+
 void
 ev_transition_animation_paint (EvTransitionAnimation *animation,
                               cairo_t               *cr,
@@ -358,6 +402,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation,
        case EV_TRANSITION_EFFECT_BLINDS:
                ev_transition_animation_blinds (cr, animation, priv->effect, progress, page_area);
                break;
+       case EV_TRANSITION_EFFECT_BOX:
+               ev_transition_animation_box (cr, animation, priv->effect, progress, page_area);
+               break;
        default: {
                GEnumValue *enum_value;