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

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

svn path=/trunk/; revision=2806

ChangeLog
shell/ev-transition-animation.c

index bee1518fd070955dc237517acda40082ebd0c417..59c765bf9bda56215750fbf325fdff7dcffa1837 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_push)
+       (ev_transition_animation_paint): Implement "push" effect.
+
 2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
 
        * shell/ev-transition-animation.c (ev_transition_animation_dissolve)
index 196d0e18d1c6bb8841c9bba731f54b0af7fbfe65..a99a47f1d410146320a1afb6d7a508bd6ff370ce 100644 (file)
@@ -439,6 +439,36 @@ ev_transition_animation_dissolve (cairo_t               *cr,
        paint_surface (cr, priv->origin_surface, 0, 0, 1 - progress, page_area);
 }
 
+static void
+ev_transition_animation_push (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);
+
+       if (angle == 0) {
+               /* left to right */
+               paint_surface (cr, priv->origin_surface, - (width * progress), 0, 0, page_area);
+               paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 0, page_area);
+       } else {
+               /* top to bottom */
+               paint_surface (cr, priv->origin_surface, 0, - (height * progress), 0, page_area);
+               paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 0, page_area);
+       }
+}
+
 void
 ev_transition_animation_paint (EvTransitionAnimation *animation,
                               cairo_t               *cr,
@@ -480,6 +510,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation,
        case EV_TRANSITION_EFFECT_DISSOLVE:
                ev_transition_animation_dissolve (cr, animation, priv->effect, progress, page_area);
                break;
+       case EV_TRANSITION_EFFECT_PUSH:
+               ev_transition_animation_push (cr, animation, priv->effect, progress, page_area);
+               break;
        default: {
                GEnumValue *enum_value;