aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtGui
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-11-01 18:42:47 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:56:20 -0300
commit2a87b74bfea936691db2eb97a8ab2788277869b6 (patch)
treeb4ec4ef4b62df6bf488301e243501ceac960fa46 /PySide/QtGui
parent792504f978441d0a7708ebdaabc4b4baf24fdff4 (diff)
Replaced TypeResolver by SbkConverter and SpecificConverter.
Also updated QtGui's WId conversion to Python 3.
Diffstat (limited to 'PySide/QtGui')
-rw-r--r--PySide/QtGui/typesystem_gui_win.xml20
1 files changed, 19 insertions, 1 deletions
diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml
index a0cfe84f2..28b48e6f8 100644
--- a/PySide/QtGui/typesystem_gui_win.xml
+++ b/PySide/QtGui/typesystem_gui_win.xml
@@ -23,14 +23,32 @@
<primitive-type name="WId" target-lang-api-name="PyObject">
<conversion-rule file="glue/wid_conversions.h">
<native-to-target>
+ #ifdef IS_PY3K
+ return PyCapsule_New(%in, 0, 0);
+ #else
return PyCObject_FromVoidPtr(%in, 0);
+ #endif
</native-to-target>
<target-to-native>
- <add-conversion type="PyCObject">
+ <add-conversion type="checkPyCapsuleOrPyCObject">
+ #ifdef IS_PY3K
+ %out = (%OUTTYPE)PyCapsule_GetPointer(%in, 0);
+ #else
%out = (%OUTTYPE)PyCObject_AsVoidPtr(%in);
+ #endif
</add-conversion>
</target-to-native>
</conversion-rule>
</primitive-type>
+ <inject-code class="native" position="beginning">
+ static bool checkPyCapsuleOrPyCObject(PyObject* pyObj)
+ {
+ #ifdef IS_PY3K
+ return PyCapsule_CheckExact(pyObj);
+ #else
+ return PyCObject_Check(pyObj);
+ #endif
+ }
+ </inject-code>
<enum-type name="QPixmap::HBitmapFormat" />
</typesystem>