diff options
-rw-r--r-- | libview/ev-view.c | 15 | ||||
-rw-r--r-- | libview/ev-view.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c index ea101dce..50e0af2a 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -34,6 +34,7 @@ #include "ev-document-links.h" #include "ev-document-layers.h" #include "ev-document-misc.h" +#include "ev-document-text.h" #include "ev-pixbuf-cache.h" #include "ev-page-cache.h" #include "ev-view-marshal.h" @@ -3443,6 +3444,20 @@ ev_view_pend_cursor_blink (EvView *view) (GSourceFunc)blink_cb, view); } +gboolean +ev_view_supports_caret_navigation (EvView *view) +{ + EvDocumentTextInterface *iface; + + if (!view->document || !EV_IS_DOCUMENT_TEXT (view->document)) + return FALSE; + + iface = EV_DOCUMENT_TEXT_GET_IFACE (view->document); + if (!iface->get_text_layout || !iface->get_text) + return FALSE; + + return TRUE; +} void ev_view_set_caret_navigation_enabled (EvView *view, diff --git a/libview/ev-view.h b/libview/ev-view.h index be829357..6a4a6d4f 100644 --- a/libview/ev-view.h +++ b/libview/ev-view.h @@ -115,6 +115,7 @@ void ev_view_remove_annotation (EvView *view, void ev_view_disconnect_handlers (EvView *view); /* Caret navigation */ +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); |