summaryrefslogtreecommitdiff
path: root/libview/ev-view-accessible.c
diff options
context:
space:
mode:
authorAntia Puentes <[email protected]>2013-07-03 17:31:40 +0200
committerraveit65 <[email protected]>2017-09-06 18:25:34 +0200
commita6d277859cfea9450ab8b41ffeceb49752fdabc0 (patch)
treef411db693f8776108599b1a6dcdcf88dada42bd2 /libview/ev-view-accessible.c
parent50d175ff54a2dc99e1af65ef9611de57e1bd5d68 (diff)
downloadatril-a6d277859cfea9450ab8b41ffeceb49752fdabc0.tar.bz2
atril-a6d277859cfea9450ab8b41ffeceb49752fdabc0.tar.xz
libview: Emit the AtkText text-caret-moved and text-selection-changed signals
https://bugzilla.gnome.org/show_bug.cgi?id=701732 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=2590224
Diffstat (limited to 'libview/ev-view-accessible.c')
-rw-r--r--libview/ev-view-accessible.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index e415b71b..6fd633ae 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -908,6 +908,22 @@ ev_view_accessible_hypertext_iface_init (AtkHypertextIface *iface)
iface->get_link_index = ev_view_accessible_get_link_index;
}
+static void
+ev_view_accessible_cursor_moved (EvView *view,
+ gint page,
+ gint offset,
+ EvViewAccessible *accessible)
+{
+ g_signal_emit_by_name (accessible, "text-caret-moved", offset);
+}
+
+static void
+ev_view_accessible_selection_changed (EvView *view,
+ EvViewAccessible *accessible)
+{
+ g_signal_emit_by_name (accessible, "text-selection-changed");
+}
+
AtkObject *
ev_view_accessible_new (GtkWidget *widget)
{
@@ -918,6 +934,13 @@ ev_view_accessible_new (GtkWidget *widget)
accessible = g_object_new (EV_TYPE_VIEW_ACCESSIBLE, NULL);
atk_object_initialize (accessible, widget);
+ g_signal_connect (widget, "cursor-moved",
+ G_CALLBACK (ev_view_accessible_cursor_moved),
+ accessible);
+ g_signal_connect (widget, "selection-changed",
+ G_CALLBACK (ev_view_accessible_selection_changed),
+ accessible);
+
return accessible;
}