Gnome JavaScript 文档

发布于 2024-12-14 16:28:25 字数 146 浏览 0 评论 0原文

我正在尝试深入 Gnome shell 扩展开发,但目前我有点困惑。 我似乎找不到有关 GJS 库的正确文档。例如,我想至少知道哪些导入可用以及类的成员/方法,否则我只能依赖现有的扩展代码,而不是太多。

有人能引导我走向正确的方向吗?

提前致谢。

I'm trying to dive into Gnome shell extensions development but I'm a little bit confused at the moment.
I can't seem to find a proper documentation about GJS library. For example I want to know at least what imports are available and members/method of classes without that I can only rely on existing extensions code, not too much.

Can anyone lead me in the right direction?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

絕版丫頭 2024-12-21 16:28:27

要开始编写 GNOME Shell 扩展,我建议您开始查看 Shell 扩展 wiki 页面。在那里您可以找到教程和指南的链接。

对于可用的模块,您可以通过 GObject Instrospection 获得所有可用的内容。为了熟悉这一点,您可以查看解释的演示。有关 API 文档,您可以访问平台概述

To start writing GNOME Shell Extensions, I would recommend you to start looking the Shell Extensions wiki page. There you will find links to tutorials, as well as guidelines.

With respect to modules available, you have everything that is available via GObject Instrospection. In order to get familiar with this, you can take a look the explained demos. For API docuementation, you can go to Platform Overview.

软甜啾 2024-12-21 16:28:27

我自己不是专家,但根据我修补扩展的经验,大多数实用程序都基于 Clutter,其中 GObject Introspection 将 API 公开给 JavaScript。不幸的是我找不到 shell 本身的 API 文档。我能得到的最接近的是位于 /usr/share/gnome-shell/js/ 的 shell 的 JavaScript,这(对我来说)已经足够了,因为扩展可能会在运行时修改 JavaScript 对象,而不是调用它的函数。

Not an expert myself, but based on my experience patching an extension, most of the utility are based on Clutter in which GObject Introspection expose the API to JavaScript. Unfortunately I cannot find the API documentation for the shell itself. The closest I can get is the JavaScript for the shell at /usr/share/gnome-shell/js/ which (for me) is quite enough as an extension would probably modify JavaScript object at runtime rather than calling it's function.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文