Thursday, February 03, 2005

The smoky pit of ProKit

I discovered some interesting things buried in my Mac the other night.

I was poking around in the Frameworks (/System/Library/Frameworks/) looking for some indication of how the Finder sets the menu policy. Ever since OS X 10.0.0 came out, I’ve been interested in how the Apple (er, NeXT) engineers converted the floating vertical NeXTStep menus to the top-of-the-screen Mac menus in such a short time. Recall that in the early days of OS X, there was a hidden preference for turning back on the NeXT look and feel.

Anyway, I wasn’t successful in gaining any knowledge about that, but I did find some other cool stuff, which brings us, finally, to the meat of the post.

Not long ago Daring Fireball posted about the new look and feel of Apple’s media applications (it’s the last item on the page). Us longtime Mac users are getting a little bewildered by the constant L&F changes that have been coming with OS X, especially coming from a company that was so preoccupied with UI consistency that they originally burned the UI toolkit into ROM. But that’s another story.

Anyway, I found the bits and pieces that make up the “Media UI” on my machine. And it wasn’t at all like I thought it would be.

Look in /System/Library/PrivateFrameworks/ProKit.framework/Resources/ and you’ll find a bunch of files that apparently make up the new UI. Many of the files look like gibberish (“3f229972612431b0e11cc095b7ef4d09”) – hex code for something, but my efforts at de-hexing the string resulted, naturally, in ANSI gibberish.

Curious about what was inside them, I dragged one onto TextWrangler; blessed TW, it obediently rendered an image – turns out the gibberish files are the images that make up the ProKit (Media) UI.

Wishing to see the file’s guts, I cracked one open in emacs and discovered that it is a Photoshop file. So I made a copy, appended “.psd” onto the end and the Finder obediently provided a preview image – of a scrollbar with the down button pressed. I opened it in Photoshop and lo! five neatly organized layers of various states: inactive, normal, pressed, etc.

So the Mac OS is rendering layered Photoshop files as part of the UI? I would have expected TIFFs, given the NeXT history.

Not sure what use this is, but it’s interesting to know it’s there. Perhaps the real scoop is that TextWrangler renders .psd files, I don’t know.


Post a Comment

<< Home