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:01 (GMT)
committer Carlos Garnacho <carlosg@src.gnome.org>2008-01-04 20:27:01 (GMT)
commita228d600b794b4cb081e372b2d356897fb956196 (patch)
tree7dd39811d743a9c6a49778a6c012e8e1f5d134f4 /shell
parent16e10a8f22b1c22f6770e8d9d62938b83b5c52f1 (diff)
Implement "wipe" effect.
2008-01-04 Carlos Garnacho <carlosg@gnome.org> * shell/ev-transition-animation.c (ev_transition_animation_wipe) (ev_transition_animation_paint): Implement "wipe" effect. svn path=/trunk/; revision=2804
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-transition-animation.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/shell/ev-transition-animation.c b/shell/ev-transition-animation.c
index 6a4006b..028a36c 100644
--- a/shell/ev-transition-animation.c
+++ b/shell/ev-transition-animation.c
@@ -370,6 +370,60 @@ ev_transition_animation_box (cairo_t *cr,
}
}
+static void
+ev_transition_animation_wipe (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->origin_surface, 0, 0, 0, page_area);
+
+ if (angle == 0) {
+ /* left to right */
+ cairo_rectangle (cr,
+ 0, 0,
+ width * progress,
+ height);
+ } else if (angle <= 90) {
+ /* bottom to top */
+ cairo_rectangle (cr,
+ 0,
+ height * (1 - progress),
+ width,
+ height * progress);
+ } else if (angle <= 180) {
+ /* right to left */
+ cairo_rectangle (cr,
+ width * (1 - progress),
+ 0,
+ width * progress,
+ height);
+ } else if (angle <= 270) {
+ /* top to bottom */
+ cairo_rectangle (cr,
+ 0, 0,
+ width,
+ 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,
@@ -405,6 +459,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation,
case EV_TRANSITION_EFFECT_BOX:
ev_transition_animation_box (cr, animation, priv->effect, progress, page_area);
break;
+ case EV_TRANSITION_EFFECT_WIPE:
+ ev_transition_animation_wipe (cr, animation, priv->effect, progress, page_area);
+ break;
default: {
GEnumValue *enum_value;