[poppler] poppler/glib: poppler-page.cc, 1.51, 1.52 poppler-page.h,
1.21, 1.22 test-poppler-glib.c, 1.18, 1.19
Albert Astals Cid
aacid at kemper.freedesktop.org
Tue Dec 26 11:56:31 PST 2006
Update of /cvs/poppler/poppler/glib
In directory kemper:/tmp/cvs-serv26674/glib
Modified Files:
poppler-page.cc poppler-page.h test-poppler-glib.c
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: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.cc,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- poppler-page.cc 21 Sep 2006 22:40:53 -0000 1.51
+++ poppler-page.cc 26 Dec 2006 19:56:29 -0000 1.52
@@ -125,6 +125,22 @@
return page->index;
}
+/**
+ * poppler_page_get_duration:
+ * @page: a #PopplerPage
+ *
+ * Returns the duration of @page
+ *
+ * Return value: duration in seconds of @page or -1.
+ **/
+double
+poppler_page_get_duration (PopplerPage *page)
+{
+ g_return_val_if_fail (POPPLER_IS_PAGE (page), -1);
+
+ return page->page->getDuration ();
+}
+
#if defined (HAVE_CAIRO)
typedef struct {
Index: poppler-page.h
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- poppler-page.h 12 Apr 2006 02:07:07 -0000 1.21
+++ poppler-page.h 26 Dec 2006 19:56:29 -0000 1.22
@@ -57,6 +57,7 @@
double *width,
double *height);
int poppler_page_get_index (PopplerPage *page);
+double poppler_page_get_duration (PopplerPage *page);
GdkPixbuf *poppler_page_get_thumbnail (PopplerPage *page);
gboolean poppler_page_get_thumbnail_size (PopplerPage *page,
int *width,
Index: test-poppler-glib.c
===================================================================
RCS file: /cvs/poppler/poppler/glib/test-poppler-glib.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- test-poppler-glib.c 28 Feb 2006 18:25:00 -0000 1.18
+++ test-poppler-glib.c 26 Dec 2006 19:56:29 -0000 1.19
@@ -121,6 +121,7 @@
double width, height;
GList *list, *l;
char *text;
+ double duration;
PopplerRectangle area;
if (argc != 3)
@@ -147,6 +148,12 @@
poppler_page_get_size (page, &width, &height);
printf ("\tpage size:\t%f inches by %f inches\n", width / 72, height / 72);
+ duration = poppler_page_get_duration (page);
+ if (duration > 0)
+ printf ("\tpage duration:\t%f second(s)\n", duration);
+ else
+ printf ("\tpage duration:\tno duration for page\n");
+
thumb = poppler_page_get_thumbnail (page);
if (thumb != NULL) {
gdk_pixbuf_save (thumb, "thumb.png", "png", &error, NULL);
More information about the poppler
mailing list