ftp.nice.ch/pub/next/tools/screen/ScreenSaver.README

This is the README for ScreenSaver.NIHS.bs.tar.gz [Download] [Browse] [Up]

It's not that I don't like NeXT's new screen saver with the cube and the hostname, but I miss my floating login panel!  So I hacked the loginwindow app and the ScreenSaver.bundle to find out how it all works.  It's really very simple and I suspect that in 3.2 it will become a public interface so that people can write screen savers.  Actually it would make more sense to adapt BackSpace to provide the screen savers.  I guess time will tell what NeXT will do with it.  

Anyway, to write a screen saver bundle all you have to do is implement a class called ScreenSaver in a bundle that gets installed at /usr/lib/NextStep/loginwindow.app/ScreenSaver.bundle.  The ScreenSaver class has to, at least, responds to 2 methods:  startScreenSaver and stopScreenSaver.  Everything else is up to the ScreenSaver.bundle.  The bundle gets loaded dynamically by name and is then sent the start and stop messages at the appropriate times.  One tricky thing is that the startScreenSaver message gets sent at regular intervals based on what the TimeToDim default is.  That is, if you have a TimeToDim default set to 60 (seconds), your ScreenSaver class will get called EVERY 60 seconds.  This just means that you have to manage some state within the ScreenSaver class to tell whether you should really do anything or not in response to this message.  That's it.  Pretty simple, huh?

It really looks like this stuff was only half way implemented when 3.1 shipped.  NeXT should do a couple things to make this a usable interface:

1.  Use a default to specify what screen saver to load.
2.  Use NXBundle's 'primaryClass' method to determine the controlling class, so you can guarantee no class name conflicts
3.  Document it!

On cs.orst.edu and nova.cc.purdue.edu, I've submitted MovingLoginPanel.compressed.  It contains the ScreenSaver.bundle and the source to this simple screen saver.  To install it, rename your existing ScreenSaver.bundle to something else and copy the bundle into /usr/lib/NextStep/loginwindow.app.  Adjust you TimeToDim default to whatever you want and make sure that you have ScreenSaverEnabled set to YES.  You'll have to restart the loginwindow app so log out of the WorkSpace and type exit for the user name, that should do it.  

Enjoy!  

Paul Marcos
marcos@kaleida.com

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.