Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebKitGTK+, GTK2, GTK3

I have some difficulty to understand what WebKit, WebKitGTK, GTK are with the different versions. Here is what I have so far :

  • WebKit is a library which contains both WebKit1 and WebKit2. Which one is called with this include #include <webkit/webkit.h>?

  • WebKitGTK 1.10.2 is the last version to depend on GTK2. Is it still maintained/developped?

  • Does it always need to be supported by GTK, Qt or some other toolkit? Or would it be possible to use it alone?

like image 814
Gradient Avatar asked Oct 30 '13 20:10

Gradient


2 Answers

You have to distinguish between version number and api level.

  • The version number is something like 1.10.2 or 2.2.1 - and that's it, just the version number - it has nothing to do with the GTK version or api level.
  • There are two different apis: webkit (webkit/webkit.h) and webkit2 (webkit2/webkit2.h). The main difference is that webkit2 uses a multi process architecture for the rendering, javascript and plugins instead of the single process architecture of webkit.

WebKitGTK+ can be compiled against either GTK+2 or GTK+3. This will result in library filenames like libwebkitgtk-1.0.so or libwebkitgtk-3.0.so, respectively. (This has nothing to do with the version of WebKit itself.) However, the webkit2 api depends on GTK+3 and the library filename is something like libwebkit2gtk-3.0.so.

WebKitGTK+ and the other ports implement stuff like:

  • drawing ui elements (checkbox, selectbox,...)
  • dialogs (file choose, download, http auth)
  • network communications (handling dns and http)
  • ...

You would need to implement this all by yourself if you want to avoid any available webkit port.

PS: WebKitGTK+ 2.x.x does still support GTK+2

like image 156
Ivaldi Avatar answered Nov 14 '22 07:11

Ivaldi


WebKitGTK is a "port", and yes you practically do need to pick one of the several ports, using webkit alone basically means writing your own port which is a massive job. On linux I would suggest going with WebKitGTK or QtWebKit.

WebKit and WebKit2 are two totally different web engine APIs that happen to live in the same source tree (that as a whole is also called WebKit) and use the same core components. The big difference is that WebKit2 splits web content handling to a different process -- I believe it's also the only one with serious development going on. You don't really need to choose between these two as the port has typically already made a choice: you just use the API the port provides. GTK+ port used to be on Webkit but should now use WebKit2 (but the Webkit API may still be there for now).

If 1.10.2 really was the last version to support GTK2 (note that I don't know if this is true), then I'm fairly sure it's not being developed further.

EDIT: On debian the library options are:

  • libwebkitgtk-1.0 2.2.0: Webkit1, GTK+ 2
  • libwebkitgtk-3.0 2.2.0: Webkit1, GTK+ 3
  • libwebkit2gtk-3.0 2.2.0: Webkit2, GTK+ 3

So it looks like GTK+ 2 is still at least somehow supported, but (at least on debian) you only get WebKit2 API with GTK+ 3. That option should be the most future-proof.

like image 35
Jussi Kukkonen Avatar answered Nov 14 '22 09:11

Jussi Kukkonen