How to use WebKitGtk+

download How to use WebKitGtk+

If you can't read please download the document

Transcript of How to use WebKitGtk+

PowerPoint Presentation

How to use WebKitGtk+

(Joone Hur)

2012. 1.281st GNOME Tech Talks, GNOME Korea Community

Who am I?

WebKit Committer ([email protected])

Working for Collabora (http://collabora.com)

Working on WebKitGtk+, WebKit-Clutter

WebKitGtk+

WebKitGTK+ is the GNOME platform port of the WebKit rendering engine.

Offering WebKit's full functionality through a set of GObject-based APIs

GTK+ widget

What Uses WebKitGtk+?

GNOME Browser (Epiphany)

Midori

DevHelp

Evolution

GNOME Shell

Amazon Kindle

Current Version

Stable versionWebKitGTK+ 1.6.1 (2011.9.28)

Development VersionWebKitGTK+ 1.7.4 (2012. 1.16)

WebKitGTK+ 1.6.1

The JavaScriptCore library is now installed independently as "libjavascriptcoregtk", and it comes with its own pkg-config file.

New DOM methods exist to check if editable areas have been modified by the user (webkit_dom_html_{input,text_area}_is_edited).

A few new spell checking APIs are added, which make implementing spell checking in a user agent much easier. - Added API to set local storage database path.

GTK+ 3.x is now the default toolkit for WebKitGTK+. GTK+ 2 is considered deprecated now and we will stop supporting it in future releases, so please try to move to GTK+3 in the near future.

The JavaScriptCore library is now installed independently as "libjavascriptcoregtk", and it comes with its own pkg-config file. This allows linking to JavaScriptCore without WebKitGTK+.

New DOM methods exist to check if editable areas have been modified by the user (webkit_dom_html_{input,text_area}_is_edited). A typical usecase for these APIs is to warn the user if they are leaving a page without submitting a form.

A few new spell checking APIs are added, which make implementing spell checking in a user agent much easier. - Added API to set local storage database path.

GTK+ 3.x is now the default toolkit for WebKitGTK+. GTK+ 2 is considered deprecated now and we will stop supporting it in future releases, so please try to move to GTK+3 in the near future.

WebKitWebView is a GtkWdiget

GObject +----GInitiallyUnowned +----GtkWidget +----GtkContainer +----WebKitWebView

#ifdef GTK_API_VERSION_2G_DEFINE_TYPE(WebKitWebView, webkit_web_view, GTK_TYPE_CONTAINER)#elseG_DEFINE_TYPE_WITH_CODE(WebKitWebView, webkit_web_view, GTK_TYPE_CONTAINER, G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, 0))#endif

Dependency

gtk+

libsoup

cairo & pango

fontconfig

FreeType2

libxml

Optional dependency

libxslt

sqlite

gstreamer

gstreamer-plugin-base

enchant

geoclue

Applications can use fontconfig in two ways:

by querying it for the available fonts on the system, or

by asking it for a font matching certain parameters (pattern). Fontconfig will then return a font whose properties match those specified in the pattern as closely as possible.

Architecture

Class Overview

WebKitWebView The central class of the WebKitGTK+ API

WebKitWebFrame The content of aWebKitWebView

WebKitWebSettings Control the behaviour of aWebKitWebView

WebKitWebBackForwardList The history of aWebKitWebView

WebKitWebHistoryItem One item of theWebKitWebBackForwardListand or global history

WebKitWebNavigationAction Object used to report details of navigation actions

WebKitWebPolicyDecision Liason between WebKit and the application regarding asynchronous policy decisions

WebKitGeolocationPolicyDecision Liaison between WebKit and the application regarding asynchronous geolocation policy decisions

WebKitNetworkRequest The target of a navigation request

WebKitNetworkResponse the response given to a network request

WebKitWebInspector Access to the WebKit Inspector

WebKitWebDatabase A WebKit web application database

WebKitWebResource Represents a downloaded URI.

WebKitDownload Object used to communicate with the application when downloading.

WebKitViewportAttributes Represents the viewport properties of a web page

WebKitHitTestResult The target of a mouse event

WebKitSoupAuthDialog ASoupSessionFeatureto provide a simple authentication dialog for HTTP basic auth support.

WebKitWebWindowFeatures Window properties of aWebKitWebView

WebKitWebView signal

create-web-viewweb-view-readyclose-web-viewnavigation-requestednew-window-policy-decision-requestednavigation-policy-decision-requesteddownload-requestedload-startedload-committedload-progress-changedload-errorload-finishedonload-eventtitle-changed

geolocation-policy-decision-requested

Code Example

http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html

Build and Run

gcc -o run main.c `pkg-config webkitgtk-3.0 --cflags --libs`

GObject DOM bindings

Access to DOM APIs through native GObjectlayer

Demo

WebKitGtk+ GObject Introspection

Demo

Next topic?

WebKit2Gtk+