After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728673 - AtkComponent is not implemented for pages
AtkComponent is not implemented for pages
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-21 18:36 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2014-04-25 05:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (4.74 KB, patch)
2014-04-21 18:36 UTC, Joanmarie Diggs (IRC: joanie)
reviewed Details | Review
proposed patch (4.60 KB, patch)
2014-04-22 11:56 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2014-04-21 18:36:02 UTC
Created attachment 274831 [details] [review]
proposed patch

The default AtkComponent interface will largely JustWork(tm) -- if there is a minimal implementation (namely atk_component_get_extents).
Comment 1 Carlos Garcia Campos 2014-04-22 10:53:52 UTC
Review of attachment 274831 [details] [review]:

::: libview/ev-page-accessible.c
@@ +1075,3 @@
+	ev_view_get_page_extents (view, self->priv->page, &page_area, &border);
+
+	doc_rect = ev_rectangle_new();

Use a stack allocated rectangle instead.

@@ +1080,3 @@
+	doc_rect->x2 = page_area.x + page_area.width;
+	doc_rect->y2 = page_area.y + page_area.height;
+	atk_rect = _transform_doc_rect_to_atk_rect (self->priv->view_accessible, self->priv->page, doc_rect, coord_type);

This could return the transformed rect as an out parameter (like view methods do) and you could use a stack allocated rectangle for the return value as well.

::: libview/ev-view-accessible.c
@@ +503,3 @@
 }
+
+EvRectangle*

EvRectangle* -> EvRectangle *

@@ +504,3 @@
+
+EvRectangle*
+_transform_doc_rect_to_atk_rect (EvViewAccessible *accessible,

Why does this need to be here? it's only used in ev-page-accessible, couldn't it be a static function there? or are there other places where we could reuse this?
Comment 2 Joanmarie Diggs (IRC: joanie) 2014-04-22 11:06:25 UTC
Thanks for the review! I'll do the first two things you mention, but in answer to this:

(In reply to comment #1)

> @@ +504,3 @@
> +
> +EvRectangle*
> +_transform_doc_rect_to_atk_rect (EvViewAccessible *accessible,
> 
> Why does this need to be here? it's only used in ev-page-accessible, couldn't
> it be a static function there? or are there other places where we could reuse
> this?

Not can; will. That bit came out of bug 728475 (which I'm still chipping away at). But all objects (tagged pdf elements, images, form fields, links ...) will need to implement atk_component_get_extents.
Comment 3 Joanmarie Diggs (IRC: joanie) 2014-04-22 11:56:25 UTC
Created attachment 274882 [details] [review]
proposed patch
Comment 4 Carlos Garcia Campos 2014-04-23 16:26:46 UTC
Review of attachment 274882 [details] [review]:

Ok.
Comment 5 Joanmarie Diggs (IRC: joanie) 2014-04-25 05:15:10 UTC
Comment on attachment 274882 [details] [review]
proposed patch

Thanks!

Since it only touches the a11y code, I committed it both to master and the gnome-3-12 branch. Hope that's ok. If not, please let me know.