+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);
+ }
+}
+
+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);
+}
+
+static void
+ev_transition_animation_dissolve (cairo_t *cr,
+ EvTransitionAnimation *animation,
+ EvTransitionEffect *effect,
+ gdouble progress,
+ GdkRectangle page_area)
+{
+ EvTransitionAnimationPriv *priv;
+
+ priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+
+ paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ 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);
+ }
+}
+
+static void
+ev_transition_animation_cover (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 */
+ paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 0, page_area);
+ } else {
+ /* top to bottom */
+ paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 0, page_area);
+ }
+}
+
+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);
+ }
+}
+
+static void
+ev_transition_animation_fade (cairo_t *cr,
+ EvTransitionAnimation *animation,
+ EvTransitionEffect *effect,
+ gdouble progress,
+ GdkRectangle page_area)
+{
+ EvTransitionAnimationPriv *priv;
+
+ priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+
+ paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, progress, page_area);
+}
+