Apr 2006

MacOS X Web Screensaver

A screensaver that will display your favorite Web page.

Whilst doing some graphics and layout work on Watershed's public display system (the screens at the top of the stairs) I thought it would be useful for staff to have the daily What's On information displayed on their computers. A screensaver looked to be a good idea:

  • We already had, not only the data, but formatted and layed out for display.
  • The public screens are very simillar a screensaver - non-interactive content is displayed in a sequence.
  • The public screens are built using standard HTML, CSS & Javascript making the content easy to display.
  • The content updates and refreshes itself. The application displaying the content does not have to interact with the content in any way.

One evening, on the train home, I quickly built a screensaver that would load and display the content.

The Web content you wish to display must change itself. This can be done usins a meta refresh tag, Javascript timers (AJAX calls work well) or using a simple HTML wrapper around QuickTime, Flash or Shockwave content. Obviously user events, such as mouse & keyboard (this being a screensaver), are not passed to the HTML.

Download

Requires MacOS X 10.3 or later. Download .dmg file

Redistribution and Usage

Redistribution is permitted but please give Watershed Media Centre with an engineering credit and include a link to the homepage at www.watershed.co.uk in either a splash screen or Read Me file. The software is provided 'as is' and is unsupported. If you use the screen saver, then please send us an email (benjamin@watershed.co.uk) because we are interested in any use it receives.

How to configure the screensaver

The screensaver just needs a full, absolute URL to operate. It will not currently work with a relative URL for content distributed inside the screensaver bundle. The URL is stored in a plist file inside the .saver bundle.

  1. Open the .saver bundle by ctrl-clicking the icon and select Show Package Contents from the contextual menu that is displayed.
  2. Open the Info.plist file, that is inside the Content folder, in either a text editor or Apple's Plist Editor.
  3. Change the value of the WSHDWebLocation key to the location of yout content. Ensure you have included the http:// protocol prefix.
  4. Save changes and double click to install.
|

Universal Binary Widget

The Watershed What‘s OnWidget is now a Universal Binary

We have a few MacOS X applications, written against the Cocoa frameworks, that are used internally. Until very recently we didn't have any Intel Macintoshes. No problem so far.

In his keynote at WWDC 2005, Steve Jobs announced that Intel Macintoshes would ship by summer 2006 and almost all developers assumed this meant shipping in summer 2006. So when Apple announced the new Core Duo iMac and MacBook Pro in January it was a bit of a surprise. Still the only 'native' Macintosh software that was anything near public was a Dashboard Widget. Widgets are primarily HTML, CSS & Javascript. No problem so far.

The Widget started out as an experiment/toy not long after the first developer previews of Tiger were released in 2004. Almost all of the work was done and the Widget had been hanging around for over a year with no work done on it. A link(commented out) has been present in the Accessing Calendar Data page in the Watershed site since the site's redevelopment.

Unfortunately, the Widget uses a couple of plug-ins to provide some of its functionality:

  • a widget plug-in, Watershed Utilities, is used to bridge Javascript into the Address Book;
  • a webkit browser plug-in, RippleSelector, displays the thumbnails and draws the Core Image ripple transitions.

The Widget, not being a 'standard' desktop application, had escaped my attention when looking for projects that needed to be re-built as Universal Binaries.

I didn't envision any problems building the Universal versions of the plug-ins as Apple had advised that in most cases it was just a checkbox tick. The WatershedUtilities plug-in re-built and worked as advertised. The RippleSelector plug-in was a little more trouble. I should explain that the build-run-debug cycle was slightly more convoluted than usal:

  1. compile and link on my PPC PowerBook
  2. install the plugin into a Widget bundle in my public folder
  3. walk across the office to Maddie's Core Duo iMac
  4. launch Dashboard and the Widget from my mounted public folder
  5. wait for the Widget to launch, get the SOAP results and crash

Eventually I tracked down the problem to a method that dealt with calculating the layout and positions of the thumbnails in the view. The method -(int)batchCount; calculates the number of batches required to display all the thumbnails and.contains a line something like:

if (batchVolume % [items count])...

The number of events is rarely 0, apart from Christmas Day, Boxing Day... and the time window between when the plug-in is first drawn to the screen and when the results of the Javascript XMLHttpRequest SOAP call are returned. This isn't a problem because zero events means zero batches required. Exept when running on an Intel chip; zero batches means crash.

So the moral of this story is:
/0
ppc - OK
i386 - BAD

The Universal Binary version of thc Watershed widget is fixed now and can now be downloaded.

|

odds&ends…
Benjamin Miller