Code

gtk-tpdfv: Added gtk_tpdfv_goto_page().
authorSebastian Harl <sh@tokkee.org>
Fri, 23 Dec 2011 17:51:06 +0000 (18:51 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 23 Dec 2011 17:51:06 +0000 (18:51 +0100)
src/gtk-tpdfv.c
src/gtk-tpdfv.h

index 3ebbfab7ba965c74341d7867900eeaa3b5439d5a..d1a377ce4e44bd3d1204b259982f02ded02f533b 100644 (file)
@@ -426,6 +426,20 @@ gtk_tpdfv_last_page(GtkWidget *widget)
        do_redraw(widget);
 } /* gtk_tpdfv_last_page */
 
+void
+gtk_tpdfv_goto_page(GtkWidget *widget, int page)
+{
+       gtk_tpdfv_t *pdf;
+
+       pdf = GTK_TPDFV_GET_PRIVATE(widget);
+
+       if ((page < 0) || (page >= pdf->total_pages))
+               return;
+
+       pdf->current_page_no = page;
+       do_redraw(widget);
+} /* gtk_tpdfv_goto_page */
+
 void
 gtk_tpdfv_zoom_in(GtkWidget *widget)
 {
index e354bd39cd689e8eb4d298771fbfca1ec71c3731..1313c7aaab2884c8810ce2adada27371cc433424 100644 (file)
@@ -83,7 +83,8 @@ gtk_tpdfv_get_current_page(GtkWidget *widget);
 
 /*
  * gtk_tpdfv_page_up, gtk_tpdfv_page_down,
- * gtk_tpdfv_first_page, gtk_tpdfv_last_page:
+ * gtk_tpdfv_first_page, gtk_tpdfv_last_page,
+ * gtk_tpdfv_goto_page:
  * Navigation.
  */
 void
@@ -94,6 +95,8 @@ void
 gtk_tpdfv_first_page(GtkWidget *widget);
 void
 gtk_tpdfv_last_page(GtkWidget *widget);
+void
+gtk_tpdfv_goto_page(GtkWidget *widget, int page);
 
 /*
  * gtk_tpdfv_zoom_in, gtk_tpdfv_zoom_out,