summaryrefslogtreecommitdiff
path: root/pdf/pdf_xref.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-10-15 00:10:32 +0100
committerRobin Watts <robin.watts@artifex.com>2012-10-17 16:42:04 +0100
commit9cd836ca656584f7d9148faba0039c21f503512b (patch)
treed7a6bec3184d50f7c3175af460d862299115107c /pdf/pdf_xref.c
parent04bdd849e8872b9b26c5a80e6517f8401a06ee14 (diff)
downloadmupdf-9cd836ca656584f7d9148faba0039c21f503512b.tar.xz
First steps towards supporting transitions.
Only Fade, Wipe and Blinds supported so far. Hit 'p' in the viewer to go into 'presentation' mode. Page swaps then transition from page to page. Pages auto advance until key or mouse is used.
Diffstat (limited to 'pdf/pdf_xref.c')
-rw-r--r--pdf/pdf_xref.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index 2b2a7f91..c78a9ec7 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -1252,6 +1252,16 @@ pdf_meta(pdf_document *doc, int key, void *ptr, int size)
}
}
+fz_transition *
+pdf_page_presentation(pdf_document *doc, pdf_page *page, float *duration)
+{
+ *duration = page->duration;
+ if (!page->transition_present)
+ return NULL;
+ return &page->transition;
+}
+
+
static fz_interactive *
pdf_interact(pdf_document *doc)
{
@@ -1287,6 +1297,7 @@ pdf_new_document(fz_context *ctx, fz_stream *file)
doc->super.run_page = NULL; /* see pdf_xref_aux.c */
doc->super.free_page = (void*)pdf_free_page;
doc->super.meta = (void*)pdf_meta;
+ doc->super.page_presentation = (void*)pdf_page_presentation;
doc->super.interact = (void*)pdf_interact;
doc->super.write = (void*)pdf_write_document;