Skip to content

Commit 2548304

Browse files
committed
add new api patchs
1 parent 85edc72 commit 2548304

File tree

5 files changed

+876
-0
lines changed

5 files changed

+876
-0
lines changed

build.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import subprocess
1919
import sys
2020
import urllib.request
21+
from pathlib import Path
2122
from py7zr import SevenZipFile
2223
from py7zr.callbacks import ExtractCallback
2324
from tarfile import TarFile
@@ -230,6 +231,13 @@ def reporthook(a, b, c):
230231

231232
print('extractall PyQt5 ok')
232233

234+
# 拷贝补丁文件
235+
print('src_dir:', src_dir)
236+
for p in Path('patchs').rglob('*.sip'):
237+
dfile = os.path.join(src_dir, str(p).replace('\\', '/')[7:])
238+
print('copy', p, 'to', dfile)
239+
shutil.copy(str(p), dfile)
240+
233241
os.chdir(src_dir)
234242

235243
try:

patchs/sip/QtWebKit/qwebhistory.sip

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// qwebhistory.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2020 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt5.
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+
class QWebHistoryItem
24+
{
25+
%TypeHeaderCode
26+
#include <qwebhistory.h>
27+
%End
28+
29+
public:
30+
QWebHistoryItem(const QWebHistoryItem &other);
31+
~QWebHistoryItem();
32+
QUrl originalUrl() const;
33+
QUrl url() const;
34+
QString title() const;
35+
QDateTime lastVisited() const;
36+
QIcon icon() const;
37+
QVariant userData() const;
38+
void setUserData(const QVariant &userData);
39+
bool isValid() const;
40+
QVariantMap toMap() const;
41+
void loadFromMap(const QVariantMap &map);
42+
};
43+
44+
class QWebHistory
45+
{
46+
%TypeHeaderCode
47+
#include <qwebhistory.h>
48+
%End
49+
50+
public:
51+
void clear();
52+
QList<QWebHistoryItem> items() const;
53+
QList<QWebHistoryItem> backItems(int maxItems) const;
54+
QList<QWebHistoryItem> forwardItems(int maxItems) const;
55+
bool canGoBack() const;
56+
bool canGoForward() const;
57+
void back();
58+
void forward();
59+
void goToItem(const QWebHistoryItem &item);
60+
QWebHistoryItem backItem() const;
61+
QWebHistoryItem currentItem() const;
62+
QWebHistoryItem forwardItem() const;
63+
QWebHistoryItem itemAt(int i) const;
64+
int count() const /__len__/;
65+
66+
private:
67+
QWebHistory();
68+
QWebHistory(const QWebHistory &);
69+
~QWebHistory();
70+
71+
public:
72+
int currentItemIndex() const;
73+
int maximumItemCount() const;
74+
void setMaximumItemCount(int count);
75+
QVariantMap toMap() const;
76+
void loadFromMap(const QVariantMap &map);
77+
};
78+
79+
QDataStream &operator<<(QDataStream &, const QWebHistory & /Constrained/) /ReleaseGIL/;
80+
QDataStream &operator>>(QDataStream &, QWebHistory & /Constrained/) /ReleaseGIL/;

patchs/sip/QtWebKit/qwebsettings.sip

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
// qwebsettings.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2020 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt5.
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+
class QWebSettings
24+
{
25+
%TypeHeaderCode
26+
#include <qwebsettings.h>
27+
%End
28+
29+
public:
30+
enum FontFamily
31+
{
32+
StandardFont,
33+
FixedFont,
34+
SerifFont,
35+
SansSerifFont,
36+
CursiveFont,
37+
FantasyFont,
38+
};
39+
40+
enum WebAttribute
41+
{
42+
AutoLoadImages,
43+
JavascriptEnabled,
44+
JavaEnabled,
45+
PluginsEnabled,
46+
PrivateBrowsingEnabled,
47+
JavascriptCanOpenWindows,
48+
JavascriptCanCloseWindows,
49+
JavascriptCanAccessClipboard,
50+
DeveloperExtrasEnabled,
51+
LinksIncludedInFocusChain,
52+
ZoomTextOnly,
53+
PrintElementBackgrounds,
54+
OfflineStorageDatabaseEnabled,
55+
OfflineWebApplicationCacheEnabled,
56+
LocalStorageDatabaseEnabled,
57+
LocalStorageEnabled,
58+
LocalContentCanAccessRemoteUrls,
59+
DnsPrefetchEnabled,
60+
XSSAuditingEnabled,
61+
AcceleratedCompositingEnabled,
62+
SpatialNavigationEnabled,
63+
LocalContentCanAccessFileUrls,
64+
TiledBackingStoreEnabled,
65+
FrameFlatteningEnabled,
66+
SiteSpecificQuirksEnabled,
67+
WebGLEnabled,
68+
HyperlinkAuditingEnabled,
69+
CSSRegionsEnabled,
70+
CSSGridLayoutEnabled,
71+
ScrollAnimatorEnabled,
72+
CaretBrowsingEnabled,
73+
NotificationsEnabled,
74+
%If (Qt_5_2_0 -)
75+
WebAudioEnabled,
76+
%End
77+
%If (Qt_5_4_0 -)
78+
Accelerated2dCanvasEnabled,
79+
MediaSourceEnabled,
80+
MediaEnabled,
81+
WebSecurityEnabled,
82+
FullScreenSupportEnabled,
83+
ImagesEnabled,
84+
AllowRunningInsecureContent,
85+
ErrorPageEnabled,
86+
%End
87+
};
88+
89+
enum WebGraphic
90+
{
91+
MissingImageGraphic,
92+
MissingPluginGraphic,
93+
DefaultFrameIconGraphic,
94+
TextAreaSizeGripCornerGraphic,
95+
InputSpeechButtonGraphic,
96+
SearchCancelButtonGraphic,
97+
SearchCancelButtonPressedGraphic,
98+
};
99+
100+
enum FontSize
101+
{
102+
MinimumFontSize,
103+
MinimumLogicalFontSize,
104+
DefaultFontSize,
105+
DefaultFixedFontSize,
106+
};
107+
108+
static QWebSettings *globalSettings();
109+
void setFontFamily(QWebSettings::FontFamily which, const QString &family);
110+
QString fontFamily(QWebSettings::FontFamily which) const;
111+
void resetFontFamily(QWebSettings::FontFamily which);
112+
void setFontSize(QWebSettings::FontSize type, int size);
113+
int fontSize(QWebSettings::FontSize type) const;
114+
void resetFontSize(QWebSettings::FontSize type);
115+
void setAttribute(QWebSettings::WebAttribute attr, bool on);
116+
bool testAttribute(QWebSettings::WebAttribute attr) const;
117+
void resetAttribute(QWebSettings::WebAttribute attr);
118+
void setUserStyleSheetUrl(const QUrl &location);
119+
QUrl userStyleSheetUrl() const;
120+
static void setIconDatabasePath(const QString &location);
121+
static QString iconDatabasePath();
122+
static void clearIconDatabase();
123+
static QIcon iconForUrl(const QUrl &url);
124+
static void setPluginSearchPaths(const QStringList& paths);
125+
static QStringList pluginSearchPaths();
126+
static void setWebGraphic(QWebSettings::WebGraphic type, const QPixmap &graphic);
127+
static QPixmap webGraphic(QWebSettings::WebGraphic type);
128+
static void setMaximumPagesInCache(int pages);
129+
static int maximumPagesInCache();
130+
static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
131+
132+
private:
133+
QWebSettings();
134+
QWebSettings(const QWebSettings &);
135+
~QWebSettings();
136+
137+
public:
138+
static void setOfflineStoragePath(const QString &path);
139+
static QString offlineStoragePath();
140+
static void setOfflineStorageDefaultQuota(qint64 maximumSize);
141+
static qint64 offlineStorageDefaultQuota();
142+
void setDefaultTextEncoding(const QString &encoding);
143+
QString defaultTextEncoding() const;
144+
static void setOfflineWebApplicationCachePath(const QString &path);
145+
static QString offlineWebApplicationCachePath();
146+
static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
147+
static qint64 offlineWebApplicationCacheQuota();
148+
void setLocalStoragePath(const QString &path);
149+
QString localStoragePath() const;
150+
static void clearMemoryCaches();
151+
static void enablePersistentStorage(const QString &path = QString());
152+
153+
enum ThirdPartyCookiePolicy
154+
{
155+
AlwaysAllowThirdPartyCookies,
156+
AlwaysBlockThirdPartyCookies,
157+
AllowThirdPartyWithExistingCookies,
158+
};
159+
160+
void setThirdPartyCookiePolicy(QWebSettings::ThirdPartyCookiePolicy);
161+
QWebSettings::ThirdPartyCookiePolicy thirdPartyCookiePolicy() const;
162+
%If (Qt_5_1_0 -)
163+
void setCSSMediaType(const QString &);
164+
%End
165+
%If (Qt_5_1_0 -)
166+
QString cssMediaType() const;
167+
%End
168+
};

0 commit comments

Comments
 (0)