屏幕保护程序如何在 Mac OS X 和 Linux 上工作?
在 Windows 中,屏幕保护程序只是一个转储到 system32 中的带有 .scr 扩展名的可执行文件,它由三个开关(我认为是 /p、/c 和 /s)控制。
屏幕保护程序如何在 Mac OS X 和 Linux 上工作?它们在 Mac OS X 和 Linux(Gnome、KDE、Ubuntu 或任何有区别的地方)中的工作方式相似还是完全不同?
另外,它们可以用 C#/Mono 开发吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OSX中的屏幕保护程序系统是,屏幕保护程序(通常但不一定)是一个Objective-C库,扩展基类来实现诸如绘图、首选项窗格、预览模式等方法。
此处有一个关于编写它们的很好的教程。
虽然 Objective-C 是我们所期望的语言,但将 Objective-C API 背后的 C/C++ 实现结合在一起是足够简单的。
有一个API(桥梁)允许其他语言与Objective-C API 进行互操作。例如,此处使用它来允许使用 Python 编写的 OSX 屏幕保护程序。我想类似的方法对于 Mono 来说是可行的。
xscreensaver 现在主要在 OSX 上开发,并使用 OSX 屏幕保护程序 API 和 X11 上的其他内容。
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.
对于 X11,我非常确定您可以定位 xscreensaver 并让它在 GNOME 中工作。不确定 KDE。但 xscreensaver 长期以来一直是 Linux 上的主导软件包。
IIRC,xscreensaver 的编程模型是像任何绘制 X 窗口的旧应用程序一样编写它。然后可以使用“
-root
”调用它,并且它应该在根窗口上绘制。但这可能还不是全部。xscreensaver FAQ 似乎表明 GNOME 和 KDE 都有自己的屏幕保护程序框架。但是关于 gnome-screensaver 的维基百科文章说它是 xscreensaver 的包装。
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.