Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-transition-animation.h File Reference
#include <evince-document.h>
#include "ev-timeline.h"
#include "ev-transition-effect.h"
+ Include dependency graph for ev-transition-animation.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvTransitionAnimation
 
struct  _EvTransitionAnimationClass
 

Macros

#define EV_TYPE_TRANSITION_ANIMATION   (ev_transition_animation_get_type ())
 
#define EV_TRANSITION_ANIMATION(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimation))
 
#define EV_TRANSITION_ANIMATION_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimationClass))
 
#define EV_IS_TRANSITION_ANIMATION(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_TRANSITION_ANIMATION))
 
#define EV_IS_TRANSITION_ANIMATION_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_TRANSITION_ANIMATION))
 
#define EV_TRANSITION_ANIMATION_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimationClass))
 

Typedefs

typedef struct
_EvTransitionAnimation 
EvTransitionAnimation
 
typedef struct
_EvTransitionAnimationClass 
EvTransitionAnimationClass
 

Functions

GType ev_transition_animation_get_type (void) G_GNUC_CONST
 
EvTransitionAnimationev_transition_animation_new (EvTransitionEffect *effect)
 
void ev_transition_animation_set_origin_surface (EvTransitionAnimation *animation, cairo_surface_t *origin_surface)
 
void ev_transition_animation_set_dest_surface (EvTransitionAnimation *animation, cairo_surface_t *origin_surface)
 
gint ev_transition_animation_get_page_from (EvTransitionAnimation *animation)
 
gint ev_transition_animation_get_page_to (EvTransitionAnimation *animation)
 
void ev_transition_animation_paint (EvTransitionAnimation *animation, cairo_t *cr, GdkRectangle page_area)
 
gboolean ev_transition_animation_ready (EvTransitionAnimation *animation)
 

Macro Definition Documentation

#define EV_IS_TRANSITION_ANIMATION (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_TRANSITION_ANIMATION))

Definition at line 38 of file ev-transition-animation.h.

#define EV_IS_TRANSITION_ANIMATION_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_TRANSITION_ANIMATION))

Definition at line 39 of file ev-transition-animation.h.

#define EV_TRANSITION_ANIMATION (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimation))

Definition at line 36 of file ev-transition-animation.h.

#define EV_TRANSITION_ANIMATION_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimationClass))

Definition at line 37 of file ev-transition-animation.h.

#define EV_TRANSITION_ANIMATION_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimationClass))

Definition at line 40 of file ev-transition-animation.h.

#define EV_TYPE_TRANSITION_ANIMATION   (ev_transition_animation_get_type ())

Definition at line 35 of file ev-transition-animation.h.

Typedef Documentation

Definition at line 42 of file ev-transition-animation.h.

Function Documentation

gint ev_transition_animation_get_page_from ( EvTransitionAnimation animation)
gint ev_transition_animation_get_page_to ( EvTransitionAnimation animation)
GType ev_transition_animation_get_type ( void  )
EvTransitionAnimation* ev_transition_animation_new ( EvTransitionEffect effect)

Definition at line 608 of file ev-transition-animation.c.

609 {
610  g_return_val_if_fail (EV_IS_TRANSITION_EFFECT (effect), NULL);
611 
612  return g_object_new (EV_TYPE_TRANSITION_ANIMATION,
613  "effect", effect,
614  NULL);
615 }

+ Here is the caller graph for this function:

void ev_transition_animation_paint ( EvTransitionAnimation animation,
cairo_t *  cr,
GdkRectangle  page_area 
)

Definition at line 538 of file ev-transition-animation.c.

541 {
544  gdouble progress;
545 
546  g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation));
547 
548  priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
549 
550  if (!priv->dest_surface) {
551  /* animation is still not ready, paint the origin surface */
552  paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
553  return;
554  }
555 
556  g_object_get (priv->effect, "type", &type, NULL);
557  progress = ev_timeline_get_progress (EV_TIMELINE (animation));
558 
559  switch (type) {
561  /* just paint the destination slide */
562  paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
563  break;
565  ev_transition_animation_split (cr, animation, priv->effect, progress, page_area);
566  break;
568  ev_transition_animation_blinds (cr, animation, priv->effect, progress, page_area);
569  break;
571  ev_transition_animation_box (cr, animation, priv->effect, progress, page_area);
572  break;
574  ev_transition_animation_wipe (cr, animation, priv->effect, progress, page_area);
575  break;
577  ev_transition_animation_dissolve (cr, animation, priv->effect, progress, page_area);
578  break;
580  ev_transition_animation_push (cr, animation, priv->effect, progress, page_area);
581  break;
583  ev_transition_animation_cover (cr, animation, priv->effect, progress, page_area);
584  break;
586  ev_transition_animation_uncover (cr, animation, priv->effect, progress, page_area);
587  break;
589  ev_transition_animation_fade (cr, animation, priv->effect, progress, page_area);
590  break;
591  default: {
592  GEnumValue *enum_value;
593 
594  enum_value = g_enum_get_value (g_type_class_peek (EV_TYPE_TRANSITION_EFFECT_TYPE), type);
595 
596  g_warning ("Unimplemented transition animation: '%s', "
597  "please post a bug report in Evince bugzilla "
598  "(http://bugzilla.gnome.org) with a testcase.",
599  enum_value->value_nick);
600 
601  /* just paint the destination slide */
602  paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
603  }
604  }
605 }

+ Here is the caller graph for this function:

gboolean ev_transition_animation_ready ( EvTransitionAnimation animation)

Definition at line 670 of file ev-transition-animation.c.

671 {
673 
674  g_return_val_if_fail (EV_IS_TRANSITION_ANIMATION (animation), FALSE);
675 
676  priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
677 
678  return (priv->origin_surface != NULL);
679 }

+ Here is the caller graph for this function:

void ev_transition_animation_set_dest_surface ( EvTransitionAnimation animation,
cairo_surface_t *  origin_surface 
)

Definition at line 644 of file ev-transition-animation.c.

646 {
648  cairo_surface_t *surface;
649 
650  g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation));
651 
652  priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
653 
654  if (priv->dest_surface == dest_surface)
655  return;
656 
657  surface = cairo_surface_reference (dest_surface);
658 
659  if (priv->dest_surface)
660  cairo_surface_destroy (priv->dest_surface);
661 
662  priv->dest_surface = surface;
663  g_object_notify (G_OBJECT (animation), "dest-surface");
664 
665  if (priv->origin_surface && priv->dest_surface)
666  ev_timeline_start (EV_TIMELINE (animation));
667 }

+ Here is the caller graph for this function:

void ev_transition_animation_set_origin_surface ( EvTransitionAnimation animation,
cairo_surface_t *  origin_surface 
)

Definition at line 618 of file ev-transition-animation.c.

620 {
622  cairo_surface_t *surface;
623 
624  g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation));
625 
626  priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
627 
628  if (priv->origin_surface == origin_surface)
629  return;
630 
631  surface = cairo_surface_reference (origin_surface);
632 
633  if (priv->origin_surface)
634  cairo_surface_destroy (priv->origin_surface);
635 
636  priv->origin_surface = surface;
637  g_object_notify (G_OBJECT (animation), "origin-surface");
638 
639  if (priv->origin_surface && priv->dest_surface)
640  ev_timeline_start (EV_TIMELINE (animation));
641 }

+ Here is the caller graph for this function: