PythonQtWrapper_QTcpServer.cpp
276 lines
| 9.4 KiB
| text/x-c
|
CppLexer
|
r13 | #include "PythonQtWrapper_QTcpServer.h" | ||
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qhostaddress.h> | ||||
#include <qlist.h> | ||||
#include <qnetworkproxy.h> | ||||
#include <qobject.h> | ||||
#include <qtcpserver.h> | ||||
#include <qtcpsocket.h> | ||||
|
r24 | void PythonQtShell_QTcpServer::childEvent(QChildEvent* arg__1) | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"childEvent(QTcpServer*,QChildEvent* )"); | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTcpServer::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QTcpServer::customEvent(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"customEvent(QTcpServer*,QEvent* )"); | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTcpServer::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QTcpServer::event(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"event(QTcpServer*,QEvent* )"); | ||||
bool returnValue; | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
returnValue = *((bool *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QTcpServer::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QTcpServer::eventFilter(QObject* arg__1, QEvent* arg__2) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"eventFilter(QTcpServer*,QObject* ,QEvent* )"); | ||||
bool returnValue; | ||||
void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
returnValue = *((bool *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QTcpServer::eventFilter(arg__1, arg__2); | ||||
} | ||||
bool PythonQtShell_QTcpServer::hasPendingConnections() const | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hasPendingConnections"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"hasPendingConnections(QTcpServer*)"); | ||||
bool returnValue; | ||||
void* args[1] = {NULL}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
returnValue = *((bool *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QTcpServer::hasPendingConnections(); | ||||
} | ||||
void PythonQtShell_QTcpServer::incomingConnection(int handle) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "incomingConnection"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"incomingConnection(QTcpServer*,int )"); | ||||
void* args[2] = {NULL, (void*)&handle}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTcpServer::incomingConnection(handle); | ||||
} | ||||
QTcpSocket* PythonQtShell_QTcpServer::nextPendingConnection() | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "nextPendingConnection"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"nextPendingConnection(QTcpServer*)"); | ||||
QTcpSocket* returnValue; | ||||
void* args[1] = {NULL}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
returnValue = *((QTcpSocket* *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QTcpServer::nextPendingConnection(); | ||||
} | ||||
void PythonQtShell_QTcpServer::timerEvent(QTimerEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTcpServer::staticMetaObject, | ||||
"timerEvent(QTcpServer*,QTimerEvent* )"); | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTcpServer::timerEvent(arg__1); | ||||
} | ||||
|
r13 | QTcpServer* PythonQtWrapper_QTcpServer::new_QTcpServer(QObject* parent) | ||
{ | ||||
|
r24 | return new PythonQtShell_QTcpServer(parent); } | ||
|
r13 | |||
|
r28 | bool PythonQtWrapper_QTcpServer::hasPendingConnections(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return ((PythonQtPublicPromoter_QTcpServer*)theWrappedObject)->promoted_hasPendingConnections(); | ||
|
r13 | } | ||
|
r28 | void PythonQtWrapper_QTcpServer::close(QTcpServer* theWrappedObject) | ||
|
r13 | { | ||
|
r28 | theWrappedObject->close(); | ||
|
r13 | } | ||
|
r28 | QAbstractSocket::SocketError PythonQtWrapper_QTcpServer::serverError(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->serverError(); | ||
|
r13 | } | ||
|
r28 | void PythonQtWrapper_QTcpServer::incomingConnection(QTcpServer* theWrappedObject, int handle) | ||
|
r13 | { | ||
|
r28 | ((PythonQtPublicPromoter_QTcpServer*)theWrappedObject)->promoted_incomingConnection(handle); | ||
|
r13 | } | ||
|
r24 | void PythonQtWrapper_QTcpServer::setProxy(QTcpServer* theWrappedObject, const QNetworkProxy& networkProxy) | ||
|
r13 | { | ||
|
r28 | theWrappedObject->setProxy(networkProxy); | ||
|
r13 | } | ||
|
r28 | bool PythonQtWrapper_QTcpServer::listen(QTcpServer* theWrappedObject, const QHostAddress& address, unsigned short port) | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->listen(address, port); | ||
|
r13 | } | ||
|
r28 | QTcpSocket* PythonQtWrapper_QTcpServer::nextPendingConnection(QTcpServer* theWrappedObject) | ||
|
r13 | { | ||
|
r28 | return ((PythonQtPublicPromoter_QTcpServer*)theWrappedObject)->promoted_nextPendingConnection(); | ||
|
r13 | } | ||
|
r28 | void PythonQtWrapper_QTcpServer::setMaxPendingConnections(QTcpServer* theWrappedObject, int numConnections) | ||
|
r13 | { | ||
|
r28 | theWrappedObject->setMaxPendingConnections(numConnections); | ||
|
r13 | } | ||
|
r28 | QHostAddress PythonQtWrapper_QTcpServer::serverAddress(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->serverAddress(); | ||
|
r13 | } | ||
|
r28 | bool PythonQtWrapper_QTcpServer::waitForNewConnection(QTcpServer* theWrappedObject, int msec, bool* timedOut) | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->waitForNewConnection(msec, timedOut); | ||
|
r13 | } | ||
|
r28 | int PythonQtWrapper_QTcpServer::socketDescriptor(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->socketDescriptor(); | ||
|
r13 | } | ||
|
r28 | QString PythonQtWrapper_QTcpServer::errorString(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->errorString(); | ||
|
r13 | } | ||
|
r28 | int PythonQtWrapper_QTcpServer::maxPendingConnections(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->maxPendingConnections(); | ||
|
r13 | } | ||
|
r28 | unsigned short PythonQtWrapper_QTcpServer::serverPort(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->serverPort(); | ||
|
r13 | } | ||
|
r28 | bool PythonQtWrapper_QTcpServer::isListening(QTcpServer* theWrappedObject) const | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->isListening(); | ||
|
r13 | } | ||
|
r28 | QNetworkProxy PythonQtWrapper_QTcpServer::proxy(QTcpServer* theWrappedObject) const | ||
|
r24 | { | ||
|
r28 | return theWrappedObject->proxy(); | ||
|
r24 | } | ||
|
r28 | bool PythonQtWrapper_QTcpServer::setSocketDescriptor(QTcpServer* theWrappedObject, int socketDescriptor) | ||
|
r13 | { | ||
|
r28 | return theWrappedObject->setSocketDescriptor(socketDescriptor); | ||
|
r13 | } | ||