在嵌入式环境中使用html渲染器 [英] Use a html renderer in an embedded environment

查看:244
本文介绍了在嵌入式环境中使用html渲染器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我将为嵌入式设备设计一个GUI,并且会喜欢使用HTML。



要求:




  • 网页必须呈现为内存缓冲区。然后我会将内存缓冲区传输到显示器。


  • 我必须通过回调或事件通知渲染引擎需要提取新项目。 HTML页面,图像等。这样做的原因是我必须获取资源并将其提供给渲染引擎(原因是设备在所有配置中没有TCP / IP,然后需要获取该项目串行线,并且为了安全,我需要验证请求是允许的)。


  • 我必须能够注入鼠标和键盘事件到渲染引擎。


  • 只有C和/或C ++


  • 到只存在于win / linux / mac的库。


  • 小的占用空间和内存消耗,我可能会得到10MB的空间和5-10 MB分配的内存。


  • 欢迎使用开源和商业解决方案。

    >我不需要完整的HTML5和CSS3支持,我的意思是如果我可以使用基本的HTML和一些CSS我很高兴。




我看过一些WebKit,chrome,gecko,berkelium和awesomium,但是没有真正发现它们符合我的需要。



在那里接近我需要什么?或者我应该放弃这个想法,并以其他方式构建GUI?非常感谢任何帮助!

解决方案

好问题!事实证明,在这个空间有几个选项,和你猜测,其中许多是基于Webkit。其中一些不是,而那些是我认为你最感兴趣的。



链接



最简单的0级浏览器,可以满足您的需求是图形版本的链接Web浏览器。它是适当的跨平台(诚然,您将需要从 Cygwin Windows环境中的一些库),开源,携带小内存脚本,以及其某些分叉或增强的形式(例如, Elinks )具有增强的功能,如JavaScript支持,全鼠标



当然,它是用C写的。



Konqueror / Embedded



探索此空间内的其他一些选项, Konqueror / Embedded 是将来要考虑和观看的东西。是的,它是基于Qt / Embedded和Webkit( mumble mumble ),但他们的目标是提供一个苗条的版本的浏览器和他们的库堆栈特别满足这一需求。再次,Windows将是这里奇怪的孩子,但它是可行的。



Fennec



最后一个跨平台选项是Mozilla Firefox, Fennec 。虽然提供了更大的代码库,Mozilla正在非常积极地处理其嵌入版本,并且您可以提供的任何帮助非常感谢。从我的理解,纤薄的版本仍然是前alpha( Fennec,然而,生活在),但是



和其他人探索



除了目前在此空间中竞争的网络浏览器的范围,专有选项(例如 ANT Galio 也可能满足您的需求。它似乎有很多其他专有解决方案,但大多数(例如, Internet Explorer移动版 Mobile Safari )只服务少数平台。



SpliFF还提供了一个基于Webkit的好的,专有的跨平台解决方案,在他的回答中的出色建议:请尝试 libRocket 。他建议,轻量级,跨平台,目前和积极维护,方便您加入,提供您寻求的自动化案例。在这种情况下,为了更方便,它使用C ++编程,并使用 Python绑定






总之,根据您的需求,您仍然需要评估选项的优势,弱点和API规格以上所列。



我建议从Links开始,因为它是最强大,功能最强大的选项,同时在非常小的内存占用和代码库上进行优化。它最大的优点是,这是一个从一开始的设计目标,整个代码树是用这种设计理念构建的。



请让我们知道你在做什么对于。这是社群中常见的需求,我相信其他人会从您的体验中受益。


I'm working on a project where I will design a GUI for an embedded device and would love to go with HTML for this. I hope you guys can help me find a render engine that suits my needs.

Requirements:

  • The web-page must be rendered into a memory buffer. I will then transfer the memory buffer to the display.

  • I must be notified though callback or event that the render engine need to fetch a new item. HTML page, image, etc. The reason for this is that I must fetch the resource and feed it to the render engine (the reason is that the device does not have TCP/IP in all configurations and will then need to fetch the item over serial line, and also for security I need to validate that the request is allowed).

  • I must be able to inject mouse and keyboard events into the rendering engine.

  • Only C and/or C++

  • Must be easily portable and lack dependencies to libraries that only exist for win/linux/mac. The device I have runs a custom OS...

  • Small footprint and memory consumption, I can probably get away with 10MB footprint and 5-10 MB allocated memory during rendering. But not much more.

  • Both open source as well as commercial solutions are welcome

  • I do NOT need full HTML5 and CSS3 support, I mean if I can use "basic HTML and some CSS" I'm more than happy.

I have looked at some WebKit, chromium, gecko, berkelium and awesomium but not really found that they fit my needs.

Is there anything out there that comes close to what I need? Or should I just give up this idea and build the GUI in some other way? I appreciate any help!

解决方案

Good question! It turns out there are a few options within this space, and as you've surmised, many of them are based on Webkit. Some of them aren't, though, and those are the ones that I believe you're most interested in.

Links

The simplest, 0th-level browser that's going to meet your needs is the graphical version of the Links web browser. It's suitably cross-platform (admittedly, you will require some of the libraries from Cygwin for Windows environments), open source, carries a small memory footprint, and in some of its forked or enhanced incarnations (for example, Elinks), has enhanced functionality like Javascript support, full mouse functionality, and the bells and whistles that you desire in your problem statement.

Of course, it's written in C.

Konqueror/Embedded

Exploring some of the other options within this space, Konqueror/Embedded is something to consider and watch in the future. Yes, it is based on Qt/Embedded and Webkit (mumble mumble), but they're aiming to provide a slimmed down version of both their browser and their library stack to meet this need specifically. Once again, Windows is going to be the odd child out here, but it's workable.

Fennec

One last cross-platform option to explore is the slim version of Mozilla Firefox, Fennec. While providing a much larger code base, Mozilla is working on its embedded version very aggressively, and any help you can provide here would be greatly appreciated. From what I understand, the slimmed version is still pre-alpha (Fennec, however, lives on), but it should become a workable option in the future.

And a Gamut of Others to Explore

In addition to the gamut of web browsers currently competing in this space, proprietary options like ANT Galio may also meet your needs. It seems there are many other proprietary solutions out there, but the majority of them (for example, Internet Explorer Mobile, Mobile Safari) only service a small number of platforms. Good, proprietary, cross-platform solutions that aren't based on Webkit seem to be quite rare.

SpliFF also offered an excellent suggestion in his answer: try libRocket. As he recommends, it's lightweight, cross-platform, currently and actively maintained, easy for you to hook into, and provides for the automation cases that you seek. In this case, it's programmed in C++, with Python bindings for additional convenience.


In conclusion, given your needs, you'll still need to evaluate the strengths, weaknesses, and API specifications for the options listed above.

I recommend starting with Links, because it's the most feature-rich and robust option while optimizing on a very small memory footprint and codebase. Its biggest strength is that this was a design goal from the outset, and the entire code tree is built with this design philosophy in mind.

Do let us know what you go for. This is a common enough need in the community that I'm sure others will benefit from your experience.

这篇关于在嵌入式环境中使用html渲染器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆