diff options
author | Antia Puentes <[email protected]> | 2013-07-26 14:42:32 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-09-06 21:19:51 +0200 |
commit | 534bb05456ae915bd4ab8fab0183eb14dd479d24 (patch) | |
tree | 6a44ef0eb6a2ceb68c9509f54ab90a4f1c791feb /libview | |
parent | 3c124fbac4dd43697d33d8d44ea6c48636c49884 (diff) | |
download | atril-534bb05456ae915bd4ab8fab0183eb14dd479d24.tar.bz2 atril-534bb05456ae915bd4ab8fab0183eb14dd479d24.tar.xz |
libview: Add ev_view_supports_caret_navigation()
https://bugzilla.gnome.org/show_bug.cgi?id=702079
origin commit:
https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=6127a36
Diffstat (limited to 'libview')
-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); |