Skip to content

Commit 4aaa6d4

Browse files
committed
debian packaging update: add internal QtWebKit bindings
(backported from c2f363f)
1 parent dbcddc4 commit 4aaa6d4

19 files changed

+2000
-0
lines changed

debian/python-qgis.install.in

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ usr/lib/python*/*-packages/qgis/server/*
99
usr/lib/python*/*-packages/qgis/testing/*
1010
#wheezy precise#usr/lib/python*/*-packages/pyspatialite/*.py
1111
#wheezy precise#usr/lib/python*/*-packages/pyspatialite/*.so
12+
#sid stretch#usr/lib/python*/*-packages/PyQt4/*.so

debian/rules

+4
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ ifneq (,$(findstring $(DISTRIBUTION),"sid stretch"))
110110
CMAKE_OPTS += -DPOSTGRES_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpq.so
111111
endif
112112

113+
ifneq (,$(findstring $(DISTRIBUTION),"sid stretch"))
114+
CMAKE_OPTS += -DWITH_INTERNAL_WEBKIT_BINDINGS=TRUE
115+
endif
116+
113117
ifneq (,$(findstring $(DISTRIBUTION),"sid"))
114118
CMAKE_OPTS += -DGEOS_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgeos_c.so
115119
endif

python/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,15 @@ FOREACH(module ${PY_MODULES})
307307
ENDFOREACH(pyfile)
308308
PY_COMPILE(py${module} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}")
309309
ENDFOREACH(module)
310+
311+
SET (WITH_INTERNAL_WEBKIT_BINDINGS FALSE CACHE BOOL "Build internal QtWebKit bindings")
312+
IF(WITH_INTERNAL_WEBKIT_BINDINGS)
313+
INCLUDE_DIRECTORIES(${QT_QTWEBKIT_INCLUDE_DIR})
314+
FILE(GLOB_RECURSE sip_files_qtwebkit QtWebKit/*.sip)
315+
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_qtwebkit})
316+
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/PyQt4.QtWebKit.api)
317+
318+
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/PyQt4)
319+
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/PyQt4)
320+
ADD_SIP_PYTHON_MODULE(PyQt4.QtWebKit QtWebKit/QtWebKitmod.sip QtWebKit QtCore QtGui QtNetwork)
321+
ENDIF(WITH_INTERNAL_WEBKIT_BINDINGS)

python/QtWebKit/QtWebKitmod.sip

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// QtWebKitmod.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%Module(name=PyQt4.QtWebKit, keyword_arguments="Optional")
24+
25+
%Import QtCore/QtCoremod.sip
26+
%Import QtGui/QtGuimod.sip
27+
%Import QtNetwork/QtNetworkmod.sip
28+
29+
%Copying
30+
Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
31+
32+
This file is part of PyQt4.
33+
34+
This file may be used under the terms of the GNU General Public License
35+
version 3.0 as published by the Free Software Foundation and appearing in
36+
the file LICENSE included in the packaging of this file. Please review the
37+
following information to ensure the GNU General Public License version 3.0
38+
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
39+
40+
If you do not wish to use this file under the terms of the GPL version 3.0
41+
then you may purchase a commercial license. For more information contact
42+
info@riverbankcomputing.com.
43+
44+
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
45+
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
46+
%End
47+
48+
%DefaultSupertype sip.simplewrapper
49+
50+
%Include qgraphicswebview.sip
51+
%Include qwebdatabase.sip
52+
%Include qwebelement.sip
53+
%Include qwebframe.sip
54+
%Include qwebkitglobal.sip
55+
%Include qwebhistory.sip
56+
%Include qwebhistoryinterface.sip
57+
%Include qwebinspector.sip
58+
%Include qwebkitversion.sip
59+
%Include qwebpage.sip
60+
%Include qwebpluginfactory.sip
61+
%Include qwebsecurityorigin.sip
62+
%Include qwebsettings.sip
63+
%Include qwebview.sip

python/QtWebKit/__init__.py

Whitespace-only changes.

python/QtWebKit/qgraphicswebview.sip

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
// qgraphicswebview.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_6_0 -)
24+
25+
class QGraphicsWebView : QGraphicsWidget
26+
{
27+
%TypeHeaderCode
28+
#include <qgraphicswebview.h>
29+
%End
30+
31+
%ConvertToSubClassCode
32+
sipType = 0;
33+
34+
// For some reason Qt doesn't allocate a new type for this so we have to test
35+
// the numeric and QObject types.
36+
if (sipCpp->type() == 11)
37+
{
38+
QGraphicsWidget *gw = static_cast<QGraphicsWidget *>(sipCpp);
39+
40+
if (gw->inherits("QGraphicsWebView"))
41+
{
42+
*sipCppRet = static_cast<QGraphicsWebView *>(gw);
43+
sipType = sipType_QGraphicsWebView;
44+
}
45+
}
46+
%End
47+
48+
public:
49+
explicit QGraphicsWebView(QGraphicsItem *parent /TransferThis/ = 0);
50+
virtual ~QGraphicsWebView();
51+
QWebPage *page() const;
52+
void setPage(QWebPage * /KeepReference/);
53+
QUrl url() const;
54+
void setUrl(const QUrl &);
55+
QString title() const;
56+
QIcon icon() const;
57+
qreal zoomFactor() const;
58+
void setZoomFactor(qreal);
59+
bool isModified() const;
60+
void load(const QUrl &url) /ReleaseGIL/;
61+
void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray()) /ReleaseGIL/;
62+
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
63+
void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
64+
QWebHistory *history() const;
65+
QWebSettings *settings() const;
66+
QAction *pageAction(QWebPage::WebAction action) const;
67+
void triggerPageAction(QWebPage::WebAction action, bool checked = false);
68+
bool findText(const QString &subString, QFlags<QWebPage::FindFlag> options = 0);
69+
virtual void setGeometry(const QRectF &rect);
70+
virtual void updateGeometry();
71+
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
72+
virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
73+
virtual bool event(QEvent *);
74+
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
75+
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
76+
77+
public slots:
78+
void stop();
79+
void back();
80+
void forward();
81+
void reload();
82+
83+
signals:
84+
void loadStarted();
85+
void loadFinished(bool);
86+
void loadProgress(int progress);
87+
void urlChanged(const QUrl &);
88+
void titleChanged(const QString &);
89+
void iconChanged();
90+
void statusBarMessage(const QString &message);
91+
void linkClicked(const QUrl &);
92+
93+
protected:
94+
virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
95+
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
96+
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
97+
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);
98+
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *);
99+
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *);
100+
virtual void wheelEvent(QGraphicsSceneWheelEvent *);
101+
virtual void keyPressEvent(QKeyEvent *);
102+
virtual void keyReleaseEvent(QKeyEvent *);
103+
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *);
104+
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *);
105+
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *);
106+
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *);
107+
virtual void dropEvent(QGraphicsSceneDragDropEvent *);
108+
virtual void focusInEvent(QFocusEvent *);
109+
virtual void focusOutEvent(QFocusEvent *);
110+
virtual void inputMethodEvent(QInputMethodEvent *);
111+
virtual bool focusNextPrevChild(bool next);
112+
virtual bool sceneEvent(QEvent *);
113+
114+
public:
115+
%If (Qt_4_7_0 -)
116+
bool resizesToContents() const;
117+
%End
118+
%If (Qt_4_7_0 -)
119+
void setResizesToContents(bool enabled);
120+
%End
121+
%If (Qt_4_7_0 -)
122+
bool isTiledBackingStoreFrozen() const;
123+
%End
124+
%If (Qt_4_7_0 -)
125+
void setTiledBackingStoreFrozen(bool frozen);
126+
%End
127+
%If (Qt_4_8_0 -)
128+
QFlags<QPainter::RenderHint> renderHints() const;
129+
%End
130+
%If (Qt_4_8_0 -)
131+
void setRenderHints(QFlags<QPainter::RenderHint> hints);
132+
%End
133+
%If (Qt_4_8_0 -)
134+
void setRenderHint(QPainter::RenderHint hint, bool enabled = true);
135+
%End
136+
};
137+
138+
%End
139+
140+
%ModuleHeaderCode
141+
#if QT_VERSION >= 0x040600
142+
// This is needed by the %ConvertSubClassCode.
143+
#include <QGraphicsWebView>
144+
#endif
145+
146+
// This is needed for Qt v5.0.0.
147+
#if defined(B0)
148+
#undef B0
149+
#endif
150+
%End

python/QtWebKit/qwebdatabase.sip

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// qwebdatabase.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_5_0 -)
24+
25+
class QWebDatabase
26+
{
27+
%TypeHeaderCode
28+
#include <qwebdatabase.h>
29+
%End
30+
31+
public:
32+
QWebDatabase(const QWebDatabase &other);
33+
~QWebDatabase();
34+
QString name() const;
35+
QString displayName() const;
36+
qint64 expectedSize() const;
37+
qint64 size() const;
38+
QString fileName() const;
39+
QWebSecurityOrigin origin() const;
40+
static void removeDatabase(const QWebDatabase &db);
41+
%If (Qt_4_6_0 -)
42+
static void removeAllDatabases();
43+
%End
44+
};
45+
46+
%End

0 commit comments

Comments
 (0)