Skip to content

Commit

Permalink
libview: Add ev_view_supports_caret_navigation()
Browse files Browse the repository at this point in the history
  • Loading branch information
Antia Puentes authored and Carlos Garcia Campos committed Jul 26, 2013
1 parent 2f720ef commit 6127a36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions libview/ev-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -3326,6 +3326,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,
Expand Down
2 changes: 1 addition & 1 deletion libview/ev-view.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ void ev_view_begin_add_annotation (EvView *view,
void ev_view_cancel_add_annotation (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);

G_END_DECLS

#endif /* __EV_VIEW_H__ */

0 comments on commit 6127a36

Please sign in to comment.