From: Sebastian Harl Date: Fri, 23 Dec 2011 17:51:06 +0000 (+0100) Subject: gtk-tpdfv: Added gtk_tpdfv_goto_page(). X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e3db3e399a189f65c37d460a9c2be448eb04fa43;p=tpdfview.git gtk-tpdfv: Added gtk_tpdfv_goto_page(). --- diff --git a/src/gtk-tpdfv.c b/src/gtk-tpdfv.c index 3ebbfab..d1a377c 100644 --- a/src/gtk-tpdfv.c +++ b/src/gtk-tpdfv.c @@ -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) { diff --git a/src/gtk-tpdfv.h b/src/gtk-tpdfv.h index e354bd3..1313c7a 100644 --- a/src/gtk-tpdfv.h +++ b/src/gtk-tpdfv.h @@ -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,