summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-12-09 18:07:23 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-09 19:25:36 -0300
commit60cf6028897c1d88507532a5df6ada5a599845e3 (patch)
tree3aedb551e9552b5ee239fb9082b30f65a1e8799f
parenteb4a6abe58c0b458cbb12319e57e3ed734db2880 (diff)
downloadpyside-60cf6028897c1d88507532a5df6ada5a599845e3.tar.gz
pyside-60cf6028897c1d88507532a5df6ada5a599845e3.tar.xz
pyside-60cf6028897c1d88507532a5df6ada5a599845e3.zip
Fixed QtCore's HWND converter for win32.
-rw-r--r--PySide/QtCore/typesystem_core_win.xml27
1 files changed, 19 insertions, 8 deletions
diff --git a/PySide/QtCore/typesystem_core_win.xml b/PySide/QtCore/typesystem_core_win.xml
index 9982282..b55f04d 100644
--- a/PySide/QtCore/typesystem_core_win.xml
+++ b/PySide/QtCore/typesystem_core_win.xml
@@ -21,14 +21,25 @@
<typesystem package="PySide.QtCore">
<primitive-type name="HWND">
<conversion-rule file="glue/hwnd_conversions.h">
- <native-to-target>
- return PyCObject_FromVoidPtr(%in, 0);
- </native-to-target>
- <target-to-native>
- <add-conversion type="PyCObject">
- %out = *((%OUTTYPE*)PyCObject_AsVoidPtr(%in));
- </add-conversion>
- </target-to-native>
+ <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="PyNone">
+ %out = 0;
+ </add-conversion>
+ <add-conversion check="checkPyCapsuleOrPyCObject(%in)" type="PyObject">
+ #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>
<value-type name="POINT">