XCB 准备好用于生产了吗?我应该使用 Xlib 吗?

发布于 2024-12-29 08:37:36 字数 138 浏览 2 评论 0原文

如果需要在不使用 GTK、QT 等的情况下对 X11 事件、窗口和输入进行低级别访问,应该使用 Xlib 或 XCB ?各自的优点和缺点是什么?

If one needs low level access to X11 events, windowing and input without using GTK, QT et al., should one use Xlib or XCB? What are the pros and cons of each?

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

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

发布评论

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

评论(2

花开半夏魅人心 2025-01-05 08:37:36

您可以同时使用它们。 XCB 使用起来更简单,对多线程环境有更好的响应,但缺乏文档,而 Xlib 是一个更过时/复杂的工具,有更好的文档记录和完全实现。

我目前正在研究 XCB API,最难的事情就是找到文档和好的 API 参考资料。

最后:如果你的目标是更快的开发,你应该使用 Xlib,否则 XCB 就意味着未来(但是但距离这样还很远)。

You can use both of them. XCB is simpler to use, has a better response to a multithread environment but lacks documentation, while Xlib is a more dated/complex tool, better documented and fully implemented.

I'm currently studying the XCB API and the hardest thing to do is to find docs and good API references..

In the end: if you aim to faster development, you should use Xlib, otherwise XCB is meant to be the future (but it's still far from being such).

悸初 2025-01-05 08:37:36

学习 XCB 时有帮助的是查看 X11 规范,例如这里 https ://www.x.org/releases/current/doc/xproto/x11protocol.pdf

大多数 XCB 调用直接映射到 X11 请求。对于扩展来说也是如此。

What helps when learning XCB is to look at X11 specification, for example here https://www.x.org/releases/current/doc/xproto/x11protocol.pdf

Most XCB calls map directly to X11 requests. The same is true for extensions.

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