Cocoa Code

From time to time, I like to give a little bit back to OS X's vibrant developer community. Here are some of the things I've released, and be sure to watch my blog for occasional Cocoa tidbits!

MBTableGrid

An NSControl subclass (along with some supporting classes), which represents a typical spreadsheet control. Includes column and row reordering and drag and drop functionality. Best of all? It's painstakingly documented! Check it out, and be sure to let me know if you have any feature requests or problems! Includes a (basic) sample app.

MBTableGrid sample application

NSWindow+MBGenieEffect

Category on NSWindow which provides a Cocoa interface to Carbon's TransitionWindow() function, enabling the use of the "Genie Effect" on Cocoa windows. Adds the following methods to NSWindow:

- (void)orderFront:(id)sender usingGenieTransitionFromRect:(NSRect)originFrame; - (void)makeKeyAndOrderFront:(id)sender usingGenieTransitionFromRect:(NSRect)originFrame; - (void)orderOut:(id)sender usingGenieTransitionToRect:(NSRect)finalFrame; - (void)addChildWindow:(NSWindow *)childWindow ordered:(NSWindowOrderingMode)orderingMode usingGenieTransitionFromRect:(NSRect)originFrame; - (void)removeChildWindow:(NSWindow *)childWindow usingGenieTransitionToRect:(NSRect)finalFrame;

Important bug to note: When hiding a window, the window briefly draws in its old location after the transition completes. Any help in getting this resolved is welcome at my email.

Miscellaneous Code

The following are the various scripts or other miscellaneous snippets which aren't directly applicable to Cocoa.

DoxyClean

A Python script which, with the help of several XSLT stylesheets, transforms the XML output from Doxygen to be easier to read and parse, as well as more geared towards Objective-C. With an optional -h flag, the script will also convert the XML to XHTML in the same format as Apple's AppKit documentation.

Example: Original HTML Output, DoxyCleaned HTML

This script is a very early work in progress. The cleaned XML currently does not retain some features of Doxygen, most notably cross-linking of classes and inheritance diagrams. I will slowly be adding features back into the script, but for now, it is a decent way to format your documentation similarly to Apple's.

If you make any modifications to the script, please email them to me, and if they're useful enough, I'd love to incorporate them into future versions of the script.