[evince] [libview] Only set text and text_layout flags in page cache when a11y might be enabled
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] [libview] Only set text and text_layout flags in page cache when a11y might be enabled
- Date: Wed, 14 Jul 2010 13:32:25 +0000 (UTC)
commit 9d70081e79a63d1189d2497dbafaac3c48b1a581
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Wed Jul 14 15:28:15 2010 +0200
[libview] Only set text and text_layout flags in page cache when a11y might be enabled
libview/ev-view-private.h | 3 +++
libview/ev-view.c | 14 ++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/libview/ev-view-private.h b/libview/ev-view-private.h
index 0630908..57eea30 100644
--- a/libview/ev-view-private.h
+++ b/libview/ev-view-private.h
@@ -188,6 +188,9 @@ struct _EvView {
/* Synctex */
EvMapping *synctex_result;
+
+ /* Accessibility */
+ gboolean a11y_enabled;
};
struct _EvViewClass {
diff --git a/libview/ev-view.c b/libview/ev-view.c
index e024fb9..d5f2a71 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4408,10 +4408,12 @@ ev_view_get_accessible (GtkWidget *widget)
factory = atk_registry_get_factory (registry,
derived_type);
derived_atk_type = atk_object_factory_get_accessible_type (factory);
- if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE))
- atk_registry_set_factory_type (registry,
+ if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE)) {
+ atk_registry_set_factory_type (registry,
EV_TYPE_VIEW,
ev_view_accessible_factory_get_type ());
+ EV_VIEW (widget)->a11y_enabled = TRUE;
+ }
first_time = FALSE;
}
return GTK_WIDGET_CLASS (ev_view_parent_class)->get_accessible (widget);
@@ -4691,6 +4693,14 @@ setup_caches (EvView *view)
view->height_to_page_cache = ev_view_get_height_to_page_cache (view);
view->pixbuf_cache = ev_pixbuf_cache_new (GTK_WIDGET (view), view->model, view->pixbuf_cache_size);
view->page_cache = ev_page_cache_new (view->document);
+ if (view->a11y_enabled) {
+ EvJobPageDataFlags flags = ev_page_cache_get_flags (view->page_cache);
+
+ ev_page_cache_set_flags (view->page_cache,
+ flags |
+ EV_PAGE_DATA_INCLUDE_TEXT_LAYOUT |
+ EV_PAGE_DATA_INCLUDE_TEXT);
+ }
inverted_colors = ev_document_model_get_inverted_colors (view->model);
ev_pixbuf_cache_set_inverted_colors (view->pixbuf_cache, inverted_colors);
g_signal_connect (view->pixbuf_cache, "job-finished", G_CALLBACK (job_finished_cb), view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]