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 720095 - Adding a method atk_object_peek_parent would be really convenient.
Adding a method atk_object_peek_parent would be really convenient.
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: atk
unspecified
Other Linux
: Normal normal
: ---
Assigned To: ATK maintainer(s)
ATK maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-12-09 09:53 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2013-12-09 17:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add atk_object_peek_parent (4.64 KB, patch)
2013-12-09 10:30 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
none Details | Review
atk_object_peek_parent (4.75 KB, patch)
2013-12-09 11:09 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review

Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-12-09 09:53:30 UTC
Right now you can set the parent of an atk object using atk_object_set_parent.

Default implementation of atk_object_set_parent is return the object assigned on set_parent. But on most toolkit implementors, the implementation is usually checking if there is a parent assigned with set_parent, and then fallback on custom methods on that toolkit. In most cases that initial check is checking if accessible_parent on the object structure is different to NULL. Something that is not really object-oriented, more if we take into account that we plan to create a private structure with that (bug 647488). On webkitgtk they are trying to bypass that using peek_class_parent, in order to use atk_object_get_parent implementation at AtkObject. But that seems like an overkill.

It would be more simpler and more API clean to just add a method atk_object_peek_parent. Additionally, this method would not require an equivalent virtual method.
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-12-09 10:30:21 UTC
Created attachment 263805 [details] [review]
Add atk_object_peek_parent

Review of the patch, specifically about the wording on the new added documentation is welcome.
Comment 2 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-12-09 11:09:56 UTC
Created attachment 263809 [details] [review]
atk_object_peek_parent

Added some extra documentation on atk_object_peek_parent, to mention that is a utility method for ATK implementors. For the pov of an AT, peek_parent is not useful at all. Or in other words: this method will not have an equivalent on atspi.
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-12-09 17:11:12 UTC
Comment on attachment 263809 [details] [review]
atk_object_peek_parent

Committed after IRC review by Joanmarie Diggs