What's New in 0.2.1
-
Panther compatibility.
The new version allows unmodified applications to run on both Panther and older versions of Mac OS X. By default, "pure Perl" applications written for CB do not care what version of Perl the CB framework is linked to. (Obviously you can override this behavior with Perl's "require" statement, or by bundling binary modules with your app.)
Another aspect of Panther compatibility is a change in namespace. Apple has chosen to use the Foundation namespace for their own PerlObjCBridge module. This isn't much of a problem, as the likelihood that you'll ever need both tools in a single program isn't very high. Regardless, the preferred "use" statement to import Cocoa functions is now "use CamelBones qw(:All);", rather than the longer four-line set of "use" statements found in older versions. The older variation is still supported for compatibility's sake, but generates some warnings in your system log.
-
Automatic class wrappers.
Previous versions created Perl wrappers only for specified Objective-C classes. This meant you had to create and use wrapper modules for any classes that you added to your project, or classes added to newer versions of Cocoa.
Wrappers are now created automatically for all loaded and registered Objective-C classes. When a bundle is loaded dynamically, CB is automatically notified and creates new wrappers for Objective-C classes found in it, as well.
-
Extended module search path.
The module search path - @INC, the list of directories Perl will search when it finds a "use" statement - has been extended. Previously, the "Resources/" directory in all loaded frameworks and bundles was searched. This has been extended to include version- and architecture- specific subdirectories.
For example, when using the default Perl on Panther, directories named "Resources/5.8.1/darwin-thread-multi-2level/", "Resources/5.8.1/", and "Resources/" are added for each loaded framework and bundle. (This includes, of course, the .app bundle.)
What this means is that you can include XS modules in your apps. Because XS modules are specific to a particular version of Perl, you'll need to create the appropriate version & architecture subdirectories for each of the combinations you want to support. At minimum, that probably means the standard "5.6.0/darwin" and "5.8.1/darwin-thread-multi-2level" combinations shipped by Apple, but you can include as many as you'd like.
Naturally, the traditional directories are also searched for modules, if the requested module isn't found as a Resource. Users who don't have one of the Perl configurations supported by your app can still use it, by installing the required module by way of the usual "CPAN Dance."
This approach allows you to cover all your bases. Non-technical end users who are using the standard Apple-provided Perl won't be faced with the challenge of installing a Perl module, and the technically-savvy still have the flexibility to use any Perl they want.
-
Support for void* pointers
C-style pointers to void are now supported, and passed to Perl as integer values stored in scalars. Using these pointers is illustrated in the RendezvousBrowser example. For each service that's found, the network information for connecting to it is passed as an NSData object that holds a C sockaddr struct. The example uses NSData's -bytes method to get a (void*) pointer to this struct, and uses pack() and unpack() to get at the data elements inside of it.
Even if you never use pointers, you'll be happy to know that this also silences the "unsupported argument type" warnings that appear when sheets are used. ;-)
-
GNUstep Makefile support.
This is the beginnings of full support for GNUstep. The CB framework is no longer built with Apple tools; instead, it uses the GNUstep Makefiles package and the 'make' tool. This provides much more flexibility, and allows for easier collaborative development than the version-specific PB/Xcode .pbprj files formerly used.
To expand on that last point a little: Apple's Project Builder & Xcode environments are very nice to work in, and they've gone to great lengths to ensure that they can be used to create applications that are compatible with older versions of Mac OS X. Unfortunately, the project files are not so portable; as soon as Xcode touches a .pbprj file, it "upgrades" it to a format that older PB releases can't use very well. This isn't an issue for tightly-managed teams where every developer is using the same tools; for open-source development where a variety of tool versions might be in use, it presents a problem.
As stated above, however, this is just an early step. The CB framework and the Renaissance example application both build without error on my Linux/GNUstep system, but the result won't run. Also, applications built this way have to be opened with the command-line 'openapp' tool - neither the standard 'open' tool nor a double-click in the Finder will run them successfully. The GNUstep Makefile package is an optional install, and at this point it's included primarily for those who want to hack on and/or compile the framework itself.
Note that this doesn't mean that the application templates and other Project Builder/Xcode additions are going away. This is an additional option, not a replacement.
-
GNUstep Renaissance.
As a similar measure in the spirit of providing more options, the GNUstep Renaissance framework is included as an optional install. This framework allows GUI elements to be created from an XML file, rather than from the traditional NIB. Although the included example app uses the GNU Makefile package and the command-line 'make' tool, Renaissance can also be used from Project Builder/Xcode.
-
New applications and examples.
Several new example applications have been added. Several - BrowserSample, Data Access, FileViewer, OutlineSample, Renaissance, SheetsAndDrawers, and Timer - are intended to illustrate a specific technique or API. Others - TicTacToe and RendezvousBrowser - are complete applications.
ShuX has also been extensively updated, with multiple windows, hyperlinks, and a new hierarchical Finder-like interface.
-
Web site update.
Last, but not least, is the feature you're looking at right now: A major web site overhaul with an "Aqua" look and feel by Alex Robinson.
