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

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

svn path=/trunk/; revision=2808

ChangeLog
shell/ev-transition-animation.c

index 1a229dfa8fe572ab17f7d5fd7b0b1af5f001d9b2..f176ed1836358b81841e6d9effc9cc7625447fed 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_uncover)
+       (ev_transition_animation_paint): Implement "uncover" effect.
+
 2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
 
        * shell/ev-transition-animation.c (ev_transition_animation_cover)
index 2e39ee6e7de762aaaff9a3f22a3b2a7ed0e91dba..676552c9be734cfe59840d1d4885b4e3daf90bf8 100644 (file)
@@ -499,6 +499,36 @@ ev_transition_animation_cover (cairo_t               *cr,
        }
 }
 
+static void
+ev_transition_animation_uncover (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->dest_surface, 0, 0, 0, page_area);
+
+       if (angle == 0) {
+               /* left to right */
+               paint_surface (cr, priv->origin_surface, - (width * progress), 0, 0, page_area);
+       } else {
+               /* top to bottom */
+               paint_surface (cr, priv->origin_surface, 0, - (height * progress), 0, page_area);
+       }
+}
+
 void
 ev_transition_animation_paint (EvTransitionAnimation *animation,
                               cairo_t               *cr,
@@ -546,6 +576,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation,
        case EV_TRANSITION_EFFECT_COVER:
                ev_transition_animation_cover (cr, animation, priv->effect, progress, page_area);
                break;
+       case EV_TRANSITION_EFFECT_UNCOVER:
+               ev_transition_animation_uncover (cr, animation, priv->effect, progress, page_area);
+               break;
        default: {
                GEnumValue *enum_value;