summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-12-01 17:32:48 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-09 19:25:36 -0300
commitc93001f792db0de9eede4ef14ba365ea21470f78 (patch)
treedd37b14d19cd80cd2e985ebf23ea92937539ae9e
parent55ac5ba259680881e46a6e35bd7453b5d9f0df5d (diff)
downloadpyside-c93001f792db0de9eede4ef14ba365ea21470f78.tar.gz
pyside-c93001f792db0de9eede4ef14ba365ea21470f78.tar.xz
pyside-c93001f792db0de9eede4ef14ba365ea21470f78.zip
Removed the remaining occurrences of Shiboken::makeTuple.
-rw-r--r--PySide/QtCore/typesystem_core.xml60
-rw-r--r--PySide/QtDeclarative/pysideqmlregistertype.cpp18
-rw-r--r--PySide/QtDeclarative/typesystem_declarative.xml4
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml66
-rw-r--r--PySide/QtNetwork/typesystem_network.xml2
-rw-r--r--PySide/QtOpenGL/typesystem_opengl.xml4
-rw-r--r--PySide/QtXml/typesystem_xml.xml45
-rw-r--r--PySide/typesystem_templates.xml146
8 files changed, 209 insertions, 136 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 9e698f1..f41688c 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -937,7 +937,9 @@
static void msgHandlerCallback(QtMsgType type, const char* msg)
{
Shiboken::GilState state;
- Shiboken::AutoDecRef arglist(Shiboken::makeTuple(type, msg));
+ Shiboken::AutoDecRef arglist(PyTuple_New(2));
+ PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QtMsgType](type));
+ PyTuple_SET_ITEM(arglist, 1, %CONVERTTOPYTHON[const char*](msg));
Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist));
}
static void QtCoreModuleExit()
@@ -1047,9 +1049,11 @@
<replace-type modified-type="(intersectType, intersectionPoint)" />
</modify-argument>
<inject-code class="target" position="beginning">
- QPointF p;
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;p);
- %PYARG_0 = Shiboken::makeTuple(retval, p);
+ QPointF p;
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;p);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QPointF](p));
</inject-code>
</modify-function>
</value-type>
@@ -1165,8 +1169,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
int year, month, day;
+ %BEGIN_ALLOW_THREADS
%CPPSELF.%FUNCTION_NAME(&amp;year, &amp;month, &amp;day);
- %PYARG_0 = Shiboken::makeTuple(year, month, day);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(3);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](year));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](month));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](day));
</inject-code>
</modify-function>
<modify-function signature="weekNumber(int*)const" >
@@ -1178,8 +1187,12 @@
</modify-argument>
<inject-code class="target" position="beginning">
int yearNumber;
+ %BEGIN_ALLOW_THREADS
int week = %CPPSELF.%FUNCTION_NAME(&amp;yearNumber);
- %PYARG_0 = Shiboken::makeTuple(week, yearNumber);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](week));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](yearNumber));
</inject-code>
</modify-function>
<!-- This function isn't part of Qt public API -->
@@ -1365,6 +1378,7 @@
}
};
</inject-code>
+
<modify-function signature="getCoords(int*,int*,int*,int*)const">
<modify-argument index="return">
<replace-type modified-type="PyObject" />
@@ -1382,9 +1396,9 @@
<remove-argument />
</modify-argument>
<inject-code class="target">
- int a, b, c, d;
- %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ <insert-template name="fix_number*,number*,number*,number*">
+ <replace from="$TYPE" to="int" />
+ </insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRect(int*,int*,int*,int*)const">
@@ -1404,9 +1418,9 @@
<remove-argument />
</modify-argument>
<inject-code class="target">
- int a, b, c, d;
- %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ <insert-template name="fix_number*,number*,number*,number*">
+ <replace from="$TYPE" to="int" />
+ </insert-template>
</inject-code>
</modify-function>
</value-type>
@@ -1449,9 +1463,9 @@
<remove-argument />
</modify-argument>
<inject-code class="target">
- qreal a, b, c, d;
- %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ <insert-template name="fix_number*,number*,number*,number*">
+ <replace from="$TYPE" to="qreal" />
+ </insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRect(qreal*,qreal*,qreal*,qreal*)const">
@@ -1471,9 +1485,9 @@
<remove-argument />
</modify-argument>
<inject-code class="target">
- qreal a, b, c, d;
- %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ <insert-template name="fix_number*,number*,number*,number*">
+ <replace from="$TYPE" to="qreal" />
+ </insert-template>
</inject-code>
</modify-function>
</value-type>
@@ -3063,7 +3077,9 @@
<inject-code class="target" position="beginning">
qint64 pid;
%RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &amp;pid);
- %PYARG_0 = Shiboken::makeTuple(retval, pid);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[qint64](pid));
</inject-code>
</modify-function>
<!-- Function removed because on windows it returns a win32 specific structure -->
@@ -3171,8 +3187,10 @@
</conversion-rule>
</modify-argument>
<inject-code position="end">
- %PYARG_0 = Shiboken::makeTuple(%0, *result_out);
- delete result_out;
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[long](*result_out));
+ delete result_out;
</inject-code>
</modify-function>
</object-type>
diff --git a/PySide/QtDeclarative/pysideqmlregistertype.cpp b/PySide/QtDeclarative/pysideqmlregistertype.cpp
index 7dfd7a6..6c59516 100644
--- a/PySide/QtDeclarative/pysideqmlregistertype.cpp
+++ b/PySide/QtDeclarative/pysideqmlregistertype.cpp
@@ -258,7 +258,10 @@ PyTypeObject PropertyListType = {
void propListAppender(QDeclarativeListProperty<QDeclarativeItem>* propList, QDeclarativeItem* item)
{
Shiboken::GilState state;
- Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object, item));
+
+ Shiboken::AutoDecRef args(PyTuple_New(2));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtDeclarativeTypes[SBK_QDECLARATIVEITEM_IDX], item));
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->append, args));
@@ -271,7 +274,9 @@ void propListAppender(QDeclarativeListProperty<QDeclarativeItem>* propList, QDec
int propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList)
{
Shiboken::GilState state;
- Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object));
+
+ Shiboken::AutoDecRef args(PyTuple_New(1));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args));
@@ -289,7 +294,10 @@ int propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList)
QDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propList, int index)
{
Shiboken::GilState state;
- Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object, index));
+
+ Shiboken::AutoDecRef args(PyTuple_New(2));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index));
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args));
@@ -306,7 +314,9 @@ QDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propLis
void propListClear(QDeclarativeListProperty<QDeclarativeItem>* propList)
{
Shiboken::GilState state;
- Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object));
+
+ Shiboken::AutoDecRef args(PyTuple_New(1));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->clear, args));
diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml
index 58bce2a..91c2e48 100644
--- a/PySide/QtDeclarative/typesystem_declarative.xml
+++ b/PySide/QtDeclarative/typesystem_declarative.xml
@@ -104,7 +104,9 @@
%BEGIN_ALLOW_THREADS
%RETURN_TYPE ok_ = %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;errorString);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(ok_, errorString);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](ok_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](errorString));
</inject-code>
</modify-function>
</object-type>
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 4ebccf6..6922bcf 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -448,10 +448,12 @@
<replace-type modified-type="PyObject" />
</modify-argument>
<inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;%1, %2);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(%0, %1);
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;%1, %2);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
</inject-code>
</modify-function>
<modify-function signature="xToCursor(qreal,QTextLine::CursorPosition)const">
@@ -911,9 +913,11 @@
</inject-code>
</add-function>
<template name="qmatrix_map">
- %ARG1_TYPE a, b;
- %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;a, &amp;b);
- %PYARG_0 = Shiboken::makeTuple(a, b);
+ %ARG1_TYPE a, b;
+ %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;a, &amp;b);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%ARG1_TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](b));
</template>
<modify-function signature="map(int,int,int*,int*)const">
<modify-argument index="3">
@@ -1296,7 +1300,9 @@
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_int*,int*,int*,int*,int*"/>
+ <insert-template name="fix_number*,number*,number*,number*,number*">
+ <replace from="$TYPE" to="int" />
+ </insert-template>
</inject-code>
</modify-function>
<modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)">
@@ -1321,7 +1327,9 @@
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="fix_qreal*,qreal*,qreal*,qreal*,qreal*"/>
+ <insert-template name="fix_number*,number*,number*,number*,number*">
+ <replace from="$TYPE" to="qreal" />
+ </insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsl(int*,int*,int*,int*)const" since="4.6">
@@ -1775,9 +1783,11 @@
<replace-type modified-type="(retval, blockingPanel)"/>
</modify-argument>
<inject-code class="target" position="beginning">
- QGraphicsItem *item_ = NULL;
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;item_);
- %PYARG_0 = Shiboken::makeTuple(retval_, item_);
+ QGraphicsItem *item_ = NULL;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;item_);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));
</inject-code>
</modify-function>
<modify-function signature="itemTransform(const QGraphicsItem*,bool*)const">
@@ -3362,9 +3372,13 @@
<remove-default-expression/>
</modify-argument>
<inject-code class="target" position="beginning">
- int a, b, c, d;
- %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b, &amp;c, &amp;d);
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ int a, b, c, d;
+ %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b, &amp;c, &amp;d);
+ %PYARG_0 = PyTuple_New(4);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c));
+ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));
</inject-code>
</modify-function>
</object-type>
@@ -4860,8 +4874,12 @@
<replace-type modified-type="(retval, subtype)"/>
</modify-argument>
<inject-code class="target" position="end">
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
- %PYARG_0 = Shiboken::makeTuple(retval_, %1);
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
</inject-code>
</modify-function>
</object-type>
@@ -5678,12 +5696,14 @@
<enum-type name="RowWrapPolicy"/>
<template name="fix_args,int*,ItemRole*">
- int _row;
- QFormLayout::ItemRole _role;
- %BEGIN_ALLOW_THREADS
- %CPPSELF->%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_row, &amp;_role);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(_row, _role);
+ int _row;
+ QFormLayout::ItemRole _role;
+ %BEGIN_ALLOW_THREADS
+ %CPPSELF->%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_row, &amp;_role);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](_row));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QFormLayout::ItemRole](_role));
</template>
<modify-function signature="getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const">
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 87cb7d9..a8327cd 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -144,7 +144,7 @@
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &amp;ha, &amp;port);
%END_ALLOW_THREADS
QByteArray ba(data, retval);
- PyObject* %PYARG_0 = PyTuple_New(3);
+ %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));
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 808ed22..4c2604a 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -701,7 +701,9 @@
QByteArray ret;
if (result)
ret.append((const char*)data, %3);
- %PYARG_0 = Shiboken::makeTuple(result, ret);
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](result));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QByteArray](ret));
delete[] data;
</inject-code>
</modify-function>
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index 1bf07de..19b1520 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -33,14 +33,17 @@
<value-type name="QDomComment" />
<template name="qdomdocument_setcontent">
- QString _errorMsg_;
- int _errorLine_ = 0;
- int _errorColumn_ = 0;
-
- %BEGIN_ALLOW_THREADS
- bool _ret_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_errorMsg_, &amp;_errorLine_, &amp;_errorColumn_);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(_ret_, _errorMsg_, _errorLine_, _errorColumn_);
+ QString _errorMsg_;
+ int _errorLine_ = 0;
+ int _errorColumn_ = 0;
+ %BEGIN_ALLOW_THREADS
+ bool _ret_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_errorMsg_, &amp;_errorLine_, &amp;_errorColumn_);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(4);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](_ret_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](_errorMsg_));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](_errorLine_));
+ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](_errorColumn_));
</template>
<value-type name="QDomDocument">
@@ -269,13 +272,13 @@
</conversion-rule>
</modify-argument>
<inject-code class="target" position="end">
- QXmlInputSource* _qxmlinputsource_arg_ = 0;
-
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
- %END_ALLOW_THREADS
-
- %PYARG_0 = Shiboken::makeTuple(%0, _qxmlinputsource_arg_);
+ QXmlInputSource* _qxmlinputsource_arg_ = 0;
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QXmlInputSource*](_qxmlinputsource_arg_));
</inject-code>
</modify-function>
</object-type>
@@ -296,11 +299,13 @@
</conversion-rule>
</modify-argument>
<inject-code class="target" position="end">
- QXmlInputSource* _qxmlinputsource_arg_ = 0;
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF.%TYPE::%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(%0, _qxmlinputsource_arg_);
+ QXmlInputSource* _qxmlinputsource_arg_ = 0;
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE %0 = %CPPSELF.%TYPE::%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QXmlInputSource*](_qxmlinputsource_arg_));
</inject-code>
</modify-function>
</object-type>
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index bf7abd1..47615ad 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -30,75 +30,80 @@
</template>
<!-- Templates to fix bool* parameters -->
+ <template name="tuple_retval_ok">
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[bool](ok_));
+ </template>
<template name="fix_bool*">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_args,bool*">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;ok_);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_arg,bool*,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, &amp;ok_, %3);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_bool*,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_bool*,arg,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_bool*,arg,arg,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_bool*,arg,arg,arg,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4, %5);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, &amp;ok_, %9);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_arg,arg,arg,arg,arg,arg,bool*,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, &amp;ok_, %8);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="fix_arg,arg,arg,arg,arg,bool*,arg">
bool ok_;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, &amp;ok_, %7);
%END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, ok_);
+ <insert-template name="tuple_retval_ok"/>
</template>
<template name="get_slice">
%TYPE* sequence;
@@ -143,27 +148,35 @@
</template>
<template name="fix_char*">
- char val_;
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;val_);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, val_);
+ char val_;
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;val_);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[char](val_));
+ </template>
+
+ <template name="tuple_abcd_same_type">
+ %PYARG_0 = PyTuple_New(4);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[$TYPE](c));
+ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[$TYPE](d));
</template>
-
<template name="fix_number*,number*,number*,number*">
- $TYPE a, b, c, d;
- %BEGIN_ALLOW_THREADS
- %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ $TYPE a, b, c, d;
+ %BEGIN_ALLOW_THREADS
+ %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);
+ %END_ALLOW_THREADS
+ <insert-template name="tuple_abcd_same_type"/>
</template>
-
<template name="fix_number*,number*,number*,number*,args">
- $TYPE a, b, c, d;
- %BEGIN_ALLOW_THREADS
- %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, %ARGUMENT_NAMES);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ $TYPE a, b, c, d;
+ %BEGIN_ALLOW_THREADS
+ %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, %ARGUMENT_NAMES);
+ %END_ALLOW_THREADS
+ <insert-template name="tuple_abcd_same_type"/>
</template>
<template name="fix_native_return_number*,number*,number*,number*">
@@ -183,18 +196,19 @@
}
</template>
- <template name="fix_int*,int*,int*,int*,int*">
- int a, b, c, d, e;
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, &amp;e);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
- </template>
- <template name="fix_qreal*,qreal*,qreal*,qreal*,qreal*">
- qreal a, b, c, d, e;
- %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, &amp;e);
- %PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
+ <template name="fix_number*,number*,number*,number*,number*">
+ $TYPE a, b, c, d, e;
+ %BEGIN_ALLOW_THREADS
+ %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, &amp;e);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(5);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[$TYPE](c));
+ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[$TYPE](d));
+ PyTuple_SET_ITEM(%PYARG_0, 4, %CONVERTTOPYTHON[$TYPE](e));
</template>
+
<template name="read_wrapper">
Shiboken::AutoArrayPointer&lt;char&gt; _data(%2);
qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);
@@ -203,21 +217,15 @@
ba = QByteArray(_data, _size);
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
</template>
- <template name="fix_return_args,int*">
- RETURNTYPE _ret;
- int _arg;
- %BEGIN_ALLOW_THREADS
- _ret = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_arg);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(_ret, _arg);
- </template>
<template name="fix_args,number*,number*">
- $TYPE a, b;
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;a, &amp;b);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(a, b);
+ $TYPE a, b;
+ %BEGIN_ALLOW_THREADS
+ %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;a, &amp;b);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));
</template>
<template name="fix_virtual_method_return_value_and_bool*">
@@ -228,12 +236,15 @@
</template>
<template name="fix_arg,int*,int*">
- %RETURN_TYPE _ret;
- int a, b;
- %BEGIN_ALLOW_THREADS
- _ret = %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(_ret, a, b);
+ %RETURN_TYPE _ret;
+ int a, b;
+ %BEGIN_ALLOW_THREADS
+ _ret = %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(3);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](_ret));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](a));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](b));
</template>
<template name="return_QString">
@@ -241,17 +252,22 @@
</template>
<template name="return_tuple_QValidator_QString_int">
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE retval_ = %RETURN_TYPE(%CPPSELF.%FUNCTION_NAME(%1, %2));
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, %1, %2);
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE retval_ = %RETURN_TYPE(%CPPSELF.%FUNCTION_NAME(%1, %2));
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(3);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
+ PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[%ARG2_TYPE](%2));
</template>
<template name="return_for_QFileDialog">
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &amp;%5, %6);
- %END_ALLOW_THREADS
- %PYARG_0 = Shiboken::makeTuple(retval_, %5);
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &amp;%5, %6);
+ %END_ALLOW_THREADS
+ %PYARG_0 = PyTuple_New(2);
+ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
+ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG5_TYPE](%5));
</template>
<template name="set_qapp_parent_for_orphan">
if (%PYARG_0 &amp;&amp; (%PYARG_0 != Py_None)) {