GNOME Bugzilla – Bug 701746
Enable getting and setting the caret via AtkText
Last modified: 2014-02-27 11:16:12 UTC
Orca's structural navigation makes it possible to navigate amongst items by type, e.g. headings, lists, tables, etc. This functionality depends not only upon these objects being discrete and having the correct AtkRole, but upon ATs being able to (re)position the caret within those objects via AtkText. (Only making this a depends-on for bug 638905; while the Orca functionality also depends on bug 701720, fixing this bug does not.)
Created attachment 246390 [details] [review] proposed patch * Use the EvView's cursor_offset rather than the GtkTextBuffer * Return -1 rather than 0 when the offset cannot be obtained
Review of attachment 246390 [details] [review]: This might depend on bug #701732 ::: libview/ev-view-accessible.c @@ +320,1 @@ + return view->cursor_offset; I think we could add a private function to get the cursor that checks if caret navigation is enabled and returns the current offset or -1. @@ +337,3 @@ + view->cursor_offset = offset; + gtk_widget_queue_draw (widget); Same here, this could be the function I commented in the other bug, that sets the new offset, and checks whether it has actually changed or not to emit the notify singal and queue a draw.
Created attachment 270258 [details] [review] Emits cursor-moved on ev_view_set_caret_cursor_position (In reply to comment #2) > Same here, this could be the function I commented in the other bug, that sets > the new offset, and checks whether it has actually changed or not to emit the > notify singal and queue a draw. I saw that you added that method on commit b2597d9be5a95b37f2133bf97627d9a36f023bcb What is missing on this method is the emission of CURSOR_MOVED.
Created attachment 270259 [details] [review] Implement atk_text_set_caret_offset based on ev_view_set_caret_cursor_position
Created attachment 270260 [details] [review] a11y: cleaning implementation for atk_text_get_caret_offset (In reply to comment #2) > Review of attachment 246390 [details] [review]: > > This might depend on bug #701732 > > ::: libview/ev-view-accessible.c > @@ +320,1 @@ > + return view->cursor_offset; > > I think we could add a private function to get the cursor that checks if caret > navigation is enabled and returns the current offset or -1. I don't think that that makes sense, as that behaviour is really tied to the accessibility needs. In the same way that ev_view_set_caret_cursor_position is setting cursor_offset and cursor_page not matters if the caret is enabled, a equivalen ev_view_get_cursor_position should return the values assigned. So this patch do basically what Joanmarie Diggs was doing, but updating due last changes.