Resolution independence is a fine idea, but there's the pesky issue of exactly how to draw all those user interface widgets using more pixels. When resolution independence finally arrives in 2008 (or whenever), will the Mac OS X UI be drawn entirely using infinitely scalable vector art? That'd sure solve the problem of where to get all those extra pixels, but I'm not a fan of this approach. How about simply including huge bitmaps for each interface element, relying on the traditional bitmap scaling mechanisms to draw them at the smaller sizes? That'd work fine, but it does seem kind of wasteful to use giant bitmaps for thing like line art and basic shapes which are oh-so-compactly represented by vectors.
Hey, what do we have here lurking under
/System/Library/PrivateFrameworks in Leopard? Why, it appears to be a new framework:
CoreUI.framework. Whatever could that be for? Surprise! Every piece of the user interface in Leopard is being drawn in an entirely new way that incorporates the best of the bitmapped and vector styles.
Let's take a look at the moving parts. Core UI draws each piece of the user interface based on a series of XML "recipes" that describe the structure and features of each element, referencing pieces of art stored as separate resources files within the framework bundle. Here are just a few example recipes:
/System/Library/PrivateFrameworks/ CoreUI.framework/Resources/AquaUI.bundle/Contents/Recipes/ checkbox.xml disclosurebutton.xml disclosuretriangle.xml menu.xml menubar.xml progressindicator.xml pushbutton.xml radiobutton.xml roundbutton.xml scrollbars.xml splitter.xml syncarrow.xml ...
Note the storage location: the Core UI framework contains other bundles which in turn contain the recipes and resources. It's hard not to look at this arrangement as a kind of theming engine in the tradition of Kaleidoscope, ShapeShifter, and of course Apple's own Appearance Manager... albeit an engine that's closed to outsiders and likely to change in the future. But still, it's quite a departure from the comparatively inflexible approach to drawing the UI used in Tiger and earlier. At the very least, the new recipe/resource structure lays bare the components that make up what's shown on the screen.
Take the humble checkbox, for example. The
checkbox.xml file is a dizzying 2,800+ lines long, most likely created by Apple's long-rumored (to those paying attention) in-house Core UI theming tools. It references a figure named
checkmark, represented in the
Resources directory by the
In that same directory you'll also find various "material" bitmaps. Here are two examples (scaled down from their actual 398x398 pixel sizes):
Keep in mind that these are not giant radio buttons; bitmaps like these are used as texture sources for widgets of all shapes and sizes.
Finally, here's what a checkbox looks like in Leopard at various scale factors.
You can see how this all starts to come together. Browsing through the full set of resources reveals an unsurprising division of labor between big bitmaps (PNGs) and vector graphics (PDFs). Anything that looks like line art or is a basic shape is done with vectors. The "lickable" bits, on the other hand, are still represented by (presumably hand-tweaked) bitmaps, usually in very large sizes. In particular, the way Core UI constructs the various shiny Aqua widgets using a suite of "materials" bitmaps—some for highlights, some for backgrounds, and so on—is a nice way to conserve memory while still using hand-drawn art.
So what does this all mean for Mac OS X? Well first, it means that Apple is ramping up for resolution independence. We knew that already, but it's still nice to see how far along things are. Remember, even at the default (1.0) scale factor that Leopard will ship with, all the UI widgets you see are being drawn by Core UI. This wasn't always the case. Earlier Leopard seeds only used Core UI at scale factors greater than 1.0, falling back to the old way for 1.0. The move to using Core UI everywhere shows some confidence in the technology.
Core UI also means that Apple is well-positioned to deliver the radical change to Mac OS X's appearance that I longed for in Leopard. Core UI is certainly not a general-purpose engine capable of creating any appearance an artist can dream of. It's clearly focused on creating Aqua-like appearances, with baked-in support for things like drop shadows and highlights. But the general approach of using XML recipes to compose vector and bitmap resources is a sound one that will last Apple a very long time, well into the coming age of resolution independence.