summaryrefslogtreecommitdiff
path: root/libview/ev-page-accessible.c
diff options
context:
space:
mode:
authorJoanmarie Diggs <[email protected]>2014-06-23 12:06:46 -0400
committerraveit65 <[email protected]>2017-11-27 10:13:51 +0100
commit6473980b44cbb959c1eadf0ce1549837b645318d (patch)
tree5a5f4fa4b89c3e30e121719cb695318a1281c854 /libview/ev-page-accessible.c
parentfd9b18641b5ddda364aaca2bbba678f644554741 (diff)
downloadatril-6473980b44cbb959c1eadf0ce1549837b645318d.tar.bz2
atril-6473980b44cbb959c1eadf0ce1549837b645318d.tar.xz
Expose form fields 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=d707486
Diffstat (limited to 'libview/ev-page-accessible.c')
-rw-r--r--libview/ev-page-accessible.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
index 3346dc4b..7e97b955 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-form-field-accessible.h"
#include "ev-image-accessible.h"
#include "ev-link-accessible.h"
#include "ev-view-private.h"
@@ -99,6 +100,7 @@ ev_page_accessible_initialize_children (EvPageAccessible *self)
EvView *view;
EvMappingList *images;
EvMappingList *links;
+ EvMappingList *fields;
GList *children = NULL;
GList *list;
@@ -113,11 +115,13 @@ ev_page_accessible_initialize_children (EvPageAccessible *self)
links = ev_page_cache_get_link_mapping (view->page_cache, self->priv->page);
images = ev_page_cache_get_image_mapping (view->page_cache, self->priv->page);
- if (!links && !images)
+ fields = ev_page_cache_get_form_field_mapping (view->page_cache, self->priv->page);
+ if (!links && !images && !fields)
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_concat (children, g_list_copy (ev_mapping_list_get_list (fields)));
children = g_list_sort (children, (GCompareFunc) compare_mappings);
self->priv->children = g_ptr_array_new_full (g_list_length (children), (GDestroyNotify) g_object_unref);
@@ -133,6 +137,8 @@ ev_page_accessible_initialize_children (EvPageAccessible *self)
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));
+ else if (fields && ev_mapping_list_find (fields, mapping->data))
+ child = ATK_OBJECT (ev_form_field_accessible_new (self, EV_FORM_FIELD (mapping->data), &mapping->area));
if (child)
g_ptr_array_add (self->priv->children, child);