diff options
author | Joanmarie Diggs <[email protected]> | 2014-04-25 01:30:30 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-11-27 10:13:51 +0100 |
commit | 91241a1d27d9763df56ff5c6e868f4c37d65fe8b (patch) | |
tree | a19263625c4a24497bfb28a91b013440aa571c93 /libview/ev-view-accessible.c | |
parent | e2326c25e1249cf921dd1b878c42d6b51b032bcf (diff) | |
download | atril-91241a1d27d9763df56ff5c6e868f4c37d65fe8b.tar.bz2 atril-91241a1d27d9763df56ff5c6e868f4c37d65fe8b.tar.xz |
libview: Update ATK_STATE_SHOWING when the visible page range changes
https://bugzilla.gnome.org/show_bug.cgi?id=728664
origin commit:
https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=110a98a
https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=c4e98b3
Diffstat (limited to 'libview/ev-view-accessible.c')
-rw-r--r-- | libview/ev-view-accessible.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c index c063e366..bcff9100 100644 --- a/libview/ev-view-accessible.c +++ b/libview/ev-view-accessible.c @@ -61,6 +61,8 @@ struct _EvViewAccessiblePrivate { GtkScrollType idle_scroll; gint previous_cursor_page; + gint start_page; + gint end_page; GPtrArray *children; }; @@ -529,3 +531,31 @@ _transform_doc_rect_to_atk_rect (EvViewAccessible *accessible, atk_rect->x2 = view_rect.x + view_rect.width; atk_rect->y2 = view_rect.y + view_rect.height; } + +void +ev_view_accessible_set_page_range (EvViewAccessible *accessible, + gint start, + gint end) +{ + gint i; + AtkObject *page; + + g_return_if_fail (EV_IS_VIEW_ACCESSIBLE (accessible)); + + for (i = accessible->priv->start_page; i <= accessible->priv->end_page; i++) { + if (i < start || i > end) { + page = g_ptr_array_index (accessible->priv->children, i); + atk_object_notify_state_change (page, ATK_STATE_SHOWING, FALSE); + } + } + + for (i = start; i <= end; i++) { + if (i < accessible->priv->start_page || i > accessible->priv->end_page) { + page = g_ptr_array_index (accessible->priv->children, i); + atk_object_notify_state_change (page, ATK_STATE_SHOWING, TRUE); + } + } + + accessible->priv->start_page = start; + accessible->priv->end_page = end; +} |