diff options
-rw-r--r-- | libview/ev-view.c | 18 | ||||
-rw-r--r-- | libview/ev-view.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c index c76e5541..e04d7298 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -3497,6 +3497,24 @@ ev_view_is_caret_navigation_enabled (EvView *view) return view->caret_enabled; } +void +ev_view_set_caret_cursor_position (EvView *view, + guint page, + guint offset) +{ + g_return_if_fail (EV_IS_VIEW (view)); + g_return_if_fail (EV_IS_DOCUMENT (view->document)); + g_return_if_fail (page < ev_document_get_n_pages (view->document)); + + if (view->cursor_page != page || view->cursor_offset != offset) { + view->cursor_page = page; + view->cursor_offset = offset; + + if (view->caret_enabled && cursor_is_in_visible_page (view)) + gtk_widget_queue_draw (GTK_WIDGET (view)); + } +} + /*** GtkWidget implementation ***/ static void diff --git a/libview/ev-view.h b/libview/ev-view.h index 6a4a6d4f..fdf6c0ea 100644 --- a/libview/ev-view.h +++ b/libview/ev-view.h @@ -119,6 +119,9 @@ gboolean ev_view_supports_caret_navigation (EvView *view); gboolean ev_view_is_caret_navigation_enabled (EvView *view); void ev_view_set_caret_navigation_enabled (EvView *view, gboolean enabled); +void ev_view_set_caret_cursor_position (EvView *view, + guint page, + guint offset); G_END_DECLS #endif /* __EV_VIEW_H__ */ |