More about GAIL

In one of the old bugs related to GAIL you can find that:

“In general we don’t want to export the other gail headers, since the implementation details of how ATK is provided for specific widgets is not something we want to require bincompat for, nor do we want these interfaces, in general, to be used externally (other than the ones in libgail-gnome).”

This sounds pretty well. Anyway, this paragraph has a “but”. The reporter (Bill Haneman, one of GAIL’s fathers), opened the bug in order to make public the GailWidget header, as it is a real useful class.

On one of my previous posts, I said that although you have an anonymous (run-time) inheritance from GAIL, this can’t solve the problem that without the header you can’t redefine the virtual methods of a GAIL object without reimplement it, or make something really hackish.

Well, now I found another problem with this: GtkAdjustment. The a11y support on GtkAdjustment is implemented on the object GailAdjustment. But as you normally don’t require direct a11y support for this widget, this class is used as an aux class for classes like GailRange (GtkRange). Soooo, in the end, the current implementation of GAIL doesn’t define a concrete GtkAdjustment factory.

Conclusion: if you want to use GailAdjustment outside Gtk+, you can’t do that using the “indirect subclassing method”, so if you want that, you need to reimplement it, or just C&P the code. And this is funny, because normally with the C&P anti-pattern you get two similar problems fixed with two similar solutions (the original code and his copy). In this case, with exactly the same problem, you get two similar (equal) solutions (the original and his copy).

Leave a Reply

Your email address will not be published. Required fields are marked *