[Pyobjc-dev] Automatically wrapping frameworks
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-20 16:32:48
|
On Wednesday, November 20, 2002, at 02:19 AM, Ronald Oussoren wrote: > That said, I'd like to build a module or script to build a template > from wrapping yet another Objective-C class library. I don't think it > would be usefull to use 'AddressBook = > Foundation.Python.GenerateModuleForBundle("AddressBook")' as a > replacement for 'import AddressBook' There are two kinds of 'automatic wrapping' possible and thing there is some confusion as to who is referring to which type. First, 'automatic wrapping' can be something that replaces 'import AddressBook'. For Objective-C APIs, we already have this -- simply load the framework as a bundle via load_bundle (soon loadBundle) and use the APIs directly. This is effectively how the AddressBook wrapper is currently working outside of it being included as a module within the objc project. Easy to do, but doesn't include support the various enumerated types and global variables found in the framework. The second kind of 'automatic wrapping' would effectively generate a distutils based project that included the automatically generated source that, when compiled, would produce a module that contained the various exported references that can only be accessed via a compiled module [the various globals and C functions, etc... though, also containing a wrapping of the enumerated types is useful in that a simple recompile will pick up any changes to the types]. The first can be done on the fly on any machine.... the second requires the dev tools and is really more appropriate for developers looking to wrap existing frameworks. Both very useful but, in general, only the second will be able to fully wrap an existing framework automatically. b.bum |