From 9cd836ca656584f7d9148faba0039c21f503512b Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 15 Oct 2012 00:10:32 +0100 Subject: 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. --- pdf/pdf_xref.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pdf/pdf_xref.c') 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; -- cgit v1.2.3