summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoanmarie Diggs <[email protected]>2014-06-23 08:41:00 -0400
committerraveit65 <[email protected]>2017-11-27 10:13:51 +0100
commit3eb5aac5d3313fee4f4f60ef323b2fa35f03b847 (patch)
tree01a4cdc00be9e2a1e1d7a3fb4e58eb1edc2bdb4c
parente532aade547eac42a05fbd59ad98425a4d920f4a (diff)
downloadatril-3eb5aac5d3313fee4f4f60ef323b2fa35f03b847.tar.bz2
atril-3eb5aac5d3313fee4f4f60ef323b2fa35f03b847.tar.xz
ev-page-cache: Add method to check if a given page has been cached
The Accessibility code will expose child objects (links, images, form fields) of the page, but can only do so after that page has been cached. https://bugzilla.gnome.org/show_bug.cgi?id=728475 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=a898d96
-rw-r--r--libview/ev-page-cache.c14
-rw-r--r--libview/ev-page-cache.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/libview/ev-page-cache.c b/libview/ev-page-cache.c
index b5be8bac..3aee0453 100644
--- a/libview/ev-page-cache.c
+++ b/libview/ev-page-cache.c
@@ -664,3 +664,17 @@ ev_page_cache_ensure_page (EvPageCache *cache,
ev_page_cache_schedule_job_if_needed (cache, page);
}
+
+gboolean
+ev_page_cache_is_page_cached (EvPageCache *cache,
+ gint page)
+{
+ EvPageCacheData *data;
+
+ g_return_val_if_fail (EV_IS_PAGE_CACHE (cache), FALSE);
+ g_return_val_if_fail (page >= 0 && page < cache->n_pages, FALSE);
+
+ data = &cache->page_list[page];
+
+ return data->done;
+}
diff --git a/libview/ev-page-cache.h b/libview/ev-page-cache.h
index c0f5b82f..4ad527d8 100644
--- a/libview/ev-page-cache.h
+++ b/libview/ev-page-cache.h
@@ -74,6 +74,8 @@ gboolean ev_page_cache_get_text_log_attrs (EvPageCache *cach
gulong *n_attrs);
void ev_page_cache_ensure_page (EvPageCache *cache,
gint page);
+gboolean ev_page_cache_is_page_cached (EvPageCache *cache,
+ gint page);
G_END_DECLS
#endif /* EV_PAGE_CACHE_H */