GNOME Bugzilla – Bug 636060
use ATK_DEFINE_TYPE where possible
Last modified: 2011-09-05 04:14:21 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).
These widgets are GtkAssistant, GtkIconView, GtkSpinner and GtkSwitch.
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.
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.
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.
diffstat: gtk/gtkassistant.c | 166 ++++++++++++++++--------------------------- gtk/gtkspinner.c | 200 ++++++++++++++++++--------------------------------- 2 files changed, 134 insertions(+), 232 deletions(-)
Review of attachment 175474 [details] [review]: Looks good to me, lets commit these as soon as I've got 2.91.5 out
Review of attachment 175475 [details] [review]: Same here
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
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.
I believe this has been obsoleted by all the gail merge and cleanup work