[poppler] poppler/poppler: Page.cc,1.14,1.15 Page.h,1.6,1.7

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Dec 26 11:56:31 PST 2006


Update of /cvs/poppler/poppler/poppler
In directory kemper:/tmp/cvs-serv26674/poppler

Modified Files:
	Page.cc Page.h 
Log Message:
        * glib/test-poppler-glib.c:
        * glib/poppler-page.cc:
        * glib/poppler-page.h:
        * poppler/Page.cc:
        * poppler/Page.h: Implement /Dur entry in page object. Patch by Carlos
        Garcia Campos <carlosgc at gnome.org>


Index: Page.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Page.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Page.cc	22 Dec 2006 23:39:41 -0000	1.14
+++ Page.cc	26 Dec 2006 19:56:29 -0000	1.15
@@ -189,9 +189,12 @@
 //------------------------------------------------------------------------
 
 Page::Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA) {
+  Object tmp;
+	
   ok = gTrue;
   xref = xrefA;
   num = numA;
+  duration = -1;
 
   // get attributes
   attrs = attrsA;
@@ -204,6 +207,16 @@
     trans.free();
   }
 
+  // duration
+  pageDict->lookupNF("Dur", &tmp);
+  if (!(tmp.isNum() || tmp.isNull())) {
+    error(-1, "Page duration object (page %d) is wrong type (%s)",
+	  num, tmp.getTypeName());
+  } else if (tmp.isNum()) {
+    duration = tmp.getNum();
+  }
+  tmp.free();
+
   // annotations
   pageDict->lookupNF("Annots", &annots);
   if (!(annots.isRef() || annots.isArray() || annots.isNull())) {

Index: Page.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Page.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Page.h	8 Oct 2006 20:38:47 -0000	1.6
+++ Page.h	26 Dec 2006 19:56:29 -0000	1.7
@@ -151,6 +151,11 @@
   // Get transition.
   Object *getTrans(Object *obj) { return trans.fetch(xref, obj); }
 
+  // Get duration, the maximum length of time, in seconds,
+  // that the page is displayed before the presentation automatically
+  // advances to the next page
+  double getDuration() { return duration; }
+
   // Get actions
   Object *getActions(Object *obj) { return actions.fetch(xref, obj); }
 
@@ -198,6 +203,7 @@
   Object thumb;			// page thumbnail
   Object trans;			// page transition
   Object actions;		// page addiction actions
+  double duration;              // page duration
   GBool ok;			// true if page is valid
 };
 



More information about the poppler mailing list