From ec7b2ee70a8b2db7fb87f50671a001ddd54697b0 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 15 Nov 2013 14:21:17 +0100 Subject: Add an intermediate Qt5WebEngine module library. Make the WebEngine QtQuick plubin library a library only that fetches the API privatly from the official module. This will allow an experimental plugin library to also have access to the API classes, which it currently can't since the plugins aren't deployed the same way as module to /lib. The module currently only export classes privately but the plan is to make this library the official linking point of entry for applications along with the Qt5WebEngineWidgets module. The WebEngineCore library could eventyally be merged into this module library if we can get gyp to play well with qmake. Change-Id: I5edb60b412e213b59f791a7b8df9f28c295502de Reviewed-by: Andras Becsi --- lib/qtwebenginecoreglobal.h | 56 +++++++++++++++++++++++++++ lib/qtwebengineglobal.h | 56 --------------------------- lib/quick/plugin.cpp | 64 ------------------------------- lib/quick/plugin/plugin.cpp | 64 +++++++++++++++++++++++++++++++ lib/quick/plugin/plugin.pro | 13 +++++++ lib/quick/plugin/qmldir | 3 ++ lib/quick/qmldir | 3 -- lib/quick/qquickwebengineview_p.h | 3 +- lib/quick/qquickwebengineview_p_p.h | 3 +- lib/quick/qtwebengineglobal.h | 60 +++++++++++++++++++++++++++++ lib/quick/qtwebengineglobal_p.h | 64 +++++++++++++++++++++++++++++++ lib/quick/quick.pro | 14 ++++--- lib/render_widget_host_view_qt_delegate.h | 2 +- lib/web_contents_adapter.h | 2 +- lib/web_contents_adapter_client.h | 2 +- 15 files changed, 275 insertions(+), 134 deletions(-) create mode 100644 lib/qtwebenginecoreglobal.h delete mode 100644 lib/qtwebengineglobal.h delete mode 100644 lib/quick/plugin.cpp create mode 100644 lib/quick/plugin/plugin.cpp create mode 100644 lib/quick/plugin/plugin.pro create mode 100644 lib/quick/plugin/qmldir delete mode 100644 lib/quick/qmldir create mode 100644 lib/quick/qtwebengineglobal.h create mode 100644 lib/quick/qtwebengineglobal_p.h (limited to 'lib') diff --git a/lib/qtwebenginecoreglobal.h b/lib/qtwebenginecoreglobal.h new file mode 100644 index 000000000..3ad62b4b9 --- /dev/null +++ b/lib/qtwebenginecoreglobal.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QTWEBENGINECOREGLOBAL_H +#define QTWEBENGINECOREGLOBAL_H + +#include + +#ifndef QT_STATIC +# if defined(BUILDING_CHROMIUM) +# define QWEBENGINE_EXPORT Q_DECL_EXPORT +# else +# define QWEBENGINE_EXPORT Q_DECL_IMPORT +# endif +#else +# define QWEBENGINE_EXPORT +#endif + +#endif // QTWEBENGINECOREGLOBAL_H diff --git a/lib/qtwebengineglobal.h b/lib/qtwebengineglobal.h deleted file mode 100644 index a9069f962..000000000 --- a/lib/qtwebengineglobal.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QTWEBENGINEGLOBAL_H -#define QTWEBENGINEGLOBAL_H - -#include - -#ifndef QT_STATIC -# if !defined(QT_BUILD_WEBENGINEWIDGETS_LIB) && defined(BUILDING_CHROMIUM) -# define QWEBENGINE_EXPORT Q_DECL_EXPORT -# else -# define QWEBENGINE_EXPORT Q_DECL_IMPORT -# endif -#else -# define QWEBENGINE_EXPORT -#endif - -#endif // QTWEBENGINEGLOBAL_H diff --git a/lib/quick/plugin.cpp b/lib/quick/plugin.cpp deleted file mode 100644 index 5efde6dd8..000000000 --- a/lib/quick/plugin.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "qquickwebengineview_p.h" - -QT_BEGIN_NAMESPACE - -class QtWebEnginePlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") -public: - virtual void registerTypes(const char *uri) Q_DECL_OVERRIDE - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine")); - Q_UNUSED(uri); - - qmlRegisterType(uri, 1, 0, "WebEngineView"); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/lib/quick/plugin/plugin.cpp b/lib/quick/plugin/plugin.cpp new file mode 100644 index 000000000..5efde6dd8 --- /dev/null +++ b/lib/quick/plugin/plugin.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qquickwebengineview_p.h" + +QT_BEGIN_NAMESPACE + +class QtWebEnginePlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") +public: + virtual void registerTypes(const char *uri) Q_DECL_OVERRIDE + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine")); + Q_UNUSED(uri); + + qmlRegisterType(uri, 1, 0, "WebEngineView"); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" diff --git a/lib/quick/plugin/plugin.pro b/lib/quick/plugin/plugin.pro new file mode 100644 index 000000000..93e04f97a --- /dev/null +++ b/lib/quick/plugin/plugin.pro @@ -0,0 +1,13 @@ +CXX_MODULE = qml +TARGET = qtwebengineplugin +TARGETPATH = QtWebEngine +IMPORT_VERSION = 1.0 + +QT += webengine qml quick +QT_PRIVATE += webengine-private qml-private quick-private gui-private core-private + +INCLUDEPATH += $$QTWEBENGINE_ROOT/lib $$QTWEBENGINE_ROOT/lib/quick + +SOURCES = plugin.cpp + +load(qml_plugin) diff --git a/lib/quick/plugin/qmldir b/lib/quick/plugin/qmldir new file mode 100644 index 000000000..e24f55ed9 --- /dev/null +++ b/lib/quick/plugin/qmldir @@ -0,0 +1,3 @@ +module QtWebEngine +plugin qtwebengineplugin +typeinfo plugins.qmltypes diff --git a/lib/quick/qmldir b/lib/quick/qmldir deleted file mode 100644 index e24f55ed9..000000000 --- a/lib/quick/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module QtWebEngine -plugin qtwebengineplugin -typeinfo plugins.qmltypes diff --git a/lib/quick/qquickwebengineview_p.h b/lib/quick/qquickwebengineview_p.h index d1fa4ceaa..270ad779c 100644 --- a/lib/quick/qquickwebengineview_p.h +++ b/lib/quick/qquickwebengineview_p.h @@ -42,13 +42,14 @@ #ifndef QQUICKWEBENGINEVIEW_P_H #define QQUICKWEBENGINEVIEW_P_H +#include #include QT_BEGIN_NAMESPACE class QQuickWebEngineViewPrivate; -class QQuickWebEngineView : public QQuickItem { +class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_OBJECT Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged) diff --git a/lib/quick/qquickwebengineview_p_p.h b/lib/quick/qquickwebengineview_p_p.h index 040b3fe14..541022538 100644 --- a/lib/quick/qquickwebengineview_p_p.h +++ b/lib/quick/qquickwebengineview_p_p.h @@ -42,6 +42,7 @@ #ifndef QQUICKWEBENGINEVIEW_P_P_H #define QQUICKWEBENGINEVIEW_P_P_H +#include "qquickwebengineview_p.h" #include "web_contents_adapter_client.h" #include @@ -52,7 +53,7 @@ class WebContentsAdapter; QT_BEGIN_NAMESPACE class QQuickWebEngineView; -class QQuickWebEngineViewPrivate : public QQuickItemPrivate, public WebContentsAdapterClient +class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public QQuickItemPrivate, public WebContentsAdapterClient { public: Q_DECLARE_PUBLIC(QQuickWebEngineView) diff --git a/lib/quick/qtwebengineglobal.h b/lib/quick/qtwebengineglobal.h new file mode 100644 index 000000000..46f77c55f --- /dev/null +++ b/lib/quick/qtwebengineglobal.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QTWEBENGINEGLOBAL_H +#define QTWEBENGINEGLOBAL_H + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_STATIC +# if defined(QT_BUILD_WEBENGINE_LIB) +# define Q_WEBENGINE_EXPORT Q_DECL_EXPORT +# else +# define Q_WEBENGINE_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_WEBENGINE_EXPORT +#endif + +QT_END_NAMESPACE + +#endif // QTWEBENGINEGLOBAL_H diff --git a/lib/quick/qtwebengineglobal_p.h b/lib/quick/qtwebengineglobal_p.h new file mode 100644 index 000000000..1600dad63 --- /dev/null +++ b/lib/quick/qtwebengineglobal_p.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTWEBENGINEGLOBAL_P_H +#define QTWEBENGINEGLOBAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qtwebengineglobal.h" + +QT_BEGIN_NAMESPACE + +#define Q_WEBENGINE_PRIVATE_EXPORT Q_WEBENGINE_EXPORT + +QT_END_NAMESPACE + +#endif // QTWEBENGINEGLOBAL_P_H diff --git a/lib/quick/quick.pro b/lib/quick/quick.pro index c4c248a41..50353066b 100644 --- a/lib/quick/quick.pro +++ b/lib/quick/quick.pro @@ -1,7 +1,8 @@ -CXX_MODULE = qml -TARGET = qtwebengineplugin -TARGETPATH = QtWebEngine -IMPORT_VERSION = 1.0 +TARGET = QtWebEngine +MODULE = webengine + +# For our export macros +DEFINES += QT_BUILD_WEBENGINE_LIB QT += qml quick QT_PRIVATE += qml-private quick-private gui-private core-private @@ -21,12 +22,13 @@ QMAKE_RPATHDIR += $$LIBPATH SOURCES = \ qquickwebengineview.cpp \ - plugin.cpp \ render_widget_host_view_qt_delegate_quick.cpp HEADERS = \ + qtwebengineglobal.h \ + qtwebengineglobal_p.h \ qquickwebengineview_p.h \ qquickwebengineview_p_p.h \ render_widget_host_view_qt_delegate_quick.h -load(qml_plugin) +load(qt_module) diff --git a/lib/render_widget_host_view_qt_delegate.h b/lib/render_widget_host_view_qt_delegate.h index d08296a8e..74151fdbf 100644 --- a/lib/render_widget_host_view_qt_delegate.h +++ b/lib/render_widget_host_view_qt_delegate.h @@ -42,7 +42,7 @@ #ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_H #define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_H -#include "qtwebengineglobal.h" +#include "qtwebenginecoreglobal.h" #include #include diff --git a/lib/web_contents_adapter.h b/lib/web_contents_adapter.h index cde5a147d..f631b6d69 100644 --- a/lib/web_contents_adapter.h +++ b/lib/web_contents_adapter.h @@ -41,7 +41,7 @@ #ifndef WEB_CONTENTS_ADAPTER_H #define WEB_CONTENTS_ADAPTER_H -#include "qtwebengineglobal.h" +#include "qtwebenginecoreglobal.h" #include "web_contents_adapter_client.h" #include diff --git a/lib/web_contents_adapter_client.h b/lib/web_contents_adapter_client.h index c92d6ddc0..c7746ffb1 100644 --- a/lib/web_contents_adapter_client.h +++ b/lib/web_contents_adapter_client.h @@ -41,7 +41,7 @@ #ifndef WEB_CONTENTS_ADAPTER_CLIENT_H #define WEB_CONTENTS_ADAPTER_CLIENT_H -#include "qtwebengineglobal.h" +#include "qtwebenginecoreglobal.h" #include #include -- cgit v1.2.3