aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/glue/hwnd_conversions.h
blob: 65b95e2fde5e4c3268724f35638efeb4c0e98198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace Shiboken {
template <>
struct Converter<HWND>
{
    static bool checkType(PyObject* pyObj)
    {
        return false;
    }

    static bool isConvertible(PyObject* pyobj)
    {
        return PyCObject_Check(pyobj);
    }

    static inline PyObject* toPython(void* cppobj)
    {
        // not supported
        Q_ASSERT(true);
        return 0;
    }

    static PyObject* toPython(HWND cppobj)
    {
        return PyCObject_FromVoidPtr(cppobj, 0);
    }

    static HWND toCpp(PyObject* pyobj)
    {
        return (HWND)PyCObject_AsVoidPtr(pyobj);
    }
};
}