This was also done prior to commit 806cb44. I just assumed that now that we are back using the system’s named image stuff, we would benefit from their cache, but clearly we are not (especially file browser seemed sluggish because of (re)loading the file type images).
I moved it to a C header. An alternative would be to put some #ifdef’s around the Objective-C stuff in OakAppKit.h, but with the standalone header, it’s clear that this is the only thing we need from OakAppKit.
This code was using (the no longer there in the 10.7 SDK) GetPortBounds() to be able to render into a CGContextRef.
It was also using the private _NSGetCarbonMenu to be able to install the menu handler (that augmented the rendering).
This is using NSAttributedString’s NSTextTableBlocks:
* Font is determined from current menu rather than hardcoded
* Fixed: Invalid font size on bundle-item popup
* Fixed: Both tab triggers and key equivalents can co exists on single menu item
* No relayout calculations are needed after menu update (this is done automatically by NSLayoutManager when using NSTextTables)
* Uses 10.5 compatible API
When the last tab is closed the window will be kept open if the
file browser is shown. It will close the existing document and
replace it with a scratch document.