Re: language bindings



Bill Haneman wrote:

James said:

It shouldn't be too difficult to wrap the ATK API (another lib I just haven't got round to doing yet). One issue is that when selecting a python type to use as the wrapper for a GObject, it goes up the inheritance tree til it finds a type with an associated python wrapper. This doesn't take interfaces into account.

So it is possible that some objects returned by ATK functions will be wrapped with the GObject wrapper (which doesn't include any of the interface mixins), so won't be usable.


At the moment all implementors of ATK interfaces must derive from AtkObject, so as long as there is a binding for AtkObject we should be OK. (That is, until someone decides to implement Atk interfaces on something directly, without deriving from AtkObject).

I can provide an AtkObject binding quite easily. If all the objects returned by ATK would get the AtkObject wrapper class. However, we run into the same problem, as AtkObject doesn't actually implement any of the ATK interfaces, so the required methods would be missing on the wrapper classes.

By the way, if you want to ensure that all implementations of the ATK interfaces are derived from AtkObject, add a line like the following to the get_type() function for the interface:

   g_type_interface_add_prerequisite (type, ATK_TYPE_OBJECT);

Note that this will also mean that the interface types can be used as arguments for signals (as the prerequisite means instances of the interface are GObjects, so can be managed the same way as GObjects).

James.

--
Email: james daa com au
WWW:   http://www.daa.com.au/~james/







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]