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:26:52 (GMT)
committer Carlos Garnacho <carlosg@src.gnome.org>2008-01-04 20:26:52 (GMT)
commit16e10a8f22b1c22f6770e8d9d62938b83b5c52f1 (patch)
treeef6884881088dabbbf50c6ca33dfe79ac6d23ab7 /shell/ev-transition-animation.c
parent4859886aa78453b5a948f5ca17083bae536c4625 (diff)
Implement "box" effect.
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
Diffstat (limited to 'shell/ev-transition-animation.c')
-rw-r--r--shell/ev-transition-animation.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/shell/ev-transition-animation.c b/shell/ev-transition-animation.c
index aa0177e..6a4006b 100644
--- a/shell/ev-transition-animation.c
+++ b/shell/ev-transition-animation.c
@@ -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;