Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2008-01-04 20:27:17 (GMT)
committer Carlos Garnacho <carlosg@src.gnome.org>2008-01-04 20:27:17 (GMT)
commit0473a8908632ad9b12306906da2414d2d36d9582 (patch)
treee49900bb1e8040e6f2a075f7c5d28a6edc94ae5f /shell
parenta753105c6aef682941344bc21a8f4a51e78a5440 (diff)
Implement "push" effect.
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
Diffstat (limited to 'shell')
-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 196d0e1..a99a47f 100644
--- a/shell/ev-transition-animation.c
+++ b/shell/ev-transition-animation.c
@@ -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;