[evince] EvPageAccessible: use page-cached signal to initialize children
- From: Alejandro Piñeiro Iglesias <apinheiro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] EvPageAccessible: use page-cached signal to initialize children
- Date: Mon, 1 Sep 2014 13:50:12 +0000 (UTC)
commit 7ccfb40014d7b00bc50f45b9e0ef0515fbd67673
Author: Alejandro Piñeiro <apinheiro igalia com>
Date: Fri Jul 25 18:27:50 2014 +0200
EvPageAccessible: use page-cached signal to initialize children
https://bugzilla.gnome.org/show_bug.cgi?id=733747
libview/ev-page-accessible.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
index 6cbccc9..214726c 100644
--- a/libview/ev-page-accessible.c
+++ b/libview/ev-page-accessible.c
@@ -324,7 +324,6 @@ ev_page_accessible_get_n_children (AtkObject *accessible)
EvPageAccessible *self;
self = EV_PAGE_ACCESSIBLE (accessible);
- ev_page_accessible_initialize_children (self);
return self->priv->children == NULL ? 0 : self->priv->children->len;
}
@@ -336,7 +335,6 @@ ev_page_accessible_ref_child (AtkObject *accessible,
EvPageAccessible *self;
self = EV_PAGE_ACCESSIBLE (accessible);
- ev_page_accessible_initialize_children (self);
g_return_val_if_fail (i >= 0 || i < self->priv->children->len, NULL);
@@ -1207,11 +1205,21 @@ ev_page_accessible_component_iface_init (AtkComponentIface *iface)
iface->get_extents = ev_page_accessible_get_extents;
}
+static void
+page_cached_cb (EvPageCache *cache,
+ gint page,
+ EvPageAccessible *self)
+{
+ if (page == self->priv->page)
+ ev_page_accessible_initialize_children (self);
+}
+
EvPageAccessible *
ev_page_accessible_new (EvViewAccessible *view_accessible,
gint page)
{
EvPageAccessible *atk_page;
+ EvView *view;
g_return_val_if_fail (EV_IS_VIEW_ACCESSIBLE (view_accessible), NULL);
g_return_val_if_fail (page >= 0, NULL);
@@ -1221,6 +1229,14 @@ ev_page_accessible_new (EvViewAccessible *view_accessible,
"page", page,
NULL);
+ view = ev_page_accessible_get_view (EV_PAGE_ACCESSIBLE (atk_page));
+ if (ev_page_cache_is_page_cached (view->page_cache, page))
+ ev_page_accessible_initialize_children (EV_PAGE_ACCESSIBLE (atk_page));
+ else
+ g_signal_connect (view->page_cache, "page-cached",
+ G_CALLBACK (page_cached_cb),
+ atk_page);
+
return EV_PAGE_ACCESSIBLE (atk_page);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]