PythonQtWrapper_QPicture.cpp
198 lines
| 6.4 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QPicture.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
#include <qdatastream.h> | ||||
#include <qiodevice.h> | ||||
#include <qpaintdevice.h> | ||||
#include <qpaintengine.h> | ||||
#include <qpainter.h> | ||||
#include <qpicture.h> | ||||
#include <qrect.h> | ||||
florianlink
|
r24 | int PythonQtShell_QPicture::devType() const | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"int"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); | ||||
int returnValue; | ||||
florianlink
|
r24 | 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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); | ||||
} else { | ||||
returnValue = *((int*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QPicture::devType(); | ||||
} | ||||
int PythonQtShell_QPicture::metric(QPaintDevice::PaintDeviceMetric m) const | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
int returnValue; | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&m}; | ||
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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); | ||||
} else { | ||||
returnValue = *((int*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QPicture::metric(m); | ||||
} | ||||
QPaintEngine* PythonQtShell_QPicture::paintEngine() const | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"QPaintEngine*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); | ||||
QPaintEngine* returnValue; | ||||
florianlink
|
r24 | 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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); | ||||
} else { | ||||
returnValue = *((QPaintEngine**)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QPicture::paintEngine(); | ||||
} | ||||
void PythonQtShell_QPicture::setData(const char* data, uint size) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setData"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "const char*" , "uint"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); | ||||
florianlink
|
r24 | void* args[3] = {NULL, (void*)&data, (void*)&size}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QPicture::setData(data, size); | ||||
} | ||||
florianlink
|
r13 | QPicture* PythonQtWrapper_QPicture::new_QPicture(const QPicture& arg__1) | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QPicture(arg__1); } | ||
florianlink
|
r13 | |||
QPicture* PythonQtWrapper_QPicture::new_QPicture(int formatVersion) | ||||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QPicture(formatVersion); } | ||
florianlink
|
r13 | |||
florianlink
|
r73 | bool PythonQtWrapper_QPicture::load(QPicture* theWrappedObject, QIODevice* dev, const char* format) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->load(dev, format)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QPicture::save(QPicture* theWrappedObject, const QString& fileName, const char* format) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->save(fileName, format)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QPicture::metric(QPicture* theWrappedObject, QPaintDevice::PaintDeviceMetric m) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( ((PythonQtPublicPromoter_QPicture*)theWrappedObject)->promoted_metric(m)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | const char* PythonQtWrapper_QPicture::data(QPicture* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->data()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QPicture::devType(QPicture* theWrappedObject) const | ||
{ | ||||
return ( ((PythonQtPublicPromoter_QPicture*)theWrappedObject)->promoted_devType()); | ||||
} | ||||
uint PythonQtWrapper_QPicture::size(QPicture* theWrappedObject) const | ||||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->size()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QRect PythonQtWrapper_QPicture::boundingRect(QPicture* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->boundingRect()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QPicture::load(QPicture* theWrappedObject, const QString& fileName, const char* format) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->load(fileName, format)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QPicture::writeTo(QPicture* theWrappedObject, QDataStream& arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | arg__1 << (*theWrappedObject); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QPaintEngine* PythonQtWrapper_QPicture::paintEngine(QPicture* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( ((PythonQtPublicPromoter_QPicture*)theWrappedObject)->promoted_paintEngine()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QPicture::save(QPicture* theWrappedObject, QIODevice* dev, const char* format) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->save(dev, format)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QPicture::isNull(QPicture* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->isNull()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QPicture::setBoundingRect(QPicture* theWrappedObject, const QRect& r) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setBoundingRect(r)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QPicture::play(QPicture* theWrappedObject, QPainter* p) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->play(p)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QPicture::readFrom(QPicture* theWrappedObject, QDataStream& arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | arg__1 >> (*theWrappedObject); | ||
florianlink
|
r13 | } | ||