/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.7.9
 *
 *     Copyright: (c) 2020 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_core.h"




extern "C" {static void assign_wxClientData(void *, Py_ssize_t, void *);}
static void assign_wxClientData(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxClientData *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxClientData *>(sipSrc);
}


extern "C" {static void *array_wxClientData(Py_ssize_t);}
static void *array_wxClientData(Py_ssize_t sipNrElem)
{
    return new  ::wxClientData[sipNrElem];
}


extern "C" {static void *copy_wxClientData(const void *, Py_ssize_t);}
static void *copy_wxClientData(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new  ::wxClientData(reinterpret_cast<const  ::wxClientData *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_wxClientData(void *, int);}
static void release_wxClientData(void *sipCppV, int)
{
     ::wxClientData *sipCpp = reinterpret_cast< ::wxClientData *>(sipCppV);
    Py_BEGIN_ALLOW_THREADS
    delete sipCpp;
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_wxClientData(PyObject *, void **, int *, PyObject *);}
static int convertTo_wxClientData(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj)
{
     ::wxClientData **sipCppPtr = reinterpret_cast< ::wxClientData **>(sipCppPtrV);
        // Code to test a PyObject for compatibility
        if (!sipIsErr) {
            return TRUE; // any python object is valid
        }

        // Code to create a new wxClientData from the PyObject
        wxClientData* data =  new wxPyClientData(sipPy);
        *sipCppPtr = data;
        return sipGetState(sipTransferObj);
}


extern "C" {static PyObject *convertFrom_wxClientData(void *, PyObject *);}
static PyObject *convertFrom_wxClientData(void *sipCppV, PyObject *)
{
    ::wxClientData *sipCpp = reinterpret_cast< ::wxClientData *>(sipCppV);
        // Code to convert a wxClientData back to the PyObject.
        PyObject* obj;
        obj = wxPyClientData::SafeGetData(static_cast<wxPyClientData*>(sipCpp));
        return obj;
}


sipMappedTypeDef sipTypeDef__core_wxClientData = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_MAPPED,
        sipNameNr_wxClientData,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_wxClientData,
    array_wxClientData,
    copy_wxClientData,
    release_wxClientData,
    convertTo_wxClientData,
    convertFrom_wxClientData
};
