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

#include "sipAPI_core.h"




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


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


extern "C" {static void *copy_wxClientData(const void *, SIP_SSIZE_T);}
static void *copy_wxClientData(const void *sipSrc, SIP_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 *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast< ::wxClientData *>(ptr);
    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,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_wxClientData,     /* wxClientData */
        {0},
        0
    },
    {
        -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
};
