In Windows a screen saver is just an executable with a .scr extension dumped in the system32, and it is controlled with three switches (/p, /c and /s, I think).
How does screen savers work on Mac OS X and Linux? Do they work similarly in Mac OS X and Linux (Gnome, KDE, Ubuntu, or wherever the difference is) or is it completely different?
Also, can they be developed in C#/Mono?
For X11, I'm pretty sure you can target xscreensaver and have it work in GNOME. Not sure about KDE. But xscreensaver has long been the dominant package on Linux.
IIRC, the programming model for xscreensaver is that you write it as any old app that draws an X window. Then it can be invoked with "
-root
" and it should draw on the root window. But that's probably not all there is to it.The xscreensaver FAQ seems to suggest that GNOME and KDE each have their own screensaver frameworks. But the Wikipedia article for gnome-screensaver says it's a wrapper for xscreensaver.
The screensaver system in OSX is that a screensaver (typically, but not necessarily) is an Objective-C library, extending a base class to implement methods such as drawing, a preference pane, a preview mode and so on.
There is a good tutorial on writing them here.
While Objective-C is the language expected, it is straightforward enough to couple together a C/C++ implementation behind the Objective-C API.
There is an API (a bridge) to allow other languages to inter-operate with Objective-C APIs. This is used, for example, here to allow OSX screen savers written in Python. I imagine a similar approach is feasible for Mono.
xscreensaver is now developed mostly on OSX, and uses the OSX screensaver API there and something else on X11.