且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

屏幕保护程序如何在 Mac OS X 和 Linux 上工作?

更新时间:2023-11-14 12:45:28

OSX中的屏保系统是屏保(通常,但不一定)是一个Objective-C库,扩展了一个基类来实现绘图等方法、首选项窗格、预览模式等.

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.

虽然 Objective-C 是预期的语言,但将 Objective-C API 后面的 C/C++ 实现耦合在一起非常简单.

While Objective-C is the language expected, it is straightforward enough to couple together a C/C++ implementation behind the Objective-C API.

有一个 API(桥梁)允许其他语言与 Objective-C API 互操作.例如,here 用于允许使用 Python 编写的 OSX 屏幕保护程序.我想类似的方法对 Mono 来说是可行的.

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 现在主要在 OSX 上开发,并在那里使用 OSX 屏幕保护程序 API 和其他东西X11.

xscreensaver is now developed mostly on OSX, and uses the OSX screensaver API there and something else on X11.