summaryrefslogtreecommitdiff
path: root/libview/ev-page-accessible.c
diff options
context:
space:
mode:
authorJoanmarie Diggs <[email protected]>2014-06-23 12:59:38 -0400
committerraveit65 <[email protected]>2017-11-27 10:13:51 +0100
commitfd9b18641b5ddda364aaca2bbba678f644554741 (patch)
tree7a12e55f3ae643fdfe0a0b1f534df6192e3afa20 /libview/ev-page-accessible.c
parent048d4d7ecbdea03efb4f7ef1d30d87b7be545822 (diff)
downloadatril-fd9b18641b5ddda364aaca2bbba678f644554741.tar.bz2
atril-fd9b18641b5ddda364aaca2bbba678f644554741.tar.xz
Expose images as AtkObject children of the page
https://bugzilla.gnome.org/show_bug.cgi?id=728475 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-14&id=aea890c
Diffstat (limited to 'libview/ev-page-accessible.c')
-rw-r--r--libview/ev-page-accessible.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
index d3c72e3e..3346dc4b 100644
--- a/libview/ev-page-accessible.c
+++ b/libview/ev-page-accessible.c
@@ -24,6 +24,7 @@
#include <glib/gi18n-lib.h>
#include "ev-page-accessible.h"
+#include "ev-image-accessible.h"
#include "ev-link-accessible.h"
#include "ev-view-private.h"
@@ -96,6 +97,7 @@ static void
ev_page_accessible_initialize_children (EvPageAccessible *self)
{
EvView *view;
+ EvMappingList *images;
EvMappingList *links;
GList *children = NULL;
GList *list;
@@ -110,10 +112,12 @@ ev_page_accessible_initialize_children (EvPageAccessible *self)
self->priv->children_initialized = TRUE;
links = ev_page_cache_get_link_mapping (view->page_cache, self->priv->page);
- if (!links)
+ images = ev_page_cache_get_image_mapping (view->page_cache, self->priv->page);
+ if (!links && !images)
return;
children = g_list_copy (ev_mapping_list_get_list (links));
+ children = g_list_concat (children, g_list_copy (ev_mapping_list_get_list (images)));
children = g_list_sort (children, (GCompareFunc) compare_mappings);
self->priv->children = g_ptr_array_new_full (g_list_length (children), (GDestroyNotify) g_object_unref);
@@ -127,7 +131,8 @@ ev_page_accessible_initialize_children (EvPageAccessible *self)
AtkHyperlink *atk_link = atk_hyperlink_impl_get_hyperlink (ATK_HYPERLINK_IMPL (link));
child = atk_hyperlink_get_object (atk_link, 0);
- }
+ } else if (images && ev_mapping_list_find (images, mapping->data))
+ child = ATK_OBJECT (ev_image_accessible_new (self, EV_IMAGE (mapping->data), &mapping->area));
if (child)
g_ptr_array_add (self->priv->children, child);