A little more on resolution independence

After a bit more digging around, I’ve basically found two major apps that sit at either end of the RI-ready spectrum. First off, Safari seems to be very well prepared for when the RI switch is flicked (just need to sort out those Bookmark bar triangles!):
safari.png
(click to enlarge)

Notice how the button style actually changes: at 72 dpi, the buttons are more metallic than at 216 dpi (above) where they have a more “Aqua-esque” appearance.

iTunes, on the other hand, is just “magnifying” its entire interface rather than using genuine scaling. It’s also using Tiger-style window widgets:
itunes-widgets.png
(click for full screenshot; 2180 × 1652)

So, all in all, a decidedly mixed bag…

Preview GPS tag support

I’m sure this has been mentioned elsewhere, but I was a bit curious as to why the Leopard version of Preview (version 4.0) has an about box containing a link to a NASA webpage:

Preview 4.0 about box

All is revealed when you open a photo that contains geographical tags (longitude and latitude) in the Exif data. Such tags can be added using a program like Geotagger (requires Google Earth) or may be added automatically by the very few available cameras with built-in GPS.

So here’s what it looks like when such tags are in place (the image, incidentally, is of my alma mater, Trinity College, Cambridge):
preview-geotag.jpg
(click to enlarge)

Conveniently, pressing the Locate button at the bottom of the Inspector window opens the location in Google maps.

The map image itself is actually stored deep within the System folder, specifically in the ImageKit framework resource folder: /System/Library/Frameworks/Quartz.framework/Versions/A/
Frameworks/ImageKit.framework/Versions/A/Resources.

This isn’t that interesting in and of itself, but there are in fact 12 map images (each 600 x 300 pixels) in that folder, each portraying the earth with differing amounts of snow coverage! Are these maps used anywhere else in Leopard? The Time & Date preferences panel has yet another map of the world in the TimeZone.prefPane bundle, so they’re not used there…

CoreUI

I’ve been away for a few days, so I’m a bit behind on some of the newly-discovered Leopard goodies, but one of the most impressive revelations I’ve noticed is CoreUI which, as it happens, follows on nicely from my previous post on the state of resolution independence in Leopard.

Core UI is a private Apple framework that appeared in Leopard and can be found here: /System/Library/PrivateFrameworks/CoreUI.framework. The copyright information for the framework reads “© Apple, 2005” so it would seem that it’s something Apple engineers have been working on for the majority of Leopard’s development cycle. And understandably so.

In the framework’s Resources folder, there are two bundles (AquaUI.bundle and LeopardUI.bundle), a couple of binary files (ArtFile.bin and SArtFile.bin) and the usual framework paraphernalia. The two bundles each contain two folders named Resources and Recipes along with the usual “bundley” files Info.plist and version.plist.

Contained within each of the two folders is something quite brilliant: Recipes contains XML-formatted definitions of pretty much every standard UI element in the OS and Resources contains a combination of PDFs and PNGs to support the “recipes”. The PDFs and PNGs are mostly textures and arrows, in various colours and directions respectively. Here’s an image of the contents of the Resources folder (courtesy of IKImageBrowserView!):
coreuiaquaresourcessmall.png
(click to enlarge)

The XML “recipes” are quite incredible, describing each UI element in exquisite detail. The files contain such elements as “outsideShadowBlurRadius”, “inlayMaterialName” and “figureBlendMode”. As an example, the file “scrollbars.xml” has an element named “subnodes” that has the following child elements: arrows, columnsizer, thumb and track. Each of these child elements in turn have their own “properties” child elements which define the appearance of each part of a scrollbar (in both regular and mini sizes).

The immediate question that sprung to my mind was how, exactly, these files were created. And I think an Apple patent filed on December 21st 2006 answers this question nicely. The patent is titled “Resolution Independent User Interface Design” and starts with the following abstract:

Graphical user interface material map objects are specified by a collection of attribute-value pairs, the collection of which comprises a complete description of the material map and may be used by a rendering engine to create a visual representation of the material map at any resolution.

The whole patent is linked to above, but here’s the best screenshot taken from it, showing Apple’s (currently private) program for designing resolution independent interface elements:
interfacedesigner.jpg
(click to enlarge)

Just from this screenshot, we can see that the interface offers up a lot of the power of Quartz and Core Image when creating new interface elements including opacity, blend modes and custom lighting. I assume that the XML widget definitions in Leopard were made using some incarnation of this application and I’d like to think that Apple will eventually release it to developers who might currently be fretting over the best tools for making their apps resolution independent.