[evince] libview: Add API to get the selected text
- From: Jose Aliste <jaliste src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libview: Add API to get the selected text
- Date: Thu, 29 Mar 2018 22:38:36 +0000 (UTC)
commit 8bca7b22961d3e6119eeb3e44190cb365a46bdc2
Author: Will Hawkins <hakinsw borlaugic com>
Date: Wed Mar 28 22:35:46 2018 -0300
libview: Add API to get the selected text
To add search for selected text, we need to pass the
selected text from the EvView to the shell. Thus
we add a method to get the selected text from the View.
https://bugzilla.gnome.org/show_bug.cgi?id=794538
libview/ev-view.c | 18 ++++++++++++++++++
libview/ev-view.h | 1 +
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 488c368..f22a0c8 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -5656,6 +5656,24 @@ ev_view_motion_notify_event (GtkWidget *widget,
return FALSE;
}
+/**
+ * ev_view_get_selected_text:
+ * @view: #EvView instance
+ *
+ * Returns a pointer to a constant string containing the selected
+ * text in the view.
+ *
+ * The value returned may be NULL if there is no selected text.
+ *
+ * Returns: The string representing selected text.
+ *
+ * Since: 3.30
+ */
+char *
+ev_view_get_selected_text (EvView *view)
+{
+ return get_selected_text (view);
+}
/**
* ev_view_add_text_markup_annotation_for_selected_text:
diff --git a/libview/ev-view.h b/libview/ev-view.h
index e2a243f..d458df0 100644
--- a/libview/ev-view.h
+++ b/libview/ev-view.h
@@ -66,6 +66,7 @@ void ev_view_copy_link_address (EvView *view,
EvLinkAction *action);
void ev_view_select_all (EvView *view);
gboolean ev_view_get_has_selection (EvView *view);
+char * ev_view_get_selected_text (EvView *view);
/* Page size */
gboolean ev_view_can_zoom_in (EvView *view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]