]> www.fi.muni.cz Git - evince.git/commitdiff
Added implementation to get_effect() in EvDocumentTransitionIface.
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 4 Jan 2008 20:25:52 +0000 (20:25 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Fri, 4 Jan 2008 20:25:52 +0000 (20:25 +0000)
2008-01-04  Carlos Garnacho  <carlosg@gnome.org>

        * backend/pdf/ev-poppler.cc (pdf_document_get_effect): Added
        implementation to get_effect() in EvDocumentTransitionIface.

svn path=/trunk/; revision=2797

ChangeLog
backend/pdf/ev-poppler.cc

index f28e347009175a1f90c770568b7c953502f8a9d4..ba54f4891c7e7eb138bb506668a8b256f2a8de9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
+
+       * backend/pdf/ev-poppler.cc (pdf_document_get_effect): Added
+       implementation to get_effect() in EvDocumentTransitionIface.
+
 2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
 
        * libdocument/ev-transition-effect.[ch]: New files, define a page
index 5b0398047c458ec8e84f286739270951c9b20a58..7c3a594df50e1fd15be9485140fa961a322aac7f 100644 (file)
@@ -45,6 +45,7 @@
 #include "ev-document-transition.h"
 #include "ev-document-forms.h"
 #include "ev-selection.h"
+#include "ev-transition-effect.h"
 #include "ev-attachment.h"
 #include "ev-image.h"
 
@@ -1967,10 +1968,49 @@ pdf_document_get_page_duration (EvDocumentTransition *trans,
        return duration;
 }
 
+static EvTransitionEffect *
+pdf_document_get_effect (EvDocumentTransition *trans,
+                        gint                  page)
+{
+       PdfDocument            *pdf_document;
+       PopplerPage            *poppler_page;
+       PopplerPageTransition  *page_transition;
+       EvTransitionEffect     *effect;
+
+       pdf_document = PDF_DOCUMENT (trans);
+       poppler_page = poppler_document_get_page (pdf_document->document, page);
+
+       if (!poppler_page)
+               return NULL;
+
+       page_transition = poppler_page_get_transition (poppler_page);
+
+       if (!page_transition) {
+               g_object_unref (poppler_page);
+               return NULL;
+       }
+
+       /* enums in PopplerPageTransition match the EvTransitionEffect ones */
+       effect = ev_transition_effect_new ((EvTransitionEffectType) page_transition->type,
+                                          "alignment", page_transition->alignment,
+                                          "direction", page_transition->direction,
+                                          "duration", page_transition->duration,
+                                          "angle", page_transition->angle,
+                                          "scale", page_transition->scale,
+                                          "rectangular", page_transition->rectangular,
+                                          NULL);
+
+       poppler_page_transition_free (page_transition);
+       g_object_unref (poppler_page);
+
+       return effect;
+}
+
 static void
 pdf_document_page_transition_iface_init (EvDocumentTransitionIface *iface)
 {
        iface->get_page_duration = pdf_document_get_page_duration;
+       iface->get_effect = pdf_document_get_effect;
 }
 
 /* Forms */