[Pythonmac-SIG] Carbon bindings' future (was: Re: eliminating appscript-triggered Dock icon)
Ronald Oussoren
ronaldoussoren at mac.com
Wed Apr 9 07:56:47 CEST 2008
On 3 Apr, 2008, at 15:46, has wrote:
>
>
>> One of the nice things of the current Carbon bindings
>> is that a large portion of the API is just there and you probably
>> don't have
>> to write C code when you want to use an API.
>>
>> Sadly enough that's only true of API's that were present in OS9, but
>> the
>> idea stands: it would be nice to have complete bindings to the bits
>> of
>> Carbon that still make sense.
>
> Yes, although I'd repeat my earlier suggestion that the most
> economically viable way to provide Carbon bindings would be to create
> ObjC wrappers for the Carbon APIs of interest. That way, any language
> with ObjC bindings, not to mention ObjC itself, can take advantage of
> these bindings for no extra effort.
I'm far from convinced that this is true. The bridgesupport tools
don't target Objective-C exclusively but can also be used to wrap C
API's. The only problem w.r.t. Carbon might be the arcane memory-
management rules of Carbon. I'm not sure if that's relevant for the
non-GUI bits of Carbon. Even then it should be possible to extend the
bridgesupport tools a little with annotations that tell bridges that a
specific type is a Carbon-style handle.
Even fixing bgen isn't that much work, once you understand the code.
The problem is that bgen is a nearly vertical learning curve and Jack
seems to be the only person that understands enough of bgen to be able
to hack on it. I'm definitely in favor of ditching bgen and moving
toward PyObjC-based wrappers.
Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2224 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20080409/8c14b884/attachment.bin
More information about the Pythonmac-SIG
mailing list