Code

gtk-tpdfv: Added _get_n_pages() and _get_current_page().
authorSebastian Harl <sh@tokkee.org>
Fri, 23 Dec 2011 17:48:33 +0000 (18:48 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 23 Dec 2011 17:48:33 +0000 (18:48 +0100)
src/gtk-tpdfv.c
src/gtk-tpdfv.h

index 082872bece43aab0cb3416094383cc0f1d765af6..3ebbfab7ba965c74341d7867900eeaa3b5439d5a 100644 (file)
@@ -358,6 +358,30 @@ gtk_tpdfv_reload(GtkWidget *widget)
        do_redraw(widget);
 } /* gtk_tpdfv_reload */
 
+int
+gtk_tpdfv_get_n_pages(GtkWidget *widget)
+{
+       gtk_tpdfv_t *pdf;
+
+       if (! widget)
+               return -1;
+
+       pdf = GTK_TPDFV_GET_PRIVATE(widget);
+       return pdf->total_pages;
+} /* gtk_tpdfv_get_n_pages */
+
+int
+gtk_tpdfv_get_current_page(GtkWidget *widget)
+{
+       gtk_tpdfv_t *pdf;
+
+       if (! widget)
+               return -1;
+
+       pdf = GTK_TPDFV_GET_PRIVATE(widget);
+       return pdf->current_page_no;
+} /* gtk_tpdfv_get_current_page */
+
 void
 gtk_tpdfv_page_up(GtkWidget *widget)
 {
index 9dd48f8183b6bff57f43353f13f99b0d91c983f6..e354bd39cd689e8eb4d298771fbfca1ec71c3731 100644 (file)
@@ -72,6 +72,15 @@ gtk_tpdfv_new(const char *filename);
 void
 gtk_tpdfv_reload(GtkWidget *widget);
 
+/*
+ * gtk_tpdfv_get_n_pages, gtk_tpdfv_get_current_page:
+ * Get the total number of pages or the current page number.
+ */
+int
+gtk_tpdfv_get_n_pages(GtkWidget *widget);
+int
+gtk_tpdfv_get_current_page(GtkWidget *widget);
+
 /*
  * gtk_tpdfv_page_up, gtk_tpdfv_page_down,
  * gtk_tpdfv_first_page, gtk_tpdfv_last_page: