XCB 准备好用于生产了吗?我应该使用 Xlib 吗?
如果需要在不使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以同时使用它们。 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).
学习 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.