{"id":12,"date":"2007-11-23T19:14:27","date_gmt":"2007-11-23T17:14:27","guid":{"rendered":"http:\/\/blogs.igalia.com\/apinheiro\/2007\/11\/23\/playing-with-gail\/"},"modified":"2007-11-23T19:14:27","modified_gmt":"2007-11-23T17:14:27","slug":"playing-with-gail","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/apinheiro\/2007\/11\/playing-with-gail\/","title":{"rendered":"Playing with GAIL"},"content":{"rendered":"<p>These past weeks I have spent some time taking a look to <a href=\"http:\/\/library.gnome.org\/devel\/gail-libgail-util\/stable\/\">GAIL<\/a>, the Gnome Accessibility Implementation Library, taking a look at the <a href=\"http:\/\/developer.gnome.org\/projects\/gap\/guide\/gad\/\">gnome accessibility guides<\/a>, and to an interesting framework related to that, <a href=\"http:\/\/people.redhat.com\/zcerza\/dogtail\/\">dogtail<\/a> ( it will be cool to make GUI testing for <a href=\"http:\/\/www.fisterra.org\">fisterra<\/a>, eh? :P).<\/p>\n<p>I took a litle to the code and play a little with it. One of the things you can see is that almost all the interfaces are private (the headers are not installed with the library). So if you make a custom subclass of any gtk widget you haven&#8217;t got access to his accessibility object to extent. But you don&#8217;t <a href=\"http:\/\/developer.gnome.org\/projects\/gap\/presentations\/GUAD3C\/making-apps-accessible\/custom-widget-basics.html\">don&#8217;t have to reinvent the wheel<\/a>, as there are a way to workaround it, as you can do an <a href=\"http:\/\/developer.gnome.org\/projects\/gap\/presentations\/GUAD3C\/making-apps-accessible\/anonymous-inheritance-1.html\">anonymous (run-time) inheritance from GAIL<\/a>.<\/p>\n<p>Ok, so, no problem no? Well, I don&#8217;t think so (IMHO). With this solution you can obtain the parent type, and extend it using <i>g_type_register_static<\/i>. But, what happens if you have an abstract class, with any virtual abstract functions? In theory, the concrete subclasess requires to implement this functions. But how can do that if you haven&#8217;t got the parent definition (on the header)?<\/p>\n<p>You can think: but it is unlikely to happen. Well, this is not very common, but it happens: <i>GailRendererCell<\/i> define two virtual elements: <i>property_list<\/i> and <i>update_cache<\/i>. This add the accessibility for <i>GtkCellRenderer<\/i>. This has some subclasses, that defines it: <i>GailTextCell<\/i>, <i>GailBooleanCell<\/i> and <i>GailImageCell<\/i>. <\/p>\n<p>IMHO it is really common to make a <i>GtkCellRenderer<\/i> subclass, as you could want a custom cell rendering. So, what happens if you want to create a custom library with widgets (or something similar), and some try to extent it? How do you redefine this virtual elements?<\/p>\n<p>You could do some hacks, like use directy the gail source to access to the libraries (it is free software, you know? \ud83d\ude09 ), or create a custom header with the structures you require to redefine it. But this last is a really dirty hack, in fact, a copy&amp;&amp;paste hack, with all problems of sync, and others related with the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Copy_and_paste_programming\">anti-pattern copy and paste<\/a>.<\/p>\n<p>Conclusion: in my opinion, the gail interfaces, or at least some of them, <a href=\"http:\/\/bugzilla.gnome.org\/show_bug.cgi?id=490174\">should be exposed<\/a><\/p>\n<p>Well, I have found other &#8220;particularities&#8221; on gail code, but this can be exposed on the next post<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These past weeks I have spent some time taking a look to GAIL, the Gnome Accessibility Implementation Library, taking a look at the gnome accessibility guides, and to an interesting framework related to that, dogtail ( it will be cool to make GUI testing for fisterra, eh? :P). I took a litle to the code &hellip; <a href=\"https:\/\/blogs.igalia.com\/apinheiro\/2007\/11\/playing-with-gail\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Playing with GAIL&#8221;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9,13],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-a11y","category-gnome","category-igalia"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":0,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}