summaryrefslogtreecommitdiffstats
path: root/PySide/typesystem_templates.xml
diff options
context:
space:
mode:
Diffstat (limited to 'PySide/typesystem_templates.xml')
-rw-r--r--PySide/typesystem_templates.xml146
1 files changed, 81 insertions, 65 deletions
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)) {