Calling C++ from JavaScript / HTML using GTK+ Webkit Webview (and Qt WebKit bridge) -
i evaluating different approaches / solutions call c++ functions javascript code embedded in html page. application must run on ubuntu server 12.04 lts.
i not expert in linux based development. first time trying work on interface between javascript , c++ code.
the c++ code resides in .so files ( dynamic libraries) provide interface methods access hardware , file system. gui needs in html , searching different solutions possible can call c++ html. searched , ended deciding try 2 approaches, both using webkit engine.
approach 1: using qt 5.0.2 webkit bridge - webview control
gui framework on qt framework, main application window contain webview control run html code in turn contains javascript code.
interface between web page , c++ done using addtojavascriptwindowobject() function.
i created sample application , tested solution , seems works fine.
approach 2: using gtk+ webkit webview
downloaded , installed gtk 3.0 library.
got webkitgtk 2.0.1 , have installed it.
have created test application gtk without webkit, works well.
trying create webkit webview control using gtk.
when trying approach 1 qt, there quite set of documentation , samples wanted to. after starting approach 2 using gtk+, feel moving slower comparitively. feel documentation part not straight forward kind of application trying develop.
other approaches:
want try check if either using applets (to call .so files directly) or using v8 javascript engine interface between javascript , c++ viable options(https://code.google.com/p/v8/)
i have tried following resources:
http://webkitgtk.org/
http://www.webkit.org/
https://live.gnome.org/webkitgtk/programmingguide/tutorial
i want know how interface part of calling c++ functions (in .so files) when button clicked in html web page containing javascript. kind of signal supposed for. if using webkitwebview control, how map button click c++ function?
can point me right direction?
i appreciate time , knowledge.
regards.
if need use c++ code or native applications in web application can try create service on c++ code , access throught rest (for example) api.
you can use common web application framework (spring/java, django/python, etc.) develop web application , use apache thrift interface library.
Comments
Post a Comment