[WPE] Add Qt extension
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 13:07:38 +0000 (13:07 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 13:07:38 +0000 (13:07 +0000)
commit5ae69aef701acc055308251ae69739b6845c75c9
treed41bfb5f773246473063ac6483f84c1eb7a63269
parentbe75c605ab4dd9bb08951b0830080a88704f10b3
[WPE] Add Qt extension
https://bugs.webkit.org/show_bug.cgi?id=191464

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsWPE.cmake: Add ENABLE_WPE_QT_API CMake option. Disabled by default.

Source/WebKit:

This new extension is a QML plugin embedding a WPE ViewBackend
implementation. It provides a public API very similar to Qt's
WebView module. It comes with a simple mini-browser implemented in
QML.

QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
compositors) and EGLFS QPAs.

* PlatformWPE.cmake:
* UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
(WPEQmlExtensionPlugin::registerTypes):
* UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
* UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
(WPEQtView::WPEQtView):
(WPEQtView::~WPEQtView):
(WPEQtView::geometryChanged):
(WPEQtView::configureWindow):
(WPEQtView::createOffscreen):
(WPEQtView::backendCreated):
(WPEQtView::notifyUrlChangedCallback):
(WPEQtView::notifyTitleChangedCallback):
(WPEQtView::notifyLoadProgressCallback):
(WPEQtView::notifyLoadChangedCallback):
(WPEQtView::notifyLoadFailedCallback):
(WPEQtView::updatePaintNode):
(WPEQtView::url const):
(WPEQtView::setUrl):
(WPEQtView::loadProgress const):
(WPEQtView::title const):
(WPEQtView::canGoBack const):
(WPEQtView::isLoading const):
(WPEQtView::canGoForward const):
(WPEQtView::goBack):
(WPEQtView::goForward):
(WPEQtView::reload):
(WPEQtView::stop):
(WPEQtView::loadHtml):
(WPEQtView::jsAsyncReadyCallback):
(WPEQtView::handleJsResult):
(WPEQtView::runJavaScript):
(WPEQtView::mousePressEvent):
(WPEQtView::mouseReleaseEvent):
(WPEQtView::hoverEnterEvent):
(WPEQtView::hoverLeaveEvent):
(WPEQtView::hoverMoveEvent):
(WPEQtView::wheelEvent):
(WPEQtView::keyPressEvent):
(WPEQtView::keyReleaseEvent):
(WPEQtView::touchEvent):
* UIProcess/API/wpe/qt/WPEQtView.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
(configureCallback):
(WPEQtViewBackend::WPEQtViewBackend):
(WPEQtViewBackend::~WPEQtViewBackend):
(WPEQtViewBackend::configureGlibEglDisplay):
(WPEQtViewBackend::configureEglDisplay):
(WPEQtViewBackend::initialize):
(WPEQtViewBackend::backend const):
(WPEQtViewBackend::resize):
(WPEQtViewBackend::getTexture):
(WPEQtViewBackend::initSurface):
(WPEQtViewBackend::displayImage):
(WPEQtViewBackend::modifiers const):
(WPEQtViewBackend::dispatchHoverEnterEvent):
(WPEQtViewBackend::dispatchHoverLeaveEvent):
(WPEQtViewBackend::dispatchHoverMoveEvent):
(WPEQtViewBackend::dispatchMousePressEvent):
(WPEQtViewBackend::dispatchMouseReleaseEvent):
(WPEQtViewBackend::dispatchWheelEvent):
(WPEQtViewBackend::dispatchKeyEvent):
(WPEQtViewBackend::dispatchTouchEvent):
* UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
(WPEQtViewLoadRequest::WPEQtViewLoadRequest):
(WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
(WPEQtViewLoadRequest::url const):
(WPEQtViewLoadRequest::status const):
(WPEQtViewLoadRequest::errorString const):
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
(WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
(WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
* UIProcess/API/wpe/qt/qmldir: Added.

Tools:

MiniBrowser and API tests for the WPE Qt API. To run the
MiniBrowser a new script is introduced. Example invocation:

$ run-qt-wpe-minibrowser -platform wayland https://webkit.org

Also note-worthy is the introduction of the python2-subprocess32
dependency to run the GLib API tests.

* MiniBrowser/wpe/CMakeLists.txt:
* MiniBrowser/wpe/qt/CMakeLists.txt: Added.
* MiniBrowser/wpe/qt/main.cpp: Added.
(main):
* MiniBrowser/wpe/qt/main.qml: Added.
* MiniBrowser/wpe/qt/qml.qrc: Added.
* Scripts/run-gtk-tests:
(GtkTestRunner.is_google_test):
(GtkTestRunner):
(GtkTestRunner.is_qt_test):
* Scripts/run-qt-wpe-minibrowser: Added.
* Scripts/run-wpe-tests:
(WPETestRunner):
(WPETestRunner.is_google_test):
(WPETestRunner.is_qt_test):
* TestWebKitAPI/Tests/WPEQt/TestLoad.cpp: Added.
(TestLoad::main):
* TestWebKitAPI/Tests/WPEQt/TestLoadHtml.cpp: Added.
(TestLoadHtml::main):
* TestWebKitAPI/Tests/WPEQt/TestLoadRequest.cpp: Added.
(TestLoadRequest::main):
* TestWebKitAPI/Tests/WPEQt/TestRunJavaScript.cpp: Added.
(TestRunJavaScript::main):
* TestWebKitAPI/Tests/WPEQt/WPEQtTest.cpp: Added.
(waitForSignal):
* TestWebKitAPI/Tests/WPEQt/WPEQtTest.h: Added.
(LoadSpy::LoadSpy):
(LoadSpy::~LoadSpy):
(LoadSpy::onLoadingChanged):
(LoadStartedCatcher::LoadStartedCatcher):
(LoadStartedCatcher::~LoadStartedCatcher):
(LoadStartedCatcher::onLoadingChanged):
(waitForLoadSucceeded):
(waitForLoadFailed):
* TestWebKitAPI/glib/CMakeLists.txt:
* flatpak/flatpakutils.py:
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run_in_sandbox):
* flatpak/org.webkit.CommonModules.yaml:
* flatpak/org.webkit.WPE.yaml:
* flatpak/org.webkit.WPEModules.yaml:
* flatpak/org.webkit.WPEQT.yaml: Copied from Tools/flatpak/org.webkit.WebKit.yaml.
* flatpak/org.webkit.WebKit.yaml:
* glib/api_test_runner.py:
(TestRunner._run_test_qt):
(TestRunner.is_qt_test):
(TestRunner._run_test):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/PlatformWPE.cmake
Source/WebKit/UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/qt/qmldir [new file with mode: 0644]
Source/cmake/OptionsWPE.cmake
Tools/ChangeLog
Tools/MiniBrowser/wpe/CMakeLists.txt
Tools/MiniBrowser/wpe/qt/CMakeLists.txt [new file with mode: 0644]
Tools/MiniBrowser/wpe/qt/main.cpp [new file with mode: 0644]
Tools/MiniBrowser/wpe/qt/main.qml [new file with mode: 0644]
Tools/MiniBrowser/wpe/qt/qml.qrc [new file with mode: 0644]
Tools/Scripts/run-gtk-tests
Tools/Scripts/run-qt-wpe-minibrowser [new file with mode: 0755]
Tools/Scripts/run-wpe-tests
Tools/TestWebKitAPI/Tests/WPEQt/TestLoad.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WPEQt/TestLoadHtml.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WPEQt/TestLoadRequest.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WPEQt/TestRunJavaScript.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WPEQt/WPEQtTest.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WPEQt/WPEQtTest.h [new file with mode: 0644]
Tools/TestWebKitAPI/glib/CMakeLists.txt
Tools/flatpak/flatpakutils.py
Tools/flatpak/org.webkit.CommonModules.yaml
Tools/flatpak/org.webkit.WPE.yaml
Tools/flatpak/org.webkit.WPEModules.yaml
Tools/flatpak/org.webkit.WPEQT.yaml [new file with mode: 0644]
Tools/flatpak/org.webkit.WebKit.yaml
Tools/glib/api_test_runner.py