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 636060 - use ATK_DEFINE_TYPE where possible
use ATK_DEFINE_TYPE where possible
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
2.99.x
Other Linux
: Normal trivial
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-11-29 13:27 UTC by Christian Persch
Modified: 2011-09-05 04:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a11y: Use ATK macros and clean up/1 - GtkAssistant (7.89 KB, patch)
2010-11-29 15:44 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
a11y: Use ATK macros and clean up/2 - GtkSpinner (8.95 KB, patch)
2010-11-29 15:44 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Christian Persch 2010-11-29 13:27:03 UTC
There are a few widgets in gtk+ that have their a11y implemented directly and not in gail. Their gtk_foo_accessible_get_type() code is just boilerplate that can be replaced by ATK_DEFINE_TYPE([_WITH_CODE] if they implement other a11y interfaces too).
Comment 1 Christian Persch 2010-11-29 13:29:15 UTC
These widgets are GtkAssistant, GtkIconView, GtkSpinner and GtkSwitch.
Comment 2 Emmanuele Bassi (:ebassi) 2010-11-29 15:44:22 UTC
Created attachment 175474 [details] [review]
a11y: Use ATK macros and clean up/1 - GtkAssistant

ATK provides macros to the same effect as G_DEFINE_TYPE; using these
macros has the advantage of removing tons of duplicated code and
reducing the maintainership burden.

The widgets with inline accessibility implementation should switch to
these macros, and clean up the code.
Comment 3 Emmanuele Bassi (:ebassi) 2010-11-29 15:44:27 UTC
Created attachment 175475 [details] [review]
a11y: Use ATK macros and clean up/2 - GtkSpinner

ATK provides macros to the same effect as G_DEFINE_TYPE; using these
macros has the advantage of removing tons of duplicated code and
reducing the maintainership burden.

The widgets with inline accessibility implementation should switch to
these macros, and clean up the code.
Comment 4 Emmanuele Bassi (:ebassi) 2010-11-29 15:45:57 UTC
GtkSwitch has already been ported.

GtkIconView will require some more code than a simple port.

these patches are "blind": I haven't tested them with A11Y set up. functionally, they should be equivalent - given that the ATK_DEFINE_TYPE macro expands to the previous code.
Comment 5 Emmanuele Bassi (:ebassi) 2010-11-29 15:46:35 UTC
diffstat:

 gtk/gtkassistant.c |  166 ++++++++++++++++---------------------------
 gtk/gtkspinner.c   |  200 ++++++++++++++++++---------------------------------
 2 files changed, 134 insertions(+), 232 deletions(-)
Comment 6 Matthias Clasen 2010-11-29 19:20:57 UTC
Review of attachment 175474 [details] [review]:

Looks good to me, lets commit these as soon as I've got 2.91.5 out
Comment 7 Matthias Clasen 2010-11-29 19:21:23 UTC
Review of attachment 175475 [details] [review]:

Same here
Comment 8 Emmanuele Bassi (:ebassi) 2010-11-30 02:09:57 UTC
Attachment 175474 [details] pushed as e7966a2 - a11y: Use ATK macros and clean up/1 - GtkAssistant
Attachment 175475 [details] pushed as 781d4fa - a11y: Use ATK macros and clean up/2 - GtkSpinner
Comment 9 Emmanuele Bassi (:ebassi) 2010-11-30 02:31:59 UTC
ugh, I've been to overeager with git-bz -- GtkIconView is still missing

also, it would be good to move the common code of the factory type registration inside the get_accessible() implementation into its own function; it's been copy-pasted into four widgets. maybe just having it private to gtk+ -- though moving it to atk would probably be the best long-term solution.
Comment 10 Matthias Clasen 2011-09-05 04:14:21 UTC
I believe this has been obsoleted by all the gail merge and cleanup work