How does screen savers work on Mac OS X and Linux?

巧了我就是萌 提交于 2019-12-03 20:12:37

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!