EWebKit
What is EWebKit?
Also known as WebKit-EFL, this is the port of WebKit to our technologies. In order to keep it general and as independent as possible it uses (directly) a small subset of EFL libraries: Evas, Ecore and Edje. Complex non-HTML elements such as menus are delegated by means of callbacks that one should implement as desired, probably using Elementary as Eve does.
The network backend can use both CURL or libSoup, the later brings on dependency on glib.
We also have a wiki page at WebKit's official trac: http://trac.webkit.org/wiki/EFLWebKit
Source & Development
Unlike all other EFL libraries, !EWebKit is not developed in our SVN. Given that WebKit itself is quite fast evolving project, replicating its huge codebase here and keep it in sync would be a major problem.
The development happens in WebKit's SVN and uses their coding style. See http://webkit.org/building/checkout.html for more information. One can checkout their repository with (note: it's close to 1Gb as it includes every port and test):
svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit
As the official repository is a bit too big and susceptible to breakages, we do regular snapshots that are known to build and work. The snapshot includes just our code and no tests, thus much smaller (around 12Mb):
Also note that unlike rest of EFL we do not use autoconf/automake as our build system. We do use cmake as it's much faster and easy to maintain for such huge project that may take hours to build.
Dependencies, Build and Installation Instructions
See official WebKit at http://trac.webkit.org/wiki/EFLWebKit
Code Example
Usage is pretty much like any other Evas_Object
#include <Ecore.h> #include <Ecore_Evas.h> #include <Evas.h> #include <EWebKit.h> /* EWK_DATADIR is the output of: pkg-config --variable=datadir ewebkit */ #define EWK_THEME EWK_DATADIR"/themes/default.edj" int main(int argc, char *argv[]) { Ecore_Evas *window; Evas *evas; Evas_Object *browser; if (argc != 2) return 1; evas_init(); ecore_init(); ecore_evas_init(); ewk_init(); /* we need to initialize EWebKit as well! */ window = ecore_evas_new(NULL, 0, 0, 800, 600, NULL); if (!window) return 1; evas = ecore_evas_get(window); if (!evas) return 1; /* create an evas object for our browser */ browser = ewk_view_single_add(evas); /* set theme so buttons, radios and others work */ ewk_view_theme_set(browser, EWK_THEME); /* load an URL */ ewk_view_uri_set(browser, argv[1]); /* focus to send keyboard events */ evas_object_focus_set(browser, 1); evas_object_resize(browser, 800, 600); evas_object_show(browser); ecore_evas_show(window); ecore_main_loop_begin(); ewk_shutdown(); ecore_evas_shutdown(); ecore_shutdown(); evas_shutdown(); return 0; }
Compile with:
gcc -o test-ewebkit test-ewebkit.c \ $(pkg-config --cflags --libs ewebkit ecore-evas ecore evas) \ -DEWK_DATADIR="\"$(pkg-config --variable=datadir ewebkit)\""
See Lucas De Marchi's post: http://www.politreco.com/2010/10/easily-embedding-webkit-into-your-efl-application/
TODO
Our port is quite complete, missing couple of less often used features. Anyhow the major missing features at the moment are:
- Plugins (Flash): missing. Need to be done properly for EFL using offscreen rendering of plugin contents, what is complex;
- Exposure of DOM: DOM is not exposed and you cannot directly access web page nodes. However one can request javascript to be executed in the page, thus enabling basic DOM manipulation by indirect means;
- Exposure of Editor controls;
- Copy & Paste;
- Drag & Drop.
