busy-bee.net buzz buzz buzz goes the honeybee home | blog | links | about me

linux to an imac

2002-07-31 13:00 / apple don't let you write pagers (yet?)  »

Well, I spent quite a few hours over the weekend trying to write myself a pager (virtual desktop navigator). Unfortunately, it isn't possible without reverse engineering OS X's 'Core Graphics System' - there is no published way to either (a) get the process owner of a window (the current unpublished way, I think, it was trial and error with the parameters on my part, being EXTERN_API (OSErr) CPSGetWindowOwner(int windowNumber, ProcessSerialNumber* PSN);), or (b) modify (move, resize, NSAffineTransform) a window that your process did not create. As, for instance, the dock does. Without these two functions, we just have the one app per workspace pager, each app with all its accompanying windows.

This does make me wonder just how worth my $20 CodeTek's thing below might be. After all, these apis <apple-voice-of-authority>can and will change</apple-voice-of-authority>. I extremely doubt the current version will work with jaguar. I also doubt that I can GPL anything I might come up with as well, if it depends on all this secret stuff.

Maybe I should've actually read my OS X license before publishing this (bear in mind that a google search for the function above currently brings up nothing; and I spent *hours* scouring the web and, um, using nm, to find out just half of what I needed to know).

Anyway, the consequence of all this - that there will be no legitimate fully-functioning open-source pagers or future-proof closed source ones until Apple either deems them worthwhile enough to write one themselves or else they finalise the Quartz/CGS api - is disappointing. Unless someone can tell me otherwise, that is.

This page leads to some nice CGS stuff though (used to be on a .mac account, this is a copy): CGSPrivate.h, e.g. CGSGetConnectionIDForPSN, CGSGetWindowList.

mod_perl -- Speed, Power, Scalability