diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-22 16:44:51 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-22 17:49:10 +0200 |
commit | 39236c01ae6c9bc99ee3a02d8294679e12d9b734 (patch) | |
tree | 7ae55d4e33d5d34109ca7d014db791e73cddbcb5 /sources/pyside2/PySide2/QtNetwork | |
parent | 315a9ce2e7b443fa7485ed8c21189e62fe2e2165 (diff) |
move everying into sources/pyside2
in preparation for a subtree merge.
this should not be necessary to do in a separate commit, but git is a
tad stupid about following history correctly without it.
Diffstat (limited to 'sources/pyside2/PySide2/QtNetwork')
-rw-r--r-- | sources/pyside2/PySide2/QtNetwork/CMakeLists.txt | 72 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtNetwork/typesystem_network.xml | 307 |
2 files changed, 379 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt new file mode 100644 index 000000000..26518991d --- /dev/null +++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt @@ -0,0 +1,72 @@ +project(QtNetwork) + +set(QtNetwork_OPTIONAL_SRC ) +set(QtNetwork_DROPPED_ENTRIES ) +check_qt_class(QtNetwork QSslCertificate QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) +check_qt_class(QtNetwork QSslCipher QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) +check_qt_class(QtNetwork QSslConfiguration QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) +check_qt_class(QtNetwork QSslError QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) +check_qt_class(QtNetwork QSslKey QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) +check_qt_class(QtNetwork QSslSocket QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) + +set(QtNetwork_SRC +${QtNetwork_GEN_DIR}/qabstractnetworkcache_wrapper.cpp +${QtNetwork_GEN_DIR}/qabstractsocket_wrapper.cpp +${QtNetwork_GEN_DIR}/qauthenticator_wrapper.cpp +${QtNetwork_GEN_DIR}/qhostaddress_wrapper.cpp +${QtNetwork_GEN_DIR}/qhostinfo_wrapper.cpp +${QtNetwork_GEN_DIR}/qipv6address_wrapper.cpp +${QtNetwork_GEN_DIR}/qlocalserver_wrapper.cpp +${QtNetwork_GEN_DIR}/qlocalsocket_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkaccessmanager_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkaddressentry_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkcachemetadata_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkconfiguration_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkconfigurationmanager_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkcookie_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkcookiejar_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkdiskcache_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkinterface_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkproxy_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkproxyfactory_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkproxyquery_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkreply_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworkrequest_wrapper.cpp +${QtNetwork_GEN_DIR}/qnetworksession_wrapper.cpp +${QtNetwork_GEN_DIR}/qssl_wrapper.cpp +${QtNetwork_GEN_DIR}/qtcpserver_wrapper.cpp +${QtNetwork_GEN_DIR}/qtcpsocket_wrapper.cpp +${QtNetwork_GEN_DIR}/qudpsocket_wrapper.cpp +# module is always needed +${QtNetwork_GEN_DIR}/qtnetwork_module_wrapper.cpp +) + +make_path(QtNetwork_typesystem_path ${QtCore_SOURCE_DIR} + ${QtCore_BINARY_DIR} + ${QtNetwork_SOURCE_DIR}) + +set(QtNetwork_include_dirs ${QtNetwork_SOURCE_DIR} + ${QtNetwork_BINARY_DIR} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} + ${SHIBOKEN_INCLUDE_DIR} + ${libpyside_SOURCE_DIR} + ${SHIBOKEN_PYTHON_INCLUDE_DIR} + ${QtCore_GEN_DIR}) + +set(QtNetwork_libraries pyside2 + ${SHIBOKEN_PYTHON_LIBRARIES} + ${SHIBOKEN_LIBRARY} + ${Qt5Network_LIBRARIES}) + +set(QtNetwork_deps QtCore) + +create_pyside_module(QtNetwork + QtNetwork_include_dirs + QtNetwork_libraries + QtNetwork_deps + QtNetwork_typesystem_path + QtNetwork_SRC + "" + "" + QtNetwork_DROPPED_ENTRIES) diff --git a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml new file mode 100644 index 000000000..2643f1ca9 --- /dev/null +++ b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml @@ -0,0 +1,307 @@ +<?xml version="1.0"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/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 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide2.QtNetwork"> + <load-typesystem name="typesystem_core.xml" generate="no"/> + + <namespace-type name="QSsl"> + <enum-type name="AlternativeNameEntryType"/> + <enum-type name="EncodingFormat"/> + <enum-type name="KeyAlgorithm"/> + <enum-type name="KeyType"/> + <enum-type name="SslOption" flags="SslOptions" /> + <enum-type name="SslProtocol"/> + <extra-includes> + <include file-name="qssl.h" location="global"/> + </extra-includes> + </namespace-type> + + <rejection class="QIPv6Address" field-name="c"/> + + <object-type name="QAbstractSocket"> + <enum-type name="BindFlag" flags="BindMode" /> + <enum-type name="NetworkLayerProtocol"/> + <enum-type name="PauseMode" flags="PauseModes" /> + <enum-type name="SocketError"/> + <enum-type name="SocketOption" since="4.6"/> + <enum-type name="SocketState"/> + <enum-type name="SocketType"/> + <modify-function signature="connectToHost(const QString&, quint16, QFlags<QIODevice::OpenModeFlag>, QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes" /> + <modify-function signature="connectToHost(const QHostAddress&, quint16, QFlags<QIODevice::OpenModeFlag>)" allow-thread="yes" /> + <modify-function signature="disconnectFromHost()" allow-thread="yes" /> + <modify-function signature="waitForConnected(int)" allow-thread="yes" /> + <modify-function signature="waitForDisconnected(int)" allow-thread="yes" /> + </object-type> + + <object-type name="QTcpServer"> + <modify-function signature="waitForNewConnection(int,bool*)" allow-thread="yes"> + <!-- FIXME removing default expression means user will always have to pass a value, but he wouldn't have to --> + <modify-argument index="1"> + <remove-default-expression/> + </modify-argument> + <modify-argument index="2"> + <remove-default-expression/> + <remove-argument/> + </modify-argument> + <modify-argument index="return"> + <replace-type modified-type="(retval, timeOut)"/> + </modify-argument> + <inject-code class="target" position="beginning"> + <insert-template name="fix_args,bool*"/> + </inject-code> + </modify-function> + </object-type> + <object-type name="QTcpSocket"/> + <object-type name="QUdpSocket"> + <modify-function signature="readDatagram(char*, qint64, QHostAddress*, quint16*)" allow-thread="yes"> + <modify-argument index="1"> + <remove-argument/> + </modify-argument> + <modify-argument index="3"> + <remove-default-expression/> + <remove-argument/> + </modify-argument> + <modify-argument index="4"> + <remove-default-expression/> + <remove-argument/> + </modify-argument> + <modify-argument index="return"> + <replace-type modified-type="(data, address, port)"/> + </modify-argument> + <inject-code class="target" position="beginning"> + Shiboken::AutoArrayPointer<char> data(%ARGUMENT_NAMES); + QHostAddress ha; + quint16 port; + %BEGIN_ALLOW_THREADS + %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &ha, &port); + %END_ALLOW_THREADS + QByteArray ba(data, retval); + %PYARG_0 = PyTuple_New(3); + PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QByteArray](ba)); + PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QHostAddress](ha)); + PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[quint16](port)); + </inject-code> + </modify-function> + <modify-function signature="writeDatagram(const QByteArray&, const QHostAddress&, quint16)" allow-thread="yes"/> + <!-- ### writeDatagram(QByteArray, ...) does the trick --> + <modify-function signature="writeDatagram(const char*,qint64,const QHostAddress&,quint16)" remove="all"/> + <!-- ### --> + </object-type> + + <object-type name="QLocalServer"> + <enum-type name="SocketOption" flags="SocketOptions" /> + <modify-function signature="waitForNewConnection(int,bool*)" allow-thread="yes"> + <!-- FIXME --> + <modify-argument index="1"> + <remove-default-expression/> + </modify-argument> + <modify-argument index="2"> + <remove-default-expression/> + <remove-argument/> + </modify-argument> + <inject-code class="target" position="beginning"> + <insert-template name="fix_args,bool*"/> + </inject-code> + <modify-argument index="return"> + <replace-type modified-type="(retval, timeOut)"/> + </modify-argument> + + </modify-function> + </object-type> + <object-type name="QLocalSocket"> + <enum-type name="LocalSocketError"/> + <enum-type name="LocalSocketState"/> + </object-type> + <object-type name="QNetworkAccessManager"> + <enum-type name="NetworkAccessibility" since="4.7"/> + <enum-type name="Operation"/> + <modify-function signature="createRequest(QNetworkAccessManager::Operation, const QNetworkRequest&, QIODevice *)"> + <modify-argument index="3" invalidate-after-use="yes"/> + <modify-argument index="return"> + <define-ownership class="target" owner="default"/> + </modify-argument> + </modify-function> + <modify-function signature="get(const QNetworkRequest&)" allow-thread="yes"/> + <modify-function signature="post(const QNetworkRequest &, QIODevice *)" allow-thread="yes"/> + <modify-function signature="post(const QNetworkRequest &, const QByteArray &)" allow-thread="yes"/> + <modify-function signature="put(const QNetworkRequest &, QIODevice *)" allow-thread="yes"/> + <modify-function signature="put(const QNetworkRequest &, const QByteArray &)" allow-thread="yes"/> + <modify-function signature="sendCustomRequest(const QNetworkRequest &, const QByteArray &, QIODevice *)" allow-thread="yes" since="4.7" /> + <modify-function signature="setCookieJar(QNetworkCookieJar*)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + <object-type name="QNetworkCookieJar"/> + <object-type name="QNetworkReply"> + <enum-type name="NetworkError"/> + </object-type> + + <value-type name="QHostAddress" hash-function="qHash"> + <enum-type name="ConversionModeFlag" flags="ConversionMode" since="5.8"/> + <enum-type name="SpecialAddress"/> + <!-- ### QHostAddress(QIPv6Address) does this --> + <modify-function signature="QHostAddress(quint8*)" remove="all" /> + <!-- ### --> + <modify-function signature="setAddress(quint8*)" remove="all" /> + </value-type> + + <value-type name="QHostInfo"> + <enum-type name="HostInfoError"/> + <modify-function signature="lookupHost(QString,QObject*,const char*)" access="private"/> + </value-type> + + <value-type name="QNetworkAddressEntry" /> + + <value-type name="QNetworkInterface"> + <enum-type name="InterfaceFlag" flags="InterfaceFlags"/> + </value-type> + + <value-type name="QNetworkProxy"> + <enum-type name="Capability" flags="Capabilities" /> + <enum-type name="ProxyType"/> + </value-type> + + <object-type name="QNetworkProxyFactory" /> + <value-type name="QNetworkProxyQuery"> + <enum-type name="QueryType" /> + </value-type> + + <value-type name="QIPv6Address"> + <add-function signature="__len__"> + <inject-code class="target" position="beginning"> + return 16; + </inject-code> + </add-function> + <add-function signature="__getitem__"> + <inject-code class="target" position="beginning"> + if (_i >= 16) { + PyErr_SetString(PyExc_IndexError, "index out of bounds"); + return 0; + } + if (_i < 0) + _i = 16 - qAbs(_i); + + uint item = %CPPSELF.c[_i]; + return %CONVERTTOPYTHON[uint](item); + </inject-code> + </add-function> + <add-function signature="__len__"> + <inject-code class="target" position="beginning"> + return 16; + </inject-code> + </add-function> + <add-function signature="__setitem__"> + <inject-code class="target" position="beginning"> + if (_i >= 16) { + PyErr_SetString(PyExc_IndexError, "index out of bounds"); + return -1; + } + if (_i < 0) + _i = 16 - qAbs(_i); + quint8 item = %CONVERTTOCPP[quint8](_value); + %CPPSELF.c[_i] = item; + return 0; + </inject-code> + </add-function> + </value-type> + + <value-type name="QAuthenticator" /> + <value-type name="QNetworkCookie"> + <enum-type name="RawForm"/> + <extra-includes> + <include file-name="QDateTime" location="global"/> + </extra-includes> + </value-type> + <value-type name="QNetworkRequest"> + <enum-type name="Attribute" extensible="yes"/> + <enum-type name="LoadControl" since="4.7"/> + <enum-type name="Priority" since="4.7"/> + <enum-type name="CacheLoadControl"/> + <enum-type name="KnownHeaders"/> + <enum-type name="RedirectPolicy" since="5.9"/> + </value-type> + + <value-type name="QNetworkConfiguration" since="4.7"> + <enum-type name="BearerType" /> + <enum-type name="Purpose" since="4.7"/> + <enum-type name="StateFlag" flags="StateFlags" since="4.7"/> + <enum-type name="Type" since="4.7"/> + </value-type> + <object-type name="QNetworkConfigurationManager" since="4.7"> + <enum-type name="Capability" flags="Capabilities" since="4.7"/> + </object-type> + <object-type name="QNetworkSession" since="4.7"> + <enum-type name="SessionError" since="4.7"/> + <enum-type name="State" since="4.7"/> + <enum-type name="UsagePolicy" flags="UsagePolicies" /> + </object-type> + + <object-type name="QAbstractNetworkCache"/> + <object-type name="QNetworkDiskCache"/> + <value-type name="QNetworkCacheMetaData"/> + + <!-- The following entries may be present in the system or not. Keep this section organized. --> + <value-type name="QSslCertificate"> + <enum-type name="SubjectInfo"/> + </value-type> + + <value-type name="QSslCipher"/> + + <value-type name="QSslConfiguration"> + <enum-type name="NextProtocolNegotiationStatus" /> + </value-type> + + <value-type name="QSslError"> + <enum-type name="SslError"/> + </value-type> + + <value-type name="QSslKey"/> + <object-type name="QSslSocket"> + <enum-type name="SslMode"/> + <enum-type name="PeerVerifyMode"/> + <modify-function signature="connectToHostEncrypted(const QString&, quint16, QFlags<QIODevice::OpenModeFlag>, QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes" /> + <modify-function signature="waitForEncrypted(int)" allow-thread="yes" /> + </object-type> + <!-- The above entries may be present in the system or not. Keep this section organized. --> +</typesystem> + |