7. Problems
• Communication between WebKit and OS is Qt-
bound
• Hard to trace callings of QtWebKit bridge
• QtWebKit signal-slot bridge has memory
management issue
• Hard to handle cases where function returns object
• JavaScript binding cause endless code bloating
• sync calling is more friendly than Ajax
8. New Design
Unify OS and App
WebKit
call_app call_app
pub/sub pub/sub
OS App
collection of apps collection of apps
9. WebKit -> OS
var tray = new SystemTrayIcon();
tray.show();
SystemTrayIcon.prototype.show = function()
{
// POST onering://systray/show
// with body: {"id": "12345678"}
ONERING.call_app("systray", "SystemTrayIcon.show")
}
13. Pros
• small core
• app could be Qt independent
• explicit and flexible js binding interface
• less memory management issue
• easy to trace
14. Cons
• extra layers
• URL dispatch to C++ code
• JSON <--> C++ object
• slightly more code and slower
15. Future: Plugin
• Every app can be considered as a plugin
• plugin: js + (optional) native code
• /onering-plugins/systray.dll (or directory)
• auto discovery and load
• plugin repository and community