Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-transition-animation.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2008-01-04 20:27:34 (GMT)
committer Carlos Garnacho <carlosg@src.gnome.org>2008-01-04 20:27:34 (GMT)
commit92da7c48ac235b7cbf6a803348ad92a622232fb4 (patch)
treed506d220e7ff924b4fcf2c192923fac995c86678 /shell/ev-transition-animation.c
parentd66c86c82bbacd93faa4cb1a73572e7860c07308 (diff)
Implement "uncover" effect.
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
Diffstat (limited to 'shell/ev-transition-animation.c')
-rw-r--r--shell/ev-transition-animation.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/shell/ev-transition-animation.c b/shell/ev-transition-animation.c
index 2e39ee6..676552c 100644
--- a/shell/ev-transition-animation.c
+++ b/shell/ev-transition-animation.c
@@ -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;