Gtk/Cairo 中可能透明的 WebKit-Overlay?
我正在构建一个跨平台(Linux、Win、OS X)的应用程序,特别是通过 Cairo(mm) 进行图形处理,并由一点 GTK+ 脚手架支持(即 DrawingArea
)。我现在需要一些 UI 元素,这需要特定的自定义外观。理想情况下,它们还应该显示为透明覆盖(即 UI 的不同部分具有不同的不透明度)。
由于 GTK+ 很难定制(例如,我想要一个上面有建议列表的编辑字段),而我基本上完全知道如何使用 HTML/CSS 实现这一点,所以问题出现了:为什么不让 libwebkit 处理 UI 的事情呢?
我对 WebKit 没有太多经验,所以我需要知道的是:
- 我的上述推理对其他人有意义吗?
- CSS 具有不透明度,我可以以这样的方式连接 WebKit:它渲染到 RGBA 离屏表面上,并从 CSS 样式的布局处理继承 alpha 值吗?
- 即使 2. 不起作用,是否有人在屏幕外表面上使用过 libwebkit,据我所知,这需要重定向键盘和鼠标交互,可能通过 GTK+ 的规定?
I'm building an application, which is cross-platform (Linux, Win, OS X), and especially does graphics stuff via Cairo(mm), supported by a little bit of GTK+ scaffolding (i.e. DrawingArea
). I now need some UI elements, which require a certain custom look. Ideally they should also be displayed as transparent overlay (i.e. different opacities for different parts of the UI).
As GTK+ is hard to customize (e.g. I want an edit-field with the suggestion-list above it), and me basically exactly knowing how I'd achieve this with HTML/CSS, the question popped up: Why not just let libwebkit handle the UI stuff?
I don't have much experience with WebKit, so what I need to know is:
- Does my above reasoning make sense to anybody else?
- CSS has
opacity
, can I interface WebKit in such way that it renders onto an RGBA-offscreen surface, with alpha-values inherited from the layout-processing of the CSS styles? - Even if 2. would not work, has anybody used libwebkit on an offscreen surface, which AFAIK requires redirection of keyboard and mouse interactions, probably via GTK+s provisions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否可以渲染网页使用 WebKit 在清晰的背景上显示内容?
可能已经是最好的了。
Is it possible to render web content over a clear background using WebKit?
is probably as good as it gets.